@under_koen/bsm 1.10.0 → 1.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +18 -18
  2. package/package.json +6 -3
package/dist/index.js CHANGED
@@ -1,26 +1,26 @@
1
1
  #! /usr/bin/env node
2
- var On=Object.create;var ds=Object.defineProperty;var Ln=Object.getOwnPropertyDescriptor;var Dn=Object.getOwnPropertyNames;var Fn=Object.getPrototypeOf,Mn=Object.prototype.hasOwnProperty;var pi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Bn=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Dn(t))!Mn.call(e,r)&&r!==i&&ds(e,r,{get:()=>t[r],enumerable:!(s=Ln(t,r))||s.enumerable});return e};var ms=(e,t,i)=>(i=e!=null?On(Fn(e)):{},Bn(t||!e||!e.__esModule?ds(i,"default",{value:e,enumerable:!0}):i,e));var bs=pi((Cu,ys)=>{"use strict";function Vn(e,t){var i=e;t.slice(0,-1).forEach(function(r){i=i[r]||{}});var s=t[t.length-1];return s in i}function gs(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function xs(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}ys.exports=function(e,t){t||(t={});var i={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(i.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?i.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(x){i.bools[x]=!0});var s={};function r(x){return s[x].some(function(_){return i.bools[_]})}Object.keys(t.alias||{}).forEach(function(x){s[x]=[].concat(t.alias[x]),s[x].forEach(function(_){s[_]=[x].concat(s[x].filter(function(L){return _!==L}))})}),[].concat(t.string).filter(Boolean).forEach(function(x){i.strings[x]=!0,s[x]&&[].concat(s[x]).forEach(function(_){i.strings[_]=!0})});var n=t.default||{},a={_:[]};function o(x,_){return i.allBools&&/^--[^=]+$/.test(_)||i.strings[x]||i.bools[x]||s[x]}function h(x,_,L){for(var A=x,J=0;J<_.length-1;J++){var W=_[J];if(xs(A,W))return;A[W]===void 0&&(A[W]={}),(A[W]===Object.prototype||A[W]===Number.prototype||A[W]===String.prototype)&&(A[W]={}),A[W]===Array.prototype&&(A[W]=[]),A=A[W]}var N=_[_.length-1];xs(A,N)||((A===Object.prototype||A===Number.prototype||A===String.prototype)&&(A={}),A===Array.prototype&&(A=[]),A[N]===void 0||i.bools[N]||typeof A[N]=="boolean"?A[N]=L:Array.isArray(A[N])?A[N].push(L):A[N]=[A[N],L])}function c(x,_,L){if(!(L&&i.unknownFn&&!o(x,L)&&i.unknownFn(L)===!1)){var A=!i.strings[x]&&gs(_)?Number(_):_;h(a,x.split("."),A),(s[x]||[]).forEach(function(J){h(a,J.split("."),A)})}}Object.keys(i.bools).forEach(function(x){c(x,n[x]===void 0?!1:n[x])});var l=[];e.indexOf("--")!==-1&&(l=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var f=0;f<e.length;f++){var p=e[f],d,y;if(/^--.+=/.test(p)){var m=p.match(/^--([^=]+)=([\s\S]*)$/);d=m[1];var b=m[2];i.bools[d]&&(b=b!=="false"),c(d,b,p)}else if(/^--no-.+/.test(p))d=p.match(/^--no-(.+)/)[1],c(d,!1,p);else if(/^--.+/.test(p))d=p.match(/^--(.+)/)[1],y=e[f+1],y!==void 0&&!/^(-|--)[^-]/.test(y)&&!i.bools[d]&&!i.allBools&&(!s[d]||!r(d))?(c(d,y,p),f+=1):/^(true|false)$/.test(y)?(c(d,y==="true",p),f+=1):c(d,i.strings[d]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var g=p.slice(1,-1).split(""),E=!1,S=0;S<g.length;S++){if(y=p.slice(S+2),y==="-"){c(g[S],y,p);continue}if(/[A-Za-z]/.test(g[S])&&y[0]==="="){c(g[S],y.slice(1),p),E=!0;break}if(/[A-Za-z]/.test(g[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){c(g[S],y,p),E=!0;break}if(g[S+1]&&g[S+1].match(/\W/)){c(g[S],p.slice(S+2),p),E=!0;break}else c(g[S],i.strings[g[S]]?"":!0,p)}d=p.slice(-1)[0],!E&&d!=="-"&&(e[f+1]&&!/^(-|--)[^-]/.test(e[f+1])&&!i.bools[d]&&(!s[d]||!r(d))?(c(d,e[f+1],p),f+=1):e[f+1]&&/^(true|false)$/.test(e[f+1])?(c(d,e[f+1]==="true",p),f+=1):c(d,i.strings[d]?"":!0,p))}else if((!i.unknownFn||i.unknownFn(p)!==!1)&&a._.push(i.strings._||!gs(p)?p:Number(p)),t.stopEarly){a._.push.apply(a._,e.slice(f+1));break}}return Object.keys(n).forEach(function(x){Vn(a,x.split("."))||(h(a,x.split("."),n[x]),(s[x]||[]).forEach(function(_){h(a,_.split("."),n[x])}))}),t["--"]?a["--"]=l.slice():l.forEach(function(x){a._.push(x)}),a}});var ws=pi((Pu,jn)=>{jn.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var _s=pi(ft=>{"use strict";var Ss=ws(),F=process.env;Object.defineProperty(ft,"_vendors",{value:Ss.map(function(e){return e.constant})});ft.name=null;ft.isPR=null;ft.id=null;Ss.forEach(function(e){let i=(Array.isArray(e.env)?e.env:[e.env]).every(function(s){return Es(s)});ft[e.constant]=i,i&&(ft.name=e.name,ft.isPR=$n(e),ft.id=e.constant)});ft.isCI=!!(F.CI!=="false"&&(F.BUILD_ID||F.BUILD_NUMBER||F.CI||F.CI_APP_ID||F.CI_BUILD_ID||F.CI_BUILD_NUMBER||F.CI_NAME||F.CONTINUOUS_INTEGRATION||F.RUN_ID||ft.name));function Es(e){return typeof e=="string"?!!F[e]:"env"in e?F[e.env]&&F[e.env].includes(e.includes):"any"in e?e.any.some(function(t){return!!F[t]}):Object.keys(e).every(function(t){return F[t]===e[t]})}function $n(e){switch(typeof e.pr){case"string":return!!F[e.pr];case"object":return"env"in e.pr?"any"in e.pr?e.pr.any.some(function(t){return F[e.pr.env]===t}):e.pr.env in F&&F[e.pr.env]!==e.pr.ne:"any"in e.pr?e.pr.any.some(function(t){return!!F[t]}):Es(e.pr);default:return null}}});var Pn=ms(bs(),1);import{createPrompt as yu,useState as ui,useKeypress as bu,useMemo as vu}from"@inquirer/core";var I=class{static silent=!1;static silence(){this.silent=!0}static log(...t){this.silent||console.log(...t)}static error(...t){this.silent||console.error(...t)}};var vs={name:"@under_koen/bsm",version:"1.10.0",description:"BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",license:"MIT",author:"Koen van Staveren <koen@underkoen.nl>",homepage:"https://github.com/UnderKoen/bsm#readme",repository:{type:"git",url:"https://github.com/UnderKoen/bsm.git"},bugs:{url:"https://github.com/UnderKoen/bsm/issues"},type:"module",main:"dist/index.js",bin:{bsm:"./dist/index.js"},files:["dist"],scripts:{build:"bsm","build:dev":"bsm","build:prod":"bsm","build:watch":"bsm",lint:"bsm",prettier:"bsm",prepublishOnly:"bsm build.prod",test:"bsm","test:cov":"bsm test.cov"},devDependencies:{"@eslint/js":"^9.21.0","@inquirer/core":"^10.3.0","@semantic-release/changelog":"^6.0.3","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.0","@semantic-release/npm":"^13.1.1","@types/minimist":"^1.2.5","@types/node":"^22.13.9","@types/sinon":"^17.0.4","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","@under_koen/bsm":"^1.9.1",c8:"^10.1.3","ci-info":"^4.1.0","cpy-cli":"^5.0.0",defu:"^6.1.4",esbuild:"^0.25.0",eslint:"^9.21.0","eslint-config-prettier":"^10.0.2",glob:"^11.0.3",globals:"^16.0.0",minimist:"^1.2.8",mlly:"^1.8.0",prettier:"^3.5.3","prettier-package-json":"^2.8.0",rimraf:"^6.0.1","semantic-release":"^25.0.1",sinon:"^19.0.2",tsx:"^4.20.6",typescript:"^5.8.2","typescript-eslint":"^8.26.0",uvu:"^0.5.6"},keywords:["script","scripting"]};var lt=class e{static printHelp(t,i){let s=i._;if(s.length===0)I.log(`
3
- \x1B[1mAvailable commands:\x1B[0m`),e.printCommands(t.scripts);else for(let r of s){I.log(`
4
- \x1B[1mAvailable commands: \x1B[90m${r}\x1B[0m`);let n=r.split("."),a=[[t.scripts,[],n]];for(;a.length>0;){let o=a.shift();if(o[2].length===0)e.printCommands(o[0],o[1]);else if(o[2][0]==="*"){if(typeof o[0]=="object")if(Array.isArray(o[0]))for(let h=0;h<o[0].length;h++)a.push([o[0][h],[...o[1],h.toString()],[]]);else for(let h in o[0])Object.hasOwn(o[0],h)&&a.push([o[0][h],[...o[1],h],o[2].slice(1)])}else{let h=o[2][0];if(typeof o[0]=="object")if(Array.isArray(o[0])){let c=parseInt(h);a.push([o[0][c],[...o[1],c.toString()],o[2].slice(1)])}else a.push([o[0][h],[...o[1],h],o[2].slice(1)])}}}process.exit(0)}static printCommands(t,i=[],s=!0){if(Array.isArray(t))t.forEach((r,n)=>{e.printCommand(r,[...i,n.toString()])});else if(typeof t=="object"){s&&i.length>0&&e.printCommand(t,[...i]);for(let r in t)Object.hasOwn(t,r)&&e.printCommand(t[r],[...i,r])}else e.printCommand(t,i)}static printCommand(t,i){if(t===void 0){I.error(`\x1B[31mScript '${i.join(".")}' not found\x1B[0m`);return}let s=e.getCommandHelp(t,i);s&&I.log(s)}static getCommandHelp(t,i){if(i[i.length-1]==="$description")return;let s=`\x1B[92m${i.join(".")}\x1B[0m\x1B[90m - \x1B[0m`,r;return typeof t=="string"?r=t:typeof t=="function"?r="\x1B[90m<function>\x1B[0m":Array.isArray(t)?r=`\x1B[90m[${t.length}]\x1B[0m`:Object.hasOwn(t,"$description")?r=`\x1B[90m${t.$description}\x1B[0m`:r=`\x1B[90m{${Object.keys(t).join(", ")}}\x1B[0m`,`${s}${r}`}static printVersion(){I.log(vs.version),process.exit(0)}};var In=ms(_s(),1);import gu from"node:child_process";import xu from"path";import ps from"fs";function di(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function mi(e,t,i=".",s){if(!di(t))return mi(e,{},i,s);let r=Object.assign({},t);for(let n in e){if(n==="__proto__"||n==="constructor")continue;let a=e[n];a!=null&&(s&&s(r,n,a,i)||(Array.isArray(a)&&Array.isArray(r[n])?r[n]=[...a,...r[n]]:di(a)&&di(r[n])?r[n]=mi(a,r[n],(i?`${i}.`:"")+n.toString(),s):r[n]=a))}return r}function gi(e){return(...t)=>t.reduce((i,s)=>mi(i,s,"",e),{})}var Cs=gi(),Ou=gi((e,t,i)=>{if(e[t]!==void 0&&typeof i=="function")return e[t]=i(e[t]),!0}),Lu=gi((e,t,i)=>{if(Array.isArray(e[t])&&typeof i=="function")return e[t]=i(e[t]),!0});var Wn=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],Ps=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Gn="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Ns="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",xi={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},yi="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",zn={5:yi,"5module":yi+" export import",6:yi+" const class extends export import super"},Hn=/^in(stanceof)?$/,qn=new RegExp("["+Ns+"]"),Kn=new RegExp("["+Ns+Gn+"]");function vi(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function yt(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&qn.test(String.fromCharCode(e)):t===!1?!1:vi(e,Ps)}function kt(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Kn.test(String.fromCharCode(e)):t===!1?!1:vi(e,Ps)||vi(e,Wn)}var k=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function st(e,t){return new k(e,{beforeExpr:!0,binop:t})}var rt={beforeExpr:!0},X={startsExpr:!0},_i={};function T(e,t){return t===void 0&&(t={}),t.keyword=e,_i[e]=new k(e,t)}var u={num:new k("num",X),regexp:new k("regexp",X),string:new k("string",X),name:new k("name",X),privateId:new k("privateId",X),eof:new k("eof"),bracketL:new k("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:!0,startsExpr:!0}),braceR:new k("}"),parenL:new k("(",{beforeExpr:!0,startsExpr:!0}),parenR:new k(")"),comma:new k(",",rt),semi:new k(";",rt),colon:new k(":",rt),dot:new k("."),question:new k("?",rt),questionDot:new k("?."),arrow:new k("=>",rt),template:new k("template"),invalidTemplate:new k("invalidTemplate"),ellipsis:new k("...",rt),backQuote:new k("`",X),dollarBraceL:new k("${",{beforeExpr:!0,startsExpr:!0}),eq:new k("=",{beforeExpr:!0,isAssign:!0}),assign:new k("_=",{beforeExpr:!0,isAssign:!0}),incDec:new k("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new k("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:st("||",1),logicalAND:st("&&",2),bitwiseOR:st("|",3),bitwiseXOR:st("^",4),bitwiseAND:st("&",5),equality:st("==/!=/===/!==",6),relational:st("</>/<=/>=",7),bitShift:st("<</>>/>>>",8),plusMin:new k("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:st("%",10),star:st("*",10),slash:st("/",10),starstar:new k("**",{beforeExpr:!0}),coalesce:st("??",1),_break:T("break"),_case:T("case",rt),_catch:T("catch"),_continue:T("continue"),_debugger:T("debugger"),_default:T("default",rt),_do:T("do",{isLoop:!0,beforeExpr:!0}),_else:T("else",rt),_finally:T("finally"),_for:T("for",{isLoop:!0}),_function:T("function",X),_if:T("if"),_return:T("return",rt),_switch:T("switch"),_throw:T("throw",rt),_try:T("try"),_var:T("var"),_const:T("const"),_while:T("while",{isLoop:!0}),_with:T("with"),_new:T("new",{beforeExpr:!0,startsExpr:!0}),_this:T("this",X),_super:T("super",X),_class:T("class",X),_extends:T("extends",rt),_export:T("export"),_import:T("import",X),_null:T("null",X),_true:T("true",X),_false:T("false",X),_in:T("in",{beforeExpr:!0,binop:7}),_instanceof:T("instanceof",{beforeExpr:!0,binop:7}),_typeof:T("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:T("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:T("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},Z=/\r\n?|\n|\u2028|\u2029/,Qn=new RegExp(Z.source,"g");function Gt(e){return e===10||e===13||e===8232||e===8233}function Os(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var r=e.charCodeAt(s);if(Gt(r))return s<i-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var Ls=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ds=Object.prototype,Yn=Ds.hasOwnProperty,Xn=Ds.toString,zt=Object.hasOwn||function(e,t){return Yn.call(e,t)},As=Array.isArray||function(e){return Xn.call(e)==="[object Array]"},Is=Object.create(null);function Tt(e){return Is[e]||(Is[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Et(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Zn=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,oe=function(t,i){this.line=t,this.column=i};oe.prototype.offset=function(t){return new oe(this.line,this.column+t)};var Le=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Fs(e,t){for(var i=1,s=0;;){var r=Os(e,s,t);if(r<0)return new oe(i,t-s);++i,s=r}}var wi={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Rs=!1;function Jn(e){var t={};for(var i in wi)t[i]=e&&zt(e,i)?e[i]:wi[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Rs&&typeof console=="object"&&console.warn&&(Rs=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
5
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),As(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return As(t.onComment)&&(t.onComment=ta(t,t.onComment)),t}function ta(e,t){return function(i,s,r,n,a,o){var h={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(h.loc=new Le(this,a,o)),e.ranges&&(h.range=[r,n]),t.push(h)}}var he=1,Ht=2,Ci=4,Ms=8,Ai=16,Bs=32,De=64,Vs=128,Bt=256,ue=512,Fe=he|Ht|Bt;function Ii(e,t){return Ht|(e?Ci:0)|(t?Ms:0)}var ke=0,Ri=1,Ct=2,Us=3,js=4,$s=5,B=function(t,i,s){this.options=t=Jn(t),this.sourceFile=t.sourceFile,this.keywords=Tt(zn[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=xi[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=Tt(r);var n=(r?r+" ":"")+xi.strict;this.reservedWordsStrict=Tt(n),this.reservedWordsStrictBind=Tt(n+" "+xi.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
6
- `,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(Z).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(he),this.regexpState=null,this.privateNameStack=[]},bt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};B.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};bt.inFunction.get=function(){return(this.currentVarScope().flags&Ht)>0};bt.inGenerator.get=function(){return(this.currentVarScope().flags&Ms)>0};bt.inAsync.get=function(){return(this.currentVarScope().flags&Ci)>0};bt.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(Bt|ue))return!1;if(i&Ht)return(i&Ci)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};bt.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&De)>0||this.options.allowSuperOutsideMethod};bt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Vs)>0};bt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};bt.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(Bt|ue)||i&Ht&&!(i&Ai))return!0}return!1};bt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Bt)>0};B.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,r=0;r<t.length;r++)s=t[r](s);return s};B.parse=function(t,i){return new this(i,t).parse()};B.parseExpressionAt=function(t,i,s){var r=new this(s,t,i);return r.nextToken(),r.parseExpression()};B.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(B.prototype,bt);var q=B.prototype,ea=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;q.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){G.lastIndex=e,e+=G.exec(this.input)[0].length;var t=ea.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){G.lastIndex=e+t[0].length;var i=G.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||Z.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,G.lastIndex=e,e+=G.exec(this.input)[0].length,this.input[e]===";"&&e++}};q.eat=function(e){return this.type===e?(this.next(),!0):!1};q.isContextual=function(e){return this.type===u.name&&this.value===e&&!this.containsEsc};q.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};q.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};q.canInsertSemicolon=function(){return this.type===u.eof||this.type===u.braceR||Z.test(this.input.slice(this.lastTokEnd,this.start))};q.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};q.semicolon=function(){!this.eat(u.semi)&&!this.insertSemicolon()&&this.unexpected()};q.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};q.expect=function(e){this.eat(e)||this.unexpected()};q.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Me=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};q.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};q.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};q.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};q.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var w=B.prototype;w.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==u.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var s=0,r=Object.keys(this.undefinedExports);s<r.length;s+=1){var n=r[s];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Ti={kind:"loop"},ia={kind:"switch"};w.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;G.lastIndex=this.pos;var t=G.exec(this.input),i=this.pos+t[0].length,s=this.input.charCodeAt(i);if(s===91||s===92)return!0;if(e)return!1;if(s===123||s>55295&&s<56320)return!0;if(yt(s,!0)){for(var r=i+1;kt(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var n=this.input.slice(i,r);if(!Hn.test(n))return!0}return!1};w.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;G.lastIndex=this.pos;var e=G.exec(this.input),t=this.pos+e[0].length,i;return!Z.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(kt(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};w.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;G.lastIndex=this.pos;var i=G.exec(this.input),s=this.pos+i[0].length;if(Z.test(this.input.slice(this.pos,s)))return!1;if(e){var r=s+5,n;if(this.input.slice(s,r)!=="using"||r===this.input.length||kt(n=this.input.charCodeAt(r))||n>55295&&n<56320)return!1;G.lastIndex=r;var a=G.exec(this.input);if(a&&Z.test(this.input.slice(r,r+a[0].length)))return!1}if(t){var o=s+2,h;if(this.input.slice(s,o)==="of"&&(o===this.input.length||!kt(h=this.input.charCodeAt(o))&&!(h>55295&&h<56320)))return!1}var c=this.input.charCodeAt(s);return yt(c,!0)||c===92};w.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};w.isUsing=function(e){return this.isUsingKeyword(!1,e)};w.parseStatement=function(e,t,i){var s=this.type,r=this.startNode(),n;switch(this.isLet(e)&&(s=u._var,n="let"),s){case u._break:case u._continue:return this.parseBreakContinueStatement(r,s.keyword);case u._debugger:return this.parseDebuggerStatement(r);case u._do:return this.parseDoStatement(r);case u._for:return this.parseForStatement(r);case u._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case u._class:return e&&this.unexpected(),this.parseClass(r,!0);case u._if:return this.parseIfStatement(r);case u._return:return this.parseReturnStatement(r);case u._switch:return this.parseSwitchStatement(r);case u._throw:return this.parseThrowStatement(r);case u._try:return this.parseTryStatement(r);case u._const:case u._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case u._while:return this.parseWhileStatement(r);case u._with:return this.parseWithStatement(r);case u.braceL:return this.parseBlock(!0,r);case u.semi:return this.parseEmptyStatement(r);case u._export:case u._import:if(this.options.ecmaVersion>10&&s===u._import){G.lastIndex=this.pos;var a=G.exec(this.input),o=this.pos+a[0].length,h=this.input.charCodeAt(o);if(h===40||h===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===u._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return t&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),c==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,c),this.semicolon(),this.finishNode(r,"VariableDeclaration");var l=this.value,f=this.parseExpression();return s===u.name&&f.type==="Identifier"&&this.eat(u.colon)?this.parseLabeledStatement(r,l,f,e):this.parseExpressionStatement(r,f)}};w.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(u.semi)||this.insertSemicolon()?e.label=null:this.type!==u.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s<this.labels.length;++s){var r=this.labels[s];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(i||r.kind==="loop")||e.label&&i))break}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};w.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};w.parseDoStatement=function(e){return this.next(),this.labels.push(Ti),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(u._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(u.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};w.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ti),this.enterScope(0),this.expect(u.parenL),this.type===u.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===u._var||this.type===u._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}var n=this.isContextual("let"),a=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var h=this.startNode();return this.next(),o==="await using"&&this.next(),this.parseVar(h,!0,o),this.finishNode(h,"VariableDeclaration"),this.parseForAfterInit(e,h,t)}var c=this.containsEsc,l=new Me,f=this.start,p=t>-1?this.parseExprSubscripts(l,"await"):this.parseExpression(!0,l);return this.type===u._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===u._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(p.start===f&&!c&&p.type==="Identifier"&&p.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&a&&this.raise(p.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(p,!1,l),this.checkLValPattern(p),this.parseForIn(e,p)):(this.checkExpressionErrors(l,!0),t>-1&&this.unexpected(t),this.parseFor(e,p))};w.parseForAfterInit=function(e,t,i){return(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===u._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};w.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ae|(i?0:Si),!1,t)};w.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};w.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(u.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};w.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(u.braceL),this.labels.push(ia),this.enterScope(0);for(var t,i=!1;this.type!==u.braceR;)if(this.type===u._case||this.type===u._default){var s=this.type===u._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(u.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};w.parseThrowStatement=function(e){return this.next(),Z.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var sa=[];w.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Bs:0),this.checkLValPattern(e,t?js:Ct),this.expect(u.parenR),e};w.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===u._catch){var t=this.startNode();this.next(),this.eat(u.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(u._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};w.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};w.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ti),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};w.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};w.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};w.parseLabeledStatement=function(e,t,i,s){for(var r=0,n=this.labels;r<n.length;r+=1){var a=n[r];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===u._switch?"switch":null,h=this.labels.length-1;h>=0;h--){var c=this.labels[h];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};w.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};w.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(u.braceL),e&&this.enterScope(0);this.type!==u.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};w.parseFor=function(e,t){return e.init=t,this.expect(u.semi),e.test=this.type===u.semi?null:this.parseExpression(),this.expect(u.semi),e.update=this.type===u.parenR?null:this.parseExpression(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};w.parseForIn=function(e,t){var i=this.type===u._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};w.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(u.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==u._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!s&&r.id.type!=="Identifier"&&!(t&&(this.type===u._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(u.comma))break}return e};w.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Ri:Ct,!1)};var ae=1,Si=2,Ws=4;w.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===u.star&&t&Si&&this.unexpected(),e.generator=this.eat(u.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&ae&&(e.id=t&Ws&&this.type!==u.name?null:this.parseIdent(),e.id&&!(t&Si)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Ri:Ct:Us));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ii(e.async,e.generator)),t&ae||(e.id=this.type===u.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&ae?"FunctionDeclaration":"FunctionExpression")};w.parseFunctionParams=function(e){this.expect(u.parenL),e.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};w.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(u.braceL);this.type!==u.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(r.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&a.key.type==="PrivateIdentifier"&&ra(s,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};w.parseClassElement=function(e){if(this.eat(u.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(u.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===u.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===u.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(t>=9||!n)&&this.eat(u.star)&&(r=!0),!s&&!n&&!r){var h=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=h:s=h)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===u.parenL||a!=="method"||r||n){var c=!i.static&&Pe(i,"constructor"),l=c&&e;c&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":a,this.parseClassMethod(i,r,n,l)}else this.parseClassField(i);return i};w.isClassElementNameStart=function(){return this.type===u.name||this.type===u.privateId||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword};w.parseClassElementName=function(e){this.type===u.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};w.parseClassMethod=function(e,t,i,s){var r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&Pe(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};w.parseClassField=function(e){return Pe(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Pe(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(u.eq)?(this.enterScope(ue|De),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};w.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Bt|De);this.type!==u.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};w.parseClassId=function(e,t){this.type===u.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Ct,!1)):(t===!0&&this.unexpected(),e.id=null)};w.parseClassSuper=function(e){e.superClass=this.eat(u._extends)?this.parseExprSubscripts(null,!1):null};w.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};w.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=s===0?null:this.privateNameStack[s-1],n=0;n<i.length;++n){var a=i[n];zt(t,a.name)||(r?r.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function ra(e,t){var i=t.key.name,s=e[i],r="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(r=(t.static?"s":"i")+t.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(e[i]="true",!1):s?!0:(e[i]=r,!1)}function Pe(e,t){var i=e.computed,s=e.key;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}w.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};w.parseExport=function(e,t){if(this.next(),this.eat(u.star))return this.parseExportAllDeclaration(e,t);if(this.eat(u._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,s=e.specifiers;i<s.length;i+=1){var r=s[i];this.checkUnreserved(r.local),this.checkLocalExport(r.local),r.local.type==="Literal"&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};w.parseExportDeclaration=function(e){return this.parseStatement(null)};w.parseExportDefaultDeclaration=function(){var e;if(this.type===u._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ae|Ws,!1,e)}else if(this.type===u._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}};w.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),zt(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};w.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var s=0,r=t.properties;s<r.length;s+=1){var n=r[s];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var h=o[a];h&&this.checkPatternExport(e,h)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};w.checkVariableExport=function(e,t){if(e)for(var i=0,s=t;i<s.length;i+=1){var r=s[i];this.checkPatternExport(e,r.id)}};w.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};w.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};w.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(i)i=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;t.push(this.parseExportSpecifier(e))}return t};w.parseImport=function(e){return this.next(),this.type===u.string?(e.specifiers=sa,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===u.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};w.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Ct),this.finishNode(e,"ImportSpecifier")};w.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ct),this.finishNode(e,"ImportDefaultSpecifier")};w.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ct),this.finishNode(e,"ImportNamespaceSpecifier")};w.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===u.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(u.comma)))return e;if(this.type===u.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;e.push(this.parseImportSpecifier())}return e};w.parseWithClause=function(){var e=[];if(!this.eat(u._with))return e;this.expect(u.braceL);for(var t={},i=!0;!this.eat(u.braceR);){if(i)i=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;zt(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e};w.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===u.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(u.colon),this.type!==u.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};w.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===u.string){var e=this.parseLiteral(this.value);return Zn.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};w.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};w.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var at=B.prototype;at.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=e.properties;s<r.length;s+=1){var n=r[s];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};at.toAssignableList=function(e,t){for(var i=e.length,s=0;s<i;s++){var r=e[s];r&&this.toAssignable(r,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};at.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};at.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==u.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};at.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case u.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(u.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case u.braceL:return this.parseObj(!0)}return this.parseIdent()};at.parseBindingList=function(e,t,i,s){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(u.comma),t&&this.type===u.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===u.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else r.push(this.parseAssignableListItem(s))}return r};at.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};at.parseBindingListItem=function(e){return e};at.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(u.eq))return i;var s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};at.checkLValSimple=function(e,t,i){t===void 0&&(t=ke);var s=t!==ke;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===Ct&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(zt(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==$s&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};at.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"ObjectPattern":for(var s=0,r=e.properties;s<r.length;s+=1){var n=r[s];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var h=o[a];h&&this.checkLValInnerPattern(h,t,i)}break;default:this.checkLValSimple(e,t,i)}};at.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var pt=function(t,i,s,r,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!s,this.override=r,this.generator=!!n},O={b_stat:new pt("{",!1),b_expr:new pt("{",!0),b_tmpl:new pt("${",!1),p_stat:new pt("(",!1),p_expr:new pt("(",!0),q_tmpl:new pt("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new pt("function",!1),f_expr:new pt("function",!0),f_expr_gen:new pt("function",!0,!1,null,!0),f_gen:new pt("function",!1,!1,null,!0)},qt=B.prototype;qt.initialContext=function(){return[O.b_stat]};qt.curContext=function(){return this.context[this.context.length-1]};qt.braceIsBlock=function(e){var t=this.curContext();return t===O.f_expr||t===O.f_stat?!0:e===u.colon&&(t===O.b_stat||t===O.b_expr)?!t.isExpr:e===u._return||e===u.name&&this.exprAllowed?Z.test(this.input.slice(this.lastTokEnd,this.start)):e===u._else||e===u.semi||e===u.eof||e===u.parenR||e===u.arrow?!0:e===u.braceL?t===O.b_stat:e===u._var||e===u._const||e===u.name?!1:!this.exprAllowed};qt.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};qt.updateContext=function(e){var t,i=this.type;i.keyword&&e===u.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};qt.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};u.parenR.updateContext=u.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===O.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};u.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?O.b_stat:O.b_expr),this.exprAllowed=!0};u.dollarBraceL.updateContext=function(){this.context.push(O.b_tmpl),this.exprAllowed=!0};u.parenL.updateContext=function(e){var t=e===u._if||e===u._for||e===u._with||e===u._while;this.context.push(t?O.p_stat:O.p_expr),this.exprAllowed=!0};u.incDec.updateContext=function(){};u._function.updateContext=u._class.updateContext=function(e){e.beforeExpr&&e!==u._else&&!(e===u.semi&&this.curContext()!==O.p_stat)&&!(e===u._return&&Z.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===u.colon||e===u.braceL)&&this.curContext()===O.b_stat)?this.context.push(O.f_expr):this.context.push(O.f_stat),this.exprAllowed=!1};u.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};u.backQuote.updateContext=function(){this.curContext()===O.q_tmpl?this.context.pop():this.context.push(O.q_tmpl),this.exprAllowed=!1};u.star.updateContext=function(e){if(e===u._function){var t=this.context.length-1;this.context[t]===O.f_expr?this.context[t]=O.f_expr_gen:this.context[t]=O.f_gen}this.exprAllowed=!0};u.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==u.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var C=B.prototype;C.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var s=e.key,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){r==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}r="$"+r;var a=t[r];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(s.start,"Redefinition of property")}else a=t[r]={init:!1,get:!1,set:!1};a[n]=!0}};C.parseExpression=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===u.comma){var n=this.startNodeAt(i,s);for(n.expressions=[r];this.eat(u.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return r};C.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var s=!1,r=-1,n=-1,a=-1;t?(r=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Me,s=!0);var o=this.start,h=this.startLoc;(this.type===u.parenL||this.type===u.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,o,h)),this.type.isAssign){var l=this.startNodeAt(o,h);return l.operator=this.value,this.type===u.eq&&(c=this.toAssignable(c,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===u.eq?this.checkLValPattern(c):this.checkLValSimple(c),l.left=c,this.next(),l.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(l,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return r>-1&&(t.parenthesizedAssign=r),n>-1&&(t.trailingComma=n),c};C.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(u.question)){var n=this.startNodeAt(i,s);return n.test=r,n.consequent=this.parseMaybeAssign(),this.expect(u.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return r};C.parseExprOps=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,e)};C.parseExprOp=function(e,t,i,s,r){var n=this.type.binop;if(n!=null&&(!r||this.type!==u._in)&&n>s){var a=this.type===u.logicalOR||this.type===u.logicalAND,o=this.type===u.coalesce;o&&(n=u.logicalAND.binop);var h=this.value;this.next();var c=this.start,l=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),c,l,n,r),p=this.buildBinary(t,i,e,f,h,a||o);return(a&&this.type===u.coalesce||o&&(this.type===u.logicalOR||this.type===u.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,i,s,r)}return e};C.buildBinary=function(e,t,i,s,r,n){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=r,a.right=s,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};C.parseMaybeUnary=function(e,t,i,s){var r=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(s),t=!0;else if(this.type.prefix){var o=this.startNode(),h=this.type===u.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,h,s),this.checkExpressionErrors(e,!0),h?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&Gs(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Ei(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,h?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===u.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==u._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(r,n);c.operator=this.value,c.prefix=!1,c.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(c,"UpdateExpression")}}if(!i&&this.eat(u.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,n,a,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return a};function Gs(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Gs(e.expression)}function Ei(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ei(e.expression)||e.type==="ParenthesizedExpression"&&Ei(e.expression)}C.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprAtom(e,t);if(r.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return r;var n=this.parseSubscripts(r,i,s,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};C.parseSubscripts=function(e,t,i,s,r){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,i,s,n,a,r);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var h=this.startNodeAt(t,i);h.expression=o,o=this.finishNode(h,"ChainExpression")}return o}e=o}};C.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(u.arrow)};C.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)};C.parseSubscript=function(e,t,i,s,r,n,a){var o=this.options.ecmaVersion>=11,h=o&&this.eat(u.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(u.bracketL);if(c||h&&this.type!==u.parenL&&this.type!==u.backQuote||this.eat(u.dot)){var l=this.startNodeAt(t,i);l.object=e,c?(l.property=this.parseExpression(),this.expect(u.bracketR)):this.type===u.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!c,o&&(l.optional=h),e=this.finishNode(l,"MemberExpression")}else if(!s&&this.eat(u.parenL)){var f=new Me,p=this.yieldPos,d=this.awaitPos,y=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1,f);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=p,this.awaitPos=d,this.awaitIdentPos=y,this.parseSubscriptAsyncArrow(t,i,m,a);this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=y||this.awaitIdentPos;var b=this.startNodeAt(t,i);b.callee=e,b.arguments=m,o&&(b.optional=h),e=this.finishNode(b,"CallExpression")}else if(this.type===u.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var g=this.startNodeAt(t,i);g.tag=e,g.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(g,"TaggedTemplateExpression")}return e};C.parseExprAtom=function(e,t,i){this.type===u.slash&&this.readRegexp();var s,r=this.potentialArrowAt===this.start;switch(this.type){case u._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===u.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==u.dot&&this.type!==u.bracketL&&this.type!==u.parenL&&this.unexpected(),this.finishNode(s,"Super");case u._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case u.name:var n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(u._function))return this.overrideContext(O.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(u.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,t);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===u.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(u.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,t)}return h;case u.regexp:var c=this.value;return s=this.parseLiteral(c.value),s.regex={pattern:c.pattern,flags:c.flags},s;case u.num:case u.string:return this.parseLiteral(this.value);case u._null:case u._true:case u._false:return s=this.startNode(),s.value=this.type===u._null?null:this.type===u._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case u.parenL:var l=this.start,f=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),f;case u.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(u.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case u.braceL:return this.overrideContext(O.b_expr),this.parseObj(!1,e);case u._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case u._class:return this.parseClass(this.startNode(),!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate();case u._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};C.parseExprAtomDefault=function(){this.unexpected()};C.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===u.parenL&&!e)return this.parseDynamicImport(t);if(this.type===u.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};C.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(u.parenR)?e.options=null:(this.expect(u.comma),this.afterTrailingComma(u.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(u.parenR)||(this.expect(u.comma),this.afterTrailingComma(u.parenR)||this.unexpected())));else if(!this.eat(u.parenR)){var t=this.start;this.eat(u.comma)&&this.eat(u.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};C.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};C.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};C.parseParenExpression=function(){this.expect(u.parenL);var e=this.parseExpression();return this.expect(u.parenR),e};C.shouldParseArrow=function(e){return!this.canInsertSemicolon()};C.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,h=[],c=!0,l=!1,f=new Me,p=this.yieldPos,d=this.awaitPos,y;for(this.yieldPos=0,this.awaitPos=0;this.type!==u.parenR;)if(c?c=!1:this.expect(u.comma),n&&this.afterTrailingComma(u.parenR,!0)){l=!0;break}else if(this.type===u.ellipsis){y=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var m=this.lastTokEnd,b=this.lastTokEndLoc;if(this.expect(u.parenR),e&&this.shouldParseArrow(h)&&this.eat(u.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(i,s,h,t);(!h.length||l)&&this.unexpected(this.lastTokStart),y&&this.unexpected(y),this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?(r=this.startNodeAt(a,o),r.expressions=h,this.finishNodeAt(r,"SequenceExpression",m,b)):r=h[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var g=this.startNodeAt(i,s);return g.expression=r,this.finishNode(g,"ParenthesizedExpression")}else return r};C.parseParenItem=function(e){return e};C.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var na=[];C.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===u.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(u.parenL)?e.arguments=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1):e.arguments=na,this.finishNode(e,"NewExpression")};C.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===u.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
2
+ var Nn=Object.create;var ps=Object.defineProperty;var On=Object.getOwnPropertyDescriptor;var Ln=Object.getOwnPropertyNames;var Dn=Object.getPrototypeOf,Fn=Object.prototype.hasOwnProperty;var fi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Mn=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ln(t))!Fn.call(e,r)&&r!==i&&ps(e,r,{get:()=>t[r],enumerable:!(s=On(t,r))||s.enumerable});return e};var ds=(e,t,i)=>(i=e!=null?Nn(Dn(e)):{},Mn(t||!e||!e.__esModule?ps(i,"default",{value:e,enumerable:!0}):i,e));var ys=fi((Cu,xs)=>{"use strict";function Bn(e,t){var i=e;t.slice(0,-1).forEach(function(r){i=i[r]||{}});var s=t[t.length-1];return s in i}function ms(e){return typeof e=="number"||/^0x[0-9a-f]+$/i.test(e)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function gs(e,t){return t==="constructor"&&typeof e[t]=="function"||t==="__proto__"}xs.exports=function(e,t){t||(t={});var i={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(i.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?i.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(g){i.bools[g]=!0});var s={};function r(g){return s[g].some(function(_){return i.bools[_]})}Object.keys(t.alias||{}).forEach(function(g){s[g]=[].concat(t.alias[g]),s[g].forEach(function(_){s[_]=[g].concat(s[g].filter(function(L){return _!==L}))})}),[].concat(t.string).filter(Boolean).forEach(function(g){i.strings[g]=!0,s[g]&&[].concat(s[g]).forEach(function(_){i.strings[_]=!0})});var n=t.default||{},a={_:[]};function o(g,_){return i.allBools&&/^--[^=]+$/.test(_)||i.strings[g]||i.bools[g]||s[g]}function h(g,_,L){for(var I=g,q=0;q<_.length-1;q++){var M=_[q];if(gs(I,M))return;I[M]===void 0&&(I[M]={}),(I[M]===Object.prototype||I[M]===Number.prototype||I[M]===String.prototype)&&(I[M]={}),I[M]===Array.prototype&&(I[M]=[]),I=I[M]}var k=_[_.length-1];gs(I,k)||((I===Object.prototype||I===Number.prototype||I===String.prototype)&&(I={}),I===Array.prototype&&(I=[]),I[k]===void 0||i.bools[k]||typeof I[k]=="boolean"?I[k]=L:Array.isArray(I[k])?I[k].push(L):I[k]=[I[k],L])}function c(g,_,L){if(!(L&&i.unknownFn&&!o(g,L)&&i.unknownFn(L)===!1)){var I=!i.strings[g]&&ms(_)?Number(_):_;h(a,g.split("."),I),(s[g]||[]).forEach(function(q){h(a,q.split("."),I)})}}Object.keys(i.bools).forEach(function(g){c(g,n[g]===void 0?!1:n[g])});var l=[];e.indexOf("--")!==-1&&(l=e.slice(e.indexOf("--")+1),e=e.slice(0,e.indexOf("--")));for(var f=0;f<e.length;f++){var p=e[f],d,x;if(/^--.+=/.test(p)){var m=p.match(/^--([^=]+)=([\s\S]*)$/);d=m[1];var S=m[2];i.bools[d]&&(S=S!=="false"),c(d,S,p)}else if(/^--no-.+/.test(p))d=p.match(/^--no-(.+)/)[1],c(d,!1,p);else if(/^--.+/.test(p))d=p.match(/^--(.+)/)[1],x=e[f+1],x!==void 0&&!/^(-|--)[^-]/.test(x)&&!i.bools[d]&&!i.allBools&&(!s[d]||!r(d))?(c(d,x,p),f+=1):/^(true|false)$/.test(x)?(c(d,x==="true",p),f+=1):c(d,i.strings[d]?"":!0,p);else if(/^-[^-]+/.test(p)){for(var y=p.slice(1,-1).split(""),E=!1,b=0;b<y.length;b++){if(x=p.slice(b+2),x==="-"){c(y[b],x,p);continue}if(/[A-Za-z]/.test(y[b])&&x[0]==="="){c(y[b],x.slice(1),p),E=!0;break}if(/[A-Za-z]/.test(y[b])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(x)){c(y[b],x,p),E=!0;break}if(y[b+1]&&y[b+1].match(/\W/)){c(y[b],p.slice(b+2),p),E=!0;break}else c(y[b],i.strings[y[b]]?"":!0,p)}d=p.slice(-1)[0],!E&&d!=="-"&&(e[f+1]&&!/^(-|--)[^-]/.test(e[f+1])&&!i.bools[d]&&(!s[d]||!r(d))?(c(d,e[f+1],p),f+=1):e[f+1]&&/^(true|false)$/.test(e[f+1])?(c(d,e[f+1]==="true",p),f+=1):c(d,i.strings[d]?"":!0,p))}else if((!i.unknownFn||i.unknownFn(p)!==!1)&&a._.push(i.strings._||!ms(p)?p:Number(p)),t.stopEarly){a._.push.apply(a._,e.slice(f+1));break}}return Object.keys(n).forEach(function(g){Bn(a,g.split("."))||(h(a,g.split("."),n[g]),(s[g]||[]).forEach(function(_){h(a,_.split("."),n[g])}))}),t["--"]?a["--"]=l.slice():l.forEach(function(g){a._.push(g)}),a}});var vs=fi((Pu,Un)=>{Un.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Cloudflare Pages",constant:"CLOUDFLARE_PAGES",env:"CF_PAGES"},{name:"Cloudflare Workers",constant:"CLOUDFLARE_WORKERS",env:"WORKERS_CI"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]});var Es=fi(ft=>{"use strict";var ws=vs(),D=process.env;Object.defineProperty(ft,"_vendors",{value:ws.map(function(e){return e.constant})});ft.name=null;ft.isPR=null;ft.id=null;D.CI!=="false"&&ws.forEach(function(e){let i=(Array.isArray(e.env)?e.env:[e.env]).every(function(s){return Ss(s)});ft[e.constant]=i,i&&(ft.name=e.name,ft.isPR=jn(e),ft.id=e.constant)});ft.isCI=!!(D.CI!=="false"&&(D.BUILD_ID||D.BUILD_NUMBER||D.CI||D.CI_APP_ID||D.CI_BUILD_ID||D.CI_BUILD_NUMBER||D.CI_NAME||D.CONTINUOUS_INTEGRATION||D.RUN_ID||ft.name));function Ss(e){return typeof e=="string"?!!D[e]:"env"in e?D[e.env]&&D[e.env].includes(e.includes):"any"in e?e.any.some(function(t){return!!D[t]}):Object.keys(e).every(function(t){return D[t]===e[t]})}function jn(e){switch(typeof e.pr){case"string":return!!D[e.pr];case"object":return"env"in e.pr?"any"in e.pr?e.pr.any.some(function(t){return D[e.pr.env]===t}):e.pr.env in D&&D[e.pr.env]!==e.pr.ne:"any"in e.pr?e.pr.any.some(function(t){return!!D[t]}):Ss(e.pr);default:return null}}});var kn=ds(ys(),1);import{createPrompt as yu,useState as ui,useKeypress as bu,useMemo as vu}from"@inquirer/core";var A=class{static silent=!1;static silence(){this.silent=!0}static log(...t){this.silent||console.log(...t)}static error(...t){this.silent||console.error(...t)}};var bs={name:"@under_koen/bsm",version:"1.10.2",description:"BSM (Basic Script Manager) is a useful tool that enables you to create clear and concise scripts without cluttering your `package.json` file.",license:"MIT",author:"Koen van Staveren <koen@underkoen.nl>",homepage:"https://github.com/UnderKoen/bsm#readme",repository:{type:"git",url:"https://github.com/UnderKoen/bsm.git"},bugs:{url:"https://github.com/UnderKoen/bsm/issues"},type:"module",main:"dist/index.js",bin:{bsm:"./dist/index.js"},files:["dist"],scripts:{build:"bsm","build:dev":"bsm","build:prod":"bsm","build:watch":"bsm",lint:"bsm",prettier:"bsm",prepublishOnly:"bsm build.prod",test:"bsm","test:cov":"bsm test.cov"},dependencies:{"@inquirer/core":"^10.3.0"},devDependencies:{"@eslint/js":"^9.21.0","@inquirer/core":"^10.3.0","@semantic-release/changelog":"^6.0.3","@semantic-release/exec":"^7.1.0","@semantic-release/git":"^10.0.1","@semantic-release/github":"^12.0.0","@semantic-release/npm":"^13.1.1","@types/minimist":"^1.2.5","@types/node":"^22.13.9","@types/sinon":"^17.0.4","@typescript-eslint/eslint-plugin":"^8.26.0","@typescript-eslint/parser":"^8.26.0","@under_koen/bsm":"^1.9.1",c8:"^10.1.3","ci-info":"^4.1.0","cpy-cli":"^6.0.0",defu:"^6.1.4",esbuild:"^0.25.0",eslint:"^9.21.0","eslint-config-prettier":"^10.0.2",glob:"^11.0.3",globals:"^16.0.0",minimist:"^1.2.8",mlly:"^1.8.0",prettier:"^3.5.3","prettier-package-json":"^2.8.0",rimraf:"^6.0.1","semantic-release":"^25.0.1",sinon:"^21.0.0",tsx:"^4.20.6",typescript:"^5.8.2","typescript-eslint":"^8.26.0",uvu:"^0.5.6"},keywords:["script","scripting"]};var lt=class e{static printHelp(t,i){let s=i._;if(s.length===0)A.log(`
3
+ \x1B[1mAvailable commands:\x1B[0m`),e.printCommands(t.scripts);else for(let r of s){A.log(`
4
+ \x1B[1mAvailable commands: \x1B[90m${r}\x1B[0m`);let n=r.split("."),a=[[t.scripts,[],n]];for(;a.length>0;){let o=a.shift();if(o[2].length===0)e.printCommands(o[0],o[1]);else if(o[2][0]==="*"){if(typeof o[0]=="object")if(Array.isArray(o[0]))for(let h=0;h<o[0].length;h++)a.push([o[0][h],[...o[1],h.toString()],[]]);else for(let h in o[0])Object.hasOwn(o[0],h)&&a.push([o[0][h],[...o[1],h],o[2].slice(1)])}else{let h=o[2][0];if(typeof o[0]=="object")if(Array.isArray(o[0])){let c=parseInt(h);a.push([o[0][c],[...o[1],c.toString()],o[2].slice(1)])}else a.push([o[0][h],[...o[1],h],o[2].slice(1)])}}}process.exit(0)}static printCommands(t,i=[],s=!0){if(Array.isArray(t))t.forEach((r,n)=>{e.printCommand(r,[...i,n.toString()])});else if(typeof t=="object"){s&&i.length>0&&e.printCommand(t,[...i]);for(let r in t)Object.hasOwn(t,r)&&e.printCommand(t[r],[...i,r])}else e.printCommand(t,i)}static printCommand(t,i){if(t===void 0){A.error(`\x1B[31mScript '${i.join(".")}' not found\x1B[0m`);return}let s=e.getCommandHelp(t,i);s&&A.log(s)}static getCommandHelp(t,i){if(i[i.length-1]==="$description")return;let s=`\x1B[92m${i.join(".")}\x1B[0m\x1B[90m - \x1B[0m`,r;return typeof t=="string"?r=t:typeof t=="function"?r="\x1B[90m<function>\x1B[0m":Array.isArray(t)?r=`\x1B[90m[${t.length}]\x1B[0m`:Object.hasOwn(t,"$description")?r=`\x1B[90m${t.$description}\x1B[0m`:r=`\x1B[90m{${Object.keys(t).join(", ")}}\x1B[0m`,`${s}${r}`}static printVersion(){A.log(bs.version),process.exit(0)}};var An=ds(Es(),1);import gu from"node:child_process";import xu from"path";import fs from"fs";function pi(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function di(e,t,i=".",s){if(!pi(t))return di(e,{},i,s);let r=Object.assign({},t);for(let n in e){if(n==="__proto__"||n==="constructor")continue;let a=e[n];a!=null&&(s&&s(r,n,a,i)||(Array.isArray(a)&&Array.isArray(r[n])?r[n]=[...a,...r[n]]:pi(a)&&pi(r[n])?r[n]=di(a,r[n],(i?`${i}.`:"")+n.toString(),s):r[n]=a))}return r}function mi(e){return(...t)=>t.reduce((i,s)=>di(i,s,"",e),{})}var _s=mi(),Ou=mi((e,t,i)=>{if(e[t]!==void 0&&typeof i=="function")return e[t]=i(e[t]),!0}),Lu=mi((e,t,i)=>{if(Array.isArray(e[t])&&typeof i=="function")return e[t]=i(e[t]),!0});var $n=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239],ks=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Wn="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Ps="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",gi={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},xi="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",Gn={5:xi,"5module":xi+" export import",6:xi+" const class extends export import super"},zn=/^in(stanceof)?$/,Hn=new RegExp("["+Ps+"]"),qn=new RegExp("["+Ps+Wn+"]");function bi(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function yt(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&Hn.test(String.fromCharCode(e)):t===!1?!1:bi(e,ks)}function kt(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&qn.test(String.fromCharCode(e)):t===!1?!1:bi(e,ks)||bi(e,$n)}var P=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null};function st(e,t){return new P(e,{beforeExpr:!0,binop:t})}var rt={beforeExpr:!0},Z={startsExpr:!0},Ei={};function T(e,t){return t===void 0&&(t={}),t.keyword=e,Ei[e]=new P(e,t)}var u={num:new P("num",Z),regexp:new P("regexp",Z),string:new P("string",Z),name:new P("name",Z),privateId:new P("privateId",Z),eof:new P("eof"),bracketL:new P("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:!0,startsExpr:!0}),braceR:new P("}"),parenL:new P("(",{beforeExpr:!0,startsExpr:!0}),parenR:new P(")"),comma:new P(",",rt),semi:new P(";",rt),colon:new P(":",rt),dot:new P("."),question:new P("?",rt),questionDot:new P("?."),arrow:new P("=>",rt),template:new P("template"),invalidTemplate:new P("invalidTemplate"),ellipsis:new P("...",rt),backQuote:new P("`",Z),dollarBraceL:new P("${",{beforeExpr:!0,startsExpr:!0}),eq:new P("=",{beforeExpr:!0,isAssign:!0}),assign:new P("_=",{beforeExpr:!0,isAssign:!0}),incDec:new P("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new P("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:st("||",1),logicalAND:st("&&",2),bitwiseOR:st("|",3),bitwiseXOR:st("^",4),bitwiseAND:st("&",5),equality:st("==/!=/===/!==",6),relational:st("</>/<=/>=",7),bitShift:st("<</>>/>>>",8),plusMin:new P("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:st("%",10),star:st("*",10),slash:st("/",10),starstar:new P("**",{beforeExpr:!0}),coalesce:st("??",1),_break:T("break"),_case:T("case",rt),_catch:T("catch"),_continue:T("continue"),_debugger:T("debugger"),_default:T("default",rt),_do:T("do",{isLoop:!0,beforeExpr:!0}),_else:T("else",rt),_finally:T("finally"),_for:T("for",{isLoop:!0}),_function:T("function",Z),_if:T("if"),_return:T("return",rt),_switch:T("switch"),_throw:T("throw",rt),_try:T("try"),_var:T("var"),_const:T("const"),_while:T("while",{isLoop:!0}),_with:T("with"),_new:T("new",{beforeExpr:!0,startsExpr:!0}),_this:T("this",Z),_super:T("super",Z),_class:T("class",Z),_extends:T("extends",rt),_export:T("export"),_import:T("import",Z),_null:T("null",Z),_true:T("true",Z),_false:T("false",Z),_in:T("in",{beforeExpr:!0,binop:7}),_instanceof:T("instanceof",{beforeExpr:!0,binop:7}),_typeof:T("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:T("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:T("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},J=/\r\n?|\n|\u2028|\u2029/,Kn=new RegExp(J.source,"g");function Gt(e){return e===10||e===13||e===8232||e===8233}function Ns(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var r=e.charCodeAt(s);if(Gt(r))return s<i-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var Os=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,G=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,Ls=Object.prototype,Qn=Ls.hasOwnProperty,Yn=Ls.toString,zt=Object.hasOwn||(function(e,t){return Qn.call(e,t)}),Cs=Array.isArray||(function(e){return Yn.call(e)==="[object Array]"}),As=Object.create(null);function Tt(e){return As[e]||(As[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Et(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var Xn=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ae=function(t,i){this.line=t,this.column=i};ae.prototype.offset=function(t){return new ae(this.line,this.column+t)};var Le=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Ds(e,t){for(var i=1,s=0;;){var r=Ns(e,s,t);if(r<0)return new ae(i,t-s);++i,s=r}}var vi={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},Is=!1;function Zn(e){var t={};for(var i in vi)t[i]=e&&zt(e,i)?e[i]:vi[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Is&&typeof console=="object"&&console.warn&&(Is=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
5
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),Cs(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return Cs(t.onComment)&&(t.onComment=Jn(t,t.onComment)),t}function Jn(e,t){return function(i,s,r,n,a,o){var h={type:i?"Block":"Line",value:s,start:r,end:n};e.locations&&(h.loc=new Le(this,a,o)),e.ranges&&(h.range=[r,n]),t.push(h)}}var oe=1,Ht=2,_i=4,Fs=8,Ci=16,Ms=32,De=64,Bs=128,Bt=256,he=512,Fe=oe|Ht|Bt;function Ai(e,t){return Ht|(e?_i:0)|(t?Fs:0)}var ke=0,Ii=1,Ct=2,Vs=3,Us=4,js=5,V=function(t,i,s){this.options=t=Zn(t),this.sourceFile=t.sourceFile,this.keywords=Tt(Gn[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=gi[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=Tt(r);var n=(r?r+" ":"")+gi.strict;this.reservedWordsStrict=Tt(n),this.reservedWordsStrictBind=Tt(n+" "+gi.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
6
+ `,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(J).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=u.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(oe),this.regexpState=null,this.privateNameStack=[]},bt={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};V.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};bt.inFunction.get=function(){return(this.currentVarScope().flags&Ht)>0};bt.inGenerator.get=function(){return(this.currentVarScope().flags&Fs)>0};bt.inAsync.get=function(){return(this.currentVarScope().flags&_i)>0};bt.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(Bt|he))return!1;if(i&Ht)return(i&_i)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};bt.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return(t&De)>0||this.options.allowSuperOutsideMethod};bt.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Bs)>0};bt.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};bt.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(Bt|he)||i&Ht&&!(i&Ci))return!0}return!1};bt.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&Bt)>0};V.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,r=0;r<t.length;r++)s=t[r](s);return s};V.parse=function(t,i){return new this(i,t).parse()};V.parseExpressionAt=function(t,i,s){var r=new this(s,t,i);return r.nextToken(),r.parseExpression()};V.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(V.prototype,bt);var K=V.prototype,ta=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;K.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){G.lastIndex=e,e+=G.exec(this.input)[0].length;var t=ta.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){G.lastIndex=e+t[0].length;var i=G.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||J.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,G.lastIndex=e,e+=G.exec(this.input)[0].length,this.input[e]===";"&&e++}};K.eat=function(e){return this.type===e?(this.next(),!0):!1};K.isContextual=function(e){return this.type===u.name&&this.value===e&&!this.containsEsc};K.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};K.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};K.canInsertSemicolon=function(){return this.type===u.eof||this.type===u.braceR||J.test(this.input.slice(this.lastTokEnd,this.start))};K.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};K.semicolon=function(){!this.eat(u.semi)&&!this.insertSemicolon()&&this.unexpected()};K.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};K.expect=function(e){this.eat(e)||this.unexpected()};K.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Me=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};K.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern")}};K.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};K.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")};K.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var w=V.prototype;w.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==u.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var s=0,r=Object.keys(this.undefinedExports);s<r.length;s+=1){var n=r[s];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Ri={kind:"loop"},ea={kind:"switch"};w.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;G.lastIndex=this.pos;var t=G.exec(this.input),i=this.pos+t[0].length,s=this.input.charCodeAt(i);if(s===91||s===92)return!0;if(e)return!1;if(s===123||s>55295&&s<56320)return!0;if(yt(s,!0)){for(var r=i+1;kt(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var n=this.input.slice(i,r);if(!zn.test(n))return!0}return!1};w.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;G.lastIndex=this.pos;var e=G.exec(this.input),t=this.pos+e[0].length,i;return!J.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(kt(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};w.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return!1;G.lastIndex=this.pos;var i=G.exec(this.input),s=this.pos+i[0].length;if(J.test(this.input.slice(this.pos,s)))return!1;if(e){var r=s+5,n;if(this.input.slice(s,r)!=="using"||r===this.input.length||kt(n=this.input.charCodeAt(r))||n>55295&&n<56320)return!1;G.lastIndex=r;var a=G.exec(this.input);if(a&&J.test(this.input.slice(r,r+a[0].length)))return!1}if(t){var o=s+2,h;if(this.input.slice(s,o)==="of"&&(o===this.input.length||!kt(h=this.input.charCodeAt(o))&&!(h>55295&&h<56320)))return!1}var c=this.input.charCodeAt(s);return yt(c,!0)||c===92};w.isAwaitUsing=function(e){return this.isUsingKeyword(!0,e)};w.isUsing=function(e){return this.isUsingKeyword(!1,e)};w.parseStatement=function(e,t,i){var s=this.type,r=this.startNode(),n;switch(this.isLet(e)&&(s=u._var,n="let"),s){case u._break:case u._continue:return this.parseBreakContinueStatement(r,s.keyword);case u._debugger:return this.parseDebuggerStatement(r);case u._do:return this.parseDoStatement(r);case u._for:return this.parseForStatement(r);case u._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case u._class:return e&&this.unexpected(),this.parseClass(r,!0);case u._if:return this.parseIfStatement(r);case u._return:return this.parseReturnStatement(r);case u._switch:return this.parseSwitchStatement(r);case u._throw:return this.parseThrowStatement(r);case u._try:return this.parseTryStatement(r);case u._const:case u._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(r,n);case u._while:return this.parseWhileStatement(r);case u._with:return this.parseWithStatement(r);case u.braceL:return this.parseBlock(!0,r);case u.semi:return this.parseEmptyStatement(r);case u._export:case u._import:if(this.options.ecmaVersion>10&&s===u._import){G.lastIndex=this.pos;var a=G.exec(this.input),o=this.pos+a[0].length,h=this.input.charCodeAt(o);if(h===40||h===46)return this.parseExpressionStatement(r,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),s===u._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var c=this.isAwaitUsing(!1)?"await using":this.isUsing(!1)?"using":null;if(c)return t&&this.options.sourceType==="script"&&this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script`"),c==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(r,!1,c),this.semicolon(),this.finishNode(r,"VariableDeclaration");var l=this.value,f=this.parseExpression();return s===u.name&&f.type==="Identifier"&&this.eat(u.colon)?this.parseLabeledStatement(r,l,f,e):this.parseExpressionStatement(r,f)}};w.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(u.semi)||this.insertSemicolon()?e.label=null:this.type!==u.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var s=0;s<this.labels.length;++s){var r=this.labels[s];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(i||r.kind==="loop")||e.label&&i))break}return s===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};w.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};w.parseDoStatement=function(e){return this.next(),this.labels.push(Ri),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(u._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(u.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};w.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(Ri),this.enterScope(0),this.expect(u.parenL),this.type===u.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===u._var||this.type===u._const||i){var s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),this.parseForAfterInit(e,s,t)}var n=this.isContextual("let"),a=!1,o=this.isUsing(!0)?"using":this.isAwaitUsing(!0)?"await using":null;if(o){var h=this.startNode();return this.next(),o==="await using"&&this.next(),this.parseVar(h,!0,o),this.finishNode(h,"VariableDeclaration"),this.parseForAfterInit(e,h,t)}var c=this.containsEsc,l=new Me,f=this.start,p=t>-1?this.parseExprSubscripts(l,"await"):this.parseExpression(!0,l);return this.type===u._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===u._in&&this.unexpected(t),e.await=!0):a&&this.options.ecmaVersion>=8&&(p.start===f&&!c&&p.type==="Identifier"&&p.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=!1)),n&&a&&this.raise(p.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(p,!1,l),this.checkLValPattern(p),this.parseForIn(e,p)):(this.checkExpressionErrors(l,!0),t>-1&&this.unexpected(t),this.parseFor(e,p))};w.parseForAfterInit=function(e,t,i){return(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===u._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};w.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ne|(i?0:wi),!1,t)};w.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(u._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};w.parseReturnStatement=function(e){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(u.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};w.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(u.braceL),this.labels.push(ea),this.enterScope(0);for(var t,i=!1;this.type!==u.braceR;)if(this.type===u._case||this.type===u._default){var s=this.type===u._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,t.test=null),this.expect(u.colon)}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};w.parseThrowStatement=function(e){return this.next(),J.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var ia=[];w.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Ms:0),this.checkLValPattern(e,t?Us:Ct),this.expect(u.parenR),e};w.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===u._catch){var t=this.startNode();this.next(),this.eat(u.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(!1),this.exitScope(),e.handler=this.finishNode(t,"CatchClause")}return e.finalizer=this.eat(u._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};w.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};w.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ri),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};w.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};w.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};w.parseLabeledStatement=function(e,t,i,s){for(var r=0,n=this.labels;r<n.length;r+=1){var a=n[r];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared")}for(var o=this.type.isLoop?"loop":this.type===u._switch?"switch":null,h=this.labels.length-1;h>=0;h--){var c=this.labels[h];if(c.statementStart===e.start)c.statementStart=this.start,c.kind=o;else break}return this.labels.push({name:t,kind:o,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};w.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};w.parseBlock=function(e,t,i){for(e===void 0&&(e=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(u.braceL),e&&this.enterScope(0);this.type!==u.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};w.parseFor=function(e,t){return e.init=t,this.expect(u.semi),e.test=this.type===u.semi?null:this.parseExpression(),this.expect(u.semi),e.update=this.type===u.parenR?null:this.parseExpression(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};w.parseForIn=function(e,t){var i=this.type===u._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(u.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};w.parseVar=function(e,t,i,s){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(u.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===u._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==u._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!s&&r.id.type!=="Identifier"&&!(t&&(this.type===u._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(u.comma))break}return e};w.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Ii:Ct,!1)};var ne=1,wi=2,$s=4;w.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===u.star&&t&wi&&this.unexpected(),e.generator=this.eat(u.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&ne&&(e.id=t&$s&&this.type!==u.name?null:this.parseIdent(),e.id&&!(t&wi)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Ii:Ct:Vs));var n=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ai(e.async,e.generator)),t&ne||(e.id=this.type===u.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,t&ne?"FunctionDeclaration":"FunctionExpression")};w.parseFunctionParams=function(e){this.expect(u.parenL),e.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};w.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),n=!1;for(r.body=[],this.expect(u.braceL);this.type!==u.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(r.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),n=!0):a.key&&a.key.type==="PrivateIdentifier"&&sa(s,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(r,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};w.parseClassElement=function(e){if(this.eat(u.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),s="",r=!1,n=!1,a="method",o=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(u.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===u.star?o=!0:s="static"}if(i.static=o,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===u.star)&&!this.canInsertSemicolon()?n=!0:s="async"),!s&&(t>=9||!n)&&this.eat(u.star)&&(r=!0),!s&&!n&&!r){var h=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=h:s=h)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===u.parenL||a!=="method"||r||n){var c=!i.static&&Pe(i,"constructor"),l=c&&e;c&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=c?"constructor":a,this.parseClassMethod(i,r,n,l)}else this.parseClassField(i);return i};w.isClassElementNameStart=function(){return this.type===u.name||this.type===u.privateId||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword};w.parseClassElementName=function(e){this.type===u.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};w.parseClassMethod=function(e,t,i,s){var r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&Pe(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,s);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};w.parseClassField=function(e){return Pe(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Pe(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(u.eq)?(this.enterScope(he|De),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};w.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(Bt|De);this.type!==u.braceR;){var i=this.parseStatement(null);e.body.push(i)}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};w.parseClassId=function(e,t){this.type===u.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,Ct,!1)):(t===!0&&this.unexpected(),e.id=null)};w.parseClassSuper=function(e){e.superClass=this.eat(u._extends)?this.parseExprSubscripts(null,!1):null};w.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};w.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var s=this.privateNameStack.length,r=s===0?null:this.privateNameStack[s-1],n=0;n<i.length;++n){var a=i[n];zt(t,a.name)||(r?r.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"))}};function sa(e,t){var i=t.key.name,s=e[i],r="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(r=(t.static?"s":"i")+t.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(e[i]="true",!1):s?!0:(e[i]=r,!1)}function Pe(e,t){var i=e.computed,s=e.key;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.value===t)}w.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};w.parseExport=function(e,t){if(this.next(),this.eat(u.star))return this.parseExportAllDeclaration(e,t);if(this.eat(u._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==u.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else{for(var i=0,s=e.specifiers;i<s.length;i+=1){var r=s[i];this.checkUnreserved(r.local),this.checkLocalExport(r.local),r.local.type==="Literal"&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[])}this.semicolon()}return this.finishNode(e,"ExportNamedDeclaration")};w.parseExportDeclaration=function(e){return this.parseStatement(null)};w.parseExportDefaultDeclaration=function(){var e;if(this.type===u._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ne|$s,!1,e)}else if(this.type===u._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}};w.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),zt(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};w.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var s=0,r=t.properties;s<r.length;s+=1){var n=r[s];this.checkPatternExport(e,n)}else if(i==="ArrayPattern")for(var a=0,o=t.elements;a<o.length;a+=1){var h=o[a];h&&this.checkPatternExport(e,h)}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument)};w.checkVariableExport=function(e,t){if(e)for(var i=0,s=t;i<s.length;i+=1){var r=s[i];this.checkPatternExport(e,r.id)}};w.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};w.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};w.parseExportSpecifiers=function(e){var t=[],i=!0;for(this.expect(u.braceL);!this.eat(u.braceR);){if(i)i=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;t.push(this.parseExportSpecifier(e))}return t};w.parseImport=function(e){return this.next(),this.type===u.string?(e.specifiers=ia,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===u.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};w.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,Ct),this.finishNode(e,"ImportSpecifier")};w.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,Ct),this.finishNode(e,"ImportDefaultSpecifier")};w.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,Ct),this.finishNode(e,"ImportNamespaceSpecifier")};w.parseImportSpecifiers=function(){var e=[],t=!0;if(this.type===u.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(u.comma)))return e;if(this.type===u.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(u.braceL);!this.eat(u.braceR);){if(t)t=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;e.push(this.parseImportSpecifier())}return e};w.parseWithClause=function(){var e=[];if(!this.eat(u._with))return e;this.expect(u.braceL);for(var t={},i=!0;!this.eat(u.braceR);){if(i)i=!1;else if(this.expect(u.comma),this.afterTrailingComma(u.braceR))break;var s=this.parseImportAttribute(),r=s.key.type==="Identifier"?s.key.name:s.key.value;zt(t,r)&&this.raiseRecoverable(s.key.start,"Duplicate attribute key '"+r+"'"),t[r]=!0,e.push(s)}return e};w.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===u.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(u.colon),this.type!==u.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};w.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===u.string){var e=this.parseLiteral(this.value);return Xn.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};w.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1)};w.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var at=V.prototype;at.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case"Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,!0);for(var s=0,r=e.properties;s<r.length;s+=1){var n=r[s];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token")}break;case"Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case"ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,!0),this.toAssignableList(e.elements,t);break;case"SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case"ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue")}else i&&this.checkPatternErrors(i,!0);return e};at.toAssignableList=function(e,t){for(var i=e.length,s=0;s<i;s++){var r=e[s];r&&this.toAssignable(r,t)}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start)}return e};at.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};at.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==u.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};at.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case u.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(u.bracketR,!0,!0),this.finishNode(e,"ArrayPattern");case u.braceL:return this.parseObj(!0)}return this.parseIdent()};at.parseBindingList=function(e,t,i,s){for(var r=[],n=!0;!this.eat(e);)if(n?n=!1:this.expect(u.comma),t&&this.type===u.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===u.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),r.push(a),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else r.push(this.parseAssignableListItem(s))}return r};at.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};at.parseBindingListItem=function(e){return e};at.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(u.eq))return i;var s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};at.checkLValSimple=function(e,t,i){t===void 0&&(t=ke);var s=t!==ke;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===Ct&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(zt(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==js&&this.declareName(e.name,t,e.start));break;case"ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};at.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"ObjectPattern":for(var s=0,r=e.properties;s<r.length;s+=1){var n=r[s];this.checkLValInnerPattern(n,t,i)}break;case"ArrayPattern":for(var a=0,o=e.elements;a<o.length;a+=1){var h=o[a];h&&this.checkLValInnerPattern(h,t,i)}break;default:this.checkLValSimple(e,t,i)}};at.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ke),e.type){case"Property":this.checkLValInnerPattern(e.value,t,i);break;case"AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case"RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i)}};var pt=function(t,i,s,r,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!s,this.override=r,this.generator=!!n},O={b_stat:new pt("{",!1),b_expr:new pt("{",!0),b_tmpl:new pt("${",!1),p_stat:new pt("(",!1),p_expr:new pt("(",!0),q_tmpl:new pt("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new pt("function",!1),f_expr:new pt("function",!0),f_expr_gen:new pt("function",!0,!1,null,!0),f_gen:new pt("function",!1,!1,null,!0)},qt=V.prototype;qt.initialContext=function(){return[O.b_stat]};qt.curContext=function(){return this.context[this.context.length-1]};qt.braceIsBlock=function(e){var t=this.curContext();return t===O.f_expr||t===O.f_stat?!0:e===u.colon&&(t===O.b_stat||t===O.b_expr)?!t.isExpr:e===u._return||e===u.name&&this.exprAllowed?J.test(this.input.slice(this.lastTokEnd,this.start)):e===u._else||e===u.semi||e===u.eof||e===u.parenR||e===u.arrow?!0:e===u.braceL?t===O.b_stat:e===u._var||e===u._const||e===u.name?!1:!this.exprAllowed};qt.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return!1};qt.updateContext=function(e){var t,i=this.type;i.keyword&&e===u.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};qt.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e)};u.parenR.updateContext=u.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var e=this.context.pop();e===O.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr};u.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?O.b_stat:O.b_expr),this.exprAllowed=!0};u.dollarBraceL.updateContext=function(){this.context.push(O.b_tmpl),this.exprAllowed=!0};u.parenL.updateContext=function(e){var t=e===u._if||e===u._for||e===u._with||e===u._while;this.context.push(t?O.p_stat:O.p_expr),this.exprAllowed=!0};u.incDec.updateContext=function(){};u._function.updateContext=u._class.updateContext=function(e){e.beforeExpr&&e!==u._else&&!(e===u.semi&&this.curContext()!==O.p_stat)&&!(e===u._return&&J.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===u.colon||e===u.braceL)&&this.curContext()===O.b_stat)?this.context.push(O.f_expr):this.context.push(O.f_stat),this.exprAllowed=!1};u.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};u.backQuote.updateContext=function(){this.curContext()===O.q_tmpl?this.context.pop():this.context.push(O.q_tmpl),this.exprAllowed=!1};u.star.updateContext=function(e){if(e===u._function){var t=this.context.length-1;this.context[t]===O.f_expr?this.context[t]=O.f_expr_gen:this.context[t]=O.f_gen}this.exprAllowed=!0};u.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==u.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var C=V.prototype;C.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var s=e.key,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){r==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}r="$"+r;var a=t[r];if(a){var o;n==="init"?o=this.strict&&a.init||a.get||a.set:o=a.init||a[n],o&&this.raiseRecoverable(s.start,"Redefinition of property")}else a=t[r]={init:!1,get:!1,set:!1};a[n]=!0}};C.parseExpression=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===u.comma){var n=this.startNodeAt(i,s);for(n.expressions=[r];this.eat(u.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return r};C.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var s=!1,r=-1,n=-1,a=-1;t?(r=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Me,s=!0);var o=this.start,h=this.startLoc;(this.type===u.parenL||this.type===u.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var c=this.parseMaybeConditional(e,t);if(i&&(c=i.call(this,c,o,h)),this.type.isAssign){var l=this.startNodeAt(o,h);return l.operator=this.value,this.type===u.eq&&(c=this.toAssignable(c,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=c.start&&(t.shorthandAssign=-1),this.type===u.eq?this.checkLValPattern(c):this.checkLValSimple(c),l.left=c,this.next(),l.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(l,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return r>-1&&(t.parenthesizedAssign=r),n>-1&&(t.trailingComma=n),c};C.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(u.question)){var n=this.startNodeAt(i,s);return n.test=r,n.consequent=this.parseMaybeAssign(),this.expect(u.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return r};C.parseExprOps=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,e)};C.parseExprOp=function(e,t,i,s,r){var n=this.type.binop;if(n!=null&&(!r||this.type!==u._in)&&n>s){var a=this.type===u.logicalOR||this.type===u.logicalAND,o=this.type===u.coalesce;o&&(n=u.logicalAND.binop);var h=this.value;this.next();var c=this.start,l=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),c,l,n,r),p=this.buildBinary(t,i,e,f,h,a||o);return(a&&this.type===u.coalesce||o&&(this.type===u.logicalOR||this.type===u.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(p,t,i,s,r)}return e};C.buildBinary=function(e,t,i,s,r,n){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=r,a.right=s,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};C.parseMaybeUnary=function(e,t,i,s){var r=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(s),t=!0;else if(this.type.prefix){var o=this.startNode(),h=this.type===u.incDec;o.operator=this.value,o.prefix=!0,this.next(),o.argument=this.parseMaybeUnary(null,!0,h,s),this.checkExpressionErrors(e,!0),h?this.checkLValSimple(o.argument):this.strict&&o.operator==="delete"&&Ws(o.argument)?this.raiseRecoverable(o.start,"Deleting local variable in strict mode"):o.operator==="delete"&&Si(o.argument)?this.raiseRecoverable(o.start,"Private fields can not be deleted"):t=!0,a=this.finishNode(o,h?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===u.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==u._in&&this.unexpected();else{if(a=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var c=this.startNodeAt(r,n);c.operator=this.value,c.prefix=!1,c.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(c,"UpdateExpression")}}if(!i&&this.eat(u.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,n,a,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return a};function Ws(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Ws(e.expression)}function Si(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Si(e.expression)||e.type==="ParenthesizedExpression"&&Si(e.expression)}C.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprAtom(e,t);if(r.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return r;var n=this.parseSubscripts(r,i,s,!1,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};C.parseSubscripts=function(e,t,i,s,r){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=!1;;){var o=this.parseSubscript(e,t,i,s,n,a,r);if(o.optional&&(a=!0),o===e||o.type==="ArrowFunctionExpression"){if(a){var h=this.startNodeAt(t,i);h.expression=o,o=this.finishNode(h,"ChainExpression")}return o}e=o}};C.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(u.arrow)};C.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)};C.parseSubscript=function(e,t,i,s,r,n,a){var o=this.options.ecmaVersion>=11,h=o&&this.eat(u.questionDot);s&&h&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var c=this.eat(u.bracketL);if(c||h&&this.type!==u.parenL&&this.type!==u.backQuote||this.eat(u.dot)){var l=this.startNodeAt(t,i);l.object=e,c?(l.property=this.parseExpression(),this.expect(u.bracketR)):this.type===u.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!c,o&&(l.optional=h),e=this.finishNode(l,"MemberExpression")}else if(!s&&this.eat(u.parenL)){var f=new Me,p=this.yieldPos,d=this.awaitPos,x=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var m=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1,f);if(r&&!h&&this.shouldParseAsyncArrow())return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=p,this.awaitPos=d,this.awaitIdentPos=x,this.parseSubscriptAsyncArrow(t,i,m,a);this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,this.awaitIdentPos=x||this.awaitIdentPos;var S=this.startNodeAt(t,i);S.callee=e,S.arguments=m,o&&(S.optional=h),e=this.finishNode(S,"CallExpression")}else if(this.type===u.backQuote){(h||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var y=this.startNodeAt(t,i);y.tag=e,y.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(y,"TaggedTemplateExpression")}return e};C.parseExprAtom=function(e,t,i){this.type===u.slash&&this.readRegexp();var s,r=this.potentialArrowAt===this.start;switch(this.type){case u._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===u.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==u.dot&&this.type!==u.bracketL&&this.type!==u.parenL&&this.unexpected(),this.finishNode(s,"Super");case u._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case u.name:var n=this.start,a=this.startLoc,o=this.containsEsc,h=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!o&&h.name==="async"&&!this.canInsertSemicolon()&&this.eat(u._function))return this.overrideContext(O.f_expr),this.parseFunction(this.startNodeAt(n,a),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(u.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[h],!1,t);if(this.options.ecmaVersion>=8&&h.name==="async"&&this.type===u.name&&!o&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return h=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(u.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[h],!0,t)}return h;case u.regexp:var c=this.value;return s=this.parseLiteral(c.value),s.regex={pattern:c.pattern,flags:c.flags},s;case u.num:case u.string:return this.parseLiteral(this.value);case u._null:case u._true:case u._false:return s=this.startNode(),s.value=this.type===u._null?null:this.type===u._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case u.parenL:var l=this.start,f=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),f;case u.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(u.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case u.braceL:return this.overrideContext(O.b_expr),this.parseObj(!1,e);case u._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case u._class:return this.parseClass(this.startNode(),!1);case u._new:return this.parseNew();case u.backQuote:return this.parseTemplate();case u._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};C.parseExprAtomDefault=function(){this.unexpected()};C.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===u.parenL&&!e)return this.parseDynamicImport(t);if(this.type===u.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected()};C.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(u.parenR)?e.options=null:(this.expect(u.comma),this.afterTrailingComma(u.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(u.parenR)||(this.expect(u.comma),this.afterTrailingComma(u.parenR)||this.unexpected())));else if(!this.eat(u.parenR)){var t=this.start;this.eat(u.comma)&&this.eat(u.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t)}return this.finishNode(e,"ImportExpression")};C.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};C.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};C.parseParenExpression=function(){this.expect(u.parenL);var e=this.parseExpression();return this.expect(u.parenR),e};C.shouldParseArrow=function(e){return!this.canInsertSemicolon()};C.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,r,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,o=this.startLoc,h=[],c=!0,l=!1,f=new Me,p=this.yieldPos,d=this.awaitPos,x;for(this.yieldPos=0,this.awaitPos=0;this.type!==u.parenR;)if(c?c=!1:this.expect(u.comma),n&&this.afterTrailingComma(u.parenR,!0)){l=!0;break}else if(this.type===u.ellipsis){x=this.start,h.push(this.parseParenItem(this.parseRestBinding())),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else h.push(this.parseMaybeAssign(!1,f,this.parseParenItem));var m=this.lastTokEnd,S=this.lastTokEndLoc;if(this.expect(u.parenR),e&&this.shouldParseArrow(h)&&this.eat(u.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=p,this.awaitPos=d,this.parseParenArrowList(i,s,h,t);(!h.length||l)&&this.unexpected(this.lastTokStart),x&&this.unexpected(x),this.checkExpressionErrors(f,!0),this.yieldPos=p||this.yieldPos,this.awaitPos=d||this.awaitPos,h.length>1?(r=this.startNodeAt(a,o),r.expressions=h,this.finishNodeAt(r,"SequenceExpression",m,S)):r=h[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var y=this.startNodeAt(i,s);return y.expression=r,this.finishNode(y,"ParenthesizedExpression")}else return r};C.parseParenItem=function(e){return e};C.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var ra=[];C.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===u.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(u.parenL)?e.arguments=this.parseExprList(u.parenR,this.options.ecmaVersion>=8,!1):e.arguments=ra,this.finishNode(e,"NewExpression")};C.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===u.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
7
7
  `),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
8
- `),cooked:this.value},this.next(),i.tail=this.type===u.backQuote,this.finishNode(i,"TemplateElement")};C.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===u.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(u.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(u.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};C.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===u.name||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===u.star)&&!Z.test(this.input.slice(this.lastTokEnd,this.start))};C.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(u.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,r,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};C.parseProperty=function(e,t){var i=this.startNode(),s,r,n,a;if(this.options.ecmaVersion>=9&&this.eat(u.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===u.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(s=this.eat(u.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(u.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,n,a,t,o),this.finishNode(i,"Property")};C.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var s=e.value.start;e.kind==="get"?this.raiseRecoverable(s,"getter should have no params"):this.raiseRecoverable(s,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};C.parsePropertyValue=function(e,t,i,s,r,n,a,o){(i||s)&&this.type===u.colon&&this.unexpected(),this.eat(u.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===u.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,s),e.kind="init"):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==u.comma&&this.type!==u.braceR&&this.type!==u.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key)):this.type===u.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()};C.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(u.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(u.bracketR),e.key;e.computed=!1}return e.key=this.type===u.num||this.type===u.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};C.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};C.parseMethod=function(e,t,i){var s=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ii(t,s.generator)|De|(i?Vs:0)),this.expect(u.parenL),s.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")};C.parseArrowExpression=function(e,t,i,s){var r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Ii(i,!1)|Ai),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};C.parseFunctionBody=function(e,t,i,s){var r=t&&this.type!==u.braceL,n=this.strict,a=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var h=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,$s),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=h}this.exitScope()};C.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var s=i[t];if(s.type!=="Identifier")return!1}return!0};C.checkParams=function(e,t){for(var i=Object.create(null),s=0,r=e.params;s<r.length;s+=1){var n=r[s];this.checkLValInnerPattern(n,Ri,t?null:i)}};C.parseExprList=function(e,t,i,s){for(var r=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(u.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===u.comma?a=null:this.type===u.ellipsis?(a=this.parseSpread(s),s&&this.type===u.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):a=this.parseMaybeAssign(!1,s),r.push(a)}return r};C.checkUnreserved=function(e){var t=e.start,i=e.end,s=e.name;if(this.inGenerator&&s==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Fe)&&s==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(s==="arguments"||s==="await")&&this.raise(t,"Cannot use "+s+" in class static initialization block"),this.keywords.test(s)&&this.raise(t,"Unexpected keyword '"+s+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var r=this.strict?this.reservedWordsStrict:this.reservedWords;r.test(s)&&(!this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+s+"' is reserved"))}};C.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};C.parseIdentNode=function(){var e=this.startNode();return this.type===u.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=u.name):this.unexpected(),e};C.parsePrivateIdent=function(){var e=this.startNode();return this.type===u.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};C.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===u.semi||this.canInsertSemicolon()||this.type!==u.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(u.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};C.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Ne=B.prototype;Ne.raise=function(e,t){var i=Fs(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var s=new SyntaxError(t);throw s.pos=e,s.loc=i,s.raisedAt=this.pos,s};Ne.raiseRecoverable=Ne.raise;Ne.curPosition=function(){if(this.options.locations)return new oe(this.curLine,this.pos-this.lineStart)};var Pt=B.prototype,aa=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};Pt.enterScope=function(e){this.scopeStack.push(new aa(e))};Pt.exitScope=function(){this.scopeStack.pop()};Pt.treatFunctionsAsVarInScope=function(e){return e.flags&Ht||!this.inModule&&e.flags&he};Pt.declareName=function(e,t,i){var s=!1;if(t===Ct){var r=this.currentScope();s=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&he&&delete this.undefinedExports[e]}else if(t===js){var n=this.currentScope();n.lexical.push(e)}else if(t===Us){var a=this.currentScope();this.treatFunctionsAsVar?s=a.lexical.indexOf(e)>-1:s=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var h=this.scopeStack[o];if(h.lexical.indexOf(e)>-1&&!(h.flags&Bs&&h.lexical[0]===e)||!this.treatFunctionsAsVarInScope(h)&&h.functions.indexOf(e)>-1){s=!0;break}if(h.var.push(e),this.inModule&&h.flags&he&&delete this.undefinedExports[e],h.flags&Fe)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};Pt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Pt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Pt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Fe|ue|Bt))return t}};Pt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Fe|ue|Bt)&&!(t.flags&Ai))return t}};var Be=function(t,i,s){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Le(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},ce=B.prototype;ce.startNode=function(){return new Be(this,this.start,this.startLoc)};ce.startNodeAt=function(e,t){return new Be(this,e,t)};function zs(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}ce.finishNode=function(e,t){return zs.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ce.finishNodeAt=function(e,t,i,s){return zs.call(this,e,t,i,s)};ce.copyNode=function(e){var t=new Be(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var oa="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",Hs="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",qs=Hs+" Extended_Pictographic",Ks=qs,Qs=Ks+" EBase EComp EMod EPres ExtPict",Ys=Qs,ha=Ys,ua={9:Hs,10:qs,11:Ks,12:Qs,13:Ys,14:ha},ca="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",la={9:"",10:"",11:"",12:"",13:"",14:ca},Ts="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Xs="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Zs=Xs+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Js=Zs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",tr=Js+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",er=tr+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",fa=er+" "+oa,pa={9:Xs,10:Zs,11:Js,12:tr,13:er,14:fa},ir={};function da(e){var t=ir[e]={binary:Tt(ua[e]+" "+Ts),binaryOfStrings:Tt(la[e]),nonBinary:{General_Category:Tt(Ts),Script:Tt(pa[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(Te=0,bi=[9,10,11,12,13,14];Te<bi.length;Te+=1)ks=bi[Te],da(ks);var ks,Te,bi,v=B.prototype,Oe=function(t,i){this.parent=t,this.base=i||this};Oe.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var s=t;s;s=s.parent)if(i.base===s.base&&i!==s)return!0;return!1};Oe.prototype.sibling=function(){return new Oe(this.parent,this.base)};var vt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ir[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};vt.prototype.reset=function(t,i,s){var r=s.indexOf("v")!==-1,n=s.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=s,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)};vt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};vt.prototype.at=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return-1;var n=s.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=r)return n;var a=s.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};vt.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return r;var n=s.charCodeAt(t),a;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=r||(a=s.charCodeAt(t+1))<56320||a>57343?t+1:t+2};vt.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};vt.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};vt.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};vt.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};vt.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var s=this.pos,r=0,n=t;r<n.length;r+=1){var a=n[r],o=this.at(s,i);if(o===-1||o!==a)return!1;s=this.nextIndex(s,i)}return this.pos=s,!0};v.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,s=!1,r=!1,n=0;n<i.length;n++){var a=i.charAt(n);t.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(s=!0),a==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};function ma(e){for(var t in e)return!0;return!1}v.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&ma(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};v.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var s=i[t];e.groupNames[s]||e.raise("Invalid named capture referenced")}};v.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Oe(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};v.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};v.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};v.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};v.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};v.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};v.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};v.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};v.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};v.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),s=e.eat(45);if(i||s){for(var r=0;r<i.length;r++){var n=i.charAt(r);i.indexOf(n,r+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(s){var a=this.regexp_eatModifiers(e);!i&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var h=a.charAt(o);(a.indexOf(h,o+1)>-1||i.indexOf(h)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};v.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};v.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&ga(i);)t+=Et(i),e.advance();return t};function ga(e){return e===105||e===109||e===115}v.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};v.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};v.regexp_eatSyntaxCharacter=function(e){var t=e.current();return sr(t)?(e.lastIntValue=t,e.advance(),!0):!1};function sr(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}v.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!sr(i);)e.advance();return e.pos!==t};v.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};v.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var s=0,r=i;s<r.length;s+=1){var n=r[s];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};v.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};v.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Et(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Et(e.lastIntValue);return!0}return!1};v.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),xa(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function xa(e){return yt(e,!0)||e===36||e===95}v.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),ya(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function ya(e){return kt(e,!0)||e===36||e===95||e===8204||e===8205}v.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};v.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};v.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};v.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};v.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};v.regexp_eatZero=function(e){return e.current()===48&&!Ve(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};v.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};v.regexp_eatControlLetter=function(e){var t=e.current();return rr(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function rr(e){return e>=65&&e<=90||e>=97&&e<=122}v.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(r-55296)*1024+(a-56320)+65536,!0}e.pos=n,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&ba(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function ba(e){return e>=0&&e<=1114111}v.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};v.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var nr=0,_t=1,nt=2;v.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(va(t))return e.lastIntValue=-1,e.advance(),_t;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&s===nt&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return nr};function va(e){return e===100||e===68||e===115||e===83||e===119||e===87}v.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),_t}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return nr};v.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){zt(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};v.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return _t;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return nt;e.raise("Invalid property name")};v.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";ar(t=e.current());)e.lastStringValue+=Et(t),e.advance();return e.lastStringValue!==""};function ar(e){return rr(e)||e===95}v.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";wa(t=e.current());)e.lastStringValue+=Et(t),e.advance();return e.lastStringValue!==""};function wa(e){return ar(e)||Ve(e)}v.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};v.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===nt&&e.raise("Negated character class may contain strings"),!0}return!1};v.regexp_classContents=function(e){return e.current()===93?_t:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),_t)};v.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};v.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||ur(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return s!==93?(e.lastIntValue=s,e.advance(),!0):!1};v.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};v.regexp_classSetExpression=function(e){var t=_t,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===nt&&(t=nt);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==nt&&(t=_t);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===nt&&(t=nt)}};v.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return i!==-1&&s!==-1&&i>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};v.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?_t:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};v.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===nt&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null};v.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};v.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===nt&&(t=nt);return t};v.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?_t:nt};v.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&Sa(i)||Ea(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function Sa(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Ea(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}v.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return _a(t)?(e.lastIntValue=t,e.advance(),!0):!1};function _a(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}v.regexp_eatClassControlLetter=function(e){var t=e.current();return Ve(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};v.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};v.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ve(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Ve(e){return e>=48&&e<=57}v.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;or(i=e.current());)e.lastIntValue=16*e.lastIntValue+hr(i),e.advance();return e.pos!==t};function or(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function hr(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}v.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};v.regexp_eatOctalDigit=function(e){var t=e.current();return ur(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function ur(e){return e>=48&&e<=55}v.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var r=e.current();if(!or(r))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+hr(r),e.advance()}return!0};var ki=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Le(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},R=B.prototype;R.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ki(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};R.getToken=function(){return this.next(),new ki(this)};typeof Symbol<"u"&&(R[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===u.eof,value:t}}}});R.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(u.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};R.readToken=function(e){return yt(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};R.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};R.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,r=t;(s=Os(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};R.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Gt(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};R.skipSpace=function(){t:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(e>8&&e<14||e>=5760&&Ls.test(String.fromCharCode(e)))++this.pos;else break t}}};R.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};R.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(u.ellipsis)):(++this.pos,this.finishToken(u.dot))};R.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(u.assign,2):this.finishOp(u.slash,1)};R.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?u.star:u.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=u.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(u.assign,i+1):this.finishOp(s,i)};R.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(u.assign,3)}return this.finishOp(e===124?u.logicalOR:u.logicalAND,2)}return t===61?this.finishOp(u.assign,2):this.finishOp(e===124?u.bitwiseOR:u.bitwiseAND,1)};R.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(u.assign,2):this.finishOp(u.bitwiseXOR,1)};R.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||Z.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(u.incDec,2):t===61?this.finishOp(u.assign,2):this.finishOp(u.plusMin,1)};R.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(u.assign,i+1):this.finishOp(u.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(u.relational,i))};R.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(u.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(u.arrow)):this.finishOp(e===61?u.eq:u.prefix,1)};R.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(u.questionDot,2)}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(u.assign,3)}return this.finishOp(u.coalesce,2)}}return this.finishOp(u.question,1)};R.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),yt(t,!0)||t===92))return this.finishToken(u.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Et(t)+"'")};R.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(u.parenL);case 41:return++this.pos,this.finishToken(u.parenR);case 59:return++this.pos,this.finishToken(u.semi);case 44:return++this.pos,this.finishToken(u.comma);case 91:return++this.pos,this.finishToken(u.bracketL);case 93:return++this.pos,this.finishToken(u.bracketR);case 123:return++this.pos,this.finishToken(u.braceL);case 125:return++this.pos,this.finishToken(u.braceR);case 58:return++this.pos,this.finishToken(u.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(u.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(u.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Et(e)+"'")};R.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};R.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(Z.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new vt(this));o.reset(i,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(r,a)}catch{}return this.finishToken(u.regexp,{pattern:r,flags:a,value:h})};R.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0,h=0,c=t??1/0;h<c;++h,++this.pos){var l=this.input.charCodeAt(this.pos),f=void 0;if(s&&l===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),h===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=l;continue}if(l>=97?f=l-97+10:l>=65?f=l-65+10:l>=48&&l<=57?f=l-48:f=1/0,f>=e)break;o=l,a=a*e+f}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function Ca(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function cr(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}R.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=cr(this.input.slice(t,this.pos)),++this.pos):yt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,i)};R.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var r=cr(this.input.slice(t,this.pos));return++this.pos,yt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,r)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),yt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=Ca(this.input.slice(t,this.pos),i);return this.finishToken(u.num,n)};R.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};R.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Gt(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(u.string,t)};var lr={};R.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===lr)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};R.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw lr;this.raise(e,t)};R.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===u.template||this.type===u.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(u.dollarBraceL)):(++this.pos,this.finishToken(u.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(u.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Gt(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
8
+ `),cooked:this.value},this.next(),i.tail=this.type===u.backQuote,this.finishNode(i,"TemplateElement")};C.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.tail;)this.type===u.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(u.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(u.braceR),i.quasis.push(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};C.isAsyncProp=function(e){return!e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===u.name||this.type===u.num||this.type===u.string||this.type===u.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===u.star)&&!J.test(this.input.slice(this.lastTokEnd,this.start))};C.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(u.braceR);){if(s)s=!1;else if(this.expect(u.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(u.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,r,t),i.properties.push(n)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};C.parseProperty=function(e,t){var i=this.startNode(),s,r,n,a;if(this.options.ecmaVersion>=9&&this.eat(u.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===u.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===u.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(n=this.start,a=this.startLoc),e||(s=this.eat(u.star)));var o=this.containsEsc;return this.parsePropertyName(i),!e&&!o&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(u.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,n,a,t,o),this.finishNode(i,"Property")};C.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(!1),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var s=e.value.start;e.kind==="get"?this.raiseRecoverable(s,"getter should have no params"):this.raiseRecoverable(s,"setter should have exactly one param")}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params")};C.parsePropertyValue=function(e,t,i,s,r,n,a,o){(i||s)&&this.type===u.colon&&this.unexpected(),this.eat(u.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===u.parenL?(t&&this.unexpected(),e.method=!0,e.value=this.parseMethod(i,s),e.kind="init"):!t&&!o&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==u.comma&&this.type!==u.braceR&&this.type!==u.eq?((i||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),t?e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key)):this.type===u.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=!0):this.unexpected()};C.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(u.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(u.bracketR),e.key;e.computed=!1}return e.key=this.type===u.num||this.type===u.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};C.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};C.parseMethod=function(e,t,i){var s=this.startNode(),r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ai(t,s.generator)|De|(i?Bs:0)),this.expect(u.parenL),s.params=this.parseBindingList(u.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(s,"FunctionExpression")};C.parseArrowExpression=function(e,t,i,s){var r=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(Ai(i,!1)|Ci),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};C.parseFunctionBody=function(e,t,i,s){var r=t&&this.type!==u.braceL,n=this.strict,a=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);else{var o=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||o)&&(a=this.strictDirective(this.end),a&&o&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var h=this.labels;this.labels=[],a&&(this.strict=!0),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,js),e.body=this.parseBlock(!1,void 0,a&&!n),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=h}this.exitScope()};C.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var s=i[t];if(s.type!=="Identifier")return!1}return!0};C.checkParams=function(e,t){for(var i=Object.create(null),s=0,r=e.params;s<r.length;s+=1){var n=r[s];this.checkLValInnerPattern(n,Ii,t?null:i)}};C.parseExprList=function(e,t,i,s){for(var r=[],n=!0;!this.eat(e);){if(n)n=!1;else if(this.expect(u.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===u.comma?a=null:this.type===u.ellipsis?(a=this.parseSpread(s),s&&this.type===u.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):a=this.parseMaybeAssign(!1,s),r.push(a)}return r};C.checkUnreserved=function(e){var t=e.start,i=e.end,s=e.name;if(this.inGenerator&&s==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Fe)&&s==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(s==="arguments"||s==="await")&&this.raise(t,"Cannot use "+s+" in class static initialization block"),this.keywords.test(s)&&this.raise(t,"Unexpected keyword '"+s+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var r=this.strict?this.reservedWordsStrict:this.reservedWords;r.test(s)&&(!this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+s+"' is reserved"))}};C.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};C.parseIdentNode=function(){var e=this.startNode();return this.type===u.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=u.name):this.unexpected(),e};C.parsePrivateIdent=function(){var e=this.startNode();return this.type===u.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};C.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===u.semi||this.canInsertSemicolon()||this.type!==u.star&&!this.type.startsExpr?(t.delegate=!1,t.argument=null):(t.delegate=this.eat(u.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};C.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var Ne=V.prototype;Ne.raise=function(e,t){var i=Ds(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var s=new SyntaxError(t);throw s.pos=e,s.loc=i,s.raisedAt=this.pos,s};Ne.raiseRecoverable=Ne.raise;Ne.curPosition=function(){if(this.options.locations)return new ae(this.curLine,this.pos-this.lineStart)};var Pt=V.prototype,na=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[]};Pt.enterScope=function(e){this.scopeStack.push(new na(e))};Pt.exitScope=function(){this.scopeStack.pop()};Pt.treatFunctionsAsVarInScope=function(e){return e.flags&Ht||!this.inModule&&e.flags&oe};Pt.declareName=function(e,t,i){var s=!1;if(t===Ct){var r=this.currentScope();s=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&oe&&delete this.undefinedExports[e]}else if(t===Us){var n=this.currentScope();n.lexical.push(e)}else if(t===Vs){var a=this.currentScope();this.treatFunctionsAsVar?s=a.lexical.indexOf(e)>-1:s=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e)}else for(var o=this.scopeStack.length-1;o>=0;--o){var h=this.scopeStack[o];if(h.lexical.indexOf(e)>-1&&!(h.flags&Ms&&h.lexical[0]===e)||!this.treatFunctionsAsVarInScope(h)&&h.functions.indexOf(e)>-1){s=!0;break}if(h.var.push(e),this.inModule&&h.flags&oe&&delete this.undefinedExports[e],h.flags&Fe)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};Pt.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};Pt.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};Pt.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Fe|he|Bt))return t}};Pt.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Fe|he|Bt)&&!(t.flags&Ci))return t}};var Be=function(t,i,s){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Le(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},ue=V.prototype;ue.startNode=function(){return new Be(this,this.start,this.startLoc)};ue.startNodeAt=function(e,t){return new Be(this,e,t)};function Gs(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}ue.finishNode=function(e,t){return Gs.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ue.finishNodeAt=function(e,t,i,s){return Gs.call(this,e,t,i,s)};ue.copyNode=function(e){var t=new Be(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var aa="Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz",zs="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Hs=zs+" Extended_Pictographic",qs=Hs,Ks=qs+" EBase EComp EMod EPres ExtPict",Qs=Ks,oa=Qs,ha={9:zs,10:Hs,11:qs,12:Ks,13:Qs,14:oa},ua="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",ca={9:"",10:"",11:"",12:"",13:"",14:ua},Rs="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ys="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Xs=Ys+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Zs=Xs+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Js=Zs+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",tr=Js+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",la=tr+" "+aa,fa={9:Ys,10:Xs,11:Zs,12:Js,13:tr,14:la},er={};function pa(e){var t=er[e]={binary:Tt(ha[e]+" "+Rs),binaryOfStrings:Tt(ca[e]),nonBinary:{General_Category:Tt(Rs),Script:Tt(fa[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions}for(Te=0,yi=[9,10,11,12,13,14];Te<yi.length;Te+=1)Ts=yi[Te],pa(Ts);var Ts,Te,yi,v=V.prototype,Oe=function(t,i){this.parent=t,this.base=i||this};Oe.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var s=t;s;s=s.parent)if(i.base===s.base&&i!==s)return!0;return!1};Oe.prototype.sibling=function(){return new Oe(this.parent,this.base)};var vt=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=er[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};vt.prototype.reset=function(t,i,s){var r=s.indexOf("v")!==-1,n=s.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=s,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=n&&this.parser.options.ecmaVersion>=9)};vt.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};vt.prototype.at=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return-1;var n=s.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=r)return n;var a=s.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};vt.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return r;var n=s.charCodeAt(t),a;return!(i||this.switchU)||n<=55295||n>=57344||t+1>=r||(a=s.charCodeAt(t+1))<56320||a>57343?t+1:t+2};vt.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};vt.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};vt.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};vt.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};vt.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var s=this.pos,r=0,n=t;r<n.length;r+=1){var a=n[r],o=this.at(s,i);if(o===-1||o!==a)return!1;s=this.nextIndex(s,i)}return this.pos=s,!0};v.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,s=!1,r=!1,n=0;n<i.length;n++){var a=i.charAt(n);t.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(s=!0),a==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};function da(e){for(var t in e)return!0;return!1}v.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&da(e.groupNames)&&(e.switchN=!0,this.regexp_pattern(e))};v.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var s=i[t];e.groupNames[s]||e.raise("Invalid named capture referenced")}};v.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Oe(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};v.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};v.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};v.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,!0}return e.pos=t,!1};v.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};v.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};v.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};v.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};v.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};v.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),s=e.eat(45);if(i||s){for(var r=0;r<i.length;r++){var n=i.charAt(r);i.indexOf(n,r+1)>-1&&e.raise("Duplicate regular expression modifiers")}if(s){var a=this.regexp_eatModifiers(e);!i&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var o=0;o<a.length;o++){var h=a.charAt(o);(a.indexOf(h,o+1)>-1||i.indexOf(h)>-1)&&e.raise("Duplicate regular expression modifiers")}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}}e.pos=t}return!1};v.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,!0;e.raise("Unterminated group")}return!1};v.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&ma(i);)t+=Et(i),e.advance();return t};function ma(e){return e===105||e===109||e===115}v.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};v.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};v.regexp_eatSyntaxCharacter=function(e){var t=e.current();return ir(t)?(e.lastIntValue=t,e.advance(),!0):!1};function ir(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}v.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!ir(i);)e.advance();return e.pos!==t};v.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),!0):!1};v.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var s=0,r=i;s<r.length;s+=1){var n=r[s];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name")}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=!0}};v.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};v.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Et(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Et(e.lastIntValue);return!0}return!1};v.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),ga(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function ga(e){return yt(e,!0)||e===36||e===95}v.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),xa(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function xa(e){return kt(e,!0)||e===36||e===95||e===8204||e===8205}v.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};v.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};v.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};v.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};v.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};v.regexp_eatZero=function(e){return e.current()===48&&!Ve(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};v.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};v.regexp_eatControlLetter=function(e){var t=e.current();return sr(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function sr(e){return e>=65&&e<=90||e>=97&&e<=122}v.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(r-55296)*1024+(a-56320)+65536,!0}e.pos=n,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&ya(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function ya(e){return e>=0&&e<=1114111}v.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};v.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return!0}return!1};var rr=0,_t=1,nt=2;v.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(ba(t))return e.lastIntValue=-1,e.advance(),_t;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&s===nt&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return rr};function ba(e){return e===100||e===68||e===115||e===83||e===119||e===87}v.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),_t}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return rr};v.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){zt(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};v.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return _t;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return nt;e.raise("Invalid property name")};v.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";nr(t=e.current());)e.lastStringValue+=Et(t),e.advance();return e.lastStringValue!==""};function nr(e){return sr(e)||e===95}v.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";va(t=e.current());)e.lastStringValue+=Et(t),e.advance();return e.lastStringValue!==""};function va(e){return nr(e)||Ve(e)}v.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};v.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===nt&&e.raise("Negated character class may contain strings"),!0}return!1};v.regexp_classContents=function(e){return e.current()===93?_t:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),_t)};v.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class")}}};v.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||hr(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return s!==93?(e.lastIntValue=s,e.advance(),!0):!1};v.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};v.regexp_classSetExpression=function(e){var t=_t,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===nt&&(t=nt);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==nt&&(t=_t);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===nt&&(t=nt)}};v.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var s=e.lastIntValue;return i!==-1&&s!==-1&&i>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};v.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?_t:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};v.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===nt&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null};v.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t}return null};v.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===nt&&(t=nt);return t};v.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?_t:nt};v.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&wa(i)||Sa(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function wa(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Sa(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}v.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Ea(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ea(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}v.regexp_eatClassControlLetter=function(e){var t=e.current();return Ve(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};v.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};v.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ve(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Ve(e){return e>=48&&e<=57}v.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ar(i=e.current());)e.lastIntValue=16*e.lastIntValue+or(i),e.advance();return e.pos!==t};function ar(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function or(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}v.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i}else e.lastIntValue=t;return!0}return!1};v.regexp_eatOctalDigit=function(e){var t=e.current();return hr(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function hr(e){return e>=48&&e<=55}v.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var r=e.current();if(!ar(r))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+or(r),e.advance()}return!0};var Ti=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Le(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},R=V.prototype;R.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new Ti(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};R.getToken=function(){return this.next(),new Ti(this)};typeof Symbol<"u"&&(R[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===u.eof,value:t}}}});R.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(u.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos())};R.readToken=function(e){return yt(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};R.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};R.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var s=void 0,r=t;(s=Ns(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};R.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Gt(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};R.skipSpace=function(){t:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break t}break;default:if(e>8&&e<14||e>=5760&&Os.test(String.fromCharCode(e)))++this.pos;else break t}}};R.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i)};R.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(u.ellipsis)):(++this.pos,this.finishToken(u.dot))};R.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(u.assign,2):this.finishOp(u.slash,1)};R.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?u.star:u.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=u.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(u.assign,i+1):this.finishOp(s,i)};R.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(u.assign,3)}return this.finishOp(e===124?u.logicalOR:u.logicalAND,2)}return t===61?this.finishOp(u.assign,2):this.finishOp(e===124?u.bitwiseOR:u.bitwiseAND,1)};R.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(u.assign,2):this.finishOp(u.bitwiseXOR,1)};R.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||J.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(u.incDec,2):t===61?this.finishOp(u.assign,2):this.finishOp(u.plusMin,1)};R.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(u.assign,i+1):this.finishOp(u.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(u.relational,i))};R.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(u.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(u.arrow)):this.finishOp(e===61?u.eq:u.prefix,1)};R.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(u.questionDot,2)}if(t===63){if(e>=12){var s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(u.assign,3)}return this.finishOp(u.coalesce,2)}}return this.finishOp(u.question,1)};R.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),yt(t,!0)||t===92))return this.finishToken(u.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Et(t)+"'")};R.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(u.parenL);case 41:return++this.pos,this.finishToken(u.parenR);case 59:return++this.pos,this.finishToken(u.semi);case 44:return++this.pos,this.finishToken(u.comma);case 91:return++this.pos,this.finishToken(u.bracketL);case 93:return++this.pos,this.finishToken(u.bracketR);case 123:return++this.pos,this.finishToken(u.braceL);case 125:return++this.pos,this.finishToken(u.braceR);case 58:return++this.pos,this.finishToken(u.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(u.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(u.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+Et(e)+"'")};R.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};R.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(J.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}var r=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var o=this.regexpState||(this.regexpState=new vt(this));o.reset(i,r,a),this.validateRegExpFlags(o),this.validateRegExpPattern(o);var h=null;try{h=new RegExp(r,a)}catch{}return this.finishToken(u.regexp,{pattern:r,flags:a,value:h})};R.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,o=0,h=0,c=t??1/0;h<c;++h,++this.pos){var l=this.input.charCodeAt(this.pos),f=void 0;if(s&&l===95){r&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),o===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),h===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),o=l;continue}if(l>=97?f=l-97+10:l>=65?f=l-65+10:l>=48&&l<=57?f=l-48:f=1/0,f>=e)break;o=l,a=a*e+f}return s&&o===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function _a(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function ur(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}R.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=ur(this.input.slice(t,this.pos)),++this.pos):yt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,i)};R.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var r=ur(this.input.slice(t,this.pos));return++this.pos,yt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(u.num,r)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),yt(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=_a(this.input.slice(t,this.pos),i);return this.finishToken(u.num,n)};R.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds")}else t=this.readHexChar(4);return t};R.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Gt(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(u.string,t)};var cr={};R.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===cr)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};R.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw cr;this.raise(e,t)};R.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===u.template||this.type===u.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(u.dollarBraceL)):(++this.pos,this.finishToken(u.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(u.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(!0),t=this.pos;else if(Gt(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
9
9
  `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}};R.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(u.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
10
10
  `&&++this.pos;case`
11
11
  `:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")};R.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
12
- `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Et(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),(s!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Gt(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};R.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};R.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(kt(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?yt:kt)(a,s)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=Et(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};R.readWord=function(){var e=this.readWord1(),t=u.name;return this.keywords.test(e)&&(t=_i[e]),this.finishToken(t,e)};var Aa="8.15.0";B.acorn={Parser:B,version:Aa,defaultOptions:wi,Position:oe,SourceLocation:Le,getLineInfo:Fs,Node:Be,TokenType:k,tokTypes:u,keywordTypes:_i,TokContext:pt,tokContexts:O,isIdentifierChar:kt,isIdentifierStart:yt,Token:ki,isNewLine:Gt,lineBreak:Z,lineBreakG:Qn,nonASCIIwhitespace:Ls};import{builtinModules as ji,createRequire as sc}from"node:module";import Da,{realpathSync as Fa,statSync as $i,promises as nc}from"node:fs";var Mu=String.fromCharCode;var Ia=/\/$|\/\?|\/#/,Ra=/^\.?\//;function Ta(e="",t){return t?Ia.test(e):e.endsWith("/")}function ka(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(Ta(e,!0))return e||"/";let i=e,s="",r=e.indexOf("#");if(r!==-1&&(i=e.slice(0,r),s=e.slice(r),!i))return s;let[n,...a]=i.split("?");return n+"/"+(a.length>0?`?${a.join("?")}`:"")+s}function Pa(e){return e&&e!=="/"}function Pi(e,...t){let i=e||"";for(let s of t.filter(r=>Pa(r)))if(i){let r=s.replace(Ra,"");i=ka(i)+r}else i=s;return i}var Bu=Symbol.for("ufo:protocolRelative");var Na=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var Ni=function(e){return Na.test(e)};import{fileURLToPath as P,URL as M,pathToFileURL as $e}from"node:url";import Nt from"node:assert";import Vt from"node:process";import Wi,{dirname as fc}from"node:path";import Ma from"node:v8";import{format as Ba,inspect as Mi}from"node:util";var Cr=new Set(ji);function Bi(e){return e.replace(/\\/g,"/")}var Va={}.hasOwnProperty,Ua=/^([A-Z][a-z\d]*)+$/,ja=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),K={};function Oi(e,t="and"){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}var Ar=new Map,$a="__node_internal_",fr;K.ERR_INVALID_ARG_TYPE=ot("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Nt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let s="The ";if(e.endsWith(" argument"))s+=`${e} `;else{let o=e.includes(".")?"property":"argument";s+=`"${e}" ${o} `}s+="must be ";let r=[],n=[],a=[];for(let o of t)Nt(typeof o=="string","All expected entries have to be of type string"),ja.has(o)?r.push(o.toLowerCase()):Ua.exec(o)===null?(Nt(o!=="object",'The value "object" should be written as "Object"'),a.push(o)):n.push(o);if(n.length>0){let o=r.indexOf("object");o!==-1&&(r.slice(o,1),n.push("Object"))}return r.length>0&&(s+=`${r.length>1?"one of type":"of type"} ${Oi(r,"or")}`,(n.length>0||a.length>0)&&(s+=" or ")),n.length>0&&(s+=`an instance of ${Oi(n,"or")}`,a.length>0&&(s+=" or ")),a.length>0&&(a.length>1?s+=`one of ${Oi(a,"or")}`:(a[0].toLowerCase()!==a[0]&&(s+="an "),s+=`${a[0]}`)),s+=`. Received ${qa(i)}`,s},TypeError);K.ERR_INVALID_MODULE_SPECIFIER=ot("ERR_INVALID_MODULE_SPECIFIER",(e,t,i=void 0)=>`Invalid module "${e}" ${t}${i?` imported from ${i}`:""}`,TypeError);K.ERR_INVALID_PACKAGE_CONFIG=ot("ERR_INVALID_PACKAGE_CONFIG",(e,t,i)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${i?`. ${i}`:""}`,Error);K.ERR_INVALID_PACKAGE_TARGET=ot("ERR_INVALID_PACKAGE_TARGET",(e,t,i,s=!1,r=void 0)=>{let n=typeof i=="string"&&!s&&i.length>0&&!i.startsWith("./");return t==="."?(Nt(s===!1),`Invalid "exports" main target ${JSON.stringify(i)} defined in the package config ${e}package.json${r?` imported from ${r}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${JSON.stringify(i)} defined for '${t}' in the package config ${e}package.json${r?` imported from ${r}`:""}${n?'; targets must start with "./"':""}`},Error);K.ERR_MODULE_NOT_FOUND=ot("ERR_MODULE_NOT_FOUND",(e,t,i=!1)=>`Cannot find ${i?"module":"package"} '${e}' imported from ${t}`,Error);K.ERR_NETWORK_IMPORT_DISALLOWED=ot("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error);K.ERR_PACKAGE_IMPORT_NOT_DEFINED=ot("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,i)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${i}`,TypeError);K.ERR_PACKAGE_PATH_NOT_EXPORTED=ot("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,i=void 0)=>t==="."?`No "exports" main defined in ${e}package.json${i?` imported from ${i}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${i?` imported from ${i}`:""}`,Error);K.ERR_UNSUPPORTED_DIR_IMPORT=ot("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error);K.ERR_UNSUPPORTED_RESOLVE_REQUEST=ot("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError);K.ERR_UNKNOWN_FILE_EXTENSION=ot("ERR_UNKNOWN_FILE_EXTENSION",(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError);K.ERR_INVALID_ARG_VALUE=ot("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let s=Mi(t);return s.length>128&&(s=`${s.slice(0,128)}...`),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${s}`},TypeError);function ot(e,t,i){return Ar.set(e,t),Wa(i,e)}function Wa(e,t){return i;function i(...s){let r=Error.stackTraceLimit;Vi()&&(Error.stackTraceLimit=0);let n=new e;Vi()&&(Error.stackTraceLimit=r);let a=Ha(t,s,n);return Object.defineProperties(n,{message:{value:a,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),za(n),n.code=t,n}}function Vi(){try{if(Ma.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return e===void 0?Object.isExtensible(Error):Va.call(e,"writable")&&e.writable!==void 0?e.writable:e.set!==void 0}function Ga(e){let t=$a+e.name;return Object.defineProperty(e,"name",{value:t}),e}var za=Ga(function(e){let t=Vi();return t&&(fr=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=fr),e});function Ha(e,t,i){let s=Ar.get(e);if(Nt(s!==void 0,"expected `message` to be found"),typeof s=="function")return Nt(s.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${s.length}).`),Reflect.apply(s,i,t);let r=/%[dfijoOs]/g,n=0;for(;r.exec(s)!==null;)n++;return Nt(n===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${n}).`),t.length===0?s:(t.unshift(s),Reflect.apply(Ba,null,t))}function qa(e){if(e==null)return String(e);if(typeof e=="function"&&e.name)return`function ${e.name}`;if(typeof e=="object")return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${Mi(e,{depth:-1})}`;let t=Mi(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}var le={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:Ka}=K,pr=new Map;function Ir(e,{base:t,specifier:i}){let s=pr.get(e);if(s)return s;let r;try{r=Da.readFileSync(Wi.toNamespacedPath(e),"utf8")}catch(a){let o=a;if(o.code!=="ENOENT")throw o}let n={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(r!==void 0){let a;try{a=JSON.parse(r)}catch(o){let h=o,c=new Ka(e,(t?`"${i}" from `:"")+P(t||i),h.message);throw c.cause=h,c}n.exists=!0,le.call(a,"name")&&typeof a.name=="string"&&(n.name=a.name),le.call(a,"main")&&typeof a.main=="string"&&(n.main=a.main),le.call(a,"exports")&&(n.exports=a.exports),le.call(a,"imports")&&(n.imports=a.imports),le.call(a,"type")&&(a.type==="commonjs"||a.type==="module")&&(n.type=a.type)}return pr.set(e,n),n}function Gi(e){let t=new URL("package.json",e);for(;!t.pathname.endsWith("node_modules/package.json");){let r=Ir(P(t),{specifier:e});if(r.exists)return r;let n=t;if(t=new URL("../package.json",t),t.pathname===n.pathname)break}return{pjsonPath:P(t),exists:!1,type:"none"}}function dr(e){return Gi(e).type}var{ERR_UNKNOWN_FILE_EXTENSION:Qa}=K,Ya={}.hasOwnProperty,Xa={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};function Za(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?"module":e==="application/json"?"json":null}var mr={__proto__:null,"data:":Ja,"file:":eo,"http:":gr,"https:":gr,"node:"(){return"builtin"}};function Ja(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return Za(t)}function to(e){let t=e.pathname,i=t.length;for(;i--;){let s=t.codePointAt(i);if(s===47)return"";if(s===46)return t.codePointAt(i-1)===47?"":t.slice(i)}return""}function eo(e,t,i){let s=to(e);if(s===".js"){let a=dr(e);return a!=="none"?a:"commonjs"}if(s===""){let a=dr(e);return a==="none"||a==="commonjs"?"commonjs":"module"}let r=Xa[s];if(r)return r;if(i)return;let n=P(e);throw new Qa(s,n)}function gr(){}function io(e,t){let i=e.protocol;return Ya.call(mr,i)&&mr[i](e,t,!0)||null}var Ue=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:We,ERR_INVALID_PACKAGE_CONFIG:Rr,ERR_INVALID_PACKAGE_TARGET:so,ERR_MODULE_NOT_FOUND:zi,ERR_PACKAGE_IMPORT_NOT_DEFINED:ro,ERR_PACKAGE_PATH_NOT_EXPORTED:no,ERR_UNSUPPORTED_DIR_IMPORT:ao,ERR_UNSUPPORTED_RESOLVE_REQUEST:xr}=K,Tr={}.hasOwnProperty,yr=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,br=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,oo=/^\.|%|\\/,je=/\*/g,ho=/%2f|%5c/i,vr=new Set,uo=/[/\\]{2}/;function wr(e,t,i,s,r,n,a){if(Vt.noDeprecation)return;let o=P(s),h=uo.exec(a?e:t)!==null;Vt.emitWarning(`Use of deprecated ${h?"double slash":"leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t===i?"":`matched to "${i}" `}in the "${r?"imports":"exports"}" field module resolution of the package at ${o}${n?` imported from ${P(n)}`:""}.`,"DeprecationWarning","DEP0166")}function Sr(e,t,i,s){if(Vt.noDeprecation||io(e,{parentURL:i.href})!=="module")return;let n=P(e.href),a=P(new M(".",t)),o=P(i);s?Wi.resolve(a,s)!==n&&Vt.emitWarning(`Package ${a} has a "main" field set to "${s}", excluding the full filename and extension to the resolved file at "${n.slice(a.length)}", imported from ${o}.
12
+ `;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return Et(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var s=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],r=parseInt(s,8);return r>255&&(s=s.slice(0,-1),r=parseInt(s,8)),this.pos+=s.length-1,t=this.input.charCodeAt(this.pos),(s!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-s.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(r)}return Gt(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};R.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};R.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,i=this.pos,s=this.options.ecmaVersion>=6;this.pos<this.input.length;){var r=this.fullCharCodeAtPos();if(kt(r,s))this.pos+=r<=65535?1:2;else if(r===92){this.containsEsc=!0,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?yt:kt)(a,s)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=Et(a),i=this.pos}else break;t=!1}return e+this.input.slice(i,this.pos)};R.readWord=function(){var e=this.readWord1(),t=u.name;return this.keywords.test(e)&&(t=Ei[e]),this.finishToken(t,e)};var Ca="8.15.0";V.acorn={Parser:V,version:Ca,defaultOptions:vi,Position:ae,SourceLocation:Le,getLineInfo:Ds,Node:Be,TokenType:P,tokTypes:u,keywordTypes:Ei,TokContext:pt,tokContexts:O,isIdentifierChar:kt,isIdentifierStart:yt,Token:Ti,isNewLine:Gt,lineBreak:J,lineBreakG:Kn,nonASCIIwhitespace:Os};import{builtinModules as Ui,createRequire as sc}from"node:module";import La,{realpathSync as Da,statSync as ji,promises as nc}from"node:fs";var Mu=String.fromCharCode;var Aa=/\/$|\/\?|\/#/,Ia=/^\.?\//;function Ra(e="",t){return t?Aa.test(e):e.endsWith("/")}function Ta(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(Ra(e,!0))return e||"/";let i=e,s="",r=e.indexOf("#");if(r!==-1&&(i=e.slice(0,r),s=e.slice(r),!i))return s;let[n,...a]=i.split("?");return n+"/"+(a.length>0?`?${a.join("?")}`:"")+s}function ka(e){return e&&e!=="/"}function ki(e,...t){let i=e||"";for(let s of t.filter(r=>ka(r)))if(i){let r=s.replace(Ia,"");i=Ta(i)+r}else i=s;return i}var Bu=Symbol.for("ufo:protocolRelative");var Pa=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;var Pi=function(e){return Pa.test(e)};import{fileURLToPath as N,URL as B,pathToFileURL as $e}from"node:url";import Nt from"node:assert";import Vt from"node:process";import $i,{dirname as fc}from"node:path";import Fa from"node:v8";import{format as Ma,inspect as Fi}from"node:util";var _r=new Set(Ui);function Mi(e){return e.replace(/\\/g,"/")}var Ba={}.hasOwnProperty,Va=/^([A-Z][a-z\d]*)+$/,Ua=new Set(["string","function","number","object","Function","Object","boolean","bigint","symbol"]),Q={};function Ni(e,t="and"){return e.length<3?e.join(` ${t} `):`${e.slice(0,-1).join(", ")}, ${t} ${e[e.length-1]}`}var Cr=new Map,ja="__node_internal_",lr;Q.ERR_INVALID_ARG_TYPE=ot("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Nt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let s="The ";if(e.endsWith(" argument"))s+=`${e} `;else{let o=e.includes(".")?"property":"argument";s+=`"${e}" ${o} `}s+="must be ";let r=[],n=[],a=[];for(let o of t)Nt(typeof o=="string","All expected entries have to be of type string"),Ua.has(o)?r.push(o.toLowerCase()):Va.exec(o)===null?(Nt(o!=="object",'The value "object" should be written as "Object"'),a.push(o)):n.push(o);if(n.length>0){let o=r.indexOf("object");o!==-1&&(r.slice(o,1),n.push("Object"))}return r.length>0&&(s+=`${r.length>1?"one of type":"of type"} ${Ni(r,"or")}`,(n.length>0||a.length>0)&&(s+=" or ")),n.length>0&&(s+=`an instance of ${Ni(n,"or")}`,a.length>0&&(s+=" or ")),a.length>0&&(a.length>1?s+=`one of ${Ni(a,"or")}`:(a[0].toLowerCase()!==a[0]&&(s+="an "),s+=`${a[0]}`)),s+=`. Received ${Ha(i)}`,s},TypeError);Q.ERR_INVALID_MODULE_SPECIFIER=ot("ERR_INVALID_MODULE_SPECIFIER",(e,t,i=void 0)=>`Invalid module "${e}" ${t}${i?` imported from ${i}`:""}`,TypeError);Q.ERR_INVALID_PACKAGE_CONFIG=ot("ERR_INVALID_PACKAGE_CONFIG",(e,t,i)=>`Invalid package config ${e}${t?` while importing ${t}`:""}${i?`. ${i}`:""}`,Error);Q.ERR_INVALID_PACKAGE_TARGET=ot("ERR_INVALID_PACKAGE_TARGET",(e,t,i,s=!1,r=void 0)=>{let n=typeof i=="string"&&!s&&i.length>0&&!i.startsWith("./");return t==="."?(Nt(s===!1),`Invalid "exports" main target ${JSON.stringify(i)} defined in the package config ${e}package.json${r?` imported from ${r}`:""}${n?'; targets must start with "./"':""}`):`Invalid "${s?"imports":"exports"}" target ${JSON.stringify(i)} defined for '${t}' in the package config ${e}package.json${r?` imported from ${r}`:""}${n?'; targets must start with "./"':""}`},Error);Q.ERR_MODULE_NOT_FOUND=ot("ERR_MODULE_NOT_FOUND",(e,t,i=!1)=>`Cannot find ${i?"module":"package"} '${e}' imported from ${t}`,Error);Q.ERR_NETWORK_IMPORT_DISALLOWED=ot("ERR_NETWORK_IMPORT_DISALLOWED","import of '%s' by %s is not supported: %s",Error);Q.ERR_PACKAGE_IMPORT_NOT_DEFINED=ot("ERR_PACKAGE_IMPORT_NOT_DEFINED",(e,t,i)=>`Package import specifier "${e}" is not defined${t?` in package ${t}package.json`:""} imported from ${i}`,TypeError);Q.ERR_PACKAGE_PATH_NOT_EXPORTED=ot("ERR_PACKAGE_PATH_NOT_EXPORTED",(e,t,i=void 0)=>t==="."?`No "exports" main defined in ${e}package.json${i?` imported from ${i}`:""}`:`Package subpath '${t}' is not defined by "exports" in ${e}package.json${i?` imported from ${i}`:""}`,Error);Q.ERR_UNSUPPORTED_DIR_IMPORT=ot("ERR_UNSUPPORTED_DIR_IMPORT","Directory import '%s' is not supported resolving ES modules imported from %s",Error);Q.ERR_UNSUPPORTED_RESOLVE_REQUEST=ot("ERR_UNSUPPORTED_RESOLVE_REQUEST",'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',TypeError);Q.ERR_UNKNOWN_FILE_EXTENSION=ot("ERR_UNKNOWN_FILE_EXTENSION",(e,t)=>`Unknown file extension "${e}" for ${t}`,TypeError);Q.ERR_INVALID_ARG_VALUE=ot("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let s=Fi(t);return s.length>128&&(s=`${s.slice(0,128)}...`),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${s}`},TypeError);function ot(e,t,i){return Cr.set(e,t),$a(i,e)}function $a(e,t){return i;function i(...s){let r=Error.stackTraceLimit;Bi()&&(Error.stackTraceLimit=0);let n=new e;Bi()&&(Error.stackTraceLimit=r);let a=za(t,s,n);return Object.defineProperties(n,{message:{value:a,enumerable:!1,writable:!0,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},enumerable:!1,writable:!0,configurable:!0}}),Ga(n),n.code=t,n}}function Bi(){try{if(Fa.startupSnapshot.isBuildingSnapshot())return!1}catch{}let e=Object.getOwnPropertyDescriptor(Error,"stackTraceLimit");return e===void 0?Object.isExtensible(Error):Ba.call(e,"writable")&&e.writable!==void 0?e.writable:e.set!==void 0}function Wa(e){let t=ja+e.name;return Object.defineProperty(e,"name",{value:t}),e}var Ga=Wa(function(e){let t=Bi();return t&&(lr=Error.stackTraceLimit,Error.stackTraceLimit=Number.POSITIVE_INFINITY),Error.captureStackTrace(e),t&&(Error.stackTraceLimit=lr),e});function za(e,t,i){let s=Cr.get(e);if(Nt(s!==void 0,"expected `message` to be found"),typeof s=="function")return Nt(s.length<=t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${s.length}).`),Reflect.apply(s,i,t);let r=/%[dfijoOs]/g,n=0;for(;r.exec(s)!==null;)n++;return Nt(n===t.length,`Code: ${e}; The provided arguments length (${t.length}) does not match the required ones (${n}).`),t.length===0?s:(t.unshift(s),Reflect.apply(Ma,null,t))}function Ha(e){if(e==null)return String(e);if(typeof e=="function"&&e.name)return`function ${e.name}`;if(typeof e=="object")return e.constructor&&e.constructor.name?`an instance of ${e.constructor.name}`:`${Fi(e,{depth:-1})}`;let t=Fi(e,{colors:!1});return t.length>28&&(t=`${t.slice(0,25)}...`),`type ${typeof e} (${t})`}var ce={}.hasOwnProperty,{ERR_INVALID_PACKAGE_CONFIG:qa}=Q,fr=new Map;function Ar(e,{base:t,specifier:i}){let s=fr.get(e);if(s)return s;let r;try{r=La.readFileSync($i.toNamespacedPath(e),"utf8")}catch(a){let o=a;if(o.code!=="ENOENT")throw o}let n={exists:!1,pjsonPath:e,main:void 0,name:void 0,type:"none",exports:void 0,imports:void 0};if(r!==void 0){let a;try{a=JSON.parse(r)}catch(o){let h=o,c=new qa(e,(t?`"${i}" from `:"")+N(t||i),h.message);throw c.cause=h,c}n.exists=!0,ce.call(a,"name")&&typeof a.name=="string"&&(n.name=a.name),ce.call(a,"main")&&typeof a.main=="string"&&(n.main=a.main),ce.call(a,"exports")&&(n.exports=a.exports),ce.call(a,"imports")&&(n.imports=a.imports),ce.call(a,"type")&&(a.type==="commonjs"||a.type==="module")&&(n.type=a.type)}return fr.set(e,n),n}function Wi(e){let t=new URL("package.json",e);for(;!t.pathname.endsWith("node_modules/package.json");){let r=Ar(N(t),{specifier:e});if(r.exists)return r;let n=t;if(t=new URL("../package.json",t),t.pathname===n.pathname)break}return{pjsonPath:N(t),exists:!1,type:"none"}}function pr(e){return Wi(e).type}var{ERR_UNKNOWN_FILE_EXTENSION:Ka}=Q,Qa={}.hasOwnProperty,Ya={__proto__:null,".cjs":"commonjs",".js":"module",".json":"json",".mjs":"module"};function Xa(e){return e&&/\s*(text|application)\/javascript\s*(;\s*charset=utf-?8\s*)?/i.test(e)?"module":e==="application/json"?"json":null}var dr={__proto__:null,"data:":Za,"file:":to,"http:":mr,"https:":mr,"node:"(){return"builtin"}};function Za(e){let{1:t}=/^([^/]+\/[^;,]+)[^,]*?(;base64)?,/.exec(e.pathname)||[null,null,null];return Xa(t)}function Ja(e){let t=e.pathname,i=t.length;for(;i--;){let s=t.codePointAt(i);if(s===47)return"";if(s===46)return t.codePointAt(i-1)===47?"":t.slice(i)}return""}function to(e,t,i){let s=Ja(e);if(s===".js"){let a=pr(e);return a!=="none"?a:"commonjs"}if(s===""){let a=pr(e);return a==="none"||a==="commonjs"?"commonjs":"module"}let r=Ya[s];if(r)return r;if(i)return;let n=N(e);throw new Ka(s,n)}function mr(){}function eo(e,t){let i=e.protocol;return Qa.call(dr,i)&&dr[i](e,t,!0)||null}var Ue=RegExp.prototype[Symbol.replace],{ERR_INVALID_MODULE_SPECIFIER:We,ERR_INVALID_PACKAGE_CONFIG:Ir,ERR_INVALID_PACKAGE_TARGET:io,ERR_MODULE_NOT_FOUND:Gi,ERR_PACKAGE_IMPORT_NOT_DEFINED:so,ERR_PACKAGE_PATH_NOT_EXPORTED:ro,ERR_UNSUPPORTED_DIR_IMPORT:no,ERR_UNSUPPORTED_RESOLVE_REQUEST:gr}=Q,Rr={}.hasOwnProperty,xr=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))?(\\|\/|$)/i,yr=/(^|\\|\/)((\.|%2e)(\.|%2e)?|(n|%6e|%4e)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(_|%5f)(m|%6d|%4d)(o|%6f|%4f)(d|%64|%44)(u|%75|%55)(l|%6c|%4c)(e|%65|%45)(s|%73|%53))(\\|\/|$)/i,ao=/^\.|%|\\/,je=/\*/g,oo=/%2f|%5c/i,br=new Set,ho=/[/\\]{2}/;function vr(e,t,i,s,r,n,a){if(Vt.noDeprecation)return;let o=N(s),h=ho.exec(a?e:t)!==null;Vt.emitWarning(`Use of deprecated ${h?"double slash":"leading or trailing slash matching"} resolving "${e}" for module request "${t}" ${t===i?"":`matched to "${i}" `}in the "${r?"imports":"exports"}" field module resolution of the package at ${o}${n?` imported from ${N(n)}`:""}.`,"DeprecationWarning","DEP0166")}function wr(e,t,i,s){if(Vt.noDeprecation||eo(e,{parentURL:i.href})!=="module")return;let n=N(e.href),a=N(new B(".",t)),o=N(i);s?$i.resolve(a,s)!==n&&Vt.emitWarning(`Package ${a} has a "main" field set to "${s}", excluding the full filename and extension to the resolved file at "${n.slice(a.length)}", imported from ${o}.
13
13
  Automatic extension resolution of the "main" field is deprecated for ES modules.`,"DeprecationWarning","DEP0151"):Vt.emitWarning(`No "main" or "exports" field defined in the package.json for ${a} resolving the main entry point "${n.slice(a.length)}", imported from ${o}.
14
- Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function kr(e){try{return $i(e)}catch{}}function Li(e){let t=$i(e,{throwIfNoEntry:!1}),i=t?t.isFile():void 0;return i??!1}function co(e,t,i){let s;if(t.main!==void 0){if(s=new M(t.main,e),Li(s))return s;let a=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],o=-1;for(;++o<a.length&&(s=new M(a[o],e),!Li(s));)s=void 0;if(s)return Sr(s,e,i,t.main),s}let r=["./index.js","./index.json","./index.node"],n=-1;for(;++n<r.length&&(s=new M(r[n],e),!Li(s));)s=void 0;if(s)return Sr(s,e,i,t.main),s;throw new zi(P(new M(".",e)),P(i))}function lo(e,t,i){if(ho.exec(e.pathname)!==null)throw new We(e.pathname,'must not include encoded "/" or "\\" characters',P(t));let s;try{s=P(e)}catch(n){let a=n;throw Object.defineProperty(a,"input",{value:String(e)}),Object.defineProperty(a,"module",{value:String(t)}),a}let r=kr(s.endsWith("/")?s.slice(-1):s);if(r&&r.isDirectory()){let n=new ao(s,P(t));throw n.url=String(e),n}if(!r||!r.isFile()){let n=new zi(s||e.pathname,t&&P(t),!0);throw n.url=String(e),n}{let n=Fa(s),{search:a,hash:o}=e;e=$e(n+(s.endsWith(Wi.sep)?"/":"")),e.search=a,e.hash=o}return e}function fo(e,t,i){return new ro(e,t&&P(new M(".",t)),P(i))}function Di(e,t,i){return new no(P(new M(".",t)),e,i&&P(i))}function po(e,t,i,s,r){let n=`request is not a valid match in pattern "${t}" for the "${s?"imports":"exports"}" resolution of ${P(i)}`;throw new We(e,n,r&&P(r))}function fe(e,t,i,s,r){return t=typeof t=="object"&&t!==null?JSON.stringify(t,null,""):`${t}`,new so(P(new M(".",i)),e,t,s,r&&P(r))}function mo(e,t,i,s,r,n,a,o,h){if(t!==""&&!n&&e[e.length-1]!=="/")throw fe(i,e,s,a,r);if(!e.startsWith("./")){if(a&&!e.startsWith("../")&&!e.startsWith("/")){let p=!1;try{new M(e),p=!0}catch{}if(!p){let d=n?Ue.call(je,e,()=>t):e+t;return Nr(d,s,h)}}throw fe(i,e,s,a,r)}if(yr.exec(e.slice(2))!==null)if(br.exec(e.slice(2))===null){if(!o){let p=n?i.replace("*",()=>t):i+t,d=n?Ue.call(je,e,()=>t):e;wr(d,p,i,s,a,r,!0)}}else throw fe(i,e,s,a,r);let c=new M(e,s),l=c.pathname,f=new M(".",s).pathname;if(!l.startsWith(f))throw fe(i,e,s,a,r);if(t==="")return c;if(yr.exec(t)!==null){let p=n?i.replace("*",()=>t):i+t;if(br.exec(t)===null){if(!o){let d=n?Ue.call(je,e,()=>t):e;wr(d,p,i,s,a,r,!1)}}else po(p,i,s,a,r)}return n?new M(Ue.call(je,c.href,()=>t)):new M(t,c)}function go(e){let t=Number(e);return`${t}`!==e?!1:t>=0&&t<4294967295}function Kt(e,t,i,s,r,n,a,o,h){if(typeof t=="string")return mo(t,i,s,e,r,n,a,o,h);if(Array.isArray(t)){let c=t;if(c.length===0)return null;let l,f=-1;for(;++f<c.length;){let p=c[f],d;try{d=Kt(e,p,i,s,r,n,a,o,h)}catch(y){let m=y;if(l=m,m.code==="ERR_INVALID_PACKAGE_TARGET")continue;throw y}if(d!==void 0){if(d===null){l=null;continue}return d}}if(l==null)return null;throw l}if(typeof t=="object"&&t!==null){let c=Object.getOwnPropertyNames(t),l=-1;for(;++l<c.length;){let f=c[l];if(go(f))throw new Rr(P(e),r,'"exports" cannot contain numeric property keys.')}for(l=-1;++l<c.length;){let f=c[l];if(f==="default"||h&&h.has(f)){let p=t[f],d=Kt(e,p,i,s,r,n,a,o,h);if(d===void 0)continue;return d}}return null}if(t===null)return null;throw fe(s,t,e,a,r)}function xo(e,t,i){if(typeof e=="string"||Array.isArray(e))return!0;if(typeof e!="object"||e===null)return!1;let s=Object.getOwnPropertyNames(e),r=!1,n=0,a=-1;for(;++a<s.length;){let o=s[a],h=o===""||o[0]!==".";if(n++===0)r=h;else if(r!==h)throw new Rr(P(t),i,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return r}function yo(e,t,i){if(Vt.noDeprecation)return;let s=P(t);vr.has(s+"|"+e)||(vr.add(s+"|"+e),Vt.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${s}${i?` imported from ${P(i)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function Er(e,t,i,s,r){let n=i.exports;if(xo(n,e,s)&&(n={".":n}),Tr.call(n,t)&&!t.includes("*")&&!t.endsWith("/")){let l=n[t],f=Kt(e,l,"",t,s,!1,!1,!1,r);if(f==null)throw Di(t,e,s);return f}let a="",o="",h=Object.getOwnPropertyNames(n),c=-1;for(;++c<h.length;){let l=h[c],f=l.indexOf("*");if(f!==-1&&t.startsWith(l.slice(0,f))){t.endsWith("/")&&yo(t,e,s);let p=l.slice(f+1);t.length>=l.length&&t.endsWith(p)&&Pr(a,l)===1&&l.lastIndexOf("*")===f&&(a=l,o=t.slice(f,t.length-p.length))}}if(a){let l=n[a],f=Kt(e,l,o,a,s,!0,!1,t.endsWith("/"),r);if(f==null)throw Di(t,e,s);return f}throw Di(t,e,s)}function Pr(e,t){let i=e.indexOf("*"),s=t.indexOf("*"),r=i===-1?e.length:i+1,n=s===-1?t.length:s+1;return r>n?-1:n>r||i===-1?1:s===-1||e.length>t.length?-1:t.length>e.length?1:0}function bo(e,t,i){if(e==="#"||e.startsWith("#/")||e.endsWith("/")){let n="is not a valid internal imports specifier name";throw new We(e,n,P(t))}let s,r=Gi(t);if(r.exists){s=$e(r.pjsonPath);let n=r.imports;if(n)if(Tr.call(n,e)&&!e.includes("*")){let a=Kt(s,n[e],"",e,t,!1,!0,!1,i);if(a!=null)return a}else{let a="",o="",h=Object.getOwnPropertyNames(n),c=-1;for(;++c<h.length;){let l=h[c],f=l.indexOf("*");if(f!==-1&&e.startsWith(l.slice(0,-1))){let p=l.slice(f+1);e.length>=l.length&&e.endsWith(p)&&Pr(a,l)===1&&l.lastIndexOf("*")===f&&(a=l,o=e.slice(f,e.length-p.length))}}if(a){let l=n[a],f=Kt(s,l,o,a,t,!0,!0,!1,i);if(f!=null)return f}}}throw fo(e,s,t)}function vo(e,t){let i=e.indexOf("/"),s=!0,r=!1;e[0]==="@"&&(r=!0,i===-1||e.length===0?s=!1:i=e.indexOf("/",i+1));let n=i===-1?e:e.slice(0,i);if(oo.exec(n)!==null&&(s=!1),!s)throw new We(e,"is not a valid package name",P(t));let a="."+(i===-1?"":e.slice(i));return{packageName:n,packageSubpath:a,isScoped:r}}function Nr(e,t,i){if(ji.includes(e))return new M("node:"+e);let{packageName:s,packageSubpath:r,isScoped:n}=vo(e,t),a=Gi(t);if(a.exists){let l=$e(a.pjsonPath);if(a.name===s&&a.exports!==void 0&&a.exports!==null)return Er(l,r,a,t,i)}let o=new M("./node_modules/"+s+"/package.json",t),h=P(o),c;do{let l=kr(h.slice(0,-13));if(!l||!l.isDirectory()){c=h,o=new M((n?"../../../../node_modules/":"../../../node_modules/")+s+"/package.json",o),h=P(o);continue}let f=Ir(h,{base:t,specifier:e});return f.exports!==void 0&&f.exports!==null?Er(o,r,f,t,i):r==="."?co(o,f,t):new M(r,o)}while(h.length!==c.length);throw new zi(s,P(t),!1)}function wo(e){return e[0]==="."&&(e.length===1||e[1]==="/"||e[1]==="."&&(e.length===2||e[2]==="/"))}function So(e){return e===""?!1:e[0]==="/"?!0:wo(e)}function Eo(e,t,i,s){let r=t.protocol,a=r==="data:"||r==="http:"||r==="https:",o;if(So(e))try{o=new M(e,t)}catch(h){let c=new xr(e,t);throw c.cause=h,c}else if(r==="file:"&&e[0]==="#")o=bo(e,t,i);else try{o=new M(e)}catch(h){if(a&&!ji.includes(e)){let c=new xr(e,t);throw c.cause=h,c}o=Nr(e,t,i)}return Nt(o!==void 0,"expected to be defined"),o.protocol!=="file:"?o:lo(o,t)}function Ui(e){return typeof e=="string"&&!e.startsWith("file://")?Bi(e):Bi(P(e))}function Fi(e){return $e(Ui(e)).toString()}function _o(e){return typeof e!="string"&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:Cr.has(e)?"node:"+e:"file://"+encodeURI(Bi(e))}var Co=new Set(["node","import"]),Ao=[".mjs",".cjs",".js",".json"],Io=new Set(["ERR_MODULE_NOT_FOUND","ERR_UNSUPPORTED_DIR_IMPORT","MODULE_NOT_FOUND","ERR_PACKAGE_PATH_NOT_EXPORTED"]);function _r(e,t,i){try{return Eo(e,t,i)}catch(s){if(!Io.has(s==null?void 0:s.code))throw s}}function Ro(e,t={}){if(typeof e!="string")if(e instanceof URL)e=Ui(e);else throw new TypeError("input must be a `string` or `URL`");if(/(?:node|data|http|https):/.test(e))return e;if(Cr.has(e))return"node:"+e;if(e.startsWith("file://")&&(e=Ui(e)),Ni(e))try{if($i(e).isFile())return Fi(e)}catch(a){if((a==null?void 0:a.code)!=="ENOENT")throw a}let i=t.conditions?new Set(t.conditions):Co,s=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(a=>new URL(_o(a.toString())));s.length===0&&s.push(new URL(Fi(process.cwd())));let r=[...s];for(let a of s)a.protocol==="file:"&&r.push(new URL("./",a),new URL(Pi(a.pathname,"_index.js"),a),new URL("node_modules",a));let n;for(let a of r){if(n=_r(e,a,i),n)break;for(let o of["","/index"]){for(let h of t.extensions||Ao)if(n=_r(Pi(e,o)+h,a,i),n)break;if(n)break}if(n)break}if(!n){let a=new Error(`Cannot find module ${e} imported from ${r.join(", ")}`);throw a.code="ERR_MODULE_NOT_FOUND",a}return Fi(n)}function To(e,t){return Ro(e,t)}function Or(e,t){try{return Promise.resolve(To(e,t))}catch(i){return Promise.reject(i)}}var Po=Object.freeze({scripts:{},config:{defaultHelpBehavior:"help",caseInsensitive:!1,idempotency:{location:"./node_modules/.cache/bsm/idempotency",useFileContent:!1}}}),tt=class{static getSource(t){return Array.isArray(t)?t[0]:t}static async loadExtensions(t){return!Object.hasOwn(t,"extends")||!t.extends?[]:(await Promise.all([...t.extends].map(i=>this.loadFile(i,!1)))).filter(i=>i!==void 0)}static interopDefault(t){return typeof t!="object"||t===null?t:"default"in t?t.default:t}static async loadFile(t,i=!0){if(!t)return;let s=this.getSource(t);try{s=await Or(s)}catch{if(i)return;I.error(`\x1B[31mCannot find config '${s}' to extend\x1B[0m`),process.exit(1)}try{let r=this.interopDefault(await import(s));typeof r=="function"&&(r=await r(...Array.isArray(t)?t.slice(1):[]));let n=await this.loadExtensions(r);return Cs(r,...n,Po)}catch(r){I.error(r),Array.isArray(t)&&(t=t[0]),I.error(`\x1B[31mError loading config '${t}'\x1B[0m`),process.exit(1)}}static async load(t){let i=[t.config,process.env.BSM_CONFIG,"./package.scripts.js","./package.scripts.cjs","./package.scripts.mjs","./package.scripts.json"].filter(s=>s!==void 0);for(let s of i){let r=await this.loadFile(s);if(r)return process.env.BSM_CONFIG=s,this._config=r,r}I.error(`\x1B[31mCannot find config ${i.map(s=>`'${s}'`).join(" or ")}\x1B[0m`),process.exit(1)}static _config;static get config(){if(this._config)return this._config;throw new Error("Config not loaded")}};import{createHash as mu}from"node:crypto";import $t from"fs";import An from"path";var Hi=(e,t,i)=>{let s=e instanceof RegExp?Lr(e,i):e,r=t instanceof RegExp?Lr(t,i):t,n=s!==null&&r!=null&&No(s,r,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+r.length)}},Lr=(e,t)=>{let i=t.match(e);return i?i[0]:null},No=(e,t,i)=>{let s,r,n,a,o,h=i.indexOf(e),c=i.indexOf(t,h+1),l=h;if(h>=0&&c>0){if(e===t)return[h,c];for(s=[],n=i.length;l>=0&&!o;){if(l===h)s.push(l),h=i.indexOf(e,l+1);else if(s.length===1){let f=s.pop();f!==void 0&&(o=[f,c])}else r=s.pop(),r!==void 0&&r<n&&(n=r,a=c),c=i.indexOf(t,l+1);l=h<c&&h>=0?h:c}s.length&&a!==void 0&&(o=[n,a])}return o};var Dr="\0SLASH"+Math.random()+"\0",Fr="\0OPEN"+Math.random()+"\0",Ki="\0CLOSE"+Math.random()+"\0",Mr="\0COMMA"+Math.random()+"\0",Br="\0PERIOD"+Math.random()+"\0",Oo=new RegExp(Dr,"g"),Lo=new RegExp(Fr,"g"),Do=new RegExp(Ki,"g"),Fo=new RegExp(Mr,"g"),Mo=new RegExp(Br,"g"),Bo=/\\\\/g,Vo=/\\{/g,Uo=/\\}/g,jo=/\\,/g,$o=/\\./g;function qi(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function Wo(e){return e.replace(Bo,Dr).replace(Vo,Fr).replace(Uo,Ki).replace(jo,Mr).replace($o,Br)}function Go(e){return e.replace(Oo,"\\").replace(Lo,"{").replace(Do,"}").replace(Fo,",").replace(Mo,".")}function Vr(e){if(!e)return[""];let t=[],i=Hi("{","}",e);if(!i)return e.split(",");let{pre:s,body:r,post:n}=i,a=s.split(",");a[a.length-1]+="{"+r+"}";let o=Vr(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}function Ur(e){return e?(e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),pe(Wo(e),!0).map(Go)):[]}function zo(e){return"{"+e+"}"}function Ho(e){return/^-?0\d/.test(e)}function qo(e,t){return e<=t}function Ko(e,t){return e>=t}function pe(e,t){let i=[],s=Hi("{","}",e);if(!s)return[e];let r=s.pre,n=s.post.length?pe(s.post,!1):[""];if(/\$$/.test(s.pre))for(let a=0;a<n.length;a++){let o=r+"{"+s.body+"}"+n[a];i.push(o)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),h=a||o,c=s.body.indexOf(",")>=0;if(!h&&!c)return s.post.match(/,(?!,).*\}/)?(e=s.pre+"{"+s.body+Ki+s.post,pe(e)):[e];let l;if(h)l=s.body.split(/\.\./);else if(l=Vr(s.body),l.length===1&&l[0]!==void 0&&(l=pe(l[0],!1).map(zo),l.length===1))return n.map(p=>s.pre+l[0]+p);let f;if(h&&l[0]!==void 0&&l[1]!==void 0){let p=qi(l[0]),d=qi(l[1]),y=Math.max(l[0].length,l[1].length),m=l.length===3&&l[2]!==void 0?Math.abs(qi(l[2])):1,b=qo;d<p&&(m*=-1,b=Ko);let E=l.some(Ho);f=[];for(let S=p;b(S,d);S+=m){let x;if(o)x=String.fromCharCode(S),x==="\\"&&(x="");else if(x=String(S),E){let _=y-x.length;if(_>0){let L=new Array(_+1).join("0");S<0?x="-"+L+x.slice(1):x=L+x}}f.push(x)}}else{f=[];for(let p=0;p<l.length;p++)f.push.apply(f,pe(l[p],!1))}for(let p=0;p<f.length;p++)for(let d=0;d<n.length;d++){let y=r+f[p]+n[d];(!t||h||y)&&i.push(y)}}return i}var de=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var Qo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},me=e=>e.replace(/[[\]\\-]/g,"\\$&"),Yo=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),jr=e=>e.join(""),$r=(e,t)=>{let i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=i+1,a=!1,o=!1,h=!1,c=!1,l=i,f="";t:for(;n<e.length;){let m=e.charAt(n);if((m==="!"||m==="^")&&n===i+1){c=!0,n++;continue}if(m==="]"&&a&&!h){l=n+1;break}if(a=!0,m==="\\"&&!h){h=!0,n++;continue}if(m==="["&&!h){for(let[b,[g,E,S]]of Object.entries(Qo))if(e.startsWith(b,n)){if(f)return["$.",!1,e.length-i,!0];n+=b.length,S?r.push(g):s.push(g),o=o||E;continue t}}if(h=!1,f){m>f?s.push(me(f)+"-"+me(m)):m===f&&s.push(me(m)),f="",n++;continue}if(e.startsWith("-]",n+1)){s.push(me(m+"-")),n+=2;continue}if(e.startsWith("-",n+1)){f=m,n+=2;continue}s.push(me(m)),n++}if(l<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,e.length-i,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let m=s[0].length===2?s[0].slice(-1):s[0];return[Yo(m),!1,l-i,!1]}let p="["+(c?"^":"")+jr(s)+"]",d="["+(c?"":"^")+jr(r)+"]";return[s.length&&r.length?"("+p+"|"+d+")":s.length?p:d,o,l-i,!0]};var dt=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Xo=new Set(["!","?","+","*","@"]),Wr=e=>Xo.has(e),Zo="(?!(?:^|/)\\.\\.?(?:$|/))",Ge="(?!\\.)",Jo=new Set(["[","."]),th=new Set(["..","."]),eh=new Set("().*{}+?[]^$\\!"),ih=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Qi="[^/]",Gr=Qi+"*?",zr=Qi+"+?",Qt=class e{type;#t;#e;#n=!1;#s=[];#a;#v;#u;#l=!1;#o;#h;#r=!1;constructor(t,i,s={}){this.type=t,t&&(this.#e=!0),this.#a=i,this.#t=this.#a?this.#a.#t:this,this.#o=this.#t===this?s:this.#t.#o,this.#u=this.#t===this?[]:this.#t.#u,t==="!"&&!this.#t.#l&&this.#u.push(this),this.#v=this.#a?this.#a.#s.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#s)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#h!==void 0?this.#h:this.type?this.#h=this.type+"("+this.#s.map(t=>String(t)).join("|")+")":this.#h=this.#s.map(t=>String(t)).join("")}#g(){if(this!==this.#t)throw new Error("should only call on root");if(this.#l)return this;this.toString(),this.#l=!0;let t;for(;t=this.#u.pop();){if(t.type!=="!")continue;let i=t,s=i.#a;for(;s;){for(let r=i.#v+1;!s.type&&r<s.#s.length;r++)for(let n of t.#s){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#s[r])}i=s,s=i.#a}}return this}push(...t){for(let i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof e&&i.#a===this))throw new Error("invalid part: "+i);this.#s.push(i)}}toJSON(){var i;let t=this.type===null?this.#s.slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...this.#s.map(s=>s.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#l&&((i=this.#a)==null?void 0:i.type)==="!")&&t.push({}),t}isStart(){var i;if(this.#t===this)return!0;if(!((i=this.#a)!=null&&i.isStart()))return!1;if(this.#v===0)return!0;let t=this.#a;for(let s=0;s<this.#v;s++){let r=t.#s[s];if(!(r instanceof e&&r.type==="!"))return!1}return!0}isEnd(){var i,s,r;if(this.#t===this||((i=this.#a)==null?void 0:i.type)==="!")return!0;if(!((s=this.#a)!=null&&s.isEnd()))return!1;if(!this.type)return(r=this.#a)==null?void 0:r.isEnd();let t=this.#a?this.#a.#s.length:0;return this.#v===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let i=new e(this.type,t);for(let s of this.#s)i.copyIn(s);return i}static#x(t,i,s,r){let n=!1,a=!1,o=-1,h=!1;if(i.type===null){let d=s,y="";for(;d<t.length;){let m=t.charAt(d++);if(n||m==="\\"){n=!n,y+=m;continue}if(a){d===o+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(d===o+2&&h)&&(a=!1),y+=m;continue}else if(m==="["){a=!0,o=d,h=!1,y+=m;continue}if(!r.noext&&Wr(m)&&t.charAt(d)==="("){i.push(y),y="";let b=new e(m,i);d=e.#x(t,b,d,r),i.push(b);continue}y+=m}return i.push(y),d}let c=s+1,l=new e(null,i),f=[],p="";for(;c<t.length;){let d=t.charAt(c++);if(n||d==="\\"){n=!n,p+=d;continue}if(a){c===o+1?(d==="^"||d==="!")&&(h=!0):d==="]"&&!(c===o+2&&h)&&(a=!1),p+=d;continue}else if(d==="["){a=!0,o=c,h=!1,p+=d;continue}if(Wr(d)&&t.charAt(c)==="("){l.push(p),p="";let y=new e(d,l);l.push(y),c=e.#x(t,y,c,r);continue}if(d==="|"){l.push(p),p="",f.push(l),l=new e(null,i);continue}if(d===")")return p===""&&i.#s.length===0&&(i.#r=!0),l.push(p),p="",i.push(...f,l),c;p+=d}return i.type=null,i.#e=void 0,i.#s=[t.substring(s-1)],c}static fromGlob(t,i={}){let s=new e(null,void 0,i);return e.#x(t,s,0,i),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[i,s,r,n]=this.toRegExpSource();if(!(r||this.#e||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(this.#o.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:t})}get options(){return this.#o}toRegExpSource(t){var h;let i=t??!!this.#o.dot;if(this.#t===this&&this.#g(),!this.type){let c=this.isStart()&&this.isEnd(),l=this.#s.map(y=>{let[m,b,g,E]=typeof y=="string"?e.#f(y,this.#e,c):y.toRegExpSource(t);return this.#e=this.#e||g,this.#n=this.#n||E,m}).join(""),f="";if(this.isStart()&&typeof this.#s[0]=="string"&&!(this.#s.length===1&&th.has(this.#s[0]))){let m=Jo,b=i&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),g=!i&&!t&&m.has(l.charAt(0));f=b?Zo:g?Ge:""}let p="";return this.isEnd()&&this.#t.#l&&((h=this.#a)==null?void 0:h.type)==="!"&&(p="(?:$|\\/)"),[f+l+p,dt(l),this.#e=!!this.#e,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#p(i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#s=[c],this.type=null,this.#e=void 0,[c,dt(this.toString()),!1,!1]}let a=!s||t||i||!Ge?"":this.#p(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#r)o=(this.isStart()&&!i?Ge:"")+zr;else{let c=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Ge:"")+Gr+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+n+c}return[o,dt(n),this.#e=!!this.#e,this.#n]}#p(t){return this.#s.map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,r,n,a]=i.toRegExpSource(t);return this.#n=this.#n||a,s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#f(t,i,s=!1){let r=!1,n="",a=!1;for(let o=0;o<t.length;o++){let h=t.charAt(o);if(r){r=!1,n+=(eh.has(h)?"\\":"")+h;continue}if(h==="\\"){o===t.length-1?n+="\\\\":r=!0;continue}if(h==="["){let[c,l,f,p]=$r(t,o);if(f){n+=c,a=a||l,o+=f-1,i=i||p;continue}}if(h==="*"){s&&t==="*"?n+=zr:n+=Gr,i=!0;continue}if(h==="?"){n+=Qi,i=!0;continue}n+=ih(h)}return[n,dt(t),!!i,a]}};var Yt=(e,{windowsPathsNoEscape:t=!1}={})=>t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var Q=(e,t,i={})=>(de(t),!i.nocomment&&t.charAt(0)==="#"?!1:new et(t,i).match(e)),sh=/^\*+([^+@!?\*\[\(]*)$/,rh=e=>t=>!t.startsWith(".")&&t.endsWith(e),nh=e=>t=>t.endsWith(e),ah=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),oh=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),hh=/^\*+\.\*+$/,uh=e=>!e.startsWith(".")&&e.includes("."),ch=e=>e!=="."&&e!==".."&&e.includes("."),lh=/^\.\*+$/,fh=e=>e!=="."&&e!==".."&&e.startsWith("."),ph=/^\*+$/,dh=e=>e.length!==0&&!e.startsWith("."),mh=e=>e.length!==0&&e!=="."&&e!=="..",gh=/^\?+([^+@!?\*\[\(]*)?$/,xh=([e,t=""])=>{let i=Kr([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},yh=([e,t=""])=>{let i=Qr([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},bh=([e,t=""])=>{let i=Qr([e]);return t?s=>i(s)&&s.endsWith(t):i},vh=([e,t=""])=>{let i=Kr([e]);return t?s=>i(s)&&s.endsWith(t):i},Kr=([e])=>{let t=e.length;return i=>i.length===t&&!i.startsWith(".")},Qr=([e])=>{let t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Yr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Hr={win32:{sep:"\\"},posix:{sep:"/"}},wh=Yr==="win32"?Hr.win32.sep:Hr.posix.sep;Q.sep=wh;var $=Symbol("globstar **");Q.GLOBSTAR=$;var Sh="[^/]",Eh=Sh+"*?",_h="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Ch="(?:(?!(?:\\/|^)\\.).)*?",Ah=(e,t={})=>i=>Q(i,e,t);Q.filter=Ah;var ht=(e,t={})=>Object.assign({},e,t),Ih=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Q;let t=Q;return Object.assign((s,r,n={})=>t(s,r,ht(e,n)),{Minimatch:class extends t.Minimatch{constructor(r,n={}){super(r,ht(e,n))}static defaults(r){return t.defaults(ht(e,r)).Minimatch}},AST:class extends t.AST{constructor(r,n,a={}){super(r,n,ht(e,a))}static fromGlob(r,n={}){return t.AST.fromGlob(r,ht(e,n))}},unescape:(s,r={})=>t.unescape(s,ht(e,r)),escape:(s,r={})=>t.escape(s,ht(e,r)),filter:(s,r={})=>t.filter(s,ht(e,r)),defaults:s=>t.defaults(ht(e,s)),makeRe:(s,r={})=>t.makeRe(s,ht(e,r)),braceExpand:(s,r={})=>t.braceExpand(s,ht(e,r)),match:(s,r,n={})=>t.match(s,r,ht(e,n)),sep:t.sep,GLOBSTAR:$})};Q.defaults=Ih;var Xr=(e,t={})=>(de(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Ur(e));Q.braceExpand=Xr;var Rh=(e,t={})=>new et(e,t).makeRe();Q.makeRe=Rh;var Th=(e,t,i={})=>{let s=new et(t,i);return e=e.filter(r=>s.match(r)),s.options.nonull&&!e.length&&e.push(t),e};Q.match=Th;var qr=/[?*]|[+@!]\(.*?\)|\[|\]/,kh=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),et=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,i={}){de(t),i=i||{},this.options=i,this.pattern=t,this.platform=i.platform||Yr,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let i of t)if(typeof i!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,i=this.options;if(!i.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!qr.test(n[2]))&&!qr.test(n[3]),c=/^[a-z]:/i.test(n[0]);if(h)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(c)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:i=1}=this.options;return i>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):i>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(i=>{let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let r=s;for(;i[r+1]==="**";)r++;r!==s&&i.splice(s,r-s)}return i})}levelOneOptimize(t){return t.map(i=>(i=i.reduce((s,r)=>{let n=s[s.length-1];return r==="**"&&n==="**"?s:r===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(r),s)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let n=t[r];r===1&&n===""&&t[0]===""||(n==="."||n==="")&&(i=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(i=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(i=!0,t.splice(s-1,2),s-=2)}}while(i);return t.length===0?[""]:t}firstPhasePreProcess(t){let i=!1;do{i=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let a=r;for(;s[a+1]==="**";)a++;a>r&&s.splice(r+1,a-r);let o=s[r+1],h=s[r+2],c=s[r+3];if(o!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;i=!0,s.splice(r,1);let l=s.slice(0);l[r]="**",t.push(l),r--}if(!this.preserveMultipleSlashes){for(let a=1;a<s.length-1;a++){let o=s[a];a===1&&o===""&&s[0]===""||(o==="."||o==="")&&(i=!0,s.splice(a,1),a--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(i=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let a=s[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){i=!0;let h=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...h),s.length===0&&s.push(""),n-=2}}}}while(i);return t}secondPhasePreProcess(t){for(let i=0;i<t.length-1;i++)for(let s=i+1;s<t.length;s++){let r=this.partsMatch(t[i],t[s],!this.preserveMultipleSlashes);if(r){t[i]=[],t[s]=r;break}}return t.filter(i=>i.length)}partsMatch(t,i,s=!1){let r=0,n=0,a=[],o="";for(;r<t.length&&n<i.length;)if(t[r]===i[n])a.push(o==="b"?i[n]:t[r]),r++,n++;else if(s&&t[r]==="**"&&i[n]===t[r+1])a.push(t[r]),r++;else if(s&&i[n]==="**"&&t[r]===i[n+1])a.push(i[n]),n++;else if(t[r]==="*"&&i[n]&&(this.options.dot||!i[n].startsWith("."))&&i[n]!=="**"){if(o==="b")return!1;o="a",a.push(t[r]),r++,n++}else if(i[n]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(o==="a")return!1;o="b",a.push(i[n]),r++,n++}else return!1;return t.length===i.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,i=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)i=!i,s++;s&&(this.pattern=t.slice(s)),this.negate=i}matchOne(t,i,s=!1){let r=this.options;if(this.isWindows){let m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),g=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),E=!g&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),S=b?3:m?0:void 0,x=E?3:g?0:void 0;if(typeof S=="number"&&typeof x=="number"){let[_,L]=[t[S],i[x]];_.toLowerCase()===L.toLowerCase()&&(i[x]=_,x>S?i=i.slice(x):S>x&&(t=t.slice(S)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:i}),this.debug("matchOne",t.length,i.length);for(var a=0,o=0,h=t.length,c=i.length;a<h&&o<c;a++,o++){this.debug("matchOne loop");var l=i[o],f=t[a];if(this.debug(i,l,f),l===!1)return!1;if(l===$){this.debug("GLOBSTAR",[i,l,f]);var p=a,d=o+1;if(d===c){for(this.debug("** at the end");a<h;a++)if(t[a]==="."||t[a]===".."||!r.dot&&t[a].charAt(0)===".")return!1;return!0}for(;p<h;){var y=t[p];if(this.debug(`
15
- globstar while`,t,p,i,d,y),this.matchOne(t.slice(p),i.slice(d),s))return this.debug("globstar found match!",p,h,y),!0;if(y==="."||y===".."||!r.dot&&y.charAt(0)==="."){this.debug("dot detected!",t,p,i,d);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(s&&(this.debug(`
16
- >>> no match, partial?`,t,p,i,d),p===h))}let m;if(typeof l=="string"?(m=f===l,this.debug("string match",l,f,m)):(m=l.test(f),this.debug("pattern match",l,f,m)),!m)return!1}if(a===h&&o===c)return!0;if(a===h)return s;if(o===c)return a===h-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return Xr(this.pattern,this.options)}parse(t){de(t);let i=this.options;if(t==="**")return $;if(t==="")return"";let s,r=null;(s=t.match(ph))?r=i.dot?mh:dh:(s=t.match(sh))?r=(i.nocase?i.dot?oh:ah:i.dot?nh:rh)(s[1]):(s=t.match(gh))?r=(i.nocase?i.dot?yh:xh:i.dot?bh:vh)(s):(s=t.match(hh))?r=i.dot?ch:uh:(s=t.match(lh))&&(r=fh);let n=Qt.fromGlob(t,this.options).toMMPattern();return r&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:r}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let i=this.options,s=i.noglobstar?Eh:i.dot?_h:Ch,r=new Set(i.nocase?["i"]:[]),n=t.map(h=>{let c=h.map(l=>{if(l instanceof RegExp)for(let f of l.flags.split(""))r.add(f);return typeof l=="string"?kh(l):l===$?$:l._src});return c.forEach((l,f)=>{let p=c[f+1],d=c[f-1];l!==$||d===$||(d===void 0?p!==void 0&&p!==$?c[f+1]="(?:\\/|"+s+"\\/)?"+p:c[f]=s:p===void 0?c[f-1]=d+"(?:\\/|"+s+")?":p!==$&&(c[f-1]=d+"(?:\\/|\\/"+s+"\\/)"+p,c[f+1]=$))}),c.filter(l=>l!==$).join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,i=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&i)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let n=this.set;this.debug(this.pattern,"set",n);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o=0;o<n.length;o++){let h=n[o],c=r;if(s.matchBase&&h.length===1&&(c=[a]),this.matchOne(c,h,i))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return Q.defaults(t).Minimatch}};Q.AST=Qt;Q.Minimatch=et;Q.escape=Yt;Q.unescape=dt;import{fileURLToPath as hu}from"node:url";var Xt=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tn=new Set,Yi=typeof process=="object"&&process?process:{},en=(e,t,i,s)=>{typeof Yi.emitWarning=="function"?Yi.emitWarning(e,t,i,s):console.error(`[${i}] ${t}: ${e}`)},ze=globalThis.AbortController,Zr=globalThis.AbortSignal,Jr;if(typeof ze>"u"){Zr=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,r){this._onabort.push(r)}},ze=class{constructor(){t()}signal=new Zr;abort(s){var r,n;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let a of this.signal._onabort)a(s);(n=(r=this.signal).onabort)==null||n.call(r,s)}}};let e=((Jr=Yi.env)==null?void 0:Jr.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,en("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Ph=e=>!tn.has(e),jc=Symbol("type"),Ot=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),sn=e=>Ot(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Zt:null:null,Zt=class extends Array{constructor(t){super(t),this.fill(0)}},Xi=class e{heap;length;static#t=!1;static create(t){let i=sn(t);if(!i)return[];e.#t=!0;let s=new e(t,i);return e.#t=!1,s}constructor(t,i){if(!e.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},ge=class e{#t;#e;#n;#s;#a;#v;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#o;#h;#r;#g;#x;#p;#f;#E;#m;#_;#C;#b;#w;#S;#d;static unsafeExposeInternals(t){return{starts:t.#C,ttls:t.#b,sizes:t.#_,keyMap:t.#o,keyList:t.#h,valList:t.#r,next:t.#g,prev:t.#x,get head(){return t.#p},get tail(){return t.#f},free:t.#E,isBackgroundFetch:i=>t.#c(i),backgroundFetch:(i,s,r,n)=>t.#B(i,s,r,n),moveToTail:i=>t.#U(i),indexes:i=>t.#I(i),rindexes:i=>t.#R(i),isStale:i=>t.#y(i)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#v}get dispose(){return this.#n}get disposeAfter(){return this.#s}constructor(t){let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:h,dispose:c,disposeAfter:l,noDisposeOnSet:f,noUpdateTTL:p,maxSize:d=0,maxEntrySize:y=0,sizeCalculation:m,fetchMethod:b,memoMethod:g,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:S,allowStaleOnFetchRejection:x,allowStaleOnFetchAbort:_,ignoreFetchAbort:L}=t;if(i!==0&&!Ot(i))throw new TypeError("max option must be a nonnegative integer");let A=i?sn(i):Array;if(!A)throw new Error("invalid max value: "+i);if(this.#t=i,this.#e=d,this.maxEntrySize=y||this.#e,this.sizeCalculation=m,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(g!==void 0&&typeof g!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#v=g,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=b,this.#S=!!b,this.#o=new Map,this.#h=new Array(i).fill(void 0),this.#r=new Array(i).fill(void 0),this.#g=new A(i),this.#x=new A(i),this.#p=0,this.#f=0,this.#E=Xi.create(i),this.#u=0,this.#l=0,typeof c=="function"&&(this.#n=c),typeof l=="function"?(this.#s=l,this.#m=[]):(this.#s=void 0,this.#m=void 0),this.#w=!!this.#n,this.#d=!!this.#s,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!p,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!x,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#e!==0&&!Ot(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!Ot(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#k()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!S,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Ot(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Ot(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let J="LRU_CACHE_UNBOUNDED";Ph(J)&&(tn.add(J),en("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",J,e))}}getRemainingTTL(t){return this.#o.has(t)?1/0:0}#T(){let t=new Zt(this.#t),i=new Zt(this.#t);this.#b=t,this.#C=i,this.#N=(n,a,o=Xt.now())=>{if(i[n]=a!==0?o:0,t[n]=a,a!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#y(n)&&this.#P(this.#h[n],"expire")},a+1);h.unref&&h.unref()}},this.#A=n=>{i[n]=t[n]!==0?Xt.now():0},this.#i=(n,a)=>{if(t[a]){let o=t[a],h=i[a];if(!o||!h)return;n.ttl=o,n.start=h,n.now=s||r();let c=n.now-h;n.remainingTTL=o-c}};let s=0,r=()=>{let n=Xt.now();if(this.ttlResolution>0){s=n;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#o.get(n);if(a===void 0)return 0;let o=t[a],h=i[a];if(!o||!h)return 1/0;let c=(s||r())-h;return o-c},this.#y=n=>{let a=i[n],o=t[n];return!!o&&!!a&&(s||r())-a>o}}#A=()=>{};#i=()=>{};#N=()=>{};#y=()=>!1;#k(){let t=new Zt(this.#t);this.#l=0,this.#_=t,this.#O=i=>{this.#l-=t[i],t[i]=0},this.#D=(i,s,r,n)=>{if(this.#c(s))return 0;if(!Ot(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!Ot(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#L=(i,s,r)=>{if(t[i]=s,this.#e){let n=this.#e-t[i];for(;this.#l>n;)this.#M(!0)}this.#l+=t[i],r&&(r.entrySize=s,r.totalCalculatedSize=this.#l)}}#O=t=>{};#L=(t,i,s)=>{};#D=(t,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#I({allowStale:t=this.allowStale}={}){if(this.#u)for(let i=this.#f;!(!this.#F(i)||((t||!this.#y(i))&&(yield i),i===this.#p));)i=this.#x[i]}*#R({allowStale:t=this.allowStale}={}){if(this.#u)for(let i=this.#p;!(!this.#F(i)||((t||!this.#y(i))&&(yield i),i===this.#f));)i=this.#g[i]}#F(t){return t!==void 0&&this.#o.get(this.#h[t])===t}*entries(){for(let t of this.#I())this.#r[t]!==void 0&&this.#h[t]!==void 0&&!this.#c(this.#r[t])&&(yield[this.#h[t],this.#r[t]])}*rentries(){for(let t of this.#R())this.#r[t]!==void 0&&this.#h[t]!==void 0&&!this.#c(this.#r[t])&&(yield[this.#h[t],this.#r[t]])}*keys(){for(let t of this.#I()){let i=this.#h[t];i!==void 0&&!this.#c(this.#r[t])&&(yield i)}}*rkeys(){for(let t of this.#R()){let i=this.#h[t];i!==void 0&&!this.#c(this.#r[t])&&(yield i)}}*values(){for(let t of this.#I())this.#r[t]!==void 0&&!this.#c(this.#r[t])&&(yield this.#r[t])}*rvalues(){for(let t of this.#R())this.#r[t]!==void 0&&!this.#c(this.#r[t])&&(yield this.#r[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,i={}){for(let s of this.#I()){let r=this.#r[s],n=this.#c(r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,this.#h[s],this))return this.get(this.#h[s],i)}}forEach(t,i=this){for(let s of this.#I()){let r=this.#r[s],n=this.#c(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(i,n,this.#h[s],this)}}rforEach(t,i=this){for(let s of this.#R()){let r=this.#r[s],n=this.#c(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(i,n,this.#h[s],this)}}purgeStale(){let t=!1;for(let i of this.#R({allowStale:!0}))this.#y(i)&&(this.#P(this.#h[i],"expire"),t=!0);return t}info(t){let i=this.#o.get(t);if(i===void 0)return;let s=this.#r[i],r=this.#c(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#b&&this.#C){let a=this.#b[i],o=this.#C[i];if(a&&o){let h=a-(Xt.now()-o);n.ttl=h,n.start=Date.now()}}return this.#_&&(n.size=this.#_[i]),n}dump(){let t=[];for(let i of this.#I({allowStale:!0})){let s=this.#h[i],r=this.#r[i],n=this.#c(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let a={value:n};if(this.#b&&this.#C){a.ttl=this.#b[i];let o=Xt.now()-this.#C[i];a.start=Math.floor(Date.now()-o)}this.#_&&(a.size=this.#_[i]),t.unshift([s,a])}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let r=Date.now()-s.start;s.start=Xt.now()-r}this.set(i,s.value,s)}}set(t,i,s={}){var p,d,y,m,b;if(i===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=s,{noUpdateTTL:c=this.noUpdateTTL}=s,l=this.#D(t,i,s.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#P(t,"set"),this;let f=this.#u===0?void 0:this.#o.get(t);if(f===void 0)f=this.#u===0?this.#f:this.#E.length!==0?this.#E.pop():this.#u===this.#t?this.#M(!1):this.#u,this.#h[f]=t,this.#r[f]=i,this.#o.set(t,f),this.#g[this.#f]=f,this.#x[f]=this.#f,this.#f=f,this.#u++,this.#L(f,l,h),h&&(h.set="add"),c=!1;else{this.#U(f);let g=this.#r[f];if(i!==g){if(this.#S&&this.#c(g)){g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:E}=g;E!==void 0&&!a&&(this.#w&&((p=this.#n)==null||p.call(this,E,t,"set")),this.#d&&((d=this.#m)==null||d.push([E,t,"set"])))}else a||(this.#w&&((y=this.#n)==null||y.call(this,g,t,"set")),this.#d&&((m=this.#m)==null||m.push([g,t,"set"])));if(this.#O(f),this.#L(f,l,h),this.#r[f]=i,h){h.set="replace";let E=g&&this.#c(g)?g.__staleWhileFetching:g;E!==void 0&&(h.oldValue=E)}}else h&&(h.set="update")}if(r!==0&&!this.#b&&this.#T(),this.#b&&(c||this.#N(f,r,n),h&&this.#i(h,f)),!a&&this.#d&&this.#m){let g=this.#m,E;for(;E=g==null?void 0:g.shift();)(b=this.#s)==null||b.call(this,...E)}return this}pop(){var t;try{for(;this.#u;){let i=this.#r[this.#p];if(this.#M(!0),this.#c(i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(this.#d&&this.#m){let i=this.#m,s;for(;s=i==null?void 0:i.shift();)(t=this.#s)==null||t.call(this,...s)}}}#M(t){var n,a;let i=this.#p,s=this.#h[i],r=this.#r[i];return this.#S&&this.#c(r)?r.__abortController.abort(new Error("evicted")):(this.#w||this.#d)&&(this.#w&&((n=this.#n)==null||n.call(this,r,s,"evict")),this.#d&&((a=this.#m)==null||a.push([r,s,"evict"]))),this.#O(i),t&&(this.#h[i]=void 0,this.#r[i]=void 0,this.#E.push(i)),this.#u===1?(this.#p=this.#f=0,this.#E.length=0):this.#p=this.#g[i],this.#o.delete(s),this.#u--,i}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=this.#o.get(t);if(n!==void 0){let a=this.#r[n];if(this.#c(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#y(n))r&&(r.has="stale",this.#i(r,n));else return s&&this.#A(n),r&&(r.has="hit",this.#i(r,n)),!0}else r&&(r.has="miss");return!1}peek(t,i={}){let{allowStale:s=this.allowStale}=i,r=this.#o.get(t);if(r===void 0||!s&&this.#y(r))return;let n=this.#r[r];return this.#c(n)?n.__staleWhileFetching:n}#B(t,i,s,r){let n=i===void 0?void 0:this.#r[i];if(this.#c(n))return n;let a=new ze,{signal:o}=s;o==null||o.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let h={signal:a.signal,options:s,context:r},c=(m,b=!1)=>{let{aborted:g}=a.signal,E=s.ignoreFetchAbort&&m!==void 0;if(s.status&&(g&&!b?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,E&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),g&&!E&&!b)return f(a.signal.reason);let S=d;return this.#r[i]===d&&(m===void 0?S.__staleWhileFetching?this.#r[i]=S.__staleWhileFetching:this.#P(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,m,h.options))),m},l=m=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=m),f(m)),f=m=>{let{aborted:b}=a.signal,g=b&&s.allowStaleOnFetchAbort,E=g||s.allowStaleOnFetchRejection,S=E||s.noDeleteOnFetchRejection,x=d;if(this.#r[i]===d&&(!S||x.__staleWhileFetching===void 0?this.#P(t,"fetch"):g||(this.#r[i]=x.__staleWhileFetching)),E)return s.status&&x.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),x.__staleWhileFetching;if(x.__returned===x)throw m},p=(m,b)=>{var E;let g=(E=this.#a)==null?void 0:E.call(this,t,n,h);g&&g instanceof Promise&&g.then(S=>m(S===void 0?void 0:S),b),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(m(void 0),s.allowStaleOnFetchAbort&&(m=S=>c(S,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(p).then(c,l),y=Object.assign(d,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(t,y,{...h.options,status:void 0}),i=this.#o.get(t)):this.#r[i]=y,y}#c(t){if(!this.#S)return!1;let i=t;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof ze}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:h=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:g,signal:E}=i;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:g});let S={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:h,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:y,ignoreFetchAbort:d,status:g,signal:E},x=this.#o.get(t);if(x===void 0){g&&(g.fetch="miss");let _=this.#B(t,x,S,m);return _.__returned=_}else{let _=this.#r[x];if(this.#c(_)){let N=s&&_.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",N&&(g.returnedStale=!0)),N?_.__staleWhileFetching:_.__returned=_}let L=this.#y(x);if(!b&&!L)return g&&(g.fetch="hit"),this.#U(x),r&&this.#A(x),g&&this.#i(g,x),_;let A=this.#B(t,x,S,m),W=A.__staleWhileFetching!==void 0&&s;return g&&(g.fetch=L?"stale":"refresh",W&&L&&(g.returnedStale=!0)),W?A.__staleWhileFetching:A.__returned=A}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=this.#v;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...a}=i,o=this.get(t,a);if(!n&&o!==void 0)return o;let h=s(t,o,{options:a,context:r});return this.set(t,h,a),h}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=i,o=this.#o.get(t);if(o!==void 0){let h=this.#r[o],c=this.#c(h);return a&&this.#i(a,o),this.#y(o)?(a&&(a.get="stale"),c?(a&&s&&h.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?h.__staleWhileFetching:void 0):(n||this.#P(t,"expire"),a&&s&&(a.returnedStale=!0),s?h:void 0)):(a&&(a.get="hit"),c?h.__staleWhileFetching:(this.#U(o),r&&this.#A(o),h))}else a&&(a.get="miss")}#V(t,i){this.#x[i]=t,this.#g[t]=i}#U(t){t!==this.#f&&(t===this.#p?this.#p=this.#g[t]:this.#V(this.#x[t],this.#g[t]),this.#V(this.#f,t),this.#f=t)}delete(t){return this.#P(t,"delete")}#P(t,i){var r,n,a,o;let s=!1;if(this.#u!==0){let h=this.#o.get(t);if(h!==void 0)if(s=!0,this.#u===1)this.#j(i);else{this.#O(h);let c=this.#r[h];if(this.#c(c)?c.__abortController.abort(new Error("deleted")):(this.#w||this.#d)&&(this.#w&&((r=this.#n)==null||r.call(this,c,t,i)),this.#d&&((n=this.#m)==null||n.push([c,t,i]))),this.#o.delete(t),this.#h[h]=void 0,this.#r[h]=void 0,h===this.#f)this.#f=this.#x[h];else if(h===this.#p)this.#p=this.#g[h];else{let l=this.#x[h];this.#g[l]=this.#g[h];let f=this.#g[h];this.#x[f]=this.#x[h]}this.#u--,this.#E.push(h)}}if(this.#d&&((a=this.#m)!=null&&a.length)){let h=this.#m,c;for(;c=h==null?void 0:h.shift();)(o=this.#s)==null||o.call(this,...c)}return s}clear(){return this.#j("delete")}#j(t){var i,s,r;for(let n of this.#R({allowStale:!0})){let a=this.#r[n];if(this.#c(a))a.__abortController.abort(new Error("deleted"));else{let o=this.#h[n];this.#w&&((i=this.#n)==null||i.call(this,a,o,t)),this.#d&&((s=this.#m)==null||s.push([a,o,t]))}}if(this.#o.clear(),this.#r.fill(void 0),this.#h.fill(void 0),this.#b&&this.#C&&(this.#b.fill(0),this.#C.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#f=0,this.#E.length=0,this.#l=0,this.#u=0,this.#d&&this.#m){let n=this.#m,a;for(;a=n==null?void 0:n.shift();)(r=this.#s)==null||r.call(this,...a)}}};import{posix as $h,win32 as os}from"node:path";import{fileURLToPath as Wh}from"node:url";import{lstatSync as Gh,readdir as zh,readdirSync as Hh,readlinkSync as qh,realpathSync as Kh}from"fs";import*as Qh from"node:fs";import{lstat as Xh,readdir as Zh,readlink as Jh,realpath as tu}from"node:fs/promises";import{EventEmitter as rs}from"node:events";import hn from"node:stream";import{StringDecoder as Nh}from"node:string_decoder";var rn=typeof process=="object"&&process?process:{stdout:null,stderr:null},Oh=e=>!!e&&typeof e=="object"&&(e instanceof Dt||e instanceof hn||Lh(e)||Dh(e)),Lh=e=>!!e&&typeof e=="object"&&e instanceof rs&&typeof e.pipe=="function"&&e.pipe!==hn.Writable.prototype.pipe,Dh=e=>!!e&&typeof e=="object"&&e instanceof rs&&typeof e.write=="function"&&typeof e.end=="function",At=Symbol("EOF"),It=Symbol("maybeEmitEnd"),Lt=Symbol("emittedEnd"),He=Symbol("emittingEnd"),xe=Symbol("emittedError"),qe=Symbol("closed"),nn=Symbol("read"),Ke=Symbol("flush"),an=Symbol("flushChunk"),mt=Symbol("encoding"),Jt=Symbol("decoder"),V=Symbol("flowing"),ye=Symbol("paused"),te=Symbol("resume"),U=Symbol("buffer"),Y=Symbol("pipes"),j=Symbol("bufferLength"),Zi=Symbol("bufferPush"),Qe=Symbol("bufferShift"),z=Symbol("objectMode"),D=Symbol("destroyed"),Ji=Symbol("error"),ts=Symbol("emitData"),on=Symbol("emitEnd"),es=Symbol("emitEnd2"),wt=Symbol("async"),is=Symbol("abort"),Ye=Symbol("aborted"),be=Symbol("signal"),Ut=Symbol("dataListeners"),it=Symbol("discarded"),ve=e=>Promise.resolve().then(e),Fh=e=>e(),Mh=e=>e==="end"||e==="finish"||e==="prefinish",Bh=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,Vh=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),Xe=class{src;dest;opts;ondrain;constructor(t,i,s){this.src=t,this.dest=i,this.opts=s,this.ondrain=()=>t[te](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},ss=class extends Xe{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,i,s){super(t,i,s),this.proxyErrors=r=>i.emit("error",r),t.on("error",this.proxyErrors)}},Uh=e=>!!e.objectMode,jh=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",Dt=class extends rs{[V]=!1;[ye]=!1;[Y]=[];[U]=[];[z];[mt];[wt];[Jt];[At]=!1;[Lt]=!1;[He]=!1;[qe]=!1;[xe]=null;[j]=0;[D]=!1;[be];[Ye]=!1;[Ut]=0;[it]=!1;writable=!0;readable=!0;constructor(...t){let i=t[0]||{};if(super(),i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Uh(i)?(this[z]=!0,this[mt]=null):jh(i)?(this[mt]=i.encoding,this[z]=!1):(this[z]=!1,this[mt]=null),this[wt]=!!i.async,this[Jt]=this[mt]?new Nh(this[mt]):null,i&&i.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[U]}),i&&i.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Y]});let{signal:s}=i;s&&(this[be]=s,s.aborted?this[is]():s.addEventListener("abort",()=>this[is]()))}get bufferLength(){return this[j]}get encoding(){return this[mt]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[z]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[wt]}set async(t){this[wt]=this[wt]||!!t}[is](){var t,i;this[Ye]=!0,this.emit("abort",(t=this[be])==null?void 0:t.reason),this.destroy((i=this[be])==null?void 0:i.reason)}get aborted(){return this[Ye]}set aborted(t){}write(t,i,s){var n;if(this[Ye])return!1;if(this[At])throw new Error("write after end");if(this[D])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof i=="function"&&(s=i,i="utf8"),i||(i="utf8");let r=this[wt]?ve:Fh;if(!this[z]&&!Buffer.isBuffer(t)){if(Vh(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Bh(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[z]?(this[V]&&this[j]!==0&&this[Ke](!0),this[V]?this.emit("data",t):this[Zi](t),this[j]!==0&&this.emit("readable"),s&&r(s),this[V]):t.length?(typeof t=="string"&&!(i===this[mt]&&!((n=this[Jt])!=null&&n.lastNeed))&&(t=Buffer.from(t,i)),Buffer.isBuffer(t)&&this[mt]&&(t=this[Jt].write(t)),this[V]&&this[j]!==0&&this[Ke](!0),this[V]?this.emit("data",t):this[Zi](t),this[j]!==0&&this.emit("readable"),s&&r(s),this[V]):(this[j]!==0&&this.emit("readable"),s&&r(s),this[V])}read(t){if(this[D])return null;if(this[it]=!1,this[j]===0||t===0||t&&t>this[j])return this[It](),null;this[z]&&(t=null),this[U].length>1&&!this[z]&&(this[U]=[this[mt]?this[U].join(""):Buffer.concat(this[U],this[j])]);let i=this[nn](t||null,this[U][0]);return this[It](),i}[nn](t,i){if(this[z])this[Qe]();else{let s=i;t===s.length||t===null?this[Qe]():typeof s=="string"?(this[U][0]=s.slice(t),i=s.slice(0,t),this[j]-=t):(this[U][0]=s.subarray(t),i=s.subarray(0,t),this[j]-=t)}return this.emit("data",i),!this[U].length&&!this[At]&&this.emit("drain"),i}end(t,i,s){return typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i="utf8"),t!==void 0&&this.write(t,i),s&&this.once("end",s),this[At]=!0,this.writable=!1,(this[V]||!this[ye])&&this[It](),this}[te](){this[D]||(!this[Ut]&&!this[Y].length&&(this[it]=!0),this[ye]=!1,this[V]=!0,this.emit("resume"),this[U].length?this[Ke]():this[At]?this[It]():this.emit("drain"))}resume(){return this[te]()}pause(){this[V]=!1,this[ye]=!0,this[it]=!1}get destroyed(){return this[D]}get flowing(){return this[V]}get paused(){return this[ye]}[Zi](t){this[z]?this[j]+=1:this[j]+=t.length,this[U].push(t)}[Qe](){return this[z]?this[j]-=1:this[j]-=this[U][0].length,this[U].shift()}[Ke](t=!1){do;while(this[an](this[Qe]())&&this[U].length);!t&&!this[U].length&&!this[At]&&this.emit("drain")}[an](t){return this.emit("data",t),this[V]}pipe(t,i){if(this[D])return t;this[it]=!1;let s=this[Lt];return i=i||{},t===rn.stdout||t===rn.stderr?i.end=!1:i.end=i.end!==!1,i.proxyErrors=!!i.proxyErrors,s?i.end&&t.end():(this[Y].push(i.proxyErrors?new ss(this,t,i):new Xe(this,t,i)),this[wt]?ve(()=>this[te]()):this[te]()),t}unpipe(t){let i=this[Y].find(s=>s.dest===t);i&&(this[Y].length===1?(this[V]&&this[Ut]===0&&(this[V]=!1),this[Y]=[]):this[Y].splice(this[Y].indexOf(i),1),i.unpipe())}addListener(t,i){return this.on(t,i)}on(t,i){let s=super.on(t,i);if(t==="data")this[it]=!1,this[Ut]++,!this[Y].length&&!this[V]&&this[te]();else if(t==="readable"&&this[j]!==0)super.emit("readable");else if(Mh(t)&&this[Lt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[xe]){let r=i;this[wt]?ve(()=>r.call(this,this[xe])):r.call(this,this[xe])}return s}removeListener(t,i){return this.off(t,i)}off(t,i){let s=super.off(t,i);return t==="data"&&(this[Ut]=this.listeners("data").length,this[Ut]===0&&!this[it]&&!this[Y].length&&(this[V]=!1)),s}removeAllListeners(t){let i=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Ut]=0,!this[it]&&!this[Y].length&&(this[V]=!1)),i}get emittedEnd(){return this[Lt]}[It](){!this[He]&&!this[Lt]&&!this[D]&&this[U].length===0&&this[At]&&(this[He]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[qe]&&this.emit("close"),this[He]=!1)}emit(t,...i){let s=i[0];if(t!=="error"&&t!=="close"&&t!==D&&this[D])return!1;if(t==="data")return!this[z]&&!s?!1:this[wt]?(ve(()=>this[ts](s)),!0):this[ts](s);if(t==="end")return this[on]();if(t==="close"){if(this[qe]=!0,!this[Lt]&&!this[D])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[xe]=s,super.emit(Ji,s);let n=!this[be]||this.listeners("error").length?super.emit("error",s):!1;return this[It](),n}else if(t==="resume"){let n=super.emit("resume");return this[It](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...i);return this[It](),r}[ts](t){for(let s of this[Y])s.dest.write(t)===!1&&this.pause();let i=this[it]?!1:super.emit("data",t);return this[It](),i}[on](){return this[Lt]?!1:(this[Lt]=!0,this.readable=!1,this[wt]?(ve(()=>this[es]()),!0):this[es]())}[es](){if(this[Jt]){let i=this[Jt].end();if(i){for(let s of this[Y])s.dest.write(i);this[it]||super.emit("data",i)}}for(let i of this[Y])i.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[z]||(t.dataLength=0);let i=this.promise();return this.on("data",s=>{t.push(s),this[z]||(t.dataLength+=s.length)}),await i,t}async concat(){if(this[z])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[mt]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,i)=>{this.on(D,()=>i(new Error("stream destroyed"))),this.on("error",s=>i(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[it]=!1;let t=!1,i=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return i();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[At])return i();let n,a,o=f=>{this.off("data",h),this.off("end",c),this.off(D,l),i(),a(f)},h=f=>{this.off("error",o),this.off("end",c),this.off(D,l),this.pause(),n({value:f,done:!!this[At]})},c=()=>{this.off("error",o),this.off("data",h),this.off(D,l),i(),n({done:!0,value:void 0})},l=()=>o(new Error("stream destroyed"));return new Promise((f,p)=>{a=p,n=f,this.once(D,l),this.once("error",o),this.once("end",c),this.once("data",h)})},throw:i,return:i,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[it]=!1;let t=!1,i=()=>(this.pause(),this.off(Ji,i),this.off(D,i),this.off("end",i),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return i();let r=this.read();return r===null?i():{done:!1,value:r}};return this.once("end",i),this.once(Ji,i),this.once(D,i),{next:s,throw:i,return:i,[Symbol.iterator](){return this}}}destroy(t){if(this[D])return t?this.emit("error",t):this.emit(D),this;this[D]=!0,this[it]=!0,this[U].length=0,this[j]=0;let i=this;return typeof i.close=="function"&&!this[qe]&&i.close(),t?this.emit("error",t):this.emit(D),this}static get isStream(){return Oh}};var Yh=Kh.native,Se={lstatSync:Gh,readdir:zh,readdirSync:Hh,readlinkSync:qh,realpathSync:Yh,promises:{lstat:Xh,readdir:Zh,readlink:Jh,realpath:tu}},pn=e=>!e||e===Se||e===Qh?Se:{...Se,...e,promises:{...Se.promises,...e.promises||{}}},dn=/^\\\\\?\\([a-z]:)\\?$/i,eu=e=>e.replace(/\//g,"\\").replace(dn,"$1\\"),iu=/[\\\/]/,ct=0,mn=1,gn=2,St=4,xn=6,yn=8,jt=10,bn=12,ut=15,we=~ut,ns=16,un=32,Ee=64,gt=128,Ze=256,ti=512,cn=Ee|gt|ti,su=1023,as=e=>e.isFile()?yn:e.isDirectory()?St:e.isSymbolicLink()?jt:e.isCharacterDevice()?gn:e.isBlockDevice()?xn:e.isSocket()?bn:e.isFIFO()?mn:ct,ln=new Map,_e=e=>{let t=ln.get(e);if(t)return t;let i=e.normalize("NFKD");return ln.set(e,i),i},fn=new Map,Je=e=>{let t=fn.get(e);if(t)return t;let i=_e(e.toLowerCase());return fn.set(e,i),i},ei=class extends ge{constructor(){super({max:256})}},hs=class extends ge{constructor(t=16*1024){super({maxSize:t,sizeCalculation:i=>i.length+1})}},vn=Symbol("PathScurry setAsCwd"),H=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#n;get mode(){return this.#n}#s;get nlink(){return this.#s}#a;get uid(){return this.#a}#v;get gid(){return this.#v}#u;get rdev(){return this.#u}#l;get blksize(){return this.#l}#o;get ino(){return this.#o}#h;get size(){return this.#h}#r;get blocks(){return this.#r}#g;get atimeMs(){return this.#g}#x;get mtimeMs(){return this.#x}#p;get ctimeMs(){return this.#p}#f;get birthtimeMs(){return this.#f}#E;get atime(){return this.#E}#m;get mtime(){return this.#m}#_;get ctime(){return this.#_}#C;get birthtime(){return this.#C}#b;#w;#S;#d;#T;#A;#i;#N;#y;#k;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,i=ct,s,r,n,a,o){this.name=t,this.#b=n?Je(t):_e(t),this.#i=i&su,this.nocase=n,this.roots=r,this.root=s||this,this.#N=a,this.#S=o.fullpath,this.#T=o.relative,this.#A=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=pn(o.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#N}resolve(t){if(!t)return this;let i=this.getRootString(t),r=t.substring(i.length).split(this.splitSep);return i?this.getRoot(i).#O(r):this.#O(r)}#O(t){let i=this;for(let s of t)i=i.child(s);return i}children(){let t=this.#N.get(this);if(t)return t;let i=Object.assign([],{provisional:0});return this.#N.set(this,i),this.#i&=~ns,i}child(t,i){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),r=this.nocase?Je(t):_e(t);for(let h of s)if(h.#b===r)return h;let n=this.parent?this.sep:"",a=this.#S?this.#S+n+t:void 0,o=this.newChild(t,ct,{...i,parent:this,fullpath:a});return this.canReaddir()||(o.#i|=gt),s.push(o),o}relative(){if(this.isCWD)return"";if(this.#T!==void 0)return this.#T;let t=this.name,i=this.parent;if(!i)return this.#T=this.name;let s=i.relative();return s+(!s||!i.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#A!==void 0)return this.#A;let t=this.name,i=this.parent;if(!i)return this.#A=this.fullpathPosix();let s=i.relativePosix();return s+(!s||!i.parent?"":"/")+t}fullpath(){if(this.#S!==void 0)return this.#S;let t=this.name,i=this.parent;if(!i)return this.#S=this.name;let r=i.fullpath()+(i.parent?this.sep:"")+t;return this.#S=r}fullpathPosix(){if(this.#d!==void 0)return this.#d;if(this.sep==="/")return this.#d=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#d=`//?/${r}`:this.#d=r}let t=this.parent,i=t.fullpathPosix(),s=i+(!i||!t.parent?"":"/")+this.name;return this.#d=s}isUnknown(){return(this.#i&ut)===ct}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#i&ut)===yn}isDirectory(){return(this.#i&ut)===St}isCharacterDevice(){return(this.#i&ut)===gn}isBlockDevice(){return(this.#i&ut)===xn}isFIFO(){return(this.#i&ut)===mn}isSocket(){return(this.#i&ut)===bn}isSymbolicLink(){return(this.#i&jt)===jt}lstatCached(){return this.#i&un?this:void 0}readlinkCached(){return this.#y}realpathCached(){return this.#k}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#y)return!0;if(!this.parent)return!1;let t=this.#i&ut;return!(t!==ct&&t!==jt||this.#i&Ze||this.#i&gt)}calledReaddir(){return!!(this.#i&ns)}isENOENT(){return!!(this.#i&gt)}isNamed(t){return this.nocase?this.#b===Je(t):this.#b===_e(t)}async readlink(){var i;let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let s=await this.#t.promises.readlink(this.fullpath()),r=(i=await this.parent.realpath())==null?void 0:i.resolve(s);if(r)return this.#y=r}catch(s){this.#c(s.code);return}}readlinkSync(){var i;let t=this.#y;if(t)return t;if(this.canReadlink()&&this.parent)try{let s=this.#t.readlinkSync(this.fullpath()),r=(i=this.parent.realpathSync())==null?void 0:i.resolve(s);if(r)return this.#y=r}catch(s){this.#c(s.code);return}}#L(t){this.#i|=ns;for(let i=t.provisional;i<t.length;i++){let s=t[i];s&&s.#D()}}#D(){this.#i&gt||(this.#i=(this.#i|gt)&we,this.#I())}#I(){let t=this.children();t.provisional=0;for(let i of t)i.#D()}#R(){this.#i|=ti,this.#F()}#F(){if(this.#i&Ee)return;let t=this.#i;(t&ut)===St&&(t&=we),this.#i=t|Ee,this.#I()}#M(t=""){t==="ENOTDIR"||t==="EPERM"?this.#F():t==="ENOENT"?this.#D():this.children().provisional=0}#B(t=""){t==="ENOTDIR"?this.parent.#F():t==="ENOENT"&&this.#D()}#c(t=""){let i=this.#i;i|=Ze,t==="ENOENT"&&(i|=gt),(t==="EINVAL"||t==="UNKNOWN")&&(i&=we),this.#i=i,t==="ENOTDIR"&&this.parent&&this.parent.#F()}#V(t,i){return this.#P(t,i)||this.#U(t,i)}#U(t,i){let s=as(t),r=this.newChild(t.name,s,{parent:this}),n=r.#i&ut;return n!==St&&n!==jt&&n!==ct&&(r.#i|=Ee),i.unshift(r),i.provisional++,r}#P(t,i){for(let s=i.provisional;s<i.length;s++){let r=i[s];if((this.nocase?Je(t.name):_e(t.name))===r.#b)return this.#j(t,r,s,i)}}#j(t,i,s,r){let n=i.name;return i.#i=i.#i&we|as(t),n!==t.name&&(i.name=t.name),s!==r.provisional&&(s===r.length-1?r.pop():r.splice(s,1),r.unshift(i)),r.provisional++,i}async lstat(){if((this.#i&gt)===0)try{return this.#z(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#B(t.code)}}lstatSync(){if((this.#i&gt)===0)try{return this.#z(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#B(t.code)}}#z(t){let{atime:i,atimeMs:s,birthtime:r,birthtimeMs:n,blksize:a,blocks:o,ctime:h,ctimeMs:c,dev:l,gid:f,ino:p,mode:d,mtime:y,mtimeMs:m,nlink:b,rdev:g,size:E,uid:S}=t;this.#E=i,this.#g=s,this.#C=r,this.#f=n,this.#l=a,this.#r=o,this.#_=h,this.#p=c,this.#e=l,this.#v=f,this.#o=p,this.#n=d,this.#m=y,this.#x=m,this.#s=b,this.#u=g,this.#h=E,this.#a=S;let x=as(t);this.#i=this.#i&we|x|un,x!==ct&&x!==St&&x!==jt&&(this.#i|=Ee)}#W=[];#G=!1;#H(t){this.#G=!1;let i=this.#W.slice();this.#W.length=0,i.forEach(s=>s(null,t))}readdirCB(t,i=!1){if(!this.canReaddir()){i?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);i?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#W.push(t),this.#G)return;this.#G=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(n,a)=>{if(n)this.#M(n.code),s.provisional=0;else{for(let o of a)this.#V(o,s);this.#L(s)}this.#H(s.slice(0,s.provisional))})}#$;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let i=this.fullpath();if(this.#$)await this.#$;else{let s=()=>{};this.#$=new Promise(r=>s=r);try{for(let r of await this.#t.promises.readdir(i,{withFileTypes:!0}))this.#V(r,t);this.#L(t)}catch(r){this.#M(r.code),t.provisional=0}this.#$=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let i=this.fullpath();try{for(let s of this.#t.readdirSync(i,{withFileTypes:!0}))this.#V(s,t);this.#L(t)}catch(s){this.#M(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#i&cn)return!1;let t=ut&this.#i;return t===ct||t===St||t===jt}shouldWalk(t,i){return(this.#i&St)===St&&!(this.#i&cn)&&!t.has(this)&&(!i||i(this))}async realpath(){if(this.#k)return this.#k;if(!((ti|Ze|gt)&this.#i))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#k=this.resolve(t)}catch{this.#R()}}realpathSync(){if(this.#k)return this.#k;if(!((ti|Ze|gt)&this.#i))try{let t=this.#t.realpathSync(this.fullpath());return this.#k=this.resolve(t)}catch{this.#R()}}[vn](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let i=new Set([]),s=[],r=this;for(;r&&r.parent;)i.add(r),r.#T=s.join(this.sep),r.#A=s.join("/"),r=r.parent,s.push("..");for(r=t;r&&r.parent&&!i.has(r);)r.#T=void 0,r.#A=void 0,r=r.parent}},ii=class e extends H{sep="\\";splitSep=iu;constructor(t,i=ct,s,r,n,a,o){super(t,i,s,r,n,a,o)}newChild(t,i=ct,s={}){return new e(t,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return os.parse(t).root}getRoot(t){if(t=eu(t.toUpperCase()),t===this.root.name)return this.root;for(let[i,s]of Object.entries(this.roots))if(this.sameRoot(t,i))return this.roots[t]=s;return this.roots[t]=new ee(t,this).root}sameRoot(t,i=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(dn,"$1\\"),t===i}},si=class e extends H{splitSep="/";sep="/";constructor(t,i=ct,s,r,n,a,o){super(t,i,s,r,n,a,o)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,i=ct,s={}){return new e(t,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ri=class{root;rootPath;roots;cwd;#t;#e;#n;nocase;#s;constructor(t=process.cwd(),i,s,{nocase:r,childrenCacheSize:n=16*1024,fs:a=Se}={}){this.#s=pn(a),(t instanceof URL||t.startsWith("file://"))&&(t=Wh(t));let o=i.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new ei,this.#e=new ei,this.#n=new hs(n);let h=o.substring(this.rootPath.length).split(s);if(h.length===1&&!h[0]&&h.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#s),this.roots[this.rootPath]=this.root;let c=this.root,l=h.length-1,f=i.sep,p=this.rootPath,d=!1;for(let y of h){let m=l--;c=c.child(y,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(d?"":f)+y}),d=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let i="";for(let n=t.length-1;n>=0;n--){let a=t[n];if(!(!a||a===".")&&(i=i?`${a}/${i}`:a,this.isAbsolute(a)))break}let s=this.#t.get(i);if(s!==void 0)return s;let r=this.cwd.resolve(i).fullpath();return this.#t.set(i,r),r}resolvePosix(...t){let i="";for(let n=t.length-1;n>=0;n--){let a=t[n];if(!(!a||a===".")&&(i=i?`${a}/${i}`:a,this.isAbsolute(a)))break}let s=this.#e.get(i);if(s!==void 0)return s;let r=this.cwd.resolve(i).fullpathPosix();return this.#e.set(i,r),r}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,i={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s}=i;if(t.canReaddir()){let r=await t.readdir();return s?r:r.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,i={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0}=i;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(r=>r.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=await t.readlink();return i?s:s==null?void 0:s.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return i?s:s==null?void 0:s.fullpath()}async realpath(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=await t.realpath();return i?s:s==null?void 0:s.fullpath()}realpathSync(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return i?s:s==null?void 0:s.fullpath()}async walk(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=[];(!n||n(t))&&o.push(s?t:t.fullpath());let h=new Set,c=(f,p)=>{h.add(f),f.readdirCB((d,y)=>{if(d)return p(d);let m=y.length;if(!m)return p();let b=()=>{--m===0&&p()};for(let g of y)(!n||n(g))&&o.push(s?g:g.fullpath()),r&&g.isSymbolicLink()?g.realpath().then(E=>E!=null&&E.isUnknown()?E.lstat():E).then(E=>E!=null&&E.shouldWalk(h,a)?c(E,b):b()):g.shouldWalk(h,a)?c(g,b):b()},!0)},l=t;return new Promise((f,p)=>{c(l,d=>{if(d)return p(d);f(o)})})}walkSync(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=[];(!n||n(t))&&o.push(s?t:t.fullpath());let h=new Set([t]);for(let c of h){let l=c.readdirSync();for(let f of l){(!n||n(f))&&o.push(s?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(r&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(h,a)&&h.add(p)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,i={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd),this.stream(t,i)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i;(!n||n(t))&&(yield s?t:t.fullpath());let o=new Set([t]);for(let h of o){let c=h.readdirSync();for(let l of c){(!n||n(l))&&(yield s?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(r&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(o,a)&&o.add(f)}}}stream(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=new Dt({objectMode:!0});(!n||n(t))&&o.write(s?t:t.fullpath());let h=new Set,c=[t],l=0,f=()=>{let p=!1;for(;!p;){let d=c.shift();if(!d){l===0&&o.end();return}l++,h.add(d);let y=(b,g,E=!1)=>{if(b)return o.emit("error",b);if(r&&!E){let S=[];for(let x of g)x.isSymbolicLink()&&S.push(x.realpath().then(_=>_!=null&&_.isUnknown()?_.lstat():_));if(S.length){Promise.all(S).then(()=>y(null,g,!0));return}}for(let S of g)S&&(!n||n(S))&&(o.write(s?S:S.fullpath())||(p=!0));l--;for(let S of g){let x=S.realpathCached()||S;x.shouldWalk(h,a)&&c.push(x)}p&&!o.flowing?o.once("drain",f):m||f()},m=!0;d.readdirCB(y,!0),m=!1}};return f(),o}streamSync(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=new Dt({objectMode:!0}),h=new Set;(!n||n(t))&&o.write(s?t:t.fullpath());let c=[t],l=0,f=()=>{let p=!1;for(;!p;){let d=c.shift();if(!d){l===0&&o.end();return}l++,h.add(d);let y=d.readdirSync();for(let m of y)(!n||n(m))&&(o.write(s?m:m.fullpath())||(p=!0));l--;for(let m of y){let b=m;if(m.isSymbolicLink()){if(!(r&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(h,a)&&c.push(b)}}p&&!o.flowing&&o.once("drain",f)};return f(),o}chdir(t=this.cwd){let i=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[vn](i)}},ee=class extends ri{sep="\\";constructor(t=process.cwd(),i={}){let{nocase:s=!0}=i;super(t,os,"\\",{...i,nocase:s}),this.nocase=s;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(t){return os.parse(t).root.toUpperCase()}newRoot(t){return new ii(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},ie=class extends ri{sep="/";constructor(t=process.cwd(),i={}){let{nocase:s=!1}=i;super(t,$h,"/",{...i,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new si(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},Ce=class extends ie{constructor(t=process.cwd(),i={}){let{nocase:s=!0}=i;super(t,{...i,nocase:s})}},Jc=process.platform==="win32"?ii:si,wn=process.platform==="win32"?ee:process.platform==="darwin"?Ce:ie;var ru=e=>e.length>=1,nu=e=>e.length>=1,se=class e{#t;#e;#n;length;#s;#a;#v;#u;#l;#o;#h=!0;constructor(t,i,s,r){if(!ru(t))throw new TypeError("empty pattern list");if(!nu(i))throw new TypeError("empty glob list");if(i.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=i,this.#n=s,this.#s=r,this.#n===0){if(this.isUNC()){let[n,a,o,h,...c]=this.#t,[l,f,p,d,...y]=this.#e;c[0]===""&&(c.shift(),y.shift());let m=[n,a,o,h,""].join("/"),b=[l,f,p,d,""].join("/");this.#t=[m,...c],this.#e=[b,...y],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#t,[o,...h]=this.#e;a[0]===""&&(a.shift(),h.shift());let c=n+"/",l=o+"/";this.#t=[c,...a],this.#e=[l,...h],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===$}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#v=this.#v||(this.#n===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#a!==void 0?this.#a:this.hasMore()?(this.#a=new e(this.#t,this.#e,this.#n+1,this.#s),this.#a.#o=this.#o,this.#a.#l=this.#l,this.#a.#u=this.#u,this.#a):this.#a=null}isUNC(){let t=this.#t;return this.#l!==void 0?this.#l:this.#l=this.#s==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#s==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#o!==void 0?this.#o:this.#o=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#h)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#h?!1:(this.#h=!1,!0)}};var au=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",re=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:i,nocase:s,noext:r,noglobstar:n,platform:a=au}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:i,nocase:s,noext:r,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of t)this.add(o)}add(t){let i=new et(t,this.mmopts);for(let s=0;s<i.set.length;s++){let r=i.set[s],n=i.globParts[s];if(!r||!n)throw new Error("invalid pattern object");for(;r[0]==="."&&n[0]===".";)r.shift(),n.shift();let a=new se(r,n,0,this.platform),o=new et(a.globString(),this.mmopts),h=n[n.length-1]==="**",c=a.isAbsolute();c?this.absolute.push(o):this.relative.push(o),h&&(c?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(t){let i=t.fullpath(),s=`${i}/`,r=t.relative()||".",n=`${r}/`;for(let a of this.relative)if(a.match(r)||a.match(n))return!0;for(let a of this.absolute)if(a.match(i)||a.match(s))return!0;return!1}childrenIgnored(t){let i=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(s))return!0;for(let r of this.absoluteChildren)if(r.match(i))return!0;return!1}};var us=class e{store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,i){var s;return(s=this.store.get(t.fullpath()))==null?void 0:s.has(i.globString())}storeWalked(t,i){let s=t.fullpath(),r=this.store.get(s);r?r.add(i.globString()):this.store.set(s,new Set([i.globString()]))}},cs=class{store=new Map;add(t,i,s){let r=(i?2:0)|(s?1:0),n=this.store.get(t);this.store.set(t,n===void 0?r:r&n)}entries(){return[...this.store.entries()].map(([t,i])=>[t,!!(i&2),!!(i&1)])}},ls=class{store=new Map;add(t,i){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(r=>r.globString()===i.globString())||s.push(i):this.store.set(t,[i])}get(t){let i=this.store.get(t);if(!i)throw new Error("attempting to walk unknown path");return i}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Ae=class e{hasWalkedCache;matches=new cs;subwalks=new ls;patterns;follow;dot;opts;constructor(t,i){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=i?i.copy():new us}processPatterns(t,i){this.patterns=i;let s=i.map(r=>[t,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let a=n.root(),o=n.isAbsolute()&&this.opts.absolute!==!1;if(a){r=r.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let h,c,l=!1;for(;typeof(h=n.pattern())=="string"&&(c=n.rest());)r=r.resolve(h),n=c,l=!0;if(h=n.pattern(),c=n.rest(),l){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof h=="string"){let f=h===".."||h===""||h===".";this.matches.add(r.resolve(h),o,f);continue}else if(h===$){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let f=c==null?void 0:c.pattern(),p=c==null?void 0:c.rest();if(!c||(f===""||f===".")&&!p)this.matches.add(r,o,f===""||f===".");else if(f===".."){let d=r.parent||r;p?this.hasWalkedCache.hasWalked(d,p)||this.subwalks.add(d,p):this.matches.add(d,o,!0)}}else h instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,i){let s=this.subwalks.get(t),r=this.child();for(let n of i)for(let a of s){let o=a.isAbsolute(),h=a.pattern(),c=a.rest();h===$?r.testGlobstar(n,a,c,o):h instanceof RegExp?r.testRegExp(n,h,c,o):r.testString(n,h,c,o)}return r}testGlobstar(t,i,s,r){if((this.dot||!t.name.startsWith("."))&&(i.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,i):t.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(t,s):i.markFollowGlobstar()&&this.subwalks.add(t,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),r);else if(n===".."){let a=t.parent||t;this.subwalks.add(a,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),r)}}testRegExp(t,i,s,r){i.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}testString(t,i,s,r){t.isNamed(i)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}};var ou=(e,t)=>typeof e=="string"?new re([e],t):Array.isArray(e)?new re(e,t):e,ni=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#n;signal;maxDepth;includeChildMatches;constructor(t,i,s){if(this.patterns=t,this.path=i,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#e=ou(s.ignore??[],s),!this.includeChildMatches&&typeof this.#e.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#s(t){var i,s;return this.seen.has(t)||!!((s=(i=this.#e)==null?void 0:i.ignored)!=null&&s.call(i,t))}#a(t){var i,s;return!!((s=(i=this.#e)==null?void 0:i.childrenIgnored)!=null&&s.call(i,t))}pause(){this.paused=!0}resume(){var i;if((i=this.signal)!=null&&i.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){var i;(i=this.signal)!=null&&i.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,i){if(i&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(n!=null&&n.isSymbolicLink())){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,i)}matchCheckTest(t,i){var s;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!i||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((s=t.realpathCached())!=null&&s.isDirectory()))&&!this.#s(t)?t:void 0}matchCheckSync(t,i){if(i&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(n!=null&&n.isSymbolicLink())){let a=n.realpathSync();a&&(a!=null&&a.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,i)}matchFinish(t,i){var n;if(this.#s(t))return;if(!this.includeChildMatches&&((n=this.#e)!=null&&n.add)){let a=`${t.relativePosix()}/**`;this.#e.add(a)}let s=this.opts.absolute===void 0?i:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let a=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(a+r)}else{let a=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!a.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(a?o+a+r:"."+r)}}async match(t,i,s){let r=await this.matchCheck(t,s);r&&this.matchFinish(r,i)}matchSync(t,i,s){let r=this.matchCheckSync(t,s);r&&this.matchFinish(r,i)}walkCB(t,i,s){var r;(r=this.signal)!=null&&r.aborted&&s(),this.walkCB2(t,i,new Ae(this.opts),s)}walkCB2(t,i,s,r){var o;if(this.#a(t))return r();if((o=this.signal)!=null&&o.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,i,s,r));return}s.processPatterns(t,i);let n=1,a=()=>{--n===0&&r()};for(let[h,c,l]of s.matches.entries())this.#s(h)||(n++,this.match(h,c,l).then(()=>a()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let c=h.readdirCached();h.calledReaddir()?this.walkCB3(h,c,s,a):h.readdirCB((l,f)=>this.walkCB3(h,f,s,a),!0)}a()}walkCB3(t,i,s,r){s=s.filterEntries(t,i);let n=1,a=()=>{--n===0&&r()};for(let[o,h,c]of s.matches.entries())this.#s(o)||(n++,this.match(o,h,c).then(()=>a()));for(let[o,h]of s.subwalks.entries())n++,this.walkCB2(o,h,s.child(),a);a()}walkCBSync(t,i,s){var r;(r=this.signal)!=null&&r.aborted&&s(),this.walkCB2Sync(t,i,new Ae(this.opts),s)}walkCB2Sync(t,i,s,r){var o;if(this.#a(t))return r();if((o=this.signal)!=null&&o.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,i,s,r));return}s.processPatterns(t,i);let n=1,a=()=>{--n===0&&r()};for(let[h,c,l]of s.matches.entries())this.#s(h)||this.matchSync(h,c,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let c=h.readdirSync();this.walkCB3Sync(h,c,s,a)}a()}walkCB3Sync(t,i,s,r){s=s.filterEntries(t,i);let n=1,a=()=>{--n===0&&r()};for(let[o,h,c]of s.matches.entries())this.#s(o)||this.matchSync(o,h,c);for(let[o,h]of s.subwalks.entries())n++,this.walkCB2Sync(o,h,s.child(),a);a()}},Ie=class extends ni{matches=new Set;constructor(t,i,s){super(t,i,s)}matchEmit(t){this.matches.add(t)}async walk(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((i,s)=>{this.walkCB(this.path,this.patterns,()=>{var r;(r=this.signal)!=null&&r.aborted?s(this.signal.reason):i(this.matches)})}),this.matches}walkSync(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var i;if((i=this.signal)!=null&&i.aborted)throw this.signal.reason}),this.matches}},Re=class extends ni{results;constructor(t,i,s){super(t,i,s),this.results=new Dt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var uu=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,i){if(!i)throw new TypeError("glob options required");if(this.withFileTypes=!!i.withFileTypes,this.signal=i.signal,this.follow=!!i.follow,this.dot=!!i.dot,this.dotRelative=!!i.dotRelative,this.nodir=!!i.nodir,this.mark=!!i.mark,i.cwd?(i.cwd instanceof URL||i.cwd.startsWith("file://"))&&(i.cwd=hu(i.cwd)):this.cwd="",this.cwd=i.cwd||"",this.root=i.root,this.magicalBraces=!!i.magicalBraces,this.nobrace=!!i.nobrace,this.noext=!!i.noext,this.realpath=!!i.realpath,this.absolute=i.absolute,this.includeChildMatches=i.includeChildMatches!==!1,this.noglobstar=!!i.noglobstar,this.matchBase=!!i.matchBase,this.maxDepth=typeof i.maxDepth=="number"?i.maxDepth:1/0,this.stat=!!i.stat,this.ignore=i.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(i.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=t,this.platform=i.platform||uu,this.opts={...i,platform:this.platform},i.scurry){if(this.scurry=i.scurry,i.nocase!==void 0&&i.nocase!==i.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=i.platform==="win32"?ee:i.platform==="darwin"?Ce:i.platform?ie:wn;this.scurry=new h(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",r={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new et(h,r)),[a,o]=n.reduce((h,c)=>(h[0].push(...c.set),h[1].push(...c.globParts),h),[[],[]]);this.patterns=a.map((h,c)=>{let l=o[c];if(!l)throw new Error("invalid pattern object");return new se(h,l,0,this.platform)})}async walk(){return[...await new Ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Re(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Re(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var fs=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let i of e)if(new et(i,t).hasMagic())return!0;return!1};function ai(e,t={}){return new xt(e,t).streamSync()}function _n(e,t={}){return new xt(e,t).stream()}function oi(e,t={}){return new xt(e,t).walkSync()}async function Sn(e,t={}){return new xt(e,t).walk()}function hi(e,t={}){return new xt(e,t).iterateSync()}function Cn(e,t={}){return new xt(e,t).iterate()}var cu=ai,lu=Object.assign(_n,{sync:ai}),fu=hi,pu=Object.assign(Cn,{sync:hi}),du=Object.assign(oi,{stream:ai,iterate:hi}),En=Object.assign(Sn,{glob:Sn,globSync:oi,sync:du,globStream:_n,stream:lu,globStreamSync:ai,streamSync:cu,globIterate:Cn,iterate:pu,globIterateSync:hi,iterateSync:fu,Glob:xt,hasMagic:fs,escape:Yt,unescape:dt});En.glob=En;var Rt=class{static get useFileContent(){var t,i;return((i=(t=tt.config.config)==null?void 0:t.idempotency)==null?void 0:i.useFileContent)??!1}static get location(){var t,i;return((i=(t=tt.config.config)==null?void 0:t.idempotency)==null?void 0:i.location)??"./node_modules/.cache/bsm/idempotency"}static updateHashForFile(t,i){try{if(this.useFileContent){let s=$t.readFileSync(i);t.update(s)}else{let s=$t.lstatSync(i);t.update(s.ctimeMs.toString()),t.update(s.mtimeMs.toString())}}catch{}}static updateHashForDir(t,i){try{$t.readdirSync(i,{withFileTypes:!0,recursive:!0}).forEach(s=>{if(s.name==null)return;let r=An.join(s.parentPath??s.path??i,s.name).replace(/\\/g,"/");t.update(r),s.isFile()&&this.updateHashForFile(t,r)})}catch{}}static updateHashForGlob(t,i){try{let s=oi(i,{withFileTypes:!0});for(let r of s){let n=An.relative(process.cwd(),r.fullpath());r.isFile()?this.updateHashForFile(t,n):this.updateHashForDir(t,n)}}catch{}}static calculateIdempotencyHash(t,i){var n;let s=[];if(Array.isArray(t))s.push(...t);else if(typeof t=="string")s.push(t);else for(let a of Object.values(t))Array.isArray(a)?s.push(...a):s.push(a);let r=mu("sha256");for(let a of s){let o=a.split(":")[0],h=a.substring(o.length+1);switch(o){case"static":r.update(h);break;case"env":r.update(h),r.update(((n=i==null?void 0:i.env)==null?void 0:n[h])??process.env[h]??Buffer.of());break;case"file":this.updateHashForFile(r,h);break;case"dir":this.updateHashForDir(r,h);break;case"glob":this.updateHashForGlob(r,h);break;default:I.log(`\x1B[33m[Idempotency]\x1B[0m Unknown type: ${o}, using value as static`),r.update(a)}}return r.digest("hex")}static getFileName(t){let i=t.join(".");return`${this.location}/${i}.hash`.replaceAll("*","__all__")}static saveIdempotencyHash(t,i){$t.mkdirSync(this.location,{recursive:!0}),$t.writeFileSync(this.getFileName(i),t)}static getSavedIdempotencyHash(t){let i=this.getFileName(t);if($t.existsSync(i))return $t.readFileSync(i,"utf-8")}static checkIdempotency(t,i,s){let r=t.$idempotency,n=this.calculateIdempotencyHash(r,s);return this.getSavedIdempotencyHash(i)===n}static saveIdempotency(t,i){let s=t.$idempotency,r=this.calculateIdempotencyHash(s);this.saveIdempotencyHash(r,i)}static hasIdempotencyEnabled(t){return process.env.BSM_DISABLE_IDEMPOTENCY==="true"||!Object.hasOwn(t,"$idempotency")?!1:Object.hasOwn(t,"$idempotencyEnabled")?!!t.$idempotencyEnabled:!0}};var Ft=class extends Error{constructor(i,s){super();this.code=i;this.script=s}},ne=class extends Ft{constructor(i,s){super(1,s);this.func=i;this.script=s}};var Mt=class e{static async run(t){let i=tt.config;await e.runScript(i.scripts,t.split("."),[],{})}static async runScript(t,i,s,r){typeof t=="function"?await e.executeFunction(t,i,s,r):typeof t=="string"?await e.executeString(t,i,s,r):typeof t=="object"?Array.isArray(t)?await e.executeArray(t,i,s,r):await e.executeObject(t,i,s,r):await e.notFound(s,r)}static async notFound(t,i,s){var r;if(!i.ignoreNotFound){if(s){let n=t[t.length-1],a=t.slice(0,-1);if(a.length===0?I.error(`\x1B[31mScript '${n}' does not exist\x1B[0m`):I.error(`\x1B[31mScript '${a.join(".")}' does not have a '${n}' script\x1B[0m`),((r=tt.config.config)==null?void 0:r.defaultHelpBehavior)==="interactive"){let o=await Wt.selectScript(tt.config,{_:[t.join(".")]});await this.run(o[0]),process.exit(0)}else I.log(),Object.hasOwn(s,"$description")&&(lt.printCommand(s,a),I.log()),I.log("\x1B[1mTry one of the following:\x1B[0m"),lt.printCommands(s,a,!1)}else I.error(`\x1B[31mScript '${t.join(".")}' not found\x1B[0m`);process.exit(127)}}static async executeFunction(t,i,s,r){var o;I.log(`> \x1B[93mExecuting JavaScript function\x1B[0m \x1B[90m(${[...s].join(".")})\x1B[0m`);let n,a=process.env;try{process.env={...process.env,...r.env},n=await t.call(null,process.argv)}catch(h){throw h instanceof Error&&(h.stack=(o=h.stack)==null?void 0:o.split(" at executeFunction")[0]),new ne(h,s.join("."))}finally{process.env=a}if(n==null){i.length>0&&await e.notFound([...s,...i],r);return}await e.runScript(n,i,s,{...r,excludeArgs:!0})}static async executeString(t,i,s,r){if(i.length>0){await e.notFound([...s,...i],r);return}!r.excludeArgs&&process.argv.length&&(t+=" "+process.argv.join(" ")),I.log(`> ${t} \x1B[90m(${s.join(".")})\x1B[0m`),process.env.BSM_LOG_FILE&&ps.appendFileSync(process.env.BSM_LOG_FILE,`${new Date().toISOString()} ${t} ${s.join(".")} ${process.cwd()}
17
- `),t!==""&&(t=t.replace(/bsm ~/g,"bsm \\~"),await new Promise((n,a)=>{gu.spawn(t,[],{stdio:"inherit",shell:!0,env:{...process.env,...r.env,BSM_PATH:s.slice(0,-1).join("."),BSM_SCRIPT:s.join(".")}}).on("close",h=>{h===0?n():a(new Ft(h,s.join(".")))})}))}static async executeArray(t,i,s,r){if(i.length===0||i[0]==="*")for(let n=0;n<t.length;n++)await e.runScript(t[n],i.slice(1),[...s,n.toString()],{...r,ignoreNotFound:i[0]==="*"?!0:r.ignoreNotFound});else{let n=i[0],a=e.subscript(t,n);if(a)await e.runScript(a[1],i.slice(1),[...s,a[0]],r);else{await e.notFound([...s,n],r,t);return}}}static shouldRun(t,i,s,r){return Rt.hasIdempotencyEnabled(t)&&Rt.checkIdempotency(t,[...s,...i],r)?(I.log(`\x1B[90mNot running ${[...s,...i].join(".")} because the idempotency hash is the same\x1B[0m`),!1):!0}static async executeObject(t,i,s,r){try{if(Object.hasOwn(t,"$env")&&(r.env={...r.env,...e.getEnv(t.$env)}),!e.shouldRun(t,i,s,r))return;if(await e.executeHook(t,"_pre",s,r),i.length===0)await e.runObject(t,s,r);else if(i[0]==="*")for(let n in t)n.startsWith("_")||n.startsWith("$")||Object.hasOwn(t,n)&&await e.runScript(t[n],i.slice(1),[...s,n],{...r,ignoreNotFound:!0});else{let n=i[0],a=e.subscript(t,n);if(a)await e.runScript(a[1],i.slice(1),[...s,a[0]],r);else{await e.notFound([...s,n],r,t);return}}await e.executeHook(t,"_post",s,r),Rt.hasIdempotencyEnabled(t)&&Rt.saveIdempotency(t,[...s,...i])}catch(n){if(n instanceof Ft?process.env.BSM_ERROR=n.code.toString():process.env.BSM_ERROR="1",await e.executeHook(t,"_onError",s,r),!await e.executeHook(t,"_catch",s,r))throw n;Rt.hasIdempotencyEnabled(t)&&Rt.saveIdempotency(t,[...s,...i])}finally{await e.executeHook(t,"_finally",s,r)}}static subscript(t,i,s=!0){if(typeof t=="object"&&(Object.hasOwn(t,i)||(i=function(){var n;if((n=tt.config.config)!=null&&n.caseInsensitive){let a=Object.keys(t).find(o=>o.toLowerCase()===i.toLowerCase());if(a)return a}if(s){let a=e.resolveAlias(t,i);if(a)return a}}()??i),!!Object.hasOwn(t,i)))if(Array.isArray(t)){let r=parseInt(i);return[i,t[r]]}else return[i,t[i]]}static resolveAlias(t,i){var s;for(let[r,n]of Object.entries(t)){if(typeof n!="object"||Array.isArray(n)||!Object.hasOwn(n,"$alias"))continue;let a=e.getAliases(n.$alias);if(a.includes(i)||(s=tt.config.config)!=null&&s.caseInsensitive&&a.map(o=>o.toLowerCase()).includes(i.toLowerCase()))return r}}static getAliases(t){return typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(e.getAliases):(I.error(`\x1B[31mAlias with type ${typeof t} is not supported\x1B[0m`),[])}static getEnv(t){if(typeof t=="string"){if(t==="")return{};if(t.startsWith("file:")){let i=xu.join(process.cwd(),t.slice(5));if(!ps.existsSync(i))return I.error(`\x1B[31mFile '${i}' does not exist\x1B[0m
14
+ Default "index" lookups for the main are deprecated for ES modules.`,"DeprecationWarning","DEP0151")}function Tr(e){try{return ji(e)}catch{}}function Oi(e){let t=ji(e,{throwIfNoEntry:!1}),i=t?t.isFile():void 0;return i??!1}function uo(e,t,i){let s;if(t.main!==void 0){if(s=new B(t.main,e),Oi(s))return s;let a=[`./${t.main}.js`,`./${t.main}.json`,`./${t.main}.node`,`./${t.main}/index.js`,`./${t.main}/index.json`,`./${t.main}/index.node`],o=-1;for(;++o<a.length&&(s=new B(a[o],e),!Oi(s));)s=void 0;if(s)return wr(s,e,i,t.main),s}let r=["./index.js","./index.json","./index.node"],n=-1;for(;++n<r.length&&(s=new B(r[n],e),!Oi(s));)s=void 0;if(s)return wr(s,e,i,t.main),s;throw new Gi(N(new B(".",e)),N(i))}function co(e,t,i){if(oo.exec(e.pathname)!==null)throw new We(e.pathname,'must not include encoded "/" or "\\" characters',N(t));let s;try{s=N(e)}catch(n){let a=n;throw Object.defineProperty(a,"input",{value:String(e)}),Object.defineProperty(a,"module",{value:String(t)}),a}let r=Tr(s.endsWith("/")?s.slice(-1):s);if(r&&r.isDirectory()){let n=new no(s,N(t));throw n.url=String(e),n}if(!r||!r.isFile()){let n=new Gi(s||e.pathname,t&&N(t),!0);throw n.url=String(e),n}{let n=Da(s),{search:a,hash:o}=e;e=$e(n+(s.endsWith($i.sep)?"/":"")),e.search=a,e.hash=o}return e}function lo(e,t,i){return new so(e,t&&N(new B(".",t)),N(i))}function Li(e,t,i){return new ro(N(new B(".",t)),e,i&&N(i))}function fo(e,t,i,s,r){let n=`request is not a valid match in pattern "${t}" for the "${s?"imports":"exports"}" resolution of ${N(i)}`;throw new We(e,n,r&&N(r))}function le(e,t,i,s,r){return t=typeof t=="object"&&t!==null?JSON.stringify(t,null,""):`${t}`,new io(N(new B(".",i)),e,t,s,r&&N(r))}function po(e,t,i,s,r,n,a,o,h){if(t!==""&&!n&&e[e.length-1]!=="/")throw le(i,e,s,a,r);if(!e.startsWith("./")){if(a&&!e.startsWith("../")&&!e.startsWith("/")){let p=!1;try{new B(e),p=!0}catch{}if(!p){let d=n?Ue.call(je,e,()=>t):e+t;return Pr(d,s,h)}}throw le(i,e,s,a,r)}if(xr.exec(e.slice(2))!==null)if(yr.exec(e.slice(2))===null){if(!o){let p=n?i.replace("*",()=>t):i+t,d=n?Ue.call(je,e,()=>t):e;vr(d,p,i,s,a,r,!0)}}else throw le(i,e,s,a,r);let c=new B(e,s),l=c.pathname,f=new B(".",s).pathname;if(!l.startsWith(f))throw le(i,e,s,a,r);if(t==="")return c;if(xr.exec(t)!==null){let p=n?i.replace("*",()=>t):i+t;if(yr.exec(t)===null){if(!o){let d=n?Ue.call(je,e,()=>t):e;vr(d,p,i,s,a,r,!1)}}else fo(p,i,s,a,r)}return n?new B(Ue.call(je,c.href,()=>t)):new B(t,c)}function mo(e){let t=Number(e);return`${t}`!==e?!1:t>=0&&t<4294967295}function Kt(e,t,i,s,r,n,a,o,h){if(typeof t=="string")return po(t,i,s,e,r,n,a,o,h);if(Array.isArray(t)){let c=t;if(c.length===0)return null;let l,f=-1;for(;++f<c.length;){let p=c[f],d;try{d=Kt(e,p,i,s,r,n,a,o,h)}catch(x){let m=x;if(l=m,m.code==="ERR_INVALID_PACKAGE_TARGET")continue;throw x}if(d!==void 0){if(d===null){l=null;continue}return d}}if(l==null)return null;throw l}if(typeof t=="object"&&t!==null){let c=Object.getOwnPropertyNames(t),l=-1;for(;++l<c.length;){let f=c[l];if(mo(f))throw new Ir(N(e),r,'"exports" cannot contain numeric property keys.')}for(l=-1;++l<c.length;){let f=c[l];if(f==="default"||h&&h.has(f)){let p=t[f],d=Kt(e,p,i,s,r,n,a,o,h);if(d===void 0)continue;return d}}return null}if(t===null)return null;throw le(s,t,e,a,r)}function go(e,t,i){if(typeof e=="string"||Array.isArray(e))return!0;if(typeof e!="object"||e===null)return!1;let s=Object.getOwnPropertyNames(e),r=!1,n=0,a=-1;for(;++a<s.length;){let o=s[a],h=o===""||o[0]!==".";if(n++===0)r=h;else if(r!==h)throw new Ir(N(t),i,`"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.`)}return r}function xo(e,t,i){if(Vt.noDeprecation)return;let s=N(t);br.has(s+"|"+e)||(br.add(s+"|"+e),Vt.emitWarning(`Use of deprecated trailing slash pattern mapping "${e}" in the "exports" field module resolution of the package at ${s}${i?` imported from ${N(i)}`:""}. Mapping specifiers ending in "/" is no longer supported.`,"DeprecationWarning","DEP0155"))}function Sr(e,t,i,s,r){let n=i.exports;if(go(n,e,s)&&(n={".":n}),Rr.call(n,t)&&!t.includes("*")&&!t.endsWith("/")){let l=n[t],f=Kt(e,l,"",t,s,!1,!1,!1,r);if(f==null)throw Li(t,e,s);return f}let a="",o="",h=Object.getOwnPropertyNames(n),c=-1;for(;++c<h.length;){let l=h[c],f=l.indexOf("*");if(f!==-1&&t.startsWith(l.slice(0,f))){t.endsWith("/")&&xo(t,e,s);let p=l.slice(f+1);t.length>=l.length&&t.endsWith(p)&&kr(a,l)===1&&l.lastIndexOf("*")===f&&(a=l,o=t.slice(f,t.length-p.length))}}if(a){let l=n[a],f=Kt(e,l,o,a,s,!0,!1,t.endsWith("/"),r);if(f==null)throw Li(t,e,s);return f}throw Li(t,e,s)}function kr(e,t){let i=e.indexOf("*"),s=t.indexOf("*"),r=i===-1?e.length:i+1,n=s===-1?t.length:s+1;return r>n?-1:n>r||i===-1?1:s===-1||e.length>t.length?-1:t.length>e.length?1:0}function yo(e,t,i){if(e==="#"||e.startsWith("#/")||e.endsWith("/")){let n="is not a valid internal imports specifier name";throw new We(e,n,N(t))}let s,r=Wi(t);if(r.exists){s=$e(r.pjsonPath);let n=r.imports;if(n)if(Rr.call(n,e)&&!e.includes("*")){let a=Kt(s,n[e],"",e,t,!1,!0,!1,i);if(a!=null)return a}else{let a="",o="",h=Object.getOwnPropertyNames(n),c=-1;for(;++c<h.length;){let l=h[c],f=l.indexOf("*");if(f!==-1&&e.startsWith(l.slice(0,-1))){let p=l.slice(f+1);e.length>=l.length&&e.endsWith(p)&&kr(a,l)===1&&l.lastIndexOf("*")===f&&(a=l,o=e.slice(f,e.length-p.length))}}if(a){let l=n[a],f=Kt(s,l,o,a,t,!0,!0,!1,i);if(f!=null)return f}}}throw lo(e,s,t)}function bo(e,t){let i=e.indexOf("/"),s=!0,r=!1;e[0]==="@"&&(r=!0,i===-1||e.length===0?s=!1:i=e.indexOf("/",i+1));let n=i===-1?e:e.slice(0,i);if(ao.exec(n)!==null&&(s=!1),!s)throw new We(e,"is not a valid package name",N(t));let a="."+(i===-1?"":e.slice(i));return{packageName:n,packageSubpath:a,isScoped:r}}function Pr(e,t,i){if(Ui.includes(e))return new B("node:"+e);let{packageName:s,packageSubpath:r,isScoped:n}=bo(e,t),a=Wi(t);if(a.exists){let l=$e(a.pjsonPath);if(a.name===s&&a.exports!==void 0&&a.exports!==null)return Sr(l,r,a,t,i)}let o=new B("./node_modules/"+s+"/package.json",t),h=N(o),c;do{let l=Tr(h.slice(0,-13));if(!l||!l.isDirectory()){c=h,o=new B((n?"../../../../node_modules/":"../../../node_modules/")+s+"/package.json",o),h=N(o);continue}let f=Ar(h,{base:t,specifier:e});return f.exports!==void 0&&f.exports!==null?Sr(o,r,f,t,i):r==="."?uo(o,f,t):new B(r,o)}while(h.length!==c.length);throw new Gi(s,N(t),!1)}function vo(e){return e[0]==="."&&(e.length===1||e[1]==="/"||e[1]==="."&&(e.length===2||e[2]==="/"))}function wo(e){return e===""?!1:e[0]==="/"?!0:vo(e)}function So(e,t,i,s){let r=t.protocol,a=r==="data:"||r==="http:"||r==="https:",o;if(wo(e))try{o=new B(e,t)}catch(h){let c=new gr(e,t);throw c.cause=h,c}else if(r==="file:"&&e[0]==="#")o=yo(e,t,i);else try{o=new B(e)}catch(h){if(a&&!Ui.includes(e)){let c=new gr(e,t);throw c.cause=h,c}o=Pr(e,t,i)}return Nt(o!==void 0,"expected to be defined"),o.protocol!=="file:"?o:co(o,t)}function Vi(e){return typeof e=="string"&&!e.startsWith("file://")?Mi(e):Mi(N(e))}function Di(e){return $e(Vi(e)).toString()}function Eo(e){return typeof e!="string"&&(e=e.toString()),/(?:node|data|http|https|file):/.test(e)?e:_r.has(e)?"node:"+e:"file://"+encodeURI(Mi(e))}var _o=new Set(["node","import"]),Co=[".mjs",".cjs",".js",".json"],Ao=new Set(["ERR_MODULE_NOT_FOUND","ERR_UNSUPPORTED_DIR_IMPORT","MODULE_NOT_FOUND","ERR_PACKAGE_PATH_NOT_EXPORTED"]);function Er(e,t,i){try{return So(e,t,i)}catch(s){if(!Ao.has(s==null?void 0:s.code))throw s}}function Io(e,t={}){if(typeof e!="string")if(e instanceof URL)e=Vi(e);else throw new TypeError("input must be a `string` or `URL`");if(/(?:node|data|http|https):/.test(e))return e;if(_r.has(e))return"node:"+e;if(e.startsWith("file://")&&(e=Vi(e)),Pi(e))try{if(ji(e).isFile())return Di(e)}catch(a){if((a==null?void 0:a.code)!=="ENOENT")throw a}let i=t.conditions?new Set(t.conditions):_o,s=(Array.isArray(t.url)?t.url:[t.url]).filter(Boolean).map(a=>new URL(Eo(a.toString())));s.length===0&&s.push(new URL(Di(process.cwd())));let r=[...s];for(let a of s)a.protocol==="file:"&&r.push(new URL("./",a),new URL(ki(a.pathname,"_index.js"),a),new URL("node_modules",a));let n;for(let a of r){if(n=Er(e,a,i),n)break;for(let o of["","/index"]){for(let h of t.extensions||Co)if(n=Er(ki(e,o)+h,a,i),n)break;if(n)break}if(n)break}if(!n){let a=new Error(`Cannot find module ${e} imported from ${r.join(", ")}`);throw a.code="ERR_MODULE_NOT_FOUND",a}return Di(n)}function Ro(e,t){return Io(e,t)}function Nr(e,t){try{return Promise.resolve(Ro(e,t))}catch(i){return Promise.reject(i)}}var ko=Object.freeze({scripts:{},config:{defaultHelpBehavior:"help",caseInsensitive:!1,idempotency:{location:"./node_modules/.cache/bsm/idempotency",useFileContent:!1}}}),tt=class{static getSource(t){return Array.isArray(t)?t[0]:t}static async loadExtensions(t){return!Object.hasOwn(t,"extends")||!t.extends?[]:(await Promise.all([...t.extends].map(i=>this.loadFile(i,!1)))).filter(i=>i!==void 0)}static interopDefault(t){return typeof t!="object"||t===null?t:"default"in t?t.default:t}static async loadFile(t,i=!0){if(!t)return;let s=this.getSource(t);try{s=await Nr(s,{url:process.cwd()+"/"})}catch{if(i)return;A.error(`\x1B[31mCannot find config '${s}' to extend\x1B[0m`),process.exit(1)}try{let r=this.interopDefault(await import(s));typeof r=="function"&&(r=await r(...Array.isArray(t)?t.slice(1):[]));let n=await this.loadExtensions(r);return _s(r,...n,ko)}catch(r){A.error(r),Array.isArray(t)&&(t=t[0]),A.error(`\x1B[31mError loading config '${t}'\x1B[0m`),process.exit(1)}}static async load(t){let i=[t.config,process.env.BSM_CONFIG,"./package.scripts.js","./package.scripts.cjs","./package.scripts.mjs","./package.scripts.json"].filter(s=>s!==void 0);for(let s of i){let r=await this.loadFile(s);if(r)return process.env.BSM_CONFIG=s,this._config=r,r}A.error(`\x1B[31mCannot find config ${i.map(s=>`'${s}'`).join(" or ")}\x1B[0m`),process.exit(1)}static _config;static get config(){if(this._config)return this._config;throw new Error("Config not loaded")}};import{createHash as mu}from"node:crypto";import $t from"fs";import Cn from"path";var zi=(e,t,i)=>{let s=e instanceof RegExp?Or(e,i):e,r=t instanceof RegExp?Or(t,i):t,n=s!==null&&r!=null&&Po(s,r,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+r.length)}},Or=(e,t)=>{let i=t.match(e);return i?i[0]:null},Po=(e,t,i)=>{let s,r,n,a,o,h=i.indexOf(e),c=i.indexOf(t,h+1),l=h;if(h>=0&&c>0){if(e===t)return[h,c];for(s=[],n=i.length;l>=0&&!o;){if(l===h)s.push(l),h=i.indexOf(e,l+1);else if(s.length===1){let f=s.pop();f!==void 0&&(o=[f,c])}else r=s.pop(),r!==void 0&&r<n&&(n=r,a=c),c=i.indexOf(t,l+1);l=h<c&&h>=0?h:c}s.length&&a!==void 0&&(o=[n,a])}return o};var Lr="\0SLASH"+Math.random()+"\0",Dr="\0OPEN"+Math.random()+"\0",qi="\0CLOSE"+Math.random()+"\0",Fr="\0COMMA"+Math.random()+"\0",Mr="\0PERIOD"+Math.random()+"\0",No=new RegExp(Lr,"g"),Oo=new RegExp(Dr,"g"),Lo=new RegExp(qi,"g"),Do=new RegExp(Fr,"g"),Fo=new RegExp(Mr,"g"),Mo=/\\\\/g,Bo=/\\{/g,Vo=/\\}/g,Uo=/\\,/g,jo=/\\./g;function Hi(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function $o(e){return e.replace(Mo,Lr).replace(Bo,Dr).replace(Vo,qi).replace(Uo,Fr).replace(jo,Mr)}function Wo(e){return e.replace(No,"\\").replace(Oo,"{").replace(Lo,"}").replace(Do,",").replace(Fo,".")}function Br(e){if(!e)return[""];let t=[],i=zi("{","}",e);if(!i)return e.split(",");let{pre:s,body:r,post:n}=i,a=s.split(",");a[a.length-1]+="{"+r+"}";let o=Br(n);return n.length&&(a[a.length-1]+=o.shift(),a.push.apply(a,o)),t.push.apply(t,a),t}function Vr(e){return e?(e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),fe($o(e),!0).map(Wo)):[]}function Go(e){return"{"+e+"}"}function zo(e){return/^-?0\d/.test(e)}function Ho(e,t){return e<=t}function qo(e,t){return e>=t}function fe(e,t){let i=[],s=zi("{","}",e);if(!s)return[e];let r=s.pre,n=s.post.length?fe(s.post,!1):[""];if(/\$$/.test(s.pre))for(let a=0;a<n.length;a++){let o=r+"{"+s.body+"}"+n[a];i.push(o)}else{let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),h=a||o,c=s.body.indexOf(",")>=0;if(!h&&!c)return s.post.match(/,(?!,).*\}/)?(e=s.pre+"{"+s.body+qi+s.post,fe(e)):[e];let l;if(h)l=s.body.split(/\.\./);else if(l=Br(s.body),l.length===1&&l[0]!==void 0&&(l=fe(l[0],!1).map(Go),l.length===1))return n.map(p=>s.pre+l[0]+p);let f;if(h&&l[0]!==void 0&&l[1]!==void 0){let p=Hi(l[0]),d=Hi(l[1]),x=Math.max(l[0].length,l[1].length),m=l.length===3&&l[2]!==void 0?Math.abs(Hi(l[2])):1,S=Ho;d<p&&(m*=-1,S=qo);let E=l.some(zo);f=[];for(let b=p;S(b,d);b+=m){let g;if(o)g=String.fromCharCode(b),g==="\\"&&(g="");else if(g=String(b),E){let _=x-g.length;if(_>0){let L=new Array(_+1).join("0");b<0?g="-"+L+g.slice(1):g=L+g}}f.push(g)}}else{f=[];for(let p=0;p<l.length;p++)f.push.apply(f,fe(l[p],!1))}for(let p=0;p<f.length;p++)for(let d=0;d<n.length;d++){let x=r+f[p]+n[d];(!t||h||x)&&i.push(x)}}return i}var pe=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>65536)throw new TypeError("pattern is too long")};var Ko={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},de=e=>e.replace(/[[\]\\-]/g,"\\$&"),Qo=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ur=e=>e.join(""),jr=(e,t)=>{let i=t;if(e.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=i+1,a=!1,o=!1,h=!1,c=!1,l=i,f="";t:for(;n<e.length;){let m=e.charAt(n);if((m==="!"||m==="^")&&n===i+1){c=!0,n++;continue}if(m==="]"&&a&&!h){l=n+1;break}if(a=!0,m==="\\"&&!h){h=!0,n++;continue}if(m==="["&&!h){for(let[S,[y,E,b]]of Object.entries(Ko))if(e.startsWith(S,n)){if(f)return["$.",!1,e.length-i,!0];n+=S.length,b?r.push(y):s.push(y),o=o||E;continue t}}if(h=!1,f){m>f?s.push(de(f)+"-"+de(m)):m===f&&s.push(de(m)),f="",n++;continue}if(e.startsWith("-]",n+1)){s.push(de(m+"-")),n+=2;continue}if(e.startsWith("-",n+1)){f=m,n+=2;continue}s.push(de(m)),n++}if(l<n)return["",!1,0,!1];if(!s.length&&!r.length)return["$.",!1,e.length-i,!0];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!c){let m=s[0].length===2?s[0].slice(-1):s[0];return[Qo(m),!1,l-i,!1]}let p="["+(c?"^":"")+Ur(s)+"]",d="["+(c?"":"^")+Ur(r)+"]";return[s.length&&r.length?"("+p+"|"+d+")":s.length?p:d,o,l-i,!0]};var dt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:i=!0}={})=>i?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var Yo=new Set(["!","?","+","*","@"]),$r=e=>Yo.has(e),Xo="(?!(?:^|/)\\.\\.?(?:$|/))",Ge="(?!\\.)",Zo=new Set(["[","."]),Jo=new Set(["..","."]),th=new Set("().*{}+?[]^$\\!"),eh=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ki="[^/]",Wr=Ki+"*?",Gr=Ki+"+?",Qt=class e{type;#t;#e;#n=!1;#r=[];#a;#v;#y;#c=!1;#o;#f;#l=!1;constructor(t,i,s={}){this.type=t,t&&(this.#e=!0),this.#a=i,this.#t=this.#a?this.#a.#t:this,this.#o=this.#t===this?s:this.#t.#o,this.#y=this.#t===this?[]:this.#t.#y,t==="!"&&!this.#t.#c&&this.#y.push(this),this.#v=this.#a?this.#a.#r.length:0}get hasMagic(){if(this.#e!==void 0)return this.#e;for(let t of this.#r)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#r.map(t=>String(t)).join("|")+")":this.#f=this.#r.map(t=>String(t)).join("")}#h(){if(this!==this.#t)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let t;for(;t=this.#y.pop();){if(t.type!=="!")continue;let i=t,s=i.#a;for(;s;){for(let r=i.#v+1;!s.type&&r<s.#r.length;r++)for(let n of t.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#r[r])}i=s,s=i.#a}}return this}push(...t){for(let i of t)if(i!==""){if(typeof i!="string"&&!(i instanceof e&&i.#a===this))throw new Error("invalid part: "+i);this.#r.push(i)}}toJSON(){var i;let t=this.type===null?this.#r.slice().map(s=>typeof s=="string"?s:s.toJSON()):[this.type,...this.#r.map(s=>s.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#c&&((i=this.#a)==null?void 0:i.type)==="!")&&t.push({}),t}isStart(){var i;if(this.#t===this)return!0;if(!((i=this.#a)!=null&&i.isStart()))return!1;if(this.#v===0)return!0;let t=this.#a;for(let s=0;s<this.#v;s++){let r=t.#r[s];if(!(r instanceof e&&r.type==="!"))return!1}return!0}isEnd(){var i,s,r;if(this.#t===this||((i=this.#a)==null?void 0:i.type)==="!")return!0;if(!((s=this.#a)!=null&&s.isEnd()))return!1;if(!this.type)return(r=this.#a)==null?void 0:r.isEnd();let t=this.#a?this.#a.#r.length:0;return this.#v===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let i=new e(this.type,t);for(let s of this.#r)i.copyIn(s);return i}static#i(t,i,s,r){let n=!1,a=!1,o=-1,h=!1;if(i.type===null){let d=s,x="";for(;d<t.length;){let m=t.charAt(d++);if(n||m==="\\"){n=!n,x+=m;continue}if(a){d===o+1?(m==="^"||m==="!")&&(h=!0):m==="]"&&!(d===o+2&&h)&&(a=!1),x+=m;continue}else if(m==="["){a=!0,o=d,h=!1,x+=m;continue}if(!r.noext&&$r(m)&&t.charAt(d)==="("){i.push(x),x="";let S=new e(m,i);d=e.#i(t,S,d,r),i.push(S);continue}x+=m}return i.push(x),d}let c=s+1,l=new e(null,i),f=[],p="";for(;c<t.length;){let d=t.charAt(c++);if(n||d==="\\"){n=!n,p+=d;continue}if(a){c===o+1?(d==="^"||d==="!")&&(h=!0):d==="]"&&!(c===o+2&&h)&&(a=!1),p+=d;continue}else if(d==="["){a=!0,o=c,h=!1,p+=d;continue}if($r(d)&&t.charAt(c)==="("){l.push(p),p="";let x=new e(d,l);l.push(x),c=e.#i(t,x,c,r);continue}if(d==="|"){l.push(p),p="",f.push(l),l=new e(null,i);continue}if(d===")")return p===""&&i.#r.length===0&&(i.#l=!0),l.push(p),p="",i.push(...f,l),c;p+=d}return i.type=null,i.#e=void 0,i.#r=[t.substring(s-1)],c}static fromGlob(t,i={}){let s=new e(null,void 0,i);return e.#i(t,s,0,i),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let t=this.toString(),[i,s,r,n]=this.toRegExpSource();if(!(r||this.#e||this.#o.nocase&&!this.#o.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return s;let o=(this.#o.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:t})}get options(){return this.#o}toRegExpSource(t){var h;let i=t??!!this.#o.dot;if(this.#t===this&&this.#h(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#r.some(x=>typeof x!="string"),l=this.#r.map(x=>{let[m,S,y,E]=typeof x=="string"?e.#w(x,this.#e,c):x.toRegExpSource(t);return this.#e=this.#e||y,this.#n=this.#n||E,m}).join(""),f="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Jo.has(this.#r[0]))){let m=Zo,S=i&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),y=!i&&!t&&m.has(l.charAt(0));f=S?Xo:y?Ge:""}let p="";return this.isEnd()&&this.#t.#c&&((h=this.#a)==null?void 0:h.type)==="!"&&(p="(?:$|\\/)"),[f+l+p,dt(l),this.#e=!!this.#e,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#d(i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#r=[c],this.type=null,this.#e=void 0,[c,dt(this.toString()),!1,!1]}let a=!s||t||i||!Ge?"":this.#d(!0);a===n&&(a=""),a&&(n=`(?:${n})(?:${a})*?`);let o="";if(this.type==="!"&&this.#l)o=(this.isStart()&&!i?Ge:"")+Gr;else{let c=this.type==="!"?"))"+(this.isStart()&&!i&&!t?Ge:"")+Wr+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;o=r+n+c}return[o,dt(n),this.#e=!!this.#e,this.#n]}#d(t){return this.#r.map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,r,n,a]=i.toRegExpSource(t);return this.#n=this.#n||a,s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#w(t,i,s=!1){let r=!1,n="",a=!1;for(let o=0;o<t.length;o++){let h=t.charAt(o);if(r){r=!1,n+=(th.has(h)?"\\":"")+h;continue}if(h==="\\"){o===t.length-1?n+="\\\\":r=!0;continue}if(h==="["){let[c,l,f,p]=jr(t,o);if(f){n+=c,a=a||l,o+=f-1,i=i||p;continue}}if(h==="*"){n+=s&&t==="*"?Gr:Wr,i=!0;continue}if(h==="?"){n+=Ki,i=!0;continue}n+=eh(h)}return[n,dt(t),!!i,a]}};var Yt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:i=!1}={})=>i?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");var Y=(e,t,i={})=>(pe(t),!i.nocomment&&t.charAt(0)==="#"?!1:new et(t,i).match(e)),ih=/^\*+([^+@!?\*\[\(]*)$/,sh=e=>t=>!t.startsWith(".")&&t.endsWith(e),rh=e=>t=>t.endsWith(e),nh=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),ah=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),oh=/^\*+\.\*+$/,hh=e=>!e.startsWith(".")&&e.includes("."),uh=e=>e!=="."&&e!==".."&&e.includes("."),ch=/^\.\*+$/,lh=e=>e!=="."&&e!==".."&&e.startsWith("."),fh=/^\*+$/,ph=e=>e.length!==0&&!e.startsWith("."),dh=e=>e.length!==0&&e!=="."&&e!=="..",mh=/^\?+([^+@!?\*\[\(]*)?$/,gh=([e,t=""])=>{let i=qr([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},xh=([e,t=""])=>{let i=Kr([e]);return t?(t=t.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(t)):i},yh=([e,t=""])=>{let i=Kr([e]);return t?s=>i(s)&&s.endsWith(t):i},bh=([e,t=""])=>{let i=qr([e]);return t?s=>i(s)&&s.endsWith(t):i},qr=([e])=>{let t=e.length;return i=>i.length===t&&!i.startsWith(".")},Kr=([e])=>{let t=e.length;return i=>i.length===t&&i!=="."&&i!==".."},Qr=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",zr={win32:{sep:"\\"},posix:{sep:"/"}},vh=Qr==="win32"?zr.win32.sep:zr.posix.sep;Y.sep=vh;var W=Symbol("globstar **");Y.GLOBSTAR=W;var wh="[^/]",Sh=wh+"*?",Eh="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",_h="(?:(?!(?:\\/|^)\\.).)*?",Ch=(e,t={})=>i=>Y(i,e,t);Y.filter=Ch;var ht=(e,t={})=>Object.assign({},e,t),Ah=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return Y;let t=Y;return Object.assign((s,r,n={})=>t(s,r,ht(e,n)),{Minimatch:class extends t.Minimatch{constructor(r,n={}){super(r,ht(e,n))}static defaults(r){return t.defaults(ht(e,r)).Minimatch}},AST:class extends t.AST{constructor(r,n,a={}){super(r,n,ht(e,a))}static fromGlob(r,n={}){return t.AST.fromGlob(r,ht(e,n))}},unescape:(s,r={})=>t.unescape(s,ht(e,r)),escape:(s,r={})=>t.escape(s,ht(e,r)),filter:(s,r={})=>t.filter(s,ht(e,r)),defaults:s=>t.defaults(ht(e,s)),makeRe:(s,r={})=>t.makeRe(s,ht(e,r)),braceExpand:(s,r={})=>t.braceExpand(s,ht(e,r)),match:(s,r,n={})=>t.match(s,r,ht(e,n)),sep:t.sep,GLOBSTAR:W})};Y.defaults=Ah;var Yr=(e,t={})=>(pe(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:Vr(e));Y.braceExpand=Yr;var Ih=(e,t={})=>new et(e,t).makeRe();Y.makeRe=Ih;var Rh=(e,t,i={})=>{let s=new et(t,i);return e=e.filter(r=>s.match(r)),s.options.nonull&&!e.length&&e.push(t),e};Y.match=Rh;var Hr=/[?*]|[+@!]\(.*?\)|\[|\]/,Th=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),et=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,i={}){pe(t),i=i||{},this.options=i,this.pattern=t,this.platform=i.platform||Qr,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!i.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!i.nonegate,this.comment=!1,this.empty=!1,this.partial=!!i.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=i.windowsNoMagicRoot!==void 0?i.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let i of t)if(typeof i!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,i=this.options;if(!i.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],i.debug&&(this.debug=(...n)=>console.error(...n)),this.debug(this.pattern,this.globSet);let s=this.globSet.map(n=>this.slashSplit(n));this.globParts=this.preprocess(s),this.debug(this.pattern,this.globParts);let r=this.globParts.map((n,a,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let h=n[0]===""&&n[1]===""&&(n[2]==="?"||!Hr.test(n[2]))&&!Hr.test(n[3]),c=/^[a-z]:/i.test(n[0]);if(h)return[...n.slice(0,4),...n.slice(4).map(l=>this.parse(l))];if(c)return[n[0],...n.slice(1).map(l=>this.parse(l))]}return n.map(h=>this.parse(h))});if(this.debug(this.pattern,r),this.set=r.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let a=this.set[n];a[0]===""&&a[1]===""&&this.globParts[n][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let s=0;s<t.length;s++)for(let r=0;r<t[s].length;r++)t[s][r]==="**"&&(t[s][r]="*");let{optimizationLevel:i=1}=this.options;return i>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):i>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(i=>{let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let r=s;for(;i[r+1]==="**";)r++;r!==s&&i.splice(s,r-s)}return i})}levelOneOptimize(t){return t.map(i=>(i=i.reduce((s,r)=>{let n=s[s.length-1];return r==="**"&&n==="**"?s:r===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(r),s)},[]),i.length===0?[""]:i))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let i=!1;do{if(i=!1,!this.preserveMultipleSlashes){for(let r=1;r<t.length-1;r++){let n=t[r];r===1&&n===""&&t[0]===""||(n==="."||n==="")&&(i=!0,t.splice(r,1),r--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(i=!0,t.pop())}let s=0;for(;(s=t.indexOf("..",s+1))!==-1;){let r=t[s-1];r&&r!=="."&&r!==".."&&r!=="**"&&(i=!0,t.splice(s-1,2),s-=2)}}while(i);return t.length===0?[""]:t}firstPhasePreProcess(t){let i=!1;do{i=!1;for(let s of t){let r=-1;for(;(r=s.indexOf("**",r+1))!==-1;){let a=r;for(;s[a+1]==="**";)a++;a>r&&s.splice(r+1,a-r);let o=s[r+1],h=s[r+2],c=s[r+3];if(o!==".."||!h||h==="."||h===".."||!c||c==="."||c==="..")continue;i=!0,s.splice(r,1);let l=s.slice(0);l[r]="**",t.push(l),r--}if(!this.preserveMultipleSlashes){for(let a=1;a<s.length-1;a++){let o=s[a];a===1&&o===""&&s[0]===""||(o==="."||o==="")&&(i=!0,s.splice(a,1),a--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(i=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let a=s[n-1];if(a&&a!=="."&&a!==".."&&a!=="**"){i=!0;let h=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...h),s.length===0&&s.push(""),n-=2}}}}while(i);return t}secondPhasePreProcess(t){for(let i=0;i<t.length-1;i++)for(let s=i+1;s<t.length;s++){let r=this.partsMatch(t[i],t[s],!this.preserveMultipleSlashes);if(r){t[i]=[],t[s]=r;break}}return t.filter(i=>i.length)}partsMatch(t,i,s=!1){let r=0,n=0,a=[],o="";for(;r<t.length&&n<i.length;)if(t[r]===i[n])a.push(o==="b"?i[n]:t[r]),r++,n++;else if(s&&t[r]==="**"&&i[n]===t[r+1])a.push(t[r]),r++;else if(s&&i[n]==="**"&&t[r]===i[n+1])a.push(i[n]),n++;else if(t[r]==="*"&&i[n]&&(this.options.dot||!i[n].startsWith("."))&&i[n]!=="**"){if(o==="b")return!1;o="a",a.push(t[r]),r++,n++}else if(i[n]==="*"&&t[r]&&(this.options.dot||!t[r].startsWith("."))&&t[r]!=="**"){if(o==="a")return!1;o="b",a.push(i[n]),r++,n++}else return!1;return t.length===i.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,i=!1,s=0;for(let r=0;r<t.length&&t.charAt(r)==="!";r++)i=!i,s++;s&&(this.pattern=t.slice(s)),this.negate=i}matchOne(t,i,s=!1){let r=this.options;if(this.isWindows){let m=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),S=!m&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),y=typeof i[0]=="string"&&/^[a-z]:$/i.test(i[0]),E=!y&&i[0]===""&&i[1]===""&&i[2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3]),b=S?3:m?0:void 0,g=E?3:y?0:void 0;if(typeof b=="number"&&typeof g=="number"){let[_,L]=[t[b],i[g]];_.toLowerCase()===L.toLowerCase()&&(i[g]=_,g>b?i=i.slice(g):b>g&&(t=t.slice(b)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:i}),this.debug("matchOne",t.length,i.length);for(var a=0,o=0,h=t.length,c=i.length;a<h&&o<c;a++,o++){this.debug("matchOne loop");var l=i[o],f=t[a];if(this.debug(i,l,f),l===!1)return!1;if(l===W){this.debug("GLOBSTAR",[i,l,f]);var p=a,d=o+1;if(d===c){for(this.debug("** at the end");a<h;a++)if(t[a]==="."||t[a]===".."||!r.dot&&t[a].charAt(0)===".")return!1;return!0}for(;p<h;){var x=t[p];if(this.debug(`
15
+ globstar while`,t,p,i,d,x),this.matchOne(t.slice(p),i.slice(d),s))return this.debug("globstar found match!",p,h,x),!0;if(x==="."||x===".."||!r.dot&&x.charAt(0)==="."){this.debug("dot detected!",t,p,i,d);break}this.debug("globstar swallow a segment, and continue"),p++}return!!(s&&(this.debug(`
16
+ >>> no match, partial?`,t,p,i,d),p===h))}let m;if(typeof l=="string"?(m=f===l,this.debug("string match",l,f,m)):(m=l.test(f),this.debug("pattern match",l,f,m)),!m)return!1}if(a===h&&o===c)return!0;if(a===h)return s;if(o===c)return a===h-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return Yr(this.pattern,this.options)}parse(t){pe(t);let i=this.options;if(t==="**")return W;if(t==="")return"";let s,r=null;(s=t.match(fh))?r=i.dot?dh:ph:(s=t.match(ih))?r=(i.nocase?i.dot?ah:nh:i.dot?rh:sh)(s[1]):(s=t.match(mh))?r=(i.nocase?i.dot?xh:gh:i.dot?yh:bh)(s):(s=t.match(oh))?r=i.dot?uh:hh:(s=t.match(ch))&&(r=lh);let n=Qt.fromGlob(t,this.options).toMMPattern();return r&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:r}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let i=this.options,s=i.noglobstar?Sh:i.dot?Eh:_h,r=new Set(i.nocase?["i"]:[]),n=t.map(h=>{let c=h.map(f=>{if(f instanceof RegExp)for(let p of f.flags.split(""))r.add(p);return typeof f=="string"?Th(f):f===W?W:f._src});c.forEach((f,p)=>{let d=c[p+1],x=c[p-1];f!==W||x===W||(x===void 0?d!==void 0&&d!==W?c[p+1]="(?:\\/|"+s+"\\/)?"+d:c[p]=s:d===void 0?c[p-1]=x+"(?:\\/|\\/"+s+")?":d!==W&&(c[p-1]=x+"(?:\\/|\\/"+s+"\\/)"+d,c[p+1]=W))});let l=c.filter(f=>f!==W);if(this.partial&&l.length>=1){let f=[];for(let p=1;p<=l.length;p++)f.push(l.slice(0,p).join("/"));return"(?:"+f.join("|")+")"}return l.join("/")}).join("|"),[a,o]=t.length>1?["(?:",")"]:["",""];n="^"+a+n+o+"$",this.partial&&(n="^(?:\\/|"+a+n.slice(1,-1)+o+")$"),this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...r].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,i=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&i)return!0;let s=this.options;this.isWindows&&(t=t.split("\\").join("/"));let r=this.slashSplit(t);this.debug(this.pattern,"split",r);let n=this.set;this.debug(this.pattern,"set",n);let a=r[r.length-1];if(!a)for(let o=r.length-2;!a&&o>=0;o--)a=r[o];for(let o=0;o<n.length;o++){let h=n[o],c=r;if(s.matchBase&&h.length===1&&(c=[a]),this.matchOne(c,h,i))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(t){return Y.defaults(t).Minimatch}};Y.AST=Qt;Y.Minimatch=et;Y.escape=Yt;Y.unescape=dt;import{fileURLToPath as hu}from"node:url";var kh=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Jr=new Set,Qi=typeof process=="object"&&process?process:{},tn=(e,t,i,s)=>{typeof Qi.emitWarning=="function"?Qi.emitWarning(e,t,i,s):console.error(`[${i}] ${t}: ${e}`)},ze=globalThis.AbortController,Xr=globalThis.AbortSignal,Zr;if(typeof ze>"u"){Xr=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,r){this._onabort.push(r)}},ze=class{constructor(){t()}signal=new Xr;abort(s){var r,n;if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let a of this.signal._onabort)a(s);(n=(r=this.signal).onabort)==null||n.call(r,s)}}};let e=((Zr=Qi.env)==null?void 0:Zr.LRU_CACHE_IGNORE_AC_WARNING)!=="1",t=()=>{e&&(e=!1,tn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Ph=e=>!Jr.has(e),jc=Symbol("type"),Ot=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),en=e=>Ot(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Xt:null:null,Xt=class extends Array{constructor(t){super(t),this.fill(0)}},Yi=class e{heap;length;static#t=!1;static create(t){let i=en(t);if(!i)return[];e.#t=!0;let s=new e(t,i);return e.#t=!1,s}constructor(t,i){if(!e.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},me=class e{#t;#e;#n;#r;#a;#v;#y;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#o;#f;#l;#h;#i;#d;#w;#b;#m;#R;#g;#E;#A;#x;#S;#I;#p;#s;static unsafeExposeInternals(t){return{starts:t.#A,ttls:t.#x,sizes:t.#E,keyMap:t.#l,keyList:t.#h,valList:t.#i,next:t.#d,prev:t.#w,get head(){return t.#b},get tail(){return t.#m},free:t.#R,isBackgroundFetch:i=>t.#u(i),backgroundFetch:(i,s,r,n)=>t.#W(i,s,r,n),moveToTail:i=>t.#M(i),indexes:i=>t.#k(i),rindexes:i=>t.#N(i),isStale:i=>t.#C(i)}}get max(){return this.#t}get maxSize(){return this.#e}get calculatedSize(){return this.#f}get size(){return this.#o}get fetchMethod(){return this.#v}get memoMethod(){return this.#y}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#a}constructor(t){let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:a,updateAgeOnHas:o,allowStale:h,dispose:c,onInsert:l,disposeAfter:f,noDisposeOnSet:p,noUpdateTTL:d,maxSize:x=0,maxEntrySize:m=0,sizeCalculation:S,fetchMethod:y,memoMethod:E,noDeleteOnFetchRejection:b,noDeleteOnStaleGet:g,allowStaleOnFetchRejection:_,allowStaleOnFetchAbort:L,ignoreFetchAbort:I,perf:q}=t;if(q!==void 0&&typeof(q==null?void 0:q.now)!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#c=q??kh,i!==0&&!Ot(i))throw new TypeError("max option must be a nonnegative integer");let M=i?en(i):Array;if(!M)throw new Error("invalid max value: "+i);if(this.#t=i,this.#e=x,this.maxEntrySize=m||this.#e,this.sizeCalculation=S,this.sizeCalculation){if(!this.#e&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=E,y!==void 0&&typeof y!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#v=y,this.#I=!!y,this.#l=new Map,this.#h=new Array(i).fill(void 0),this.#i=new Array(i).fill(void 0),this.#d=new M(i),this.#w=new M(i),this.#b=0,this.#m=0,this.#R=Yi.create(i),this.#o=0,this.#f=0,typeof c=="function"&&(this.#n=c),typeof l=="function"&&(this.#r=l),typeof f=="function"?(this.#a=f,this.#g=[]):(this.#a=void 0,this.#g=void 0),this.#S=!!this.#n,this.#s=!!this.#r,this.#p=!!this.#a,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!b,this.allowStaleOnFetchRejection=!!_,this.allowStaleOnFetchAbort=!!L,this.ignoreFetchAbort=!!I,this.maxEntrySize!==0){if(this.#e!==0&&!Ot(this.#e))throw new TypeError("maxSize must be a positive integer if specified");if(!Ot(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#B()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!g,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!o,this.ttlResolution=Ot(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Ot(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#O()}if(this.#t===0&&this.ttl===0&&this.#e===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#e){let k="LRU_CACHE_UNBOUNDED";Ph(k)&&(Jr.add(k),tn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",k,e))}}getRemainingTTL(t){return this.#l.has(t)?1/0:0}#O(){let t=new Xt(this.#t),i=new Xt(this.#t);this.#x=t,this.#A=i,this.#j=(n,a,o=this.#c.now())=>{if(i[n]=a!==0?o:0,t[n]=a,a!==0&&this.ttlAutopurge){let h=setTimeout(()=>{this.#C(n)&&this.#P(this.#h[n],"expire")},a+1);h.unref&&h.unref()}},this.#T=n=>{i[n]=t[n]!==0?this.#c.now():0},this.#_=(n,a)=>{if(t[a]){let o=t[a],h=i[a];if(!o||!h)return;n.ttl=o,n.start=h,n.now=s||r();let c=n.now-h;n.remainingTTL=o-c}};let s=0,r=()=>{let n=this.#c.now();if(this.ttlResolution>0){s=n;let a=setTimeout(()=>s=0,this.ttlResolution);a.unref&&a.unref()}return n};this.getRemainingTTL=n=>{let a=this.#l.get(n);if(a===void 0)return 0;let o=t[a],h=i[a];if(!o||!h)return 1/0;let c=(s||r())-h;return o-c},this.#C=n=>{let a=i[n],o=t[n];return!!o&&!!a&&(s||r())-a>o}}#T=()=>{};#_=()=>{};#j=()=>{};#C=()=>!1;#B(){let t=new Xt(this.#t);this.#f=0,this.#E=t,this.#L=i=>{this.#f-=t[i],t[i]=0},this.#D=(i,s,r,n)=>{if(this.#u(s))return 0;if(!Ot(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!Ot(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r},this.#V=(i,s,r)=>{if(t[i]=s,this.#e){let n=this.#e-t[i];for(;this.#f>n;)this.#F(!0)}this.#f+=t[i],r&&(r.entrySize=s,r.totalCalculatedSize=this.#f)}}#L=t=>{};#V=(t,i,s)=>{};#D=(t,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:t=this.allowStale}={}){if(this.#o)for(let i=this.#m;!(!this.#$(i)||((t||!this.#C(i))&&(yield i),i===this.#b));)i=this.#w[i]}*#N({allowStale:t=this.allowStale}={}){if(this.#o)for(let i=this.#b;!(!this.#$(i)||((t||!this.#C(i))&&(yield i),i===this.#m));)i=this.#d[i]}#$(t){return t!==void 0&&this.#l.get(this.#h[t])===t}*entries(){for(let t of this.#k())this.#i[t]!==void 0&&this.#h[t]!==void 0&&!this.#u(this.#i[t])&&(yield[this.#h[t],this.#i[t]])}*rentries(){for(let t of this.#N())this.#i[t]!==void 0&&this.#h[t]!==void 0&&!this.#u(this.#i[t])&&(yield[this.#h[t],this.#i[t]])}*keys(){for(let t of this.#k()){let i=this.#h[t];i!==void 0&&!this.#u(this.#i[t])&&(yield i)}}*rkeys(){for(let t of this.#N()){let i=this.#h[t];i!==void 0&&!this.#u(this.#i[t])&&(yield i)}}*values(){for(let t of this.#k())this.#i[t]!==void 0&&!this.#u(this.#i[t])&&(yield this.#i[t])}*rvalues(){for(let t of this.#N())this.#i[t]!==void 0&&!this.#u(this.#i[t])&&(yield this.#i[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,i={}){for(let s of this.#k()){let r=this.#i[s],n=this.#u(r)?r.__staleWhileFetching:r;if(n!==void 0&&t(n,this.#h[s],this))return this.get(this.#h[s],i)}}forEach(t,i=this){for(let s of this.#k()){let r=this.#i[s],n=this.#u(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(i,n,this.#h[s],this)}}rforEach(t,i=this){for(let s of this.#N()){let r=this.#i[s],n=this.#u(r)?r.__staleWhileFetching:r;n!==void 0&&t.call(i,n,this.#h[s],this)}}purgeStale(){let t=!1;for(let i of this.#N({allowStale:!0}))this.#C(i)&&(this.#P(this.#h[i],"expire"),t=!0);return t}info(t){let i=this.#l.get(t);if(i===void 0)return;let s=this.#i[i],r=this.#u(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#x&&this.#A){let a=this.#x[i],o=this.#A[i];if(a&&o){let h=a-(this.#c.now()-o);n.ttl=h,n.start=Date.now()}}return this.#E&&(n.size=this.#E[i]),n}dump(){let t=[];for(let i of this.#k({allowStale:!0})){let s=this.#h[i],r=this.#i[i],n=this.#u(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let a={value:n};if(this.#x&&this.#A){a.ttl=this.#x[i];let o=this.#c.now()-this.#A[i];a.start=Math.floor(Date.now()-o)}this.#E&&(a.size=this.#E[i]),t.unshift([s,a])}return t}load(t){this.clear();for(let[i,s]of t){if(s.start){let r=Date.now()-s.start;s.start=this.#c.now()-r}this.set(i,s.value,s)}}set(t,i,s={}){var p,d,x,m,S,y,E;if(i===void 0)return this.delete(t),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:h}=s,{noUpdateTTL:c=this.noUpdateTTL}=s,l=this.#D(t,i,s.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize)return h&&(h.set="miss",h.maxEntrySizeExceeded=!0),this.#P(t,"set"),this;let f=this.#o===0?void 0:this.#l.get(t);if(f===void 0)f=this.#o===0?this.#m:this.#R.length!==0?this.#R.pop():this.#o===this.#t?this.#F(!1):this.#o,this.#h[f]=t,this.#i[f]=i,this.#l.set(t,f),this.#d[this.#m]=f,this.#w[f]=this.#m,this.#m=f,this.#o++,this.#V(f,l,h),h&&(h.set="add"),c=!1,this.#s&&((p=this.#r)==null||p.call(this,i,t,"add"));else{this.#M(f);let b=this.#i[f];if(i!==b){if(this.#I&&this.#u(b)){b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:g}=b;g!==void 0&&!a&&(this.#S&&((d=this.#n)==null||d.call(this,g,t,"set")),this.#p&&((x=this.#g)==null||x.push([g,t,"set"])))}else a||(this.#S&&((m=this.#n)==null||m.call(this,b,t,"set")),this.#p&&((S=this.#g)==null||S.push([b,t,"set"])));if(this.#L(f),this.#V(f,l,h),this.#i[f]=i,h){h.set="replace";let g=b&&this.#u(b)?b.__staleWhileFetching:b;g!==void 0&&(h.oldValue=g)}}else h&&(h.set="update");this.#s&&((y=this.onInsert)==null||y.call(this,i,t,i===b?"update":"replace"))}if(r!==0&&!this.#x&&this.#O(),this.#x&&(c||this.#j(f,r,n),h&&this.#_(h,f)),!a&&this.#p&&this.#g){let b=this.#g,g;for(;g=b==null?void 0:b.shift();)(E=this.#a)==null||E.call(this,...g)}return this}pop(){var t;try{for(;this.#o;){let i=this.#i[this.#b];if(this.#F(!0),this.#u(i)){if(i.__staleWhileFetching)return i.__staleWhileFetching}else if(i!==void 0)return i}}finally{if(this.#p&&this.#g){let i=this.#g,s;for(;s=i==null?void 0:i.shift();)(t=this.#a)==null||t.call(this,...s)}}}#F(t){var n,a;let i=this.#b,s=this.#h[i],r=this.#i[i];return this.#I&&this.#u(r)?r.__abortController.abort(new Error("evicted")):(this.#S||this.#p)&&(this.#S&&((n=this.#n)==null||n.call(this,r,s,"evict")),this.#p&&((a=this.#g)==null||a.push([r,s,"evict"]))),this.#L(i),t&&(this.#h[i]=void 0,this.#i[i]=void 0,this.#R.push(i)),this.#o===1?(this.#b=this.#m=0,this.#R.length=0):this.#b=this.#d[i],this.#l.delete(s),this.#o--,i}has(t,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=this.#l.get(t);if(n!==void 0){let a=this.#i[n];if(this.#u(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#C(n))r&&(r.has="stale",this.#_(r,n));else return s&&this.#T(n),r&&(r.has="hit",this.#_(r,n)),!0}else r&&(r.has="miss");return!1}peek(t,i={}){let{allowStale:s=this.allowStale}=i,r=this.#l.get(t);if(r===void 0||!s&&this.#C(r))return;let n=this.#i[r];return this.#u(n)?n.__staleWhileFetching:n}#W(t,i,s,r){let n=i===void 0?void 0:this.#i[i];if(this.#u(n))return n;let a=new ze,{signal:o}=s;o==null||o.addEventListener("abort",()=>a.abort(o.reason),{signal:a.signal});let h={signal:a.signal,options:s,context:r},c=(m,S=!1)=>{let{aborted:y}=a.signal,E=s.ignoreFetchAbort&&m!==void 0;if(s.status&&(y&&!S?(s.status.fetchAborted=!0,s.status.fetchError=a.signal.reason,E&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),y&&!E&&!S)return f(a.signal.reason);let b=d,g=this.#i[i];return(g===d||E&&S&&g===void 0)&&(m===void 0?b.__staleWhileFetching!==void 0?this.#i[i]=b.__staleWhileFetching:this.#P(t,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(t,m,h.options))),m},l=m=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=m),f(m)),f=m=>{let{aborted:S}=a.signal,y=S&&s.allowStaleOnFetchAbort,E=y||s.allowStaleOnFetchRejection,b=E||s.noDeleteOnFetchRejection,g=d;if(this.#i[i]===d&&(!b||g.__staleWhileFetching===void 0?this.#P(t,"fetch"):y||(this.#i[i]=g.__staleWhileFetching)),E)return s.status&&g.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),g.__staleWhileFetching;if(g.__returned===g)throw m},p=(m,S)=>{var E;let y=(E=this.#v)==null?void 0:E.call(this,t,n,h);y&&y instanceof Promise&&y.then(b=>m(b===void 0?void 0:b),S),a.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(m(void 0),s.allowStaleOnFetchAbort&&(m=b=>c(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);let d=new Promise(p).then(c,l),x=Object.assign(d,{__abortController:a,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(t,x,{...h.options,status:void 0}),i=this.#l.get(t)):this.#i[i]=x,x}#u(t){if(!this.#I)return!1;let i=t;return!!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof ze}async fetch(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:h=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:f=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:x=this.allowStaleOnFetchAbort,context:m,forceRefresh:S=!1,status:y,signal:E}=i;if(!this.#I)return y&&(y.fetch="get"),this.get(t,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:y});let b={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:a,noDisposeOnSet:o,size:h,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:f,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:x,ignoreFetchAbort:d,status:y,signal:E},g=this.#l.get(t);if(g===void 0){y&&(y.fetch="miss");let _=this.#W(t,g,b,m);return _.__returned=_}else{let _=this.#i[g];if(this.#u(_)){let k=s&&_.__staleWhileFetching!==void 0;return y&&(y.fetch="inflight",k&&(y.returnedStale=!0)),k?_.__staleWhileFetching:_.__returned=_}let L=this.#C(g);if(!S&&!L)return y&&(y.fetch="hit"),this.#M(g),r&&this.#T(g),y&&this.#_(y,g),_;let I=this.#W(t,g,b,m),M=I.__staleWhileFetching!==void 0&&s;return y&&(y.fetch=L?"stale":"refresh",M&&L&&(y.returnedStale=!0)),M?I.__staleWhileFetching:I.__returned=I}}async forceFetch(t,i={}){let s=await this.fetch(t,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(t,i={}){let s=this.#y;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...a}=i,o=this.get(t,a);if(!n&&o!==void 0)return o;let h=s(t,o,{options:a,context:r});return this.set(t,h,a),h}get(t,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:a}=i,o=this.#l.get(t);if(o!==void 0){let h=this.#i[o],c=this.#u(h);return a&&this.#_(a,o),this.#C(o)?(a&&(a.get="stale"),c?(a&&s&&h.__staleWhileFetching!==void 0&&(a.returnedStale=!0),s?h.__staleWhileFetching:void 0):(n||this.#P(t,"expire"),a&&s&&(a.returnedStale=!0),s?h:void 0)):(a&&(a.get="hit"),c?h.__staleWhileFetching:(this.#M(o),r&&this.#T(o),h))}else a&&(a.get="miss")}#G(t,i){this.#w[i]=t,this.#d[t]=i}#M(t){t!==this.#m&&(t===this.#b?this.#b=this.#d[t]:this.#G(this.#w[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#P(t,"delete")}#P(t,i){var r,n,a,o;let s=!1;if(this.#o!==0){let h=this.#l.get(t);if(h!==void 0)if(s=!0,this.#o===1)this.#U(i);else{this.#L(h);let c=this.#i[h];if(this.#u(c)?c.__abortController.abort(new Error("deleted")):(this.#S||this.#p)&&(this.#S&&((r=this.#n)==null||r.call(this,c,t,i)),this.#p&&((n=this.#g)==null||n.push([c,t,i]))),this.#l.delete(t),this.#h[h]=void 0,this.#i[h]=void 0,h===this.#m)this.#m=this.#w[h];else if(h===this.#b)this.#b=this.#d[h];else{let l=this.#w[h];this.#d[l]=this.#d[h];let f=this.#d[h];this.#w[f]=this.#w[h]}this.#o--,this.#R.push(h)}}if(this.#p&&((a=this.#g)!=null&&a.length)){let h=this.#g,c;for(;c=h==null?void 0:h.shift();)(o=this.#a)==null||o.call(this,...c)}return s}clear(){return this.#U("delete")}#U(t){var i,s,r;for(let n of this.#N({allowStale:!0})){let a=this.#i[n];if(this.#u(a))a.__abortController.abort(new Error("deleted"));else{let o=this.#h[n];this.#S&&((i=this.#n)==null||i.call(this,a,o,t)),this.#p&&((s=this.#g)==null||s.push([a,o,t]))}}if(this.#l.clear(),this.#i.fill(void 0),this.#h.fill(void 0),this.#x&&this.#A&&(this.#x.fill(0),this.#A.fill(0)),this.#E&&this.#E.fill(0),this.#b=0,this.#m=0,this.#R.length=0,this.#f=0,this.#o=0,this.#p&&this.#g){let n=this.#g,a;for(;a=n==null?void 0:n.shift();)(r=this.#a)==null||r.call(this,...a)}}};import{posix as $h,win32 as as}from"node:path";import{fileURLToPath as Wh}from"node:url";import{lstatSync as Gh,readdir as zh,readdirSync as Hh,readlinkSync as qh,realpathSync as Kh}from"fs";import*as Qh from"node:fs";import{lstat as Xh,readdir as Zh,readlink as Jh,realpath as tu}from"node:fs/promises";import{EventEmitter as ss}from"node:events";import on from"node:stream";import{StringDecoder as Nh}from"node:string_decoder";var sn=typeof process=="object"&&process?process:{stdout:null,stderr:null},Oh=e=>!!e&&typeof e=="object"&&(e instanceof Dt||e instanceof on||Lh(e)||Dh(e)),Lh=e=>!!e&&typeof e=="object"&&e instanceof ss&&typeof e.pipe=="function"&&e.pipe!==on.Writable.prototype.pipe,Dh=e=>!!e&&typeof e=="object"&&e instanceof ss&&typeof e.write=="function"&&typeof e.end=="function",At=Symbol("EOF"),It=Symbol("maybeEmitEnd"),Lt=Symbol("emittedEnd"),He=Symbol("emittingEnd"),ge=Symbol("emittedError"),qe=Symbol("closed"),rn=Symbol("read"),Ke=Symbol("flush"),nn=Symbol("flushChunk"),mt=Symbol("encoding"),Zt=Symbol("decoder"),U=Symbol("flowing"),xe=Symbol("paused"),Jt=Symbol("resume"),j=Symbol("buffer"),X=Symbol("pipes"),$=Symbol("bufferLength"),Xi=Symbol("bufferPush"),Qe=Symbol("bufferShift"),z=Symbol("objectMode"),F=Symbol("destroyed"),Zi=Symbol("error"),Ji=Symbol("emitData"),an=Symbol("emitEnd"),ts=Symbol("emitEnd2"),wt=Symbol("async"),es=Symbol("abort"),Ye=Symbol("aborted"),ye=Symbol("signal"),Ut=Symbol("dataListeners"),it=Symbol("discarded"),be=e=>Promise.resolve().then(e),Fh=e=>e(),Mh=e=>e==="end"||e==="finish"||e==="prefinish",Bh=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,Vh=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),Xe=class{src;dest;opts;ondrain;constructor(t,i,s){this.src=t,this.dest=i,this.opts=s,this.ondrain=()=>t[Jt](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},is=class extends Xe{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(t,i,s){super(t,i,s),this.proxyErrors=r=>i.emit("error",r),t.on("error",this.proxyErrors)}},Uh=e=>!!e.objectMode,jh=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",Dt=class extends ss{[U]=!1;[xe]=!1;[X]=[];[j]=[];[z];[mt];[wt];[Zt];[At]=!1;[Lt]=!1;[He]=!1;[qe]=!1;[ge]=null;[$]=0;[F]=!1;[ye];[Ye]=!1;[Ut]=0;[it]=!1;writable=!0;readable=!0;constructor(...t){let i=t[0]||{};if(super(),i.objectMode&&typeof i.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");Uh(i)?(this[z]=!0,this[mt]=null):jh(i)?(this[mt]=i.encoding,this[z]=!1):(this[z]=!1,this[mt]=null),this[wt]=!!i.async,this[Zt]=this[mt]?new Nh(this[mt]):null,i&&i.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[j]}),i&&i.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[X]});let{signal:s}=i;s&&(this[ye]=s,s.aborted?this[es]():s.addEventListener("abort",()=>this[es]()))}get bufferLength(){return this[$]}get encoding(){return this[mt]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[z]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[wt]}set async(t){this[wt]=this[wt]||!!t}[es](){var t,i;this[Ye]=!0,this.emit("abort",(t=this[ye])==null?void 0:t.reason),this.destroy((i=this[ye])==null?void 0:i.reason)}get aborted(){return this[Ye]}set aborted(t){}write(t,i,s){var n;if(this[Ye])return!1;if(this[At])throw new Error("write after end");if(this[F])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof i=="function"&&(s=i,i="utf8"),i||(i="utf8");let r=this[wt]?be:Fh;if(!this[z]&&!Buffer.isBuffer(t)){if(Vh(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(Bh(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[z]?(this[U]&&this[$]!==0&&this[Ke](!0),this[U]?this.emit("data",t):this[Xi](t),this[$]!==0&&this.emit("readable"),s&&r(s),this[U]):t.length?(typeof t=="string"&&!(i===this[mt]&&!((n=this[Zt])!=null&&n.lastNeed))&&(t=Buffer.from(t,i)),Buffer.isBuffer(t)&&this[mt]&&(t=this[Zt].write(t)),this[U]&&this[$]!==0&&this[Ke](!0),this[U]?this.emit("data",t):this[Xi](t),this[$]!==0&&this.emit("readable"),s&&r(s),this[U]):(this[$]!==0&&this.emit("readable"),s&&r(s),this[U])}read(t){if(this[F])return null;if(this[it]=!1,this[$]===0||t===0||t&&t>this[$])return this[It](),null;this[z]&&(t=null),this[j].length>1&&!this[z]&&(this[j]=[this[mt]?this[j].join(""):Buffer.concat(this[j],this[$])]);let i=this[rn](t||null,this[j][0]);return this[It](),i}[rn](t,i){if(this[z])this[Qe]();else{let s=i;t===s.length||t===null?this[Qe]():typeof s=="string"?(this[j][0]=s.slice(t),i=s.slice(0,t),this[$]-=t):(this[j][0]=s.subarray(t),i=s.subarray(0,t),this[$]-=t)}return this.emit("data",i),!this[j].length&&!this[At]&&this.emit("drain"),i}end(t,i,s){return typeof t=="function"&&(s=t,t=void 0),typeof i=="function"&&(s=i,i="utf8"),t!==void 0&&this.write(t,i),s&&this.once("end",s),this[At]=!0,this.writable=!1,(this[U]||!this[xe])&&this[It](),this}[Jt](){this[F]||(!this[Ut]&&!this[X].length&&(this[it]=!0),this[xe]=!1,this[U]=!0,this.emit("resume"),this[j].length?this[Ke]():this[At]?this[It]():this.emit("drain"))}resume(){return this[Jt]()}pause(){this[U]=!1,this[xe]=!0,this[it]=!1}get destroyed(){return this[F]}get flowing(){return this[U]}get paused(){return this[xe]}[Xi](t){this[z]?this[$]+=1:this[$]+=t.length,this[j].push(t)}[Qe](){return this[z]?this[$]-=1:this[$]-=this[j][0].length,this[j].shift()}[Ke](t=!1){do;while(this[nn](this[Qe]())&&this[j].length);!t&&!this[j].length&&!this[At]&&this.emit("drain")}[nn](t){return this.emit("data",t),this[U]}pipe(t,i){if(this[F])return t;this[it]=!1;let s=this[Lt];return i=i||{},t===sn.stdout||t===sn.stderr?i.end=!1:i.end=i.end!==!1,i.proxyErrors=!!i.proxyErrors,s?i.end&&t.end():(this[X].push(i.proxyErrors?new is(this,t,i):new Xe(this,t,i)),this[wt]?be(()=>this[Jt]()):this[Jt]()),t}unpipe(t){let i=this[X].find(s=>s.dest===t);i&&(this[X].length===1?(this[U]&&this[Ut]===0&&(this[U]=!1),this[X]=[]):this[X].splice(this[X].indexOf(i),1),i.unpipe())}addListener(t,i){return this.on(t,i)}on(t,i){let s=super.on(t,i);if(t==="data")this[it]=!1,this[Ut]++,!this[X].length&&!this[U]&&this[Jt]();else if(t==="readable"&&this[$]!==0)super.emit("readable");else if(Mh(t)&&this[Lt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[ge]){let r=i;this[wt]?be(()=>r.call(this,this[ge])):r.call(this,this[ge])}return s}removeListener(t,i){return this.off(t,i)}off(t,i){let s=super.off(t,i);return t==="data"&&(this[Ut]=this.listeners("data").length,this[Ut]===0&&!this[it]&&!this[X].length&&(this[U]=!1)),s}removeAllListeners(t){let i=super.removeAllListeners(t);return(t==="data"||t===void 0)&&(this[Ut]=0,!this[it]&&!this[X].length&&(this[U]=!1)),i}get emittedEnd(){return this[Lt]}[It](){!this[He]&&!this[Lt]&&!this[F]&&this[j].length===0&&this[At]&&(this[He]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[qe]&&this.emit("close"),this[He]=!1)}emit(t,...i){let s=i[0];if(t!=="error"&&t!=="close"&&t!==F&&this[F])return!1;if(t==="data")return!this[z]&&!s?!1:this[wt]?(be(()=>this[Ji](s)),!0):this[Ji](s);if(t==="end")return this[an]();if(t==="close"){if(this[qe]=!0,!this[Lt]&&!this[F])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(t==="error"){this[ge]=s,super.emit(Zi,s);let n=!this[ye]||this.listeners("error").length?super.emit("error",s):!1;return this[It](),n}else if(t==="resume"){let n=super.emit("resume");return this[It](),n}else if(t==="finish"||t==="prefinish"){let n=super.emit(t);return this.removeAllListeners(t),n}let r=super.emit(t,...i);return this[It](),r}[Ji](t){for(let s of this[X])s.dest.write(t)===!1&&this.pause();let i=this[it]?!1:super.emit("data",t);return this[It](),i}[an](){return this[Lt]?!1:(this[Lt]=!0,this.readable=!1,this[wt]?(be(()=>this[ts]()),!0):this[ts]())}[ts](){if(this[Zt]){let i=this[Zt].end();if(i){for(let s of this[X])s.dest.write(i);this[it]||super.emit("data",i)}}for(let i of this[X])i.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[z]||(t.dataLength=0);let i=this.promise();return this.on("data",s=>{t.push(s),this[z]||(t.dataLength+=s.length)}),await i,t}async concat(){if(this[z])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[mt]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,i)=>{this.on(F,()=>i(new Error("stream destroyed"))),this.on("error",s=>i(s)),this.on("end",()=>t())})}[Symbol.asyncIterator](){this[it]=!1;let t=!1,i=async()=>(this.pause(),t=!0,{value:void 0,done:!0});return{next:()=>{if(t)return i();let r=this.read();if(r!==null)return Promise.resolve({done:!1,value:r});if(this[At])return i();let n,a,o=f=>{this.off("data",h),this.off("end",c),this.off(F,l),i(),a(f)},h=f=>{this.off("error",o),this.off("end",c),this.off(F,l),this.pause(),n({value:f,done:!!this[At]})},c=()=>{this.off("error",o),this.off("data",h),this.off(F,l),i(),n({done:!0,value:void 0})},l=()=>o(new Error("stream destroyed"));return new Promise((f,p)=>{a=p,n=f,this.once(F,l),this.once("error",o),this.once("end",c),this.once("data",h)})},throw:i,return:i,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[it]=!1;let t=!1,i=()=>(this.pause(),this.off(Zi,i),this.off(F,i),this.off("end",i),t=!0,{done:!0,value:void 0}),s=()=>{if(t)return i();let r=this.read();return r===null?i():{done:!1,value:r}};return this.once("end",i),this.once(Zi,i),this.once(F,i),{next:s,throw:i,return:i,[Symbol.iterator](){return this}}}destroy(t){if(this[F])return t?this.emit("error",t):this.emit(F),this;this[F]=!0,this[it]=!0,this[j].length=0,this[$]=0;let i=this;return typeof i.close=="function"&&!this[qe]&&i.close(),t?this.emit("error",t):this.emit(F),this}static get isStream(){return Oh}};var Yh=Kh.native,we={lstatSync:Gh,readdir:zh,readdirSync:Hh,readlinkSync:qh,realpathSync:Yh,promises:{lstat:Xh,readdir:Zh,readlink:Jh,realpath:tu}},fn=e=>!e||e===we||e===Qh?we:{...we,...e,promises:{...we.promises,...e.promises||{}}},pn=/^\\\\\?\\([a-z]:)\\?$/i,eu=e=>e.replace(/\//g,"\\").replace(pn,"$1\\"),iu=/[\\\/]/,ct=0,dn=1,mn=2,St=4,gn=6,xn=8,jt=10,yn=12,ut=15,ve=~ut,rs=16,hn=32,Se=64,gt=128,Ze=256,ti=512,un=Se|gt|ti,su=1023,ns=e=>e.isFile()?xn:e.isDirectory()?St:e.isSymbolicLink()?jt:e.isCharacterDevice()?mn:e.isBlockDevice()?gn:e.isSocket()?yn:e.isFIFO()?dn:ct,cn=new Map,Ee=e=>{let t=cn.get(e);if(t)return t;let i=e.normalize("NFKD");return cn.set(e,i),i},ln=new Map,Je=e=>{let t=ln.get(e);if(t)return t;let i=Ee(e.toLowerCase());return ln.set(e,i),i},ei=class extends me{constructor(){super({max:256})}},os=class extends me{constructor(t=16*1024){super({maxSize:t,sizeCalculation:i=>i.length+1})}},bn=Symbol("PathScurry setAsCwd"),H=class{name;root;roots;parent;nocase;isCWD=!1;#t;#e;get dev(){return this.#e}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#a;get uid(){return this.#a}#v;get gid(){return this.#v}#y;get rdev(){return this.#y}#c;get blksize(){return this.#c}#o;get ino(){return this.#o}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#h;get atimeMs(){return this.#h}#i;get mtimeMs(){return this.#i}#d;get ctimeMs(){return this.#d}#w;get birthtimeMs(){return this.#w}#b;get atime(){return this.#b}#m;get mtime(){return this.#m}#R;get ctime(){return this.#R}#g;get birthtime(){return this.#g}#E;#A;#x;#S;#I;#p;#s;#O;#T;#_;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,i=ct,s,r,n,a,o){this.name=t,this.#E=n?Je(t):Ee(t),this.#s=i&su,this.nocase=n,this.roots=r,this.root=s||this,this.#O=a,this.#x=o.fullpath,this.#I=o.relative,this.#p=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=fn(o.fs)}depth(){return this.#A!==void 0?this.#A:this.parent?this.#A=this.parent.depth()+1:this.#A=0}childrenCache(){return this.#O}resolve(t){if(!t)return this;let i=this.getRootString(t),r=t.substring(i.length).split(this.splitSep);return i?this.getRoot(i).#j(r):this.#j(r)}#j(t){let i=this;for(let s of t)i=i.child(s);return i}children(){let t=this.#O.get(this);if(t)return t;let i=Object.assign([],{provisional:0});return this.#O.set(this,i),this.#s&=~rs,i}child(t,i){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let s=this.children(),r=this.nocase?Je(t):Ee(t);for(let h of s)if(h.#E===r)return h;let n=this.parent?this.sep:"",a=this.#x?this.#x+n+t:void 0,o=this.newChild(t,ct,{...i,parent:this,fullpath:a});return this.canReaddir()||(o.#s|=gt),s.push(o),o}relative(){if(this.isCWD)return"";if(this.#I!==void 0)return this.#I;let t=this.name,i=this.parent;if(!i)return this.#I=this.name;let s=i.relative();return s+(!s||!i.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#p!==void 0)return this.#p;let t=this.name,i=this.parent;if(!i)return this.#p=this.fullpathPosix();let s=i.relativePosix();return s+(!s||!i.parent?"":"/")+t}fullpath(){if(this.#x!==void 0)return this.#x;let t=this.name,i=this.parent;if(!i)return this.#x=this.name;let r=i.fullpath()+(i.parent?this.sep:"")+t;return this.#x=r}fullpathPosix(){if(this.#S!==void 0)return this.#S;if(this.sep==="/")return this.#S=this.fullpath();if(!this.parent){let r=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(r)?this.#S=`//?/${r}`:this.#S=r}let t=this.parent,i=t.fullpathPosix(),s=i+(!i||!t.parent?"":"/")+this.name;return this.#S=s}isUnknown(){return(this.#s&ut)===ct}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#s&ut)===xn}isDirectory(){return(this.#s&ut)===St}isCharacterDevice(){return(this.#s&ut)===mn}isBlockDevice(){return(this.#s&ut)===gn}isFIFO(){return(this.#s&ut)===dn}isSocket(){return(this.#s&ut)===yn}isSymbolicLink(){return(this.#s&jt)===jt}lstatCached(){return this.#s&hn?this:void 0}readlinkCached(){return this.#T}realpathCached(){return this.#_}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#T)return!0;if(!this.parent)return!1;let t=this.#s&ut;return!(t!==ct&&t!==jt||this.#s&Ze||this.#s&gt)}calledReaddir(){return!!(this.#s&rs)}isENOENT(){return!!(this.#s&gt)}isNamed(t){return this.nocase?this.#E===Je(t):this.#E===Ee(t)}async readlink(){var i;let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let s=await this.#t.promises.readlink(this.fullpath()),r=(i=await this.parent.realpath())==null?void 0:i.resolve(s);if(r)return this.#T=r}catch(s){this.#$(s.code);return}}readlinkSync(){var i;let t=this.#T;if(t)return t;if(this.canReadlink()&&this.parent)try{let s=this.#t.readlinkSync(this.fullpath()),r=(i=this.parent.realpathSync())==null?void 0:i.resolve(s);if(r)return this.#T=r}catch(s){this.#$(s.code);return}}#C(t){this.#s|=rs;for(let i=t.provisional;i<t.length;i++){let s=t[i];s&&s.#B()}}#B(){this.#s&gt||(this.#s=(this.#s|gt)&ve,this.#L())}#L(){let t=this.children();t.provisional=0;for(let i of t)i.#B()}#V(){this.#s|=ti,this.#D()}#D(){if(this.#s&Se)return;let t=this.#s;(t&ut)===St&&(t&=ve),this.#s=t|Se,this.#L()}#k(t=""){t==="ENOTDIR"||t==="EPERM"?this.#D():t==="ENOENT"?this.#B():this.children().provisional=0}#N(t=""){t==="ENOTDIR"?this.parent.#D():t==="ENOENT"&&this.#B()}#$(t=""){let i=this.#s;i|=Ze,t==="ENOENT"&&(i|=gt),(t==="EINVAL"||t==="UNKNOWN")&&(i&=ve),this.#s=i,t==="ENOTDIR"&&this.parent&&this.parent.#D()}#F(t,i){return this.#u(t,i)||this.#W(t,i)}#W(t,i){let s=ns(t),r=this.newChild(t.name,s,{parent:this}),n=r.#s&ut;return n!==St&&n!==jt&&n!==ct&&(r.#s|=Se),i.unshift(r),i.provisional++,r}#u(t,i){for(let s=i.provisional;s<i.length;s++){let r=i[s];if((this.nocase?Je(t.name):Ee(t.name))===r.#E)return this.#G(t,r,s,i)}}#G(t,i,s,r){let n=i.name;return i.#s=i.#s&ve|ns(t),n!==t.name&&(i.name=t.name),s!==r.provisional&&(s===r.length-1?r.pop():r.splice(s,1),r.unshift(i)),r.provisional++,i}async lstat(){if((this.#s&gt)===0)try{return this.#M(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#N(t.code)}}lstatSync(){if((this.#s&gt)===0)try{return this.#M(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#N(t.code)}}#M(t){let{atime:i,atimeMs:s,birthtime:r,birthtimeMs:n,blksize:a,blocks:o,ctime:h,ctimeMs:c,dev:l,gid:f,ino:p,mode:d,mtime:x,mtimeMs:m,nlink:S,rdev:y,size:E,uid:b}=t;this.#b=i,this.#h=s,this.#g=r,this.#w=n,this.#c=a,this.#l=o,this.#R=h,this.#d=c,this.#e=l,this.#v=f,this.#o=p,this.#n=d,this.#m=x,this.#i=m,this.#r=S,this.#y=y,this.#f=E,this.#a=b;let g=ns(t);this.#s=this.#s&ve|g|hn,g!==ct&&g!==St&&g!==jt&&(this.#s|=Se)}#P=[];#U=!1;#H(t){this.#U=!1;let i=this.#P.slice();this.#P.length=0,i.forEach(s=>s(null,t))}readdirCB(t,i=!1){if(!this.canReaddir()){i?t(null,[]):queueMicrotask(()=>t(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);i?t(null,n):queueMicrotask(()=>t(null,n));return}if(this.#P.push(t),this.#U)return;this.#U=!0;let r=this.fullpath();this.#t.readdir(r,{withFileTypes:!0},(n,a)=>{if(n)this.#k(n.code),s.provisional=0;else{for(let o of a)this.#F(o,s);this.#C(s)}this.#H(s.slice(0,s.provisional))})}#z;async readdir(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let i=this.fullpath();if(this.#z)await this.#z;else{let s=()=>{};this.#z=new Promise(r=>s=r);try{for(let r of await this.#t.promises.readdir(i,{withFileTypes:!0}))this.#F(r,t);this.#C(t)}catch(r){this.#k(r.code),t.provisional=0}this.#z=void 0,s()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return[];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let i=this.fullpath();try{for(let s of this.#t.readdirSync(i,{withFileTypes:!0}))this.#F(s,t);this.#C(t)}catch(s){this.#k(s.code),t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#s&un)return!1;let t=ut&this.#s;return t===ct||t===St||t===jt}shouldWalk(t,i){return(this.#s&St)===St&&!(this.#s&un)&&!t.has(this)&&(!i||i(this))}async realpath(){if(this.#_)return this.#_;if(!((ti|Ze|gt)&this.#s))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#_=this.resolve(t)}catch{this.#V()}}realpathSync(){if(this.#_)return this.#_;if(!((ti|Ze|gt)&this.#s))try{let t=this.#t.realpathSync(this.fullpath());return this.#_=this.resolve(t)}catch{this.#V()}}[bn](t){if(t===this)return;t.isCWD=!1,this.isCWD=!0;let i=new Set([]),s=[],r=this;for(;r&&r.parent;)i.add(r),r.#I=s.join(this.sep),r.#p=s.join("/"),r=r.parent,s.push("..");for(r=t;r&&r.parent&&!i.has(r);)r.#I=void 0,r.#p=void 0,r=r.parent}},ii=class e extends H{sep="\\";splitSep=iu;constructor(t,i=ct,s,r,n,a,o){super(t,i,s,r,n,a,o)}newChild(t,i=ct,s={}){return new e(t,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(t){return as.parse(t).root}getRoot(t){if(t=eu(t.toUpperCase()),t===this.root.name)return this.root;for(let[i,s]of Object.entries(this.roots))if(this.sameRoot(t,i))return this.roots[t]=s;return this.roots[t]=new te(t,this).root}sameRoot(t,i=this.root.name){return t=t.toUpperCase().replace(/\//g,"\\").replace(pn,"$1\\"),t===i}},si=class e extends H{splitSep="/";sep="/";constructor(t,i=ct,s,r,n,a,o){super(t,i,s,r,n,a,o)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,i=ct,s={}){return new e(t,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ri=class{root;rootPath;roots;cwd;#t;#e;#n;nocase;#r;constructor(t=process.cwd(),i,s,{nocase:r,childrenCacheSize:n=16*1024,fs:a=we}={}){this.#r=fn(a),(t instanceof URL||t.startsWith("file://"))&&(t=Wh(t));let o=i.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new ei,this.#e=new ei,this.#n=new os(n);let h=o.substring(this.rootPath.length).split(s);if(h.length===1&&!h[0]&&h.pop(),r===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=r,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let c=this.root,l=h.length-1,f=i.sep,p=this.rootPath,d=!1;for(let x of h){let m=l--;c=c.child(x,{relative:new Array(m).fill("..").join(f),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(d?"":f)+x}),d=!0}this.cwd=c}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let i="";for(let n=t.length-1;n>=0;n--){let a=t[n];if(!(!a||a===".")&&(i=i?`${a}/${i}`:a,this.isAbsolute(a)))break}let s=this.#t.get(i);if(s!==void 0)return s;let r=this.cwd.resolve(i).fullpath();return this.#t.set(i,r),r}resolvePosix(...t){let i="";for(let n=t.length-1;n>=0;n--){let a=t[n];if(!(!a||a===".")&&(i=i?`${a}/${i}`:a,this.isAbsolute(a)))break}let s=this.#e.get(i);if(s!==void 0)return s;let r=this.cwd.resolve(i).fullpathPosix();return this.#e.set(i,r),r}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,i={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s}=i;if(t.canReaddir()){let r=await t.readdir();return s?r:r.map(n=>n.name)}else return[]}readdirSync(t=this.cwd,i={withFileTypes:!0}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0}=i;return t.canReaddir()?s?t.readdirSync():t.readdirSync().map(r=>r.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=await t.readlink();return i?s:s==null?void 0:s.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=t.readlinkSync();return i?s:s==null?void 0:s.fullpath()}async realpath(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=await t.realpath();return i?s:s==null?void 0:s.fullpath()}realpathSync(t=this.cwd,{withFileTypes:i}={withFileTypes:!1}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t.withFileTypes,t=this.cwd);let s=t.realpathSync();return i?s:s==null?void 0:s.fullpath()}async walk(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=[];(!n||n(t))&&o.push(s?t:t.fullpath());let h=new Set,c=(f,p)=>{h.add(f),f.readdirCB((d,x)=>{if(d)return p(d);let m=x.length;if(!m)return p();let S=()=>{--m===0&&p()};for(let y of x)(!n||n(y))&&o.push(s?y:y.fullpath()),r&&y.isSymbolicLink()?y.realpath().then(E=>E!=null&&E.isUnknown()?E.lstat():E).then(E=>E!=null&&E.shouldWalk(h,a)?c(E,S):S()):y.shouldWalk(h,a)?c(y,S):S()},!0)},l=t;return new Promise((f,p)=>{c(l,d=>{if(d)return p(d);f(o)})})}walkSync(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=[];(!n||n(t))&&o.push(s?t:t.fullpath());let h=new Set([t]);for(let c of h){let l=c.readdirSync();for(let f of l){(!n||n(f))&&o.push(s?f:f.fullpath());let p=f;if(f.isSymbolicLink()){if(!(r&&(p=f.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(h,a)&&h.add(p)}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,i={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd),this.stream(t,i)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i;(!n||n(t))&&(yield s?t:t.fullpath());let o=new Set([t]);for(let h of o){let c=h.readdirSync();for(let l of c){(!n||n(l))&&(yield s?l:l.fullpath());let f=l;if(l.isSymbolicLink()){if(!(r&&(f=l.realpathSync())))continue;f.isUnknown()&&f.lstatSync()}f.shouldWalk(o,a)&&o.add(f)}}}stream(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=new Dt({objectMode:!0});(!n||n(t))&&o.write(s?t:t.fullpath());let h=new Set,c=[t],l=0,f=()=>{let p=!1;for(;!p;){let d=c.shift();if(!d){l===0&&o.end();return}l++,h.add(d);let x=(S,y,E=!1)=>{if(S)return o.emit("error",S);if(r&&!E){let b=[];for(let g of y)g.isSymbolicLink()&&b.push(g.realpath().then(_=>_!=null&&_.isUnknown()?_.lstat():_));if(b.length){Promise.all(b).then(()=>x(null,y,!0));return}}for(let b of y)b&&(!n||n(b))&&(o.write(s?b:b.fullpath())||(p=!0));l--;for(let b of y){let g=b.realpathCached()||b;g.shouldWalk(h,a)&&c.push(g)}p&&!o.flowing?o.once("drain",f):m||f()},m=!0;d.readdirCB(x,!0),m=!1}};return f(),o}streamSync(t=this.cwd,i={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof H||(i=t,t=this.cwd);let{withFileTypes:s=!0,follow:r=!1,filter:n,walkFilter:a}=i,o=new Dt({objectMode:!0}),h=new Set;(!n||n(t))&&o.write(s?t:t.fullpath());let c=[t],l=0,f=()=>{let p=!1;for(;!p;){let d=c.shift();if(!d){l===0&&o.end();return}l++,h.add(d);let x=d.readdirSync();for(let m of x)(!n||n(m))&&(o.write(s?m:m.fullpath())||(p=!0));l--;for(let m of x){let S=m;if(m.isSymbolicLink()){if(!(r&&(S=m.realpathSync())))continue;S.isUnknown()&&S.lstatSync()}S.shouldWalk(h,a)&&c.push(S)}}p&&!o.flowing&&o.once("drain",f)};return f(),o}chdir(t=this.cwd){let i=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[bn](i)}},te=class extends ri{sep="\\";constructor(t=process.cwd(),i={}){let{nocase:s=!0}=i;super(t,as,"\\",{...i,nocase:s}),this.nocase=s;for(let r=this.cwd;r;r=r.parent)r.nocase=this.nocase}parseRootPath(t){return as.parse(t).root.toUpperCase()}newRoot(t){return new ii(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},ee=class extends ri{sep="/";constructor(t=process.cwd(),i={}){let{nocase:s=!1}=i;super(t,$h,"/",{...i,nocase:s}),this.nocase=s}parseRootPath(t){return"/"}newRoot(t){return new si(this.rootPath,St,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},_e=class extends ee{constructor(t=process.cwd(),i={}){let{nocase:s=!0}=i;super(t,{...i,nocase:s})}},Jc=process.platform==="win32"?ii:si,vn=process.platform==="win32"?te:process.platform==="darwin"?_e:ee;var ru=e=>e.length>=1,nu=e=>e.length>=1,ie=class e{#t;#e;#n;length;#r;#a;#v;#y;#c;#o;#f=!0;constructor(t,i,s,r){if(!ru(t))throw new TypeError("empty pattern list");if(!nu(i))throw new TypeError("empty glob list");if(i.length!==t.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=t.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=t,this.#e=i,this.#n=s,this.#r=r,this.#n===0){if(this.isUNC()){let[n,a,o,h,...c]=this.#t,[l,f,p,d,...x]=this.#e;c[0]===""&&(c.shift(),x.shift());let m=[n,a,o,h,""].join("/"),S=[l,f,p,d,""].join("/");this.#t=[m,...c],this.#e=[S,...x],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[n,...a]=this.#t,[o,...h]=this.#e;a[0]===""&&(a.shift(),h.shift());let c=n+"/",l=o+"/";this.#t=[c,...a],this.#e=[l,...h],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===W}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#v=this.#v||(this.#n===0?this.isAbsolute()?this.#e[0]+this.#e.slice(1).join("/"):this.#e.join("/"):this.#e.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#a!==void 0?this.#a:this.hasMore()?(this.#a=new e(this.#t,this.#e,this.#n+1,this.#r),this.#a.#o=this.#o,this.#a.#c=this.#c,this.#a.#y=this.#y,this.#a):this.#a=null}isUNC(){let t=this.#t;return this.#c!==void 0?this.#c:this.#c=this.#r==="win32"&&this.#n===0&&t[0]===""&&t[1]===""&&typeof t[2]=="string"&&!!t[2]&&typeof t[3]=="string"&&!!t[3]}isDrive(){let t=this.#t;return this.#y!==void 0?this.#y:this.#y=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){let t=this.#t;return this.#o!==void 0?this.#o:this.#o=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){let t=this.#t[0];return typeof t=="string"&&this.isAbsolute()&&this.#n===0?t:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}};var au=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",se=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:i,nocase:s,noext:r,noglobstar:n,platform:a=au}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=a,this.mmopts={dot:!0,nobrace:i,nocase:s,noext:r,noglobstar:n,optimizationLevel:2,platform:a,nocomment:!0,nonegate:!0};for(let o of t)this.add(o)}add(t){let i=new et(t,this.mmopts);for(let s=0;s<i.set.length;s++){let r=i.set[s],n=i.globParts[s];if(!r||!n)throw new Error("invalid pattern object");for(;r[0]==="."&&n[0]===".";)r.shift(),n.shift();let a=new ie(r,n,0,this.platform),o=new et(a.globString(),this.mmopts),h=n[n.length-1]==="**",c=a.isAbsolute();c?this.absolute.push(o):this.relative.push(o),h&&(c?this.absoluteChildren.push(o):this.relativeChildren.push(o))}}ignored(t){let i=t.fullpath(),s=`${i}/`,r=t.relative()||".",n=`${r}/`;for(let a of this.relative)if(a.match(r)||a.match(n))return!0;for(let a of this.absolute)if(a.match(i)||a.match(s))return!0;return!1}childrenIgnored(t){let i=t.fullpath()+"/",s=(t.relative()||".")+"/";for(let r of this.relativeChildren)if(r.match(s))return!0;for(let r of this.absoluteChildren)if(r.match(i))return!0;return!1}};var hs=class e{store;constructor(t=new Map){this.store=t}copy(){return new e(new Map(this.store))}hasWalked(t,i){var s;return(s=this.store.get(t.fullpath()))==null?void 0:s.has(i.globString())}storeWalked(t,i){let s=t.fullpath(),r=this.store.get(s);r?r.add(i.globString()):this.store.set(s,new Set([i.globString()]))}},us=class{store=new Map;add(t,i,s){let r=(i?2:0)|(s?1:0),n=this.store.get(t);this.store.set(t,n===void 0?r:r&n)}entries(){return[...this.store.entries()].map(([t,i])=>[t,!!(i&2),!!(i&1)])}},cs=class{store=new Map;add(t,i){if(!t.canReaddir())return;let s=this.store.get(t);s?s.find(r=>r.globString()===i.globString())||s.push(i):this.store.set(t,[i])}get(t){let i=this.store.get(t);if(!i)throw new Error("attempting to walk unknown path");return i}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return[...this.store.keys()].filter(t=>t.canReaddir())}},Ce=class e{hasWalkedCache;matches=new us;subwalks=new cs;patterns;follow;dot;opts;constructor(t,i){this.opts=t,this.follow=!!t.follow,this.dot=!!t.dot,this.hasWalkedCache=i?i.copy():new hs}processPatterns(t,i){this.patterns=i;let s=i.map(r=>[t,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let a=n.root(),o=n.isAbsolute()&&this.opts.absolute!==!1;if(a){r=r.resolve(a==="/"&&this.opts.root!==void 0?this.opts.root:a);let f=n.rest();if(f)n=f;else{this.matches.add(r,!0,!1);continue}}if(r.isENOENT())continue;let h,c,l=!1;for(;typeof(h=n.pattern())=="string"&&(c=n.rest());)r=r.resolve(h),n=c,l=!0;if(h=n.pattern(),c=n.rest(),l){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n)}if(typeof h=="string"){let f=h===".."||h===""||h===".";this.matches.add(r.resolve(h),o,f);continue}else if(h===W){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let f=c==null?void 0:c.pattern(),p=c==null?void 0:c.rest();if(!c||(f===""||f===".")&&!p)this.matches.add(r,o,f===""||f===".");else if(f===".."){let d=r.parent||r;p?this.hasWalkedCache.hasWalked(d,p)||this.subwalks.add(d,p):this.matches.add(d,o,!0)}}else h instanceof RegExp&&this.subwalks.add(r,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new e(this.opts,this.hasWalkedCache)}filterEntries(t,i){let s=this.subwalks.get(t),r=this.child();for(let n of i)for(let a of s){let o=a.isAbsolute(),h=a.pattern(),c=a.rest();h===W?r.testGlobstar(n,a,c,o):h instanceof RegExp?r.testRegExp(n,h,c,o):r.testString(n,h,c,o)}return r}testGlobstar(t,i,s,r){if((this.dot||!t.name.startsWith("."))&&(i.hasMore()||this.matches.add(t,r,!1),t.canReaddir()&&(this.follow||!t.isSymbolicLink()?this.subwalks.add(t,i):t.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(t,s):i.markFollowGlobstar()&&this.subwalks.add(t,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(t,n,s.rest(),r);else if(n===".."){let a=t.parent||t;this.subwalks.add(a,s)}else n instanceof RegExp&&this.testRegExp(t,n,s.rest(),r)}}testRegExp(t,i,s,r){i.test(t.name)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}testString(t,i,s,r){t.isNamed(i)&&(s?this.subwalks.add(t,s):this.matches.add(t,r,!1))}};var ou=(e,t)=>typeof e=="string"?new se([e],t):Array.isArray(e)?new se(e,t):e,ni=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#e;#n;signal;maxDepth;includeChildMatches;constructor(t,i,s){if(this.patterns=t,this.path=i,this.opts=s,this.#n=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#e=ou(s.ignore??[],s),!this.includeChildMatches&&typeof this.#e.add!="function")){let r="cannot ignore child matches, ignore lacks add() method.";throw new Error(r)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#r(t){var i,s;return this.seen.has(t)||!!((s=(i=this.#e)==null?void 0:i.ignored)!=null&&s.call(i,t))}#a(t){var i,s;return!!((s=(i=this.#e)==null?void 0:i.childrenIgnored)!=null&&s.call(i,t))}pause(){this.paused=!0}resume(){var i;if((i=this.signal)!=null&&i.aborted)return;this.paused=!1;let t;for(;!this.paused&&(t=this.#t.shift());)t()}onResume(t){var i;(i=this.signal)!=null&&i.aborted||(this.paused?this.#t.push(t):t())}async matchCheck(t,i){if(i&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||await t.realpath(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&(n!=null&&n.isSymbolicLink())){let a=await n.realpath();a&&(a.isUnknown()||this.opts.stat)&&await a.lstat()}return this.matchCheckTest(n,i)}matchCheckTest(t,i){var s;return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!i||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!((s=t.realpathCached())!=null&&s.isDirectory()))&&!this.#r(t)?t:void 0}matchCheckSync(t,i){if(i&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=t.realpathCached()||t.realpathSync(),!s)return;t=s}let n=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&(n!=null&&n.isSymbolicLink())){let a=n.realpathSync();a&&(a!=null&&a.isUnknown()||this.opts.stat)&&a.lstatSync()}return this.matchCheckTest(n,i)}matchFinish(t,i){var n;if(this.#r(t))return;if(!this.includeChildMatches&&((n=this.#e)!=null&&n.add)){let a=`${t.relativePosix()}/**`;this.#e.add(a)}let s=this.opts.absolute===void 0?i:this.opts.absolute;this.seen.add(t);let r=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(s){let a=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(a+r)}else{let a=this.opts.posix?t.relativePosix():t.relative(),o=this.opts.dotRelative&&!a.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(a?o+a+r:"."+r)}}async match(t,i,s){let r=await this.matchCheck(t,s);r&&this.matchFinish(r,i)}matchSync(t,i,s){let r=this.matchCheckSync(t,s);r&&this.matchFinish(r,i)}walkCB(t,i,s){var r;(r=this.signal)!=null&&r.aborted&&s(),this.walkCB2(t,i,new Ce(this.opts),s)}walkCB2(t,i,s,r){var o;if(this.#a(t))return r();if((o=this.signal)!=null&&o.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2(t,i,s,r));return}s.processPatterns(t,i);let n=1,a=()=>{--n===0&&r()};for(let[h,c,l]of s.matches.entries())this.#r(h)||(n++,this.match(h,c,l).then(()=>a()));for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let c=h.readdirCached();h.calledReaddir()?this.walkCB3(h,c,s,a):h.readdirCB((l,f)=>this.walkCB3(h,f,s,a),!0)}a()}walkCB3(t,i,s,r){s=s.filterEntries(t,i);let n=1,a=()=>{--n===0&&r()};for(let[o,h,c]of s.matches.entries())this.#r(o)||(n++,this.match(o,h,c).then(()=>a()));for(let[o,h]of s.subwalks.entries())n++,this.walkCB2(o,h,s.child(),a);a()}walkCBSync(t,i,s){var r;(r=this.signal)!=null&&r.aborted&&s(),this.walkCB2Sync(t,i,new Ce(this.opts),s)}walkCB2Sync(t,i,s,r){var o;if(this.#a(t))return r();if((o=this.signal)!=null&&o.aborted&&r(),this.paused){this.onResume(()=>this.walkCB2Sync(t,i,s,r));return}s.processPatterns(t,i);let n=1,a=()=>{--n===0&&r()};for(let[h,c,l]of s.matches.entries())this.#r(h)||this.matchSync(h,c,l);for(let h of s.subwalkTargets()){if(this.maxDepth!==1/0&&h.depth()>=this.maxDepth)continue;n++;let c=h.readdirSync();this.walkCB3Sync(h,c,s,a)}a()}walkCB3Sync(t,i,s,r){s=s.filterEntries(t,i);let n=1,a=()=>{--n===0&&r()};for(let[o,h,c]of s.matches.entries())this.#r(o)||this.matchSync(o,h,c);for(let[o,h]of s.subwalks.entries())n++,this.walkCB2Sync(o,h,s.child(),a);a()}},Ae=class extends ni{matches=new Set;constructor(t,i,s){super(t,i,s)}matchEmit(t){this.matches.add(t)}async walk(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((i,s)=>{this.walkCB(this.path,this.patterns,()=>{var r;(r=this.signal)!=null&&r.aborted?s(this.signal.reason):i(this.matches)})}),this.matches}walkSync(){var t;if((t=this.signal)!=null&&t.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{var i;if((i=this.signal)!=null&&i.aborted)throw this.signal.reason}),this.matches}},Ie=class extends ni{results;constructor(t,i,s){super(t,i,s),this.results=new Dt({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(t){this.results.write(t),this.results.flowing||this.pause()}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end())}):this.walkCB(t,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var uu=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",xt=class{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,i){if(!i)throw new TypeError("glob options required");if(this.withFileTypes=!!i.withFileTypes,this.signal=i.signal,this.follow=!!i.follow,this.dot=!!i.dot,this.dotRelative=!!i.dotRelative,this.nodir=!!i.nodir,this.mark=!!i.mark,i.cwd?(i.cwd instanceof URL||i.cwd.startsWith("file://"))&&(i.cwd=hu(i.cwd)):this.cwd="",this.cwd=i.cwd||"",this.root=i.root,this.magicalBraces=!!i.magicalBraces,this.nobrace=!!i.nobrace,this.noext=!!i.noext,this.realpath=!!i.realpath,this.absolute=i.absolute,this.includeChildMatches=i.includeChildMatches!==!1,this.noglobstar=!!i.noglobstar,this.matchBase=!!i.matchBase,this.maxDepth=typeof i.maxDepth=="number"?i.maxDepth:1/0,this.stat=!!i.stat,this.ignore=i.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(t=t.map(h=>h.replace(/\\/g,"/"))),this.matchBase){if(i.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(h=>h.includes("/")?h:`./**/${h}`)}if(this.pattern=t,this.platform=i.platform||uu,this.opts={...i,platform:this.platform},i.scurry){if(this.scurry=i.scurry,i.nocase!==void 0&&i.nocase!==i.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let h=i.platform==="win32"?te:i.platform==="darwin"?_e:i.platform?ee:vn;this.scurry=new h(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",r={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},n=this.pattern.map(h=>new et(h,r)),[a,o]=n.reduce((h,c)=>(h[0].push(...c.set),h[1].push(...c.globParts),h),[[],[]]);this.patterns=a.map((h,c)=>{let l=o[c];if(!l)throw new Error("invalid pattern object");return new ie(h,l,0,this.platform)})}async walk(){return[...await new Ae(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new Ae(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new Ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new Ie(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var ls=(e,t={})=>{Array.isArray(e)||(e=[e]);for(let i of e)if(new et(i,t).hasMagic())return!0;return!1};function ai(e,t={}){return new xt(e,t).streamSync()}function En(e,t={}){return new xt(e,t).stream()}function oi(e,t={}){return new xt(e,t).walkSync()}async function wn(e,t={}){return new xt(e,t).walk()}function hi(e,t={}){return new xt(e,t).iterateSync()}function _n(e,t={}){return new xt(e,t).iterate()}var cu=ai,lu=Object.assign(En,{sync:ai}),fu=hi,pu=Object.assign(_n,{sync:hi}),du=Object.assign(oi,{stream:ai,iterate:hi}),Sn=Object.assign(wn,{glob:wn,globSync:oi,sync:du,globStream:En,stream:lu,globStreamSync:ai,streamSync:cu,globIterate:_n,iterate:pu,globIterateSync:hi,iterateSync:fu,Glob:xt,hasMagic:ls,escape:Yt,unescape:dt});Sn.glob=Sn;var Rt=class{static get useFileContent(){var t,i;return((i=(t=tt.config.config)==null?void 0:t.idempotency)==null?void 0:i.useFileContent)??!1}static get location(){var t,i;return((i=(t=tt.config.config)==null?void 0:t.idempotency)==null?void 0:i.location)??"./node_modules/.cache/bsm/idempotency"}static updateHashForFile(t,i){try{if(this.useFileContent){let s=$t.readFileSync(i);t.update(s)}else{let s=$t.lstatSync(i);t.update(s.ctimeMs.toString()),t.update(s.mtimeMs.toString())}}catch{}}static updateHashForDir(t,i){try{$t.readdirSync(i,{withFileTypes:!0,recursive:!0}).forEach(s=>{if(s.name==null)return;let r=Cn.join(s.parentPath??s.path??i,s.name).replace(/\\/g,"/");t.update(r),s.isFile()&&this.updateHashForFile(t,r)})}catch{}}static updateHashForGlob(t,i){try{let s=oi(i,{withFileTypes:!0});for(let r of s){let n=Cn.relative(process.cwd(),r.fullpath());r.isFile()?this.updateHashForFile(t,n):this.updateHashForDir(t,n)}}catch{}}static calculateIdempotencyHash(t,i){var n;let s=[];if(Array.isArray(t))s.push(...t);else if(typeof t=="string")s.push(t);else for(let a of Object.values(t))Array.isArray(a)?s.push(...a):s.push(a);let r=mu("sha256");for(let a of s){let o=a.split(":")[0],h=a.substring(o.length+1);switch(o){case"static":r.update(h);break;case"env":r.update(h),r.update(((n=i==null?void 0:i.env)==null?void 0:n[h])??process.env[h]??Buffer.of());break;case"file":this.updateHashForFile(r,h);break;case"dir":this.updateHashForDir(r,h);break;case"glob":this.updateHashForGlob(r,h);break;default:A.log(`\x1B[33m[Idempotency]\x1B[0m Unknown type: ${o}, using value as static`),r.update(a)}}return r.digest("hex")}static getFileName(t){let i=t.join(".");return`${this.location}/${i}.hash`.replaceAll("*","__all__")}static saveIdempotencyHash(t,i){$t.mkdirSync(this.location,{recursive:!0}),$t.writeFileSync(this.getFileName(i),t)}static getSavedIdempotencyHash(t){let i=this.getFileName(t);if($t.existsSync(i))return $t.readFileSync(i,"utf-8")}static checkIdempotency(t,i,s){let r=t.$idempotency,n=this.calculateIdempotencyHash(r,s);return this.getSavedIdempotencyHash(i)===n}static saveIdempotency(t,i){let s=t.$idempotency,r=this.calculateIdempotencyHash(s);this.saveIdempotencyHash(r,i)}static hasIdempotencyEnabled(t){return process.env.BSM_DISABLE_IDEMPOTENCY==="true"||!Object.hasOwn(t,"$idempotency")?!1:Object.hasOwn(t,"$idempotencyEnabled")?!!t.$idempotencyEnabled:!0}};var Ft=class extends Error{constructor(i,s){super();this.code=i;this.script=s}},re=class extends Ft{constructor(i,s){super(1,s);this.func=i;this.script=s}};var Mt=class e{static async run(t){let i=tt.config;await e.runScript(i.scripts,t.split("."),[],{})}static async runScript(t,i,s,r){typeof t=="function"?await e.executeFunction(t,i,s,r):typeof t=="string"?await e.executeString(t,i,s,r):typeof t=="object"?Array.isArray(t)?await e.executeArray(t,i,s,r):await e.executeObject(t,i,s,r):await e.notFound(s,r)}static async notFound(t,i,s){var r;if(!i.ignoreNotFound){if(s){let n=t[t.length-1],a=t.slice(0,-1);if(a.length===0?A.error(`\x1B[31mScript '${n}' does not exist\x1B[0m`):A.error(`\x1B[31mScript '${a.join(".")}' does not have a '${n}' script\x1B[0m`),((r=tt.config.config)==null?void 0:r.defaultHelpBehavior)==="interactive"){let o=await Wt.selectScript(tt.config,{_:[t.join(".")]});await this.run(o[0]),process.exit(0)}else A.log(),Object.hasOwn(s,"$description")&&(lt.printCommand(s,a),A.log()),A.log("\x1B[1mTry one of the following:\x1B[0m"),lt.printCommands(s,a,!1)}else A.error(`\x1B[31mScript '${t.join(".")}' not found\x1B[0m`);process.exit(127)}}static async executeFunction(t,i,s,r){var o;A.log(`> \x1B[93mExecuting JavaScript function\x1B[0m \x1B[90m(${[...s].join(".")})\x1B[0m`);let n,a=process.env;try{process.env={...process.env,...r.env},n=await t.call(null,process.argv)}catch(h){throw h instanceof Error&&(h.stack=(o=h.stack)==null?void 0:o.split(" at executeFunction")[0]),new re(h,s.join("."))}finally{process.env=a}if(n==null){i.length>0&&await e.notFound([...s,...i],r);return}await e.runScript(n,i,s,{...r,excludeArgs:!0})}static async executeString(t,i,s,r){if(i.length>0){await e.notFound([...s,...i],r);return}!r.excludeArgs&&process.argv.length&&(t+=" "+process.argv.join(" ")),A.log(`> ${t} \x1B[90m(${s.join(".")})\x1B[0m`),process.env.BSM_LOG_FILE&&fs.appendFileSync(process.env.BSM_LOG_FILE,`${new Date().toISOString()} ${t} ${s.join(".")} ${process.cwd()}
17
+ `),t!==""&&(t=t.replace(/bsm ~/g,"bsm \\~"),await new Promise((n,a)=>{gu.spawn(t,[],{stdio:"inherit",shell:!0,env:{...process.env,...r.env,BSM_PATH:s.slice(0,-1).join("."),BSM_SCRIPT:s.join(".")}}).on("close",h=>{h===0?n():a(new Ft(h,s.join(".")))})}))}static async executeArray(t,i,s,r){if(i.length===0||i[0]==="*")for(let n=0;n<t.length;n++)await e.runScript(t[n],i.slice(1),[...s,n.toString()],{...r,ignoreNotFound:i[0]==="*"?!0:r.ignoreNotFound});else{let n=i[0],a=e.subscript(t,n);if(a)await e.runScript(a[1],i.slice(1),[...s,a[0]],r);else{await e.notFound([...s,n],r,t);return}}}static shouldRun(t,i,s,r){return Rt.hasIdempotencyEnabled(t)&&Rt.checkIdempotency(t,[...s,...i],r)?(A.log(`\x1B[90mNot running ${[...s,...i].join(".")} because the idempotency hash is the same\x1B[0m`),!1):!0}static async executeObject(t,i,s,r){try{if(Object.hasOwn(t,"$env")&&(r.env={...r.env,...e.getEnv(t.$env)}),!e.shouldRun(t,i,s,r))return;if(await e.executeHook(t,"_pre",s,r),i.length===0)await e.runObject(t,s,r);else if(i[0]==="*")for(let n in t)n.startsWith("_")||n.startsWith("$")||Object.hasOwn(t,n)&&await e.runScript(t[n],i.slice(1),[...s,n],{...r,ignoreNotFound:!0});else{let n=i[0],a=e.subscript(t,n);if(a)await e.runScript(a[1],i.slice(1),[...s,a[0]],r);else{await e.notFound([...s,n],r,t);return}}await e.executeHook(t,"_post",s,r),Rt.hasIdempotencyEnabled(t)&&Rt.saveIdempotency(t,[...s,...i])}catch(n){if(n instanceof Ft?process.env.BSM_ERROR=n.code.toString():process.env.BSM_ERROR="1",await e.executeHook(t,"_onError",s,r),!await e.executeHook(t,"_catch",s,r))throw n;Rt.hasIdempotencyEnabled(t)&&Rt.saveIdempotency(t,[...s,...i])}finally{await e.executeHook(t,"_finally",s,r)}}static subscript(t,i,s=!0){if(typeof t=="object"&&(Object.hasOwn(t,i)||(i=(function(){var n;if((n=tt.config.config)!=null&&n.caseInsensitive){let a=Object.keys(t).find(o=>o.toLowerCase()===i.toLowerCase());if(a)return a}if(s){let a=e.resolveAlias(t,i);if(a)return a}})()??i),!!Object.hasOwn(t,i)))if(Array.isArray(t)){let r=parseInt(i);return[i,t[r]]}else return[i,t[i]]}static resolveAlias(t,i){var s;for(let[r,n]of Object.entries(t)){if(typeof n!="object"||Array.isArray(n)||!Object.hasOwn(n,"$alias"))continue;let a=e.getAliases(n.$alias);if(a.includes(i)||(s=tt.config.config)!=null&&s.caseInsensitive&&a.map(o=>o.toLowerCase()).includes(i.toLowerCase()))return r}}static getAliases(t){return typeof t=="string"?[t]:Array.isArray(t)?t.flatMap(e.getAliases):(A.error(`\x1B[31mAlias with type ${typeof t} is not supported\x1B[0m`),[])}static getEnv(t){if(typeof t=="string"){if(t==="")return{};if(t.startsWith("file:")){let i=xu.join(process.cwd(),t.slice(5));if(!fs.existsSync(i))return A.error(`\x1B[31mFile '${i}' does not exist\x1B[0m
18
18
  \x1B[1mRunning script without these environment variables\x1B[0m
19
- `),{};let r=ps.readFileSync(i,"utf-8").replaceAll("\r","").split(`
19
+ `),{};let r=fs.readFileSync(i,"utf-8").replaceAll("\r","").split(`
20
20
  `).filter(a=>!a.startsWith("#")&&a.trim()!==""),n={};for(let a of r){let h=/^([^=]+)=(['"])?(.+)\2$/g.exec(a);if(h){let c=h[3];h[2]==='"'&&(c=c.replaceAll(/(?<=(?<!\\)(\\\\)*)\\n/g,`
21
- `).replaceAll(/(?<=(?<!\\)(\\\\)*)\\t/g," ").replaceAll(/(?<=(?<!\\)(\\\\)*)\\r/g,"\r").replaceAll(/(?<=(?<!\\)(\\\\)*)\\\\/g,"\\")),n[h[1]]=c}}return n}else return I.error(`\x1B[31mCurrently only 'file:' is supported for environment variables\x1B[0m
22
- `),{}}else if(typeof t=="object")if(Array.isArray(t)){let i={};for(let s of t)i={...i,...e.getEnv(s)};return i}else return t;else{let i=t.call(null,process.argv);return i===void 0?{}:e.getEnv(i)}}static async executeHook(t,i,s,r){return Object.hasOwn(t,i)?(await e.runScript(t[i],[],[...s,i],{...r,excludeArgs:!0}),!0):!1}static get _isCI(){return In.isCI}static get objectScripts(){let[t,i,s]=process.versions.node.split("."),r=[`_${process.platform}`,`_${process.arch}`,`_node${t}_${i}_${s}`,`_node${t}_${i}`,`_node${t}`,"_default"];return e._isCI&&r.unshift("_ci"),r}static async runObject(t,i,s){for(let r of e.objectScripts)if(Object.hasOwn(t,r)){await e.runScript(t[r],[],[...i,r],s);return}await e.notFound([...i,"_default"],s,t)}static isExecutable(t){if(typeof t=="function"||typeof t=="string")return!0;if(typeof t!="object")return!1;if(Array.isArray(t))return!0;for(let i of e.objectScripts)if(Object.hasOwn(t,i))return!0;return!1}};var Wt=class{static async selectScript(t,i){var o;let r=(((o=i._[0])==null?void 0:o.replace(/^~/,process.env.BSM_PATH??"~"))??"").split("."),n=[],a=t.scripts;for(let h of r){let c;if(Array.isArray(a)?c=a[Number.parseInt(h)]:c=a[h],typeof c!="object")break;n.push([h,a]),a=c}return yu((h,c)=>{let[l,f]=ui(n),[p,d]=ui(a),y=vu(()=>typeof p=="string"||typeof p=="function"?[]:Object.entries(p).map(N=>[N[0],N[1],lt.getCommandHelp(N[1],[N[0]])]).filter(N=>N[2]!==void 0),[p,l]),[m,b]=ui(0),[g,E]=ui(!1),S=y.length,x=y[m][0],_=y[m][1],L=[...l.map(N=>N[0]),x].join("."),A=`
23
- \x1B[1mRun command \xBB \x1B[90m${L}\x1B[0m`;if(g)return c([L]),A;function J(){typeof _=="object"&&(b(0),f([...l,[x,p]]),d(_))}bu(N=>{if(N.name==="up")b((m-1+S)%S);else if(N.name==="down")b((m+1)%S);else if(N.name==="left"){if(l.length===0)return;let li=l.slice(0,-1),fi=l[l.length-1];b(Object.keys(fi[1]).indexOf(fi[0])),f(li),d(fi[1])}else N.name==="right"?J():N.name==="return"&&(Mt.isExecutable(_)?E(!0):J())});let W=y.map((N,li)=>`${li===m?"\x1B[32m\x1B[1m> \x1B[4m":" "}${N[2]}`).join(`
24
- `);return`${A}
25
- ${W}\x1B[?25l`})({message:"test"}).catch(()=>process.exit(1))}};import Rn from"path";function Tn(e){return Array.isArray(e)?e:Object.entries(e).filter(([t])=>!t.startsWith("$")).map(([,t])=>t)}function wu(e,t){if(!t)return;let i=process.platform==="win32"?";":":",s=t.join(i);!process.env.Path||process.env.Path.includes(s)||(e.Path=`${process.env.Path}${i}${s}`)}function Su(){let e=[],t=process.cwd();do e.push(Rn.join(t,"node_modules/.bin"));while(t!==(t=Rn.join(t,"../")));return e}function kn(e,t){if(t.length===0)return e;if(typeof e!="object")return;let i=t[0],s=Mt.subscript(e,i,!1);if(s)return kn(s[1],t.slice(1))}var ci=class{constructor(t){this.argv=t}config;async run(){this.argv.silent&&I.silence(),this.argv.version&&lt.printVersion(),this.config=await tt.load(this.argv),this.handleDebug(),this.argv.help&&lt.printHelp(this.config,this.argv),this.argv.interactive&&(this.argv._=await Wt.selectScript(this.config,this.argv)),this.argv.force&&(process.env.BSM_DISABLE_IDEMPOTENCY="true"),await this.handleNoArgs(),wu(process.env,Su());for(let t of this.argv._){if(t=t.replace(/^\\~/g,"~"),t.startsWith("~")&&process.env.BSM_PATH){let i=process.env.BSM_PATH.split("."),s=kn(this.config.scripts,i);if(s){await Mt.runScript(s,t.split(".").splice(1),i,{});continue}}await Mt.run(t)}}handleDebug(){if(this.argv.debug)switch(this.argv.debug){case"extends":{let t=this.config.extends;if(t)for(let i of t)typeof i=="string"?I.log(i):I.log(i[0]);return process.exit(0)}case"scripts":{let t=[...Tn(this.config.scripts)],i=[];for(;t.length>0;){let s=t.shift();s&&(typeof s=="string"?i.push(s):typeof s=="object"&&t.push(...Tn(s)))}return I.log(i.join(`
26
- `)),process.exit(0)}}}async handleNoArgs(){var s,r;if(this.argv._.length>0)return;let t=process.env.npm_lifecycle_event;if(t&&t!=="npx"){this.argv._=[t.replaceAll(":",".")];return}(((s=this.config.config)==null?void 0:s.defaultNoArgsBehavior)??((r=this.config.config)==null?void 0:r.defaultHelpBehavior)??"help")==="interactive"?this.argv._=await Wt.selectScript(this.config,this.argv):lt.printHelp(this.config,this.argv)}};var Nn=(0,Pn.default)(process.argv.slice(2),{"--":!0,boolean:["interactive","help","version","silent"],alias:{help:"h",version:"v",interactive:"i",force:"f",silent:"s"}});process.argv=Nn["--"]??[];async function Eu(){await new ci(Nn).run()}Eu().catch(e=>{e instanceof ne&&(I.error(e.func),I.error(`\x1B[31mError executing function '${e.script}'\x1B[0m`),process.exit(1)),e instanceof Ft&&(I.error(`\x1B[31mScript failed with code ${e.code}\x1B[0m \x1B[90m(${e.script})\x1B[0m`),process.exit(e.code)),I.error(e),I.error("\x1B[31mScript failed\x1B[0m"),process.exit(1)});export{Eu as main};
21
+ `).replaceAll(/(?<=(?<!\\)(\\\\)*)\\t/g," ").replaceAll(/(?<=(?<!\\)(\\\\)*)\\r/g,"\r").replaceAll(/(?<=(?<!\\)(\\\\)*)\\\\/g,"\\")),n[h[1]]=c}}return n}else return A.error(`\x1B[31mCurrently only 'file:' is supported for environment variables\x1B[0m
22
+ `),{}}else if(typeof t=="object")if(Array.isArray(t)){let i={};for(let s of t)i={...i,...e.getEnv(s)};return i}else return t;else{let i=t.call(null,process.argv);return i===void 0?{}:e.getEnv(i)}}static async executeHook(t,i,s,r){return Object.hasOwn(t,i)?(await e.runScript(t[i],[],[...s,i],{...r,excludeArgs:!0}),!0):!1}static get _isCI(){return An.isCI}static get objectScripts(){let[t,i,s]=process.versions.node.split("."),r=[`_${process.platform}`,`_${process.arch}`,`_node${t}_${i}_${s}`,`_node${t}_${i}`,`_node${t}`,"_default"];return e._isCI&&r.unshift("_ci"),r}static async runObject(t,i,s){for(let r of e.objectScripts)if(Object.hasOwn(t,r)){await e.runScript(t[r],[],[...i,r],s);return}await e.notFound([...i,"_default"],s,t)}static isExecutable(t){if(typeof t=="function"||typeof t=="string")return!0;if(typeof t!="object")return!1;if(Array.isArray(t))return!0;for(let i of e.objectScripts)if(Object.hasOwn(t,i))return!0;return!1}};var Wt=class{static async selectScript(t,i){var o;let r=(((o=i._[0])==null?void 0:o.replace(/^~/,process.env.BSM_PATH??"~"))??"").split("."),n=[],a=t.scripts;for(let h of r){let c;if(Array.isArray(a)?c=a[Number.parseInt(h)]:c=a[h],typeof c!="object")break;n.push([h,a]),a=c}return yu((h,c)=>{let[l,f]=ui(n),[p,d]=ui(a),x=vu(()=>typeof p=="string"||typeof p=="function"?[]:Object.entries(p).map(k=>[k[0],k[1],lt.getCommandHelp(k[1],[k[0]])]).filter(k=>k[2]!==void 0),[p,l]),[m,S]=ui(0),[y,E]=ui(!1),b=x.length,g=x[m][0],_=x[m][1],L=[...l.map(k=>k[0]),g].join("."),I=`
23
+ \x1B[1mRun command \xBB \x1B[90m${L}\x1B[0m`;if(y)return c([L]),I;function q(){typeof _=="object"&&(S(0),f([...l,[g,p]]),d(_))}bu(k=>{if(k.name==="up")S((m-1+b)%b);else if(k.name==="down")S((m+1)%b);else if(k.name==="left"){if(l.length===0)return;let Re=l.slice(0,-1),li=l[l.length-1];S(Object.keys(li[1]).indexOf(li[0])),f(Re),d(li[1])}else k.name==="right"?q():k.name==="return"&&(Mt.isExecutable(_)?E(!0):q())});let M=x.map((k,Re)=>`${Re===m?"\x1B[32m\x1B[1m> \x1B[4m":" "}${k[2]}`).join(`
24
+ `);return`${I}
25
+ ${M}\x1B[?25l`})({message:"test"}).catch(()=>process.exit(1))}};import In from"path";function Rn(e){return Array.isArray(e)?e:Object.entries(e).filter(([t])=>!t.startsWith("$")).map(([,t])=>t)}function wu(e,t){if(!t)return;let i=process.platform==="win32"?";":":",s=t.join(i);!process.env.Path||process.env.Path.includes(s)||(e.Path=`${process.env.Path}${i}${s}`)}function Su(){let e=[],t=process.cwd();do e.push(In.join(t,"node_modules/.bin"));while(t!==(t=In.join(t,"../")));return e}function Tn(e,t){if(t.length===0)return e;if(typeof e!="object")return;let i=t[0],s=Mt.subscript(e,i,!1);if(s)return Tn(s[1],t.slice(1))}var ci=class{constructor(t){this.argv=t}config;async run(){this.argv.silent&&A.silence(),this.argv.version&&lt.printVersion(),this.config=await tt.load(this.argv),this.handleDebug(),this.argv.help&&lt.printHelp(this.config,this.argv),this.argv.interactive&&(this.argv._=await Wt.selectScript(this.config,this.argv)),this.argv.force&&(process.env.BSM_DISABLE_IDEMPOTENCY="true"),await this.handleNoArgs(),wu(process.env,Su());for(let t of this.argv._){if(t=t.replace(/^\\~/g,"~"),t.startsWith("~")&&process.env.BSM_PATH){let i=process.env.BSM_PATH.split("."),s=Tn(this.config.scripts,i);if(s){await Mt.runScript(s,t.split(".").splice(1),i,{});continue}}await Mt.run(t)}}handleDebug(){if(this.argv.debug)switch(this.argv.debug){case"extends":{let t=this.config.extends;if(t)for(let i of t)typeof i=="string"?A.log(i):A.log(i[0]);return process.exit(0)}case"scripts":{let t=[...Rn(this.config.scripts)],i=[];for(;t.length>0;){let s=t.shift();s&&(typeof s=="string"?i.push(s):typeof s=="object"&&t.push(...Rn(s)))}return A.log(i.join(`
26
+ `)),process.exit(0)}}}async handleNoArgs(){var s,r;if(this.argv._.length>0)return;let t=process.env.npm_lifecycle_event;if(t&&t!=="npx"){this.argv._=[t.replaceAll(":",".")];return}(((s=this.config.config)==null?void 0:s.defaultNoArgsBehavior)??((r=this.config.config)==null?void 0:r.defaultHelpBehavior)??"help")==="interactive"?this.argv._=await Wt.selectScript(this.config,this.argv):lt.printHelp(this.config,this.argv)}};var Pn=(0,kn.default)(process.argv.slice(2),{"--":!0,boolean:["interactive","help","version","silent"],alias:{help:"h",version:"v",interactive:"i",force:"f",silent:"s"}});process.argv=Pn["--"]??[];async function Eu(){await new ci(Pn).run()}Eu().catch(e=>{e instanceof re&&(A.error(e.func),A.error(`\x1B[31mError executing function '${e.script}'\x1B[0m`),process.exit(1)),e instanceof Ft&&(A.error(`\x1B[31mScript failed with code ${e.code}\x1B[0m \x1B[90m(${e.script})\x1B[0m`),process.exit(e.code)),A.error(e),A.error("\x1B[31mScript failed\x1B[0m"),process.exit(1)});export{Eu as main};