@crossdelta/platform-sdk 0.5.4 → 0.5.6

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.
package/bin/cli.js CHANGED
@@ -24,21 +24,21 @@ Expecting one of '${s.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
24
24
  `),this.outputHelp({error:!0}));let s=t||{},i=s.exitCode||1,n=s.code||"commander.error";this._exit(i,n,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in Y.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,Y.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new oy(this.options),t=s=>this.getOptionValue(s)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(s));this.options.filter(s=>s.implied!==void 0&&t(s.attributeName())&&e.valueFromOption(this.getOptionValue(s.attributeName()),s)).forEach(s=>{Object.keys(s.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,s.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let s=o=>{let a=o.attributeName(),c=this.getOptionValue(a),l=this.options.find(h=>h.negate&&a===h.attributeName()),u=this.options.find(h=>!h.negate&&a===h.attributeName());return l&&(l.presetArg===void 0&&c===!1||l.presetArg!==void 0&&c===l.presetArg)?l:u||o},i=o=>{let a=s(o),c=a.attributeName();return this.getOptionValueSource(c)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},n=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(n,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],n=this;do{let o=n.createHelp().visibleOptions(n).filter(a=>a.long).map(a=>a.long);i=i.concat(o),n=n.parent}while(n&&!n._enablePositionalOptions);t=Nh(e,i)}let s=`error: unknown option '${e}'${t}`;this.error(s,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,s=t===1?"":"s",n=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${s} but got ${e.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(n=>{i.push(n.name()),n.alias()&&i.push(n.alias())}),t=Nh(e,i)}let s=`error: unknown command '${e}'${t}`;this.error(s,{code:"commander.unknownCommand"})}version(e,t,s){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",s=s||"output the version number";let i=this.createOption(t,s);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
25
25
  `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let s=this.parent?._findCommand(e);if(s){let i=[s.name()].concat(s.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(s=>sy(s));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=Zt.basename(e,Zt.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),s=this._getOutputContext(e);t.prepareContext({error:s.error,helpWidth:s.helpWidth,outputHasColors:s.hasColors});let i=t.formatHelp(this,t);return s.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,s,i,n;return t?(s=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),n=this._outputConfiguration.getErrHelpWidth()):(s=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),n=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),s(a)),hasColors:i,helpWidth:n}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let s=this._getOutputContext(e),i={error:s.error,write:s.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation({error:s.error});if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");s.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=Number(Y.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let s=["beforeAll","before","after","afterAll"];if(!s.includes(e))throw new Error(`Unexpected value for position to addHelpText.
26
26
  Expecting one of '${s.join("', '")}'`);let i=`${e}Help`;return this.on(i,n=>{let o;typeof t=="function"?o=t({error:n.error,command:n.command}):o=t,o&&n.write(`${o}
27
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Lh(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,s="127.0.0.1",i="9229",n;return(n=e.match(/^(--inspect(-brk)?)$/))!==null?t=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:s=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=n[1],s=n[3],i=n[4]),t&&i!=="0"?`${t}=${s}:${parseInt(i)+1}`:e})}function kc(){if(Y.env.NO_COLOR||Y.env.FORCE_COLOR==="0"||Y.env.FORCE_COLOR==="false")return!1;if(Y.env.FORCE_COLOR||Y.env.CLICOLOR_FORCE!==void 0)return!0}Sc.Command=Ec;Sc.useColor=kc});var Hh=D(tt=>{var{Argument:Wh}=Jn(),{Command:_c}=Uh(),{CommanderError:ay,InvalidArgumentError:qh}=Wi(),{Help:cy}=gc(),{Option:Vh}=Dc();tt.program=new _c;tt.createCommand=r=>new _c(r);tt.createOption=(r,e)=>new Vh(r,e);tt.createArgument=(r,e)=>new Wh(r,e);tt.Command=_c;tt.Option=Vh;tt.Argument=Wh;tt.Help=cy;tt.CommanderError=ay;tt.InvalidArgumentError=qh;tt.InvalidOptionArgumentError=qh});var Tc=D((zE,ef)=>{"use strict";ef.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",s=e.indexOf(t+r),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}});var sf=D((KE,rf)=>{"use strict";var Ly=require("os"),tf=require("tty"),rt=Tc(),{env:me}=process,hr;rt("no-color")||rt("no-colors")||rt("color=false")||rt("color=never")?hr=0:(rt("color")||rt("colors")||rt("color=true")||rt("color=always"))&&(hr=1);"FORCE_COLOR"in me&&(me.FORCE_COLOR==="true"?hr=1:me.FORCE_COLOR==="false"?hr=0:hr=me.FORCE_COLOR.length===0?1:Math.min(parseInt(me.FORCE_COLOR,10),3));function Fc(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Oc(r,e){if(hr===0)return 0;if(rt("color=16m")||rt("color=full")||rt("color=truecolor"))return 3;if(rt("color=256"))return 2;if(r&&!e&&hr===void 0)return 0;let t=hr||0;if(me.TERM==="dumb")return t;if(process.platform==="win32"){let s=Ly.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in me)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(s=>s in me)||me.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in me)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(me.TEAMCITY_VERSION)?1:0;if(me.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in me){let s=parseInt((me.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(me.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(me.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(me.TERM)||"COLORTERM"in me?1:t}function Uy(r){let e=Oc(r,r&&r.isTTY);return Fc(e)}rf.exports={supportsColor:Uy,stdout:Fc(Oc(!0,tf.isatty(1))),stderr:Fc(Oc(!0,tf.isatty(2)))}});var af=D((ZE,of)=>{"use strict";var Wy=sf(),Rs=Tc();function nf(r){if(/^\d{3,4}$/.test(r)){let t=/(\d{1,2})(\d{2})/.exec(r)||[];return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let e=(r||"").split(".").map(t=>parseInt(t,10));return{major:e[0],minor:e[1],patch:e[2]}}function Ic(r){let{CI:e,FORCE_HYPERLINK:t,NETLIFY:s,TEAMCITY_VERSION:i,TERM_PROGRAM:n,TERM_PROGRAM_VERSION:o,VTE_VERSION:a,TERM:c}=process.env;if(t)return!(t.length>0&&parseInt(t,10)===0);if(Rs("no-hyperlink")||Rs("no-hyperlinks")||Rs("hyperlink=false")||Rs("hyperlink=never"))return!1;if(Rs("hyperlink=true")||Rs("hyperlink=always")||s)return!0;if(!Wy.supportsColor(r)||r&&!r.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||e||i)return!1;if(n){let l=nf(o||"");switch(n){case"iTerm.app":return l.major===3?l.minor>=1:l.major>3;case"WezTerm":return l.major>=20200620;case"vscode":return l.major>1||l.major===1&&l.minor>=72;case"ghostty":return!0}}if(a){if(a==="0.50.0")return!1;let l=nf(a);return l.major>0||l.minor>=50}switch(c){case"alacritty":return!0}return!1}of.exports={supportsHyperlink:Ic,stdout:Ic(process.stdout),stderr:Ic(process.stderr)}});var hf=D((XE,Hi)=>{"use strict";var qy=typeof process<"u"&&process.env.TERM_PROGRAM==="Hyper",Vy=typeof process<"u"&&process.platform==="win32",cf=typeof process<"u"&&process.platform==="linux",Bc={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",question:"?",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},lf=Object.assign({},Bc,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),uf=Object.assign({},Bc,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:cf?"\u25B8":"\u276F",pointerSmall:cf?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});Hi.exports=Vy&&!qy?lf:uf;Reflect.defineProperty(Hi.exports,"common",{enumerable:!1,value:Bc});Reflect.defineProperty(Hi.exports,"windows",{enumerable:!1,value:lf});Reflect.defineProperty(Hi.exports,"other",{enumerable:!1,value:uf})});var ro=D((QE,Pc)=>{"use strict";var Hy=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),Gy=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,zy=()=>typeof process<"u"?process.env.FORCE_COLOR!=="0":!1,ff=()=>{let r={enabled:zy(),visible:!0,styles:{},keys:{}},e=n=>{let o=n.open=`\x1B[${n.codes[0]}m`,a=n.close=`\x1B[${n.codes[1]}m`,c=n.regex=new RegExp(`\\u001b\\[${n.codes[1]}m`,"g");return n.wrap=(l,u)=>{l.includes(a)&&(l=l.replace(c,a+o));let h=o+l+a;return u?h.replace(/\r*\n/g,`${a}$&${o}`):h},n},t=(n,o,a)=>typeof n=="function"?n(o):n.wrap(o,a),s=(n,o)=>{if(n===""||n==null)return"";if(r.enabled===!1)return n;if(r.visible===!1)return"";let a=""+n,c=a.includes(`
27
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Lh(r){return r.map(e=>{if(!e.startsWith("--inspect"))return e;let t,s="127.0.0.1",i="9229",n;return(n=e.match(/^(--inspect(-brk)?)$/))!==null?t=n[1]:(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=n[1],/^\d+$/.test(n[3])?i=n[3]:s=n[3]):(n=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=n[1],s=n[3],i=n[4]),t&&i!=="0"?`${t}=${s}:${parseInt(i)+1}`:e})}function kc(){if(Y.env.NO_COLOR||Y.env.FORCE_COLOR==="0"||Y.env.FORCE_COLOR==="false")return!1;if(Y.env.FORCE_COLOR||Y.env.CLICOLOR_FORCE!==void 0)return!0}Sc.Command=Ec;Sc.useColor=kc});var Hh=D(tt=>{var{Argument:Wh}=Jn(),{Command:_c}=Uh(),{CommanderError:ay,InvalidArgumentError:qh}=Wi(),{Help:cy}=gc(),{Option:Vh}=Dc();tt.program=new _c;tt.createCommand=r=>new _c(r);tt.createOption=(r,e)=>new Vh(r,e);tt.createArgument=(r,e)=>new Wh(r,e);tt.Command=_c;tt.Option=Vh;tt.Argument=Wh;tt.Help=cy;tt.CommanderError=ay;tt.InvalidArgumentError=qh;tt.InvalidOptionArgumentError=qh});var Tc=D((zE,ef)=>{"use strict";ef.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",s=e.indexOf(t+r),i=e.indexOf("--");return s!==-1&&(i===-1||s<i)}});var sf=D((KE,rf)=>{"use strict";var Ly=require("os"),tf=require("tty"),rt=Tc(),{env:me}=process,fr;rt("no-color")||rt("no-colors")||rt("color=false")||rt("color=never")?fr=0:(rt("color")||rt("colors")||rt("color=true")||rt("color=always"))&&(fr=1);"FORCE_COLOR"in me&&(me.FORCE_COLOR==="true"?fr=1:me.FORCE_COLOR==="false"?fr=0:fr=me.FORCE_COLOR.length===0?1:Math.min(parseInt(me.FORCE_COLOR,10),3));function Fc(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Oc(r,e){if(fr===0)return 0;if(rt("color=16m")||rt("color=full")||rt("color=truecolor"))return 3;if(rt("color=256"))return 2;if(r&&!e&&fr===void 0)return 0;let t=fr||0;if(me.TERM==="dumb")return t;if(process.platform==="win32"){let s=Ly.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in me)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(s=>s in me)||me.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in me)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(me.TEAMCITY_VERSION)?1:0;if(me.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in me){let s=parseInt((me.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(me.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(me.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(me.TERM)||"COLORTERM"in me?1:t}function Uy(r){let e=Oc(r,r&&r.isTTY);return Fc(e)}rf.exports={supportsColor:Uy,stdout:Fc(Oc(!0,tf.isatty(1))),stderr:Fc(Oc(!0,tf.isatty(2)))}});var af=D((ZE,of)=>{"use strict";var Wy=sf(),Rs=Tc();function nf(r){if(/^\d{3,4}$/.test(r)){let t=/(\d{1,2})(\d{2})/.exec(r)||[];return{major:0,minor:parseInt(t[1],10),patch:parseInt(t[2],10)}}let e=(r||"").split(".").map(t=>parseInt(t,10));return{major:e[0],minor:e[1],patch:e[2]}}function Ic(r){let{CI:e,FORCE_HYPERLINK:t,NETLIFY:s,TEAMCITY_VERSION:i,TERM_PROGRAM:n,TERM_PROGRAM_VERSION:o,VTE_VERSION:a,TERM:c}=process.env;if(t)return!(t.length>0&&parseInt(t,10)===0);if(Rs("no-hyperlink")||Rs("no-hyperlinks")||Rs("hyperlink=false")||Rs("hyperlink=never"))return!1;if(Rs("hyperlink=true")||Rs("hyperlink=always")||s)return!0;if(!Wy.supportsColor(r)||r&&!r.isTTY)return!1;if("WT_SESSION"in process.env)return!0;if(process.platform==="win32"||e||i)return!1;if(n){let l=nf(o||"");switch(n){case"iTerm.app":return l.major===3?l.minor>=1:l.major>3;case"WezTerm":return l.major>=20200620;case"vscode":return l.major>1||l.major===1&&l.minor>=72;case"ghostty":return!0}}if(a){if(a==="0.50.0")return!1;let l=nf(a);return l.major>0||l.minor>=50}switch(c){case"alacritty":return!0}return!1}of.exports={supportsHyperlink:Ic,stdout:Ic(process.stdout),stderr:Ic(process.stderr)}});var hf=D((XE,Hi)=>{"use strict";var qy=typeof process<"u"&&process.env.TERM_PROGRAM==="Hyper",Vy=typeof process<"u"&&process.platform==="win32",cf=typeof process<"u"&&process.platform==="linux",Bc={ballotDisabled:"\u2612",ballotOff:"\u2610",ballotOn:"\u2611",bullet:"\u2022",bulletWhite:"\u25E6",fullBlock:"\u2588",heart:"\u2764",identicalTo:"\u2261",line:"\u2500",mark:"\u203B",middot:"\xB7",minus:"\uFF0D",multiplication:"\xD7",obelus:"\xF7",pencilDownRight:"\u270E",pencilRight:"\u270F",pencilUpRight:"\u2710",percent:"%",pilcrow2:"\u2761",pilcrow:"\xB6",plusMinus:"\xB1",question:"?",section:"\xA7",starsOff:"\u2606",starsOn:"\u2605",upDownArrow:"\u2195"},lf=Object.assign({},Bc,{check:"\u221A",cross:"\xD7",ellipsisLarge:"...",ellipsis:"...",info:"i",questionSmall:"?",pointer:">",pointerSmall:"\xBB",radioOff:"( )",radioOn:"(*)",warning:"\u203C"}),uf=Object.assign({},Bc,{ballotCross:"\u2718",check:"\u2714",cross:"\u2716",ellipsisLarge:"\u22EF",ellipsis:"\u2026",info:"\u2139",questionFull:"\uFF1F",questionSmall:"\uFE56",pointer:cf?"\u25B8":"\u276F",pointerSmall:cf?"\u2023":"\u203A",radioOff:"\u25EF",radioOn:"\u25C9",warning:"\u26A0"});Hi.exports=Vy&&!qy?lf:uf;Reflect.defineProperty(Hi.exports,"common",{enumerable:!1,value:Bc});Reflect.defineProperty(Hi.exports,"windows",{enumerable:!1,value:lf});Reflect.defineProperty(Hi.exports,"other",{enumerable:!1,value:uf})});var ro=D((QE,Pc)=>{"use strict";var Hy=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),Gy=/[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g,zy=()=>typeof process<"u"?process.env.FORCE_COLOR!=="0":!1,ff=()=>{let r={enabled:zy(),visible:!0,styles:{},keys:{}},e=n=>{let o=n.open=`\x1B[${n.codes[0]}m`,a=n.close=`\x1B[${n.codes[1]}m`,c=n.regex=new RegExp(`\\u001b\\[${n.codes[1]}m`,"g");return n.wrap=(l,u)=>{l.includes(a)&&(l=l.replace(c,a+o));let h=o+l+a;return u?h.replace(/\r*\n/g,`${a}$&${o}`):h},n},t=(n,o,a)=>typeof n=="function"?n(o):n.wrap(o,a),s=(n,o)=>{if(n===""||n==null)return"";if(r.enabled===!1)return n;if(r.visible===!1)return"";let a=""+n,c=a.includes(`
28
28
  `),l=o.length;for(l>0&&o.includes("unstyle")&&(o=[...new Set(["unstyle",...o])].reverse());l-- >0;)a=t(r.styles[o[l]],a,c);return a},i=(n,o,a)=>{r.styles[n]=e({name:n,codes:o}),(r.keys[a]||(r.keys[a]=[])).push(n),Reflect.defineProperty(r,n,{configurable:!0,enumerable:!0,set(l){r.alias(n,l)},get(){let l=u=>s(u,l.stack);return Reflect.setPrototypeOf(l,r),l.stack=this.stack?this.stack.concat(n):[n],l}})};return i("reset",[0,0],"modifier"),i("bold",[1,22],"modifier"),i("dim",[2,22],"modifier"),i("italic",[3,23],"modifier"),i("underline",[4,24],"modifier"),i("inverse",[7,27],"modifier"),i("hidden",[8,28],"modifier"),i("strikethrough",[9,29],"modifier"),i("black",[30,39],"color"),i("red",[31,39],"color"),i("green",[32,39],"color"),i("yellow",[33,39],"color"),i("blue",[34,39],"color"),i("magenta",[35,39],"color"),i("cyan",[36,39],"color"),i("white",[37,39],"color"),i("gray",[90,39],"color"),i("grey",[90,39],"color"),i("bgBlack",[40,49],"bg"),i("bgRed",[41,49],"bg"),i("bgGreen",[42,49],"bg"),i("bgYellow",[43,49],"bg"),i("bgBlue",[44,49],"bg"),i("bgMagenta",[45,49],"bg"),i("bgCyan",[46,49],"bg"),i("bgWhite",[47,49],"bg"),i("blackBright",[90,39],"bright"),i("redBright",[91,39],"bright"),i("greenBright",[92,39],"bright"),i("yellowBright",[93,39],"bright"),i("blueBright",[94,39],"bright"),i("magentaBright",[95,39],"bright"),i("cyanBright",[96,39],"bright"),i("whiteBright",[97,39],"bright"),i("bgBlackBright",[100,49],"bgBright"),i("bgRedBright",[101,49],"bgBright"),i("bgGreenBright",[102,49],"bgBright"),i("bgYellowBright",[103,49],"bgBright"),i("bgBlueBright",[104,49],"bgBright"),i("bgMagentaBright",[105,49],"bgBright"),i("bgCyanBright",[106,49],"bgBright"),i("bgWhiteBright",[107,49],"bgBright"),r.ansiRegex=Gy,r.hasColor=r.hasAnsi=n=>(r.ansiRegex.lastIndex=0,typeof n=="string"&&n!==""&&r.ansiRegex.test(n)),r.alias=(n,o)=>{let a=typeof o=="string"?r[o]:o;if(typeof a!="function")throw new TypeError("Expected alias to be the name of an existing color (string) or a function");a.stack||(Reflect.defineProperty(a,"name",{value:n}),r.styles[n]=a,a.stack=[n]),Reflect.defineProperty(r,n,{configurable:!0,enumerable:!0,set(c){r.alias(n,c)},get(){let c=l=>s(l,c.stack);return Reflect.setPrototypeOf(c,r),c.stack=this.stack?this.stack.concat(a.stack):a.stack,c}})},r.theme=n=>{if(!Hy(n))throw new TypeError("Expected theme to be an object");for(let o of Object.keys(n))r.alias(o,n[o]);return r},r.alias("unstyle",n=>typeof n=="string"&&n!==""?(r.ansiRegex.lastIndex=0,n.replace(r.ansiRegex,"")):""),r.alias("noop",n=>n),r.none=r.clear=r.noop,r.stripColor=r.unstyle,r.symbols=hf(),r.define=i,r};Pc.exports=ff();Pc.exports.create=ff});var _e=D(G=>{"use strict";var Ky=Object.prototype.toString,st=ro(),df=!1,Gi=new Set,pf={yellow:"blue",cyan:"red",green:"magenta",black:"white",blue:"yellow",red:"cyan",magenta:"green",white:"black"};G.longest=(r,e)=>r.reduce((t,s)=>Math.max(t,e?s[e].length:s.length),0);G.hasColor=r=>!!r&&st.hasColor(r);var so=G.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);G.nativeType=r=>Ky.call(r).slice(8,-1).toLowerCase().replace(/\s/g,"");G.isAsyncFn=r=>G.nativeType(r)==="asyncfunction";G.isPrimitive=r=>r!=null&&typeof r!="object"&&typeof r!="function";G.resolve=(r,e,...t)=>typeof e=="function"?e.call(r,...t):e;G.scrollDown=(r=[])=>[...r.slice(1),r[0]];G.scrollUp=(r=[])=>[r.pop(),...r];G.reorder=(r=[])=>{let e=r.slice();return e.sort((t,s)=>t.index>s.index?1:t.index<s.index?-1:0),e};G.swap=(r,e,t)=>{let s=r.length,i=t===s?0:t<0?s-1:t,n=r[e];r[e]=r[i],r[i]=n};G.width=(r,e=80)=>{let t=r&&r.columns?r.columns:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[0]),process.platform==="win32"?t-1:t};G.height=(r,e=20)=>{let t=r&&r.rows?r.rows:e;return r&&typeof r.getWindowSize=="function"&&(t=r.getWindowSize()[1]),t};G.wordWrap=(r,e={})=>{if(!r)return r;typeof e=="number"&&(e={width:e});let{indent:t="",newline:s=`
29
29
  `+t,width:i=80}=e,n=(s+t).match(/[^\S\n]/g)||[];i-=n.length;let o=`.{1,${i}}([\\s\\u200B]+|$)|[^\\s\\u200B]+?([\\s\\u200B]+|$)`,a=r.trim(),c=new RegExp(o,"g"),l=a.match(c)||[];return l=l.map(u=>u.replace(/\n$/,"")),e.padEnd&&(l=l.map(u=>u.padEnd(i," "))),e.padStart&&(l=l.map(u=>u.padStart(i," "))),t+l.join(s)};G.unmute=r=>{let e=r.stack.find(s=>st.keys.color.includes(s));return e?st[e]:r.stack.find(s=>s.slice(2)==="bg")?st[e.slice(2)]:s=>s};G.pascal=r=>r?r[0].toUpperCase()+r.slice(1):"";G.inverse=r=>{if(!r||!r.stack)return r;let e=r.stack.find(s=>st.keys.color.includes(s));if(e){let s=st["bg"+G.pascal(e)];return s?s.black:r}let t=r.stack.find(s=>s.slice(0,2)==="bg");return t?st[t.slice(2).toLowerCase()]||r:st.none};G.complement=r=>{if(!r||!r.stack)return r;let e=r.stack.find(s=>st.keys.color.includes(s)),t=r.stack.find(s=>s.slice(0,2)==="bg");if(e&&!t)return st[pf[e]||e];if(t){let s=t.slice(2).toLowerCase(),i=pf[s];return i&&st["bg"+G.pascal(i)]||r}return st.none};G.meridiem=r=>{let e=r.getHours(),t=r.getMinutes(),s=e>=12?"pm":"am";e=e%12;let i=e===0?12:e,n=t<10?"0"+t:t;return i+":"+n+" "+s};G.set=(r={},e="",t)=>e.split(".").reduce((s,i,n,o)=>{let a=o.length-1>n?s[i]||{}:t;return!G.isObject(a)&&n<o.length-1&&(a={}),s[i]=a},r);G.get=(r={},e="",t)=>{let s=r[e]==null?e.split(".").reduce((i,n)=>i&&i[n],r):r[e];return s??t};G.mixin=(r,e)=>{if(!so(r))return e;if(!so(e))return r;for(let t of Object.keys(e)){let s=Object.getOwnPropertyDescriptor(e,t);if(hasOwnProperty.call(s,"value"))if(hasOwnProperty.call(r,t)&&so(s.value)){let i=Object.getOwnPropertyDescriptor(r,t);so(i.value)&&i.value!==s.value?r[t]=G.merge({},r[t],e[t]):Reflect.defineProperty(r,t,s)}else Reflect.defineProperty(r,t,s);else Reflect.defineProperty(r,t,s)}return r};G.merge=(...r)=>{let e={};for(let t of r)G.mixin(e,t);return e};G.mixinEmitter=(r,e)=>{let t=e.constructor.prototype;for(let s of Object.keys(t)){let i=t[s];typeof i=="function"?G.define(r,s,i.bind(e)):G.define(r,s,i)}};var io=(r,e)=>{df||(df=!0,Gi.forEach(t=>t()),r===!0&&process.exit(128+e))},mf=io.bind(null,!0,15),xf=io.bind(null,!0,2);G.onExit=r=>(Gi.size===0&&(process.once("SIGTERM",mf),process.once("SIGINT",xf),process.once("exit",io)),Gi.add(r),()=>{Gi.delete(r),Gi.size===0&&(process.off("SIGTERM",mf),process.off("SIGINT",xf),process.off("exit",io))});G.define=(r,e,t)=>{Reflect.defineProperty(r,e,{value:t})};G.defineExport=(r,e,t)=>{let s;Reflect.defineProperty(r,e,{enumerable:!0,configurable:!0,set(i){s=i},get(){return s?s():t()}})}});var bf=D((t3,gf)=>{"use strict";gf.exports=({onlyFirst:r=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,r?void 0:"g")}});var Ot=D((r3,yf)=>{"use strict";var Zy=bf();yf.exports=r=>typeof r=="string"?r.replace(Zy(),""):r});var wf=D(Ms=>{"use strict";Ms.ctrl={a:"first",b:"backward",c:"cancel",d:"deleteForward",e:"last",f:"forward",g:"reset",i:"tab",k:"cutForward",l:"reset",n:"newItem",m:"cancel",j:"submit",p:"search",r:"remove",s:"save",u:"undo",w:"cutLeft",x:"toggleCursor",v:"paste"};Ms.shift={up:"shiftUp",down:"shiftDown",left:"shiftLeft",right:"shiftRight",tab:"prev"};Ms.fn={up:"pageUp",down:"pageDown",left:"pageLeft",right:"pageRight",delete:"deleteForward"};Ms.option={b:"backward",f:"forward",d:"cutRight",left:"cutLeft",up:"altUp",down:"altDown"};Ms.keys={pageup:"pageUp",pagedown:"pageDown",home:"home",end:"end",cancel:"cancel",delete:"deleteForward",backspace:"delete",down:"down",enter:"submit",escape:"cancel",left:"left",space:"space",number:"number",return:"submit",right:"right",tab:"next",up:"up"}});var vf=D((n3,Df)=>{"use strict";Df.exports=class{_queue=[];_executing=!1;_jobRunner=null;constructor(e){this._jobRunner=e}enqueue=(...e)=>{this._queue.push(e),this._dequeue()};destroy(){this._queue.length=0,this._jobRunner=null}_dequeue(){this._executing||!this._queue.length||(this._executing=!0,this._jobRunner(...this._queue.shift()),setTimeout(()=>{this._executing=!1,this._dequeue()}))}}});var Rc=D((o3,Ef)=>{"use strict";var Cf=require("readline"),Yy=wf(),Jy=vf(),Xy=/^(?:\x1b)([a-zA-Z0-9])$/,Qy=/^(?:\x1b+)(O|N|\[|\[\[)(?:(\d+)(?:;(\d+))?([~^$])|(?:1;)?(\d+)?([a-zA-Z]))/,e6={OP:"f1",OQ:"f2",OR:"f3",OS:"f4","[11~":"f1","[12~":"f2","[13~":"f3","[14~":"f4","[[A":"f1","[[B":"f2","[[C":"f3","[[D":"f4","[[E":"f5","[15~":"f5","[17~":"f6","[18~":"f7","[19~":"f8","[20~":"f9","[21~":"f10","[23~":"f11","[24~":"f12","[A":"up","[B":"down","[C":"right","[D":"left","[E":"clear","[F":"end","[H":"home",OA:"up",OB:"down",OC:"right",OD:"left",OE:"clear",OF:"end",OH:"home","[1~":"home","[2~":"insert","[3~":"delete","[4~":"end","[5~":"pageup","[6~":"pagedown","[[5~":"pageup","[[6~":"pagedown","[7~":"home","[8~":"end","[a":"up","[b":"down","[c":"right","[d":"left","[e":"clear","[2$":"insert","[3$":"delete","[5$":"pageup","[6$":"pagedown","[7$":"home","[8$":"end",Oa:"up",Ob:"down",Oc:"right",Od:"left",Oe:"clear","[2^":"insert","[3^":"delete","[5^":"pageup","[6^":"pagedown","[7^":"home","[8^":"end","[Z":"tab"};function t6(r){return["[a","[b","[c","[d","[e","[2$","[3$","[5$","[6$","[7$","[8$","[Z"].includes(r)}function r6(r){return["Oa","Ob","Oc","Od","Oe","[2^","[3^","[5^","[6^","[7^","[8^"].includes(r)}var no=(r="",e={})=>{let t,s={name:e.name,ctrl:!1,meta:!1,shift:!1,option:!1,sequence:r,raw:r,...e};if(Buffer.isBuffer(r)?r[0]>127&&r[1]===void 0?(r[0]-=128,r="\x1B"+String(r)):r=String(r):r!==void 0&&typeof r!="string"?r=String(r):r||(r=s.sequence||""),s.sequence=s.sequence||r||s.name,r==="\r")s.raw=void 0,s.name="return";else if(r===`
30
- `)s.name="enter";else if(r===" ")s.name="tab";else if(r==="\b"||r==="\x7F"||r==="\x1B\x7F"||r==="\x1B\b")s.name="backspace",s.meta=r.charAt(0)==="\x1B";else if(r==="\x1B"||r==="\x1B\x1B")s.name="escape",s.meta=r.length===2;else if(r===" "||r==="\x1B ")s.name="space",s.meta=r.length===2;else if(r<="")s.name=String.fromCharCode(r.charCodeAt(0)+97-1),s.ctrl=!0;else if(r.length===1&&r>="0"&&r<="9")s.name="number";else if(r.length===1&&r>="a"&&r<="z")s.name=r;else if(r.length===1&&r>="A"&&r<="Z")s.name=r.toLowerCase(),s.shift=!0;else if(t=Xy.exec(r))s.meta=!0,s.shift=/^[A-Z]$/.test(t[1]);else if(t=Qy.exec(r)){let i=[...r];i[0]==="\x1B"&&i[1]==="\x1B"&&(s.option=!0);let n=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),o=(t[3]||t[5]||1)-1;s.ctrl=!!(o&4),s.meta=!!(o&10),s.shift=!!(o&1),s.code=n,s.name=e6[n],s.shift=t6(n)||s.shift,s.ctrl=r6(n)||s.ctrl}return s};no.listen=(r={},e)=>{let{stdin:t}=r;if(!t||t!==process.stdin&&!t.isTTY)throw new Error("Invalid stream passed");let s=Cf.createInterface({terminal:!0,input:t});Cf.emitKeypressEvents(t,s);let i=new Jy((a,c)=>e(a,no(a,c),s)),n=t.isRaw;return t.isTTY&&t.setRawMode(!0),t.on("keypress",i.enqueue),s.resume(),()=>{t.isTTY&&t.setRawMode(n),t.removeListener("keypress",i.enqueue),i.destroy(),s.pause(),s.close()}};no.action=(r,e,t)=>{let s={...Yy,...t};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)};Ef.exports=no});var Sf=D((a3,kf)=>{"use strict";kf.exports=r=>{r.timers=r.timers||{};let e=r.options.timers;if(e)for(let t of Object.keys(e)){let s=e[t];typeof s=="number"&&(s={interval:s}),s6(r,t,s)}};function s6(r,e,t={}){let s=r.timers[e]={name:e,start:Date.now(),ms:0,tick:0},i=t.interval||120;s.frames=t.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,r.render()},i);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),r.once("close",()=>s.stop()),s.stop}});var Af=D((c3,_f)=>{"use strict";var{define:i6,width:n6}=_e(),Mc=class{constructor(e){let t=e.options;i6(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=n6(t.stdout||process.stdout),Object.assign(this,t),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let t=this._color||e[this.status];return typeof t=="function"?t:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};_f.exports=Mc});var Ff=D((l3,Tf)=>{"use strict";var $c=_e(),De=ro(),jc={default:De.noop,noop:De.noop,set inverse(r){this._inverse=r},get inverse(){return this._inverse||$c.inverse(this.primary)},set complement(r){this._complement=r},get complement(){return this._complement||$c.complement(this.primary)},primary:De.cyan,success:De.green,danger:De.magenta,strong:De.bold,warning:De.yellow,muted:De.dim,disabled:De.gray,dark:De.dim.gray,underline:De.underline,set info(r){this._info=r},get info(){return this._info||this.primary},set em(r){this._em=r},get em(){return this._em||this.primary.underline},set heading(r){this._heading=r},get heading(){return this._heading||this.muted.underline},set pending(r){this._pending=r},get pending(){return this._pending||this.primary},set submitted(r){this._submitted=r},get submitted(){return this._submitted||this.success},set cancelled(r){this._cancelled=r},get cancelled(){return this._cancelled||this.danger},set typing(r){this._typing=r},get typing(){return this._typing||this.dim},set placeholder(r){this._placeholder=r},get placeholder(){return this._placeholder||this.primary.dim},set highlight(r){this._highlight=r},get highlight(){return this._highlight||this.inverse}};jc.merge=(r={})=>{r.styles&&typeof r.styles.enabled=="boolean"&&(De.enabled=r.styles.enabled),r.styles&&typeof r.styles.visible=="boolean"&&(De.visible=r.styles.visible);let e=$c.merge({},jc,r.styles);delete e.merge;for(let t of Object.keys(De))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>De[t]});for(let t of Object.keys(De.styles))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>De[t]});return e};Tf.exports=jc});var If=D((u3,Of)=>{"use strict";var Nc=process.platform==="win32",Jt=ro(),o6=_e(),Lc={...Jt.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",ellipsisLarge:"\u22EF",ellipsisSmall:"\u2026",fullBlock:"\u2588",identicalTo:"\u2261",indicator:Jt.symbols.check,leftAngle:"\u2039",mark:"\u203B",minus:"\u2212",multiplication:"\xD7",obelus:"\xF7",percent:"%",pilcrow:"\xB6",pilcrow2:"\u2761",pencilUpRight:"\u2710",pencilDownRight:"\u270E",pencilRight:"\u270F",plus:"+",plusMinus:"\xB1",pointRight:"\u261E",rightAngle:"\u203A",section:"\xA7",hexagon:{off:"\u2B21",on:"\u2B22",disabled:"\u2B22"},ballot:{on:"\u2611",off:"\u2610",disabled:"\u2612"},stars:{on:"\u2605",off:"\u2606",disabled:"\u2606"},folder:{on:"\u25BC",off:"\u25B6",disabled:"\u25B6"},prefix:{pending:Jt.symbols.question,submitted:Jt.symbols.check,cancelled:Jt.symbols.cross},separator:{pending:Jt.symbols.pointerSmall,submitted:Jt.symbols.middot,cancelled:Jt.symbols.middot},radio:{off:Nc?"( )":"\u25EF",on:Nc?"(*)":"\u25C9",disabled:Nc?"(|)":"\u24BE"},numbers:["\u24EA","\u2460","\u2461","\u2462","\u2463","\u2464","\u2465","\u2466","\u2467","\u2468","\u2469","\u246A","\u246B","\u246C","\u246D","\u246E","\u246F","\u2470","\u2471","\u2472","\u2473","\u3251","\u3252","\u3253","\u3254","\u3255","\u3256","\u3257","\u3258","\u3259","\u325A","\u325B","\u325C","\u325D","\u325E","\u325F","\u32B1","\u32B2","\u32B3","\u32B4","\u32B5","\u32B6","\u32B7","\u32B8","\u32B9","\u32BA","\u32BB","\u32BC","\u32BD","\u32BE","\u32BF"]};Lc.merge=r=>{let e=o6.merge({},Jt.symbols,Lc,r.symbols);return delete e.merge,e};Of.exports=Lc});var Pf=D((h3,Bf)=>{"use strict";var a6=Ff(),c6=If(),l6=_e();Bf.exports=r=>{r.options=l6.merge({},r.options.theme,r.options),r.symbols=c6.merge(r.options),r.styles=a6.merge(r.options)}});var Nf=D(($f,jf)=>{"use strict";var Rf=process.env.TERM_PROGRAM==="Apple_Terminal",u6=Ot(),Uc=_e(),Dt=jf.exports=$f,se="\x1B[",Mf="\x07",Wc=!1,fr=Dt.code={bell:Mf,beep:Mf,beginning:`${se}G`,down:`${se}J`,esc:se,getPosition:`${se}6n`,hide:`${se}?25l`,line:`${se}2K`,lineEnd:`${se}K`,lineStart:`${se}1K`,restorePosition:se+(Rf?"8":"u"),savePosition:se+(Rf?"7":"s"),screen:`${se}2J`,show:`${se}?25h`,up:`${se}1J`},Ur=Dt.cursor={get hidden(){return Wc},hide(){return Wc=!0,fr.hide},show(){return Wc=!1,fr.show},forward:(r=1)=>`${se}${r}C`,backward:(r=1)=>`${se}${r}D`,nextLine:(r=1)=>`${se}E`.repeat(r),prevLine:(r=1)=>`${se}F`.repeat(r),up:(r=1)=>r?`${se}${r}A`:"",down:(r=1)=>r?`${se}${r}B`:"",right:(r=1)=>r?`${se}${r}C`:"",left:(r=1)=>r?`${se}${r}D`:"",to(r,e){return e?`${se}${e+1};${r+1}H`:`${se}${r+1}G`},move(r=0,e=0){let t="";return t+=r<0?Ur.left(-r):r>0?Ur.right(r):"",t+=e<0?Ur.up(-e):e>0?Ur.down(e):"",t},strLen(r){for(var e=0,t=r.length,s=-1,i=0;i<t;i++)s=r.charCodeAt(i),s>=0&&s<=128?e+=1:e+=2;return e},restore(r={}){let{after:e,cursor:t,initial:s,input:i,prompt:n,size:o,value:a}=r;if(s=Uc.isPrimitive(s)?String(s):"",i=Uc.isPrimitive(i)?String(i):"",a=Uc.isPrimitive(a)?String(a):"",o){let c=Dt.cursor.up(o)+Dt.cursor.to(this.strLen(n)),l=i.length-t;return l>0&&(c+=Dt.cursor.left(l)),c}if(a||e){let c=!i&&s?-this.strLen(s):-this.strLen(i)+t;return e&&(c-=this.strLen(e)),i===""&&s&&!n.includes(s)&&(c+=this.strLen(s)),Dt.cursor.move(c)}}},qc=Dt.erase={screen:fr.screen,up:fr.up,down:fr.down,line:fr.line,lineEnd:fr.lineEnd,lineStart:fr.lineStart,lines(r){let e="";for(let t=0;t<r;t++)e+=Dt.erase.line+(t<r-1?Dt.cursor.up(1):"");return r&&(e+=Dt.code.beginning),e}};Dt.clear=(r="",e=process.stdout.columns)=>{if(!e)return qc.line+Ur.to(0);let t=n=>[...u6(n)].length,s=r.split(/\r?\n/),i=0;for(let n of s)i+=1+Math.floor(Math.max(t(n)-1,0)/e);return(qc.line+Ur.prevLine()).repeat(i-1)+qc.line+Ur.to(0)}});var $s=D((f3,Uf)=>{"use strict";var h6=require("events"),Lf=Ot(),Vc=Rc(),f6=Sf(),d6=Af(),p6=Pf(),Ue=_e(),Wr=Nf(),Hc=class r extends h6{constructor(e={}){super(),this.name=e.name,this.type=e.type,this.options=e,p6(this),f6(this),this.state=new d6(this),this.initial=[e.initial,e.default].find(t=>t!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=x6(this.options.margin),this.setMaxListeners(0),m6(this)}async keypress(e,t={}){this.keypressed=!0;let s=Vc.action(e,Vc(e,t),this.options.actions);this.state.keypress=s,this.emit("keypress",e,s),this.emit("state",this.state.clone());let i=this.options[s.action]||this[s.action]||this.dispatch;if(typeof i=="function")return await i.call(this,e,s);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit("alert"):this.stdout.write(Wr.code.beep)}cursorHide(){this.stdout.write(Wr.cursor.hide());let e=Ue.onExit(()=>this.cursorShow());this.on("close",()=>{this.cursorShow(),e()})}cursorShow(){this.stdout.write(Wr.cursor.show())}write(e){e&&(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let t=this.state.buffer;this.state.buffer="",!(!t&&!e||this.options.show===!1)&&this.stdout.write(Wr.cursor.down(e)+Wr.clear(t,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:t,rest:s}=this.sections(),{cursor:i,initial:n="",input:o="",value:a=""}=this,c=this.state.size=s.length,l={after:t,cursor:i,initial:n,input:o,prompt:e,size:c,value:a},u=Wr.cursor.restore(l);u&&this.stdout.write(u)}sections(){let{buffer:e,input:t,prompt:s}=this.state;s=Lf(s);let i=Lf(e),n=i.indexOf(s),o=i.slice(0,n),c=i.slice(n).split(`
30
+ `)s.name="enter";else if(r===" ")s.name="tab";else if(r==="\b"||r==="\x7F"||r==="\x1B\x7F"||r==="\x1B\b")s.name="backspace",s.meta=r.charAt(0)==="\x1B";else if(r==="\x1B"||r==="\x1B\x1B")s.name="escape",s.meta=r.length===2;else if(r===" "||r==="\x1B ")s.name="space",s.meta=r.length===2;else if(r<="")s.name=String.fromCharCode(r.charCodeAt(0)+97-1),s.ctrl=!0;else if(r.length===1&&r>="0"&&r<="9")s.name="number";else if(r.length===1&&r>="a"&&r<="z")s.name=r;else if(r.length===1&&r>="A"&&r<="Z")s.name=r.toLowerCase(),s.shift=!0;else if(t=Xy.exec(r))s.meta=!0,s.shift=/^[A-Z]$/.test(t[1]);else if(t=Qy.exec(r)){let i=[...r];i[0]==="\x1B"&&i[1]==="\x1B"&&(s.option=!0);let n=[t[1],t[2],t[4],t[6]].filter(Boolean).join(""),o=(t[3]||t[5]||1)-1;s.ctrl=!!(o&4),s.meta=!!(o&10),s.shift=!!(o&1),s.code=n,s.name=e6[n],s.shift=t6(n)||s.shift,s.ctrl=r6(n)||s.ctrl}return s};no.listen=(r={},e)=>{let{stdin:t}=r;if(!t||t!==process.stdin&&!t.isTTY)throw new Error("Invalid stream passed");let s=Cf.createInterface({terminal:!0,input:t});Cf.emitKeypressEvents(t,s);let i=new Jy((a,c)=>e(a,no(a,c),s)),n=t.isRaw;return t.isTTY&&t.setRawMode(!0),t.on("keypress",i.enqueue),s.resume(),()=>{t.isTTY&&t.setRawMode(n),t.removeListener("keypress",i.enqueue),i.destroy(),s.pause(),s.close()}};no.action=(r,e,t)=>{let s={...Yy,...t};return e.ctrl?(e.action=s.ctrl[e.name],e):e.option&&s.option?(e.action=s.option[e.name],e):e.shift?(e.action=s.shift[e.name],e):(e.action=s.keys[e.name],e)};Ef.exports=no});var Sf=D((a3,kf)=>{"use strict";kf.exports=r=>{r.timers=r.timers||{};let e=r.options.timers;if(e)for(let t of Object.keys(e)){let s=e[t];typeof s=="number"&&(s={interval:s}),s6(r,t,s)}};function s6(r,e,t={}){let s=r.timers[e]={name:e,start:Date.now(),ms:0,tick:0},i=t.interval||120;s.frames=t.frames||[],s.loading=!0;let n=setInterval(()=>{s.ms=Date.now()-s.start,s.tick++,r.render()},i);return s.stop=()=>{s.loading=!1,clearInterval(n)},Reflect.defineProperty(s,"interval",{value:n}),r.once("close",()=>s.stop()),s.stop}});var Af=D((c3,_f)=>{"use strict";var{define:i6,width:n6}=_e(),Mc=class{constructor(e){let t=e.options;i6(this,"_prompt",e),this.type=e.type,this.name=e.name,this.message="",this.header="",this.footer="",this.error="",this.hint="",this.input="",this.cursor=0,this.index=0,this.lines=0,this.tick=0,this.prompt="",this.buffer="",this.width=n6(t.stdout||process.stdout),Object.assign(this,t),this.name=this.name||this.message,this.message=this.message||this.name,this.symbols=e.symbols,this.styles=e.styles,this.required=new Set,this.cancelled=!1,this.submitted=!1}clone(){let e={...this};return e.status=this.status,e.buffer=Buffer.from(e.buffer),delete e.clone,e}set color(e){this._color=e}get color(){let e=this.prompt.styles;if(this.cancelled)return e.cancelled;if(this.submitted)return e.submitted;let t=this._color||e[this.status];return typeof t=="function"?t:e.pending}set loading(e){this._loading=e}get loading(){return typeof this._loading=="boolean"?this._loading:this.loadingChoices?"choices":!1}get status(){return this.cancelled?"cancelled":this.submitted?"submitted":"pending"}};_f.exports=Mc});var Ff=D((l3,Tf)=>{"use strict";var $c=_e(),De=ro(),jc={default:De.noop,noop:De.noop,set inverse(r){this._inverse=r},get inverse(){return this._inverse||$c.inverse(this.primary)},set complement(r){this._complement=r},get complement(){return this._complement||$c.complement(this.primary)},primary:De.cyan,success:De.green,danger:De.magenta,strong:De.bold,warning:De.yellow,muted:De.dim,disabled:De.gray,dark:De.dim.gray,underline:De.underline,set info(r){this._info=r},get info(){return this._info||this.primary},set em(r){this._em=r},get em(){return this._em||this.primary.underline},set heading(r){this._heading=r},get heading(){return this._heading||this.muted.underline},set pending(r){this._pending=r},get pending(){return this._pending||this.primary},set submitted(r){this._submitted=r},get submitted(){return this._submitted||this.success},set cancelled(r){this._cancelled=r},get cancelled(){return this._cancelled||this.danger},set typing(r){this._typing=r},get typing(){return this._typing||this.dim},set placeholder(r){this._placeholder=r},get placeholder(){return this._placeholder||this.primary.dim},set highlight(r){this._highlight=r},get highlight(){return this._highlight||this.inverse}};jc.merge=(r={})=>{r.styles&&typeof r.styles.enabled=="boolean"&&(De.enabled=r.styles.enabled),r.styles&&typeof r.styles.visible=="boolean"&&(De.visible=r.styles.visible);let e=$c.merge({},jc,r.styles);delete e.merge;for(let t of Object.keys(De))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>De[t]});for(let t of Object.keys(De.styles))hasOwnProperty.call(e,t)||Reflect.defineProperty(e,t,{get:()=>De[t]});return e};Tf.exports=jc});var If=D((u3,Of)=>{"use strict";var Nc=process.platform==="win32",Jt=ro(),o6=_e(),Lc={...Jt.symbols,upDownDoubleArrow:"\u21D5",upDownDoubleArrow2:"\u2B0D",upDownArrow:"\u2195",asterisk:"*",asterism:"\u2042",bulletWhite:"\u25E6",electricArrow:"\u2301",ellipsisLarge:"\u22EF",ellipsisSmall:"\u2026",fullBlock:"\u2588",identicalTo:"\u2261",indicator:Jt.symbols.check,leftAngle:"\u2039",mark:"\u203B",minus:"\u2212",multiplication:"\xD7",obelus:"\xF7",percent:"%",pilcrow:"\xB6",pilcrow2:"\u2761",pencilUpRight:"\u2710",pencilDownRight:"\u270E",pencilRight:"\u270F",plus:"+",plusMinus:"\xB1",pointRight:"\u261E",rightAngle:"\u203A",section:"\xA7",hexagon:{off:"\u2B21",on:"\u2B22",disabled:"\u2B22"},ballot:{on:"\u2611",off:"\u2610",disabled:"\u2612"},stars:{on:"\u2605",off:"\u2606",disabled:"\u2606"},folder:{on:"\u25BC",off:"\u25B6",disabled:"\u25B6"},prefix:{pending:Jt.symbols.question,submitted:Jt.symbols.check,cancelled:Jt.symbols.cross},separator:{pending:Jt.symbols.pointerSmall,submitted:Jt.symbols.middot,cancelled:Jt.symbols.middot},radio:{off:Nc?"( )":"\u25EF",on:Nc?"(*)":"\u25C9",disabled:Nc?"(|)":"\u24BE"},numbers:["\u24EA","\u2460","\u2461","\u2462","\u2463","\u2464","\u2465","\u2466","\u2467","\u2468","\u2469","\u246A","\u246B","\u246C","\u246D","\u246E","\u246F","\u2470","\u2471","\u2472","\u2473","\u3251","\u3252","\u3253","\u3254","\u3255","\u3256","\u3257","\u3258","\u3259","\u325A","\u325B","\u325C","\u325D","\u325E","\u325F","\u32B1","\u32B2","\u32B3","\u32B4","\u32B5","\u32B6","\u32B7","\u32B8","\u32B9","\u32BA","\u32BB","\u32BC","\u32BD","\u32BE","\u32BF"]};Lc.merge=r=>{let e=o6.merge({},Jt.symbols,Lc,r.symbols);return delete e.merge,e};Of.exports=Lc});var Pf=D((h3,Bf)=>{"use strict";var a6=Ff(),c6=If(),l6=_e();Bf.exports=r=>{r.options=l6.merge({},r.options.theme,r.options),r.symbols=c6.merge(r.options),r.styles=a6.merge(r.options)}});var Nf=D(($f,jf)=>{"use strict";var Rf=process.env.TERM_PROGRAM==="Apple_Terminal",u6=Ot(),Uc=_e(),Dt=jf.exports=$f,se="\x1B[",Mf="\x07",Wc=!1,dr=Dt.code={bell:Mf,beep:Mf,beginning:`${se}G`,down:`${se}J`,esc:se,getPosition:`${se}6n`,hide:`${se}?25l`,line:`${se}2K`,lineEnd:`${se}K`,lineStart:`${se}1K`,restorePosition:se+(Rf?"8":"u"),savePosition:se+(Rf?"7":"s"),screen:`${se}2J`,show:`${se}?25h`,up:`${se}1J`},Wr=Dt.cursor={get hidden(){return Wc},hide(){return Wc=!0,dr.hide},show(){return Wc=!1,dr.show},forward:(r=1)=>`${se}${r}C`,backward:(r=1)=>`${se}${r}D`,nextLine:(r=1)=>`${se}E`.repeat(r),prevLine:(r=1)=>`${se}F`.repeat(r),up:(r=1)=>r?`${se}${r}A`:"",down:(r=1)=>r?`${se}${r}B`:"",right:(r=1)=>r?`${se}${r}C`:"",left:(r=1)=>r?`${se}${r}D`:"",to(r,e){return e?`${se}${e+1};${r+1}H`:`${se}${r+1}G`},move(r=0,e=0){let t="";return t+=r<0?Wr.left(-r):r>0?Wr.right(r):"",t+=e<0?Wr.up(-e):e>0?Wr.down(e):"",t},strLen(r){for(var e=0,t=r.length,s=-1,i=0;i<t;i++)s=r.charCodeAt(i),s>=0&&s<=128?e+=1:e+=2;return e},restore(r={}){let{after:e,cursor:t,initial:s,input:i,prompt:n,size:o,value:a}=r;if(s=Uc.isPrimitive(s)?String(s):"",i=Uc.isPrimitive(i)?String(i):"",a=Uc.isPrimitive(a)?String(a):"",o){let c=Dt.cursor.up(o)+Dt.cursor.to(this.strLen(n)),l=i.length-t;return l>0&&(c+=Dt.cursor.left(l)),c}if(a||e){let c=!i&&s?-this.strLen(s):-this.strLen(i)+t;return e&&(c-=this.strLen(e)),i===""&&s&&!n.includes(s)&&(c+=this.strLen(s)),Dt.cursor.move(c)}}},qc=Dt.erase={screen:dr.screen,up:dr.up,down:dr.down,line:dr.line,lineEnd:dr.lineEnd,lineStart:dr.lineStart,lines(r){let e="";for(let t=0;t<r;t++)e+=Dt.erase.line+(t<r-1?Dt.cursor.up(1):"");return r&&(e+=Dt.code.beginning),e}};Dt.clear=(r="",e=process.stdout.columns)=>{if(!e)return qc.line+Wr.to(0);let t=n=>[...u6(n)].length,s=r.split(/\r?\n/),i=0;for(let n of s)i+=1+Math.floor(Math.max(t(n)-1,0)/e);return(qc.line+Wr.prevLine()).repeat(i-1)+qc.line+Wr.to(0)}});var $s=D((f3,Uf)=>{"use strict";var h6=require("events"),Lf=Ot(),Vc=Rc(),f6=Sf(),d6=Af(),p6=Pf(),Ue=_e(),qr=Nf(),Hc=class r extends h6{constructor(e={}){super(),this.name=e.name,this.type=e.type,this.options=e,p6(this),f6(this),this.state=new d6(this),this.initial=[e.initial,e.default].find(t=>t!=null),this.stdout=e.stdout||process.stdout,this.stdin=e.stdin||process.stdin,this.scale=e.scale||1,this.term=this.options.term||process.env.TERM_PROGRAM,this.margin=x6(this.options.margin),this.setMaxListeners(0),m6(this)}async keypress(e,t={}){this.keypressed=!0;let s=Vc.action(e,Vc(e,t),this.options.actions);this.state.keypress=s,this.emit("keypress",e,s),this.emit("state",this.state.clone());let i=this.options[s.action]||this[s.action]||this.dispatch;if(typeof i=="function")return await i.call(this,e,s);this.alert()}alert(){delete this.state.alert,this.options.show===!1?this.emit("alert"):this.stdout.write(qr.code.beep)}cursorHide(){this.stdout.write(qr.cursor.hide());let e=Ue.onExit(()=>this.cursorShow());this.on("close",()=>{this.cursorShow(),e()})}cursorShow(){this.stdout.write(qr.cursor.show())}write(e){e&&(this.stdout&&this.state.show!==!1&&this.stdout.write(e),this.state.buffer+=e)}clear(e=0){let t=this.state.buffer;this.state.buffer="",!(!t&&!e||this.options.show===!1)&&this.stdout.write(qr.cursor.down(e)+qr.clear(t,this.width))}restore(){if(this.state.closed||this.options.show===!1)return;let{prompt:e,after:t,rest:s}=this.sections(),{cursor:i,initial:n="",input:o="",value:a=""}=this,c=this.state.size=s.length,l={after:t,cursor:i,initial:n,input:o,prompt:e,size:c,value:a},u=qr.cursor.restore(l);u&&this.stdout.write(u)}sections(){let{buffer:e,input:t,prompt:s}=this.state;s=Lf(s);let i=Lf(e),n=i.indexOf(s),o=i.slice(0,n),c=i.slice(n).split(`
31
31
  `),l=c[0],u=c[c.length-1],d=(s+(t?" "+t:"")).length,f=d<l.length?l.slice(d+1):"";return{header:o,prompt:l,after:f,rest:c.slice(1),last:u}}async submit(){this.state.submitted=!0,this.state.validating=!0,this.options.onSubmit&&await this.options.onSubmit.call(this,this.name,this.value,this);let e=this.state.error||await this.validate(this.value,this.state);if(e!==!0){let t=`
32
32
  `+this.symbols.pointer+" ";typeof e=="string"?t+=e.trim():t+="Invalid input",this.state.error=`
33
- `+this.styles.danger(t),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),t=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(Wr.cursor.down(e.rest.length)),this.write(`
33
+ `+this.styles.danger(t),this.state.submitted=!1,await this.render(),await this.alert(),this.state.validating=!1,this.state.error=void 0;return}this.state.validating=!1,await this.render(),await this.close(),this.value=await this.result(this.value),this.emit("submit",this.value)}async cancel(e){this.state.cancelled=this.state.submitted=!0,await this.render(),await this.close(),typeof this.options.onCancel=="function"&&await this.options.onCancel.call(this,this.name,this.value,this),this.emit("cancel",await this.error(e))}async close(){this.state.closed=!0;try{let e=this.sections(),t=Math.ceil(e.prompt.length/this.width);e.rest&&this.write(qr.cursor.down(e.rest.length)),this.write(`
34
34
  `.repeat(t))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=Vc.listen(this,this.keypress.bind(this)),this.once("close",this.stop),this.emit("start",this))}async skip(){return this.skipped=this.options.skip===!0,typeof this.options.skip=="function"&&(this.skipped=await this.options.skip.call(this,this.name,this.value)),this.skipped}async initialize(){let{format:e,options:t,result:s}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>s.call(this,this.value),typeof t.initial=="function"&&(this.initial=await t.initial.call(this,this)),typeof t.onRun=="function"&&await t.onRun.call(this,this),typeof t.onSubmit=="function"){let i=t.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await i(this.name,this.value,this),n())}await this.start(),await this.render()}render(){throw new Error("expected prompt to have a custom render method")}run(){return new Promise(async(e,t)=>{if(this.once("submit",e),this.once("cancel",t),await this.skip())return this.render=()=>{},this.submit();await this.initialize(),this.emit("run")})}async element(e,t,s){let{options:i,state:n,symbols:o,timers:a}=this,c=a&&a[e];n.timer=c;let l=i[e]||n[e]||o[e],u=t&&t[e]!=null?t[e]:await l;if(u==="")return u;let h=await this.resolve(u,n,t,s);return!h&&t&&t[e]?this.resolve(l,n,t,s):h}async prefix(){let e=await this.element("prefix")||this.symbols,t=this.timers&&this.timers.prefix,s=this.state;return s.timer=t,Ue.isObject(e)&&(e=e[s.status]||e.pending),Ue.hasColor(e)?e:(this.styles[s.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return Ue.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,t=this.timers&&this.timers.separator,s=this.state;s.timer=t;let i=e[s.status]||e.pending||s.separator,n=await this.resolve(i,s);return Ue.isObject(n)&&(n=n[s.status]||n.pending),Ue.hasColor(n)?n:this.styles.muted(n)}async pointer(e,t){let s=await this.element("pointer",e,t);if(typeof s=="string"&&Ue.hasColor(s))return s;if(s){let i=this.styles,n=this.index===t,o=n?i.primary:l=>l,a=await this.resolve(s[n?"on":"off"]||s,this.state),c=Ue.hasColor(a)?a:o(a);return n?c:" ".repeat(a.length)}}async indicator(e,t){let s=await this.element("indicator",e,t);if(typeof s=="string"&&Ue.hasColor(s))return s;if(s){let i=this.styles,n=e.enabled===!0,o=n?i.success:i.dark,a=s[n?"on":"off"]||s;return Ue.hasColor(a)?a:o(a)}return""}body(){return null}footer(){if(this.state.status==="pending")return this.element("footer")}header(){if(this.state.status==="pending")return this.element("header")}async hint(){if(this.state.status==="pending"&&!this.isValue(this.state.input)){let e=await this.element("hint");return Ue.hasColor(e)?e:this.styles.muted(e)}}error(e){return this.state.submitted?"":e||this.state.error}format(e){return e}result(e){return e}validate(e){return this.options.required===!0?this.isValue(e):!0}isValue(e){return e!=null&&e!==""}resolve(e,...t){return Ue.resolve(this,e,...t)}get base(){return r.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||Ue.height(this.stdout,25)}get width(){return this.options.columns||Ue.width(this.stdout,80)}get size(){return{width:this.width,height:this.height}}set cursor(e){this.state.cursor=e}get cursor(){return this.state.cursor}set input(e){this.state.input=e}get input(){return this.state.input}set value(e){this.state.value=e}get value(){let{input:e,value:t}=this.state,s=[t,e].find(this.isValue.bind(this));return this.isValue(s)?s:this.initial}static get prompt(){return e=>new this(e).run()}};function m6(r){let e=i=>r[i]===void 0||typeof r[i]=="function",t=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],s=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let i of Object.keys(r.options)){if(t.includes(i)||/^on[A-Z]/.test(i))continue;let n=r.options[i];typeof n=="function"&&e(i)?s.includes(i)||(r[i]=n.bind(r)):typeof r[i]!="function"&&(r[i]=n)}}function x6(r){typeof r=="number"&&(r=[r,r,r,r]);let e=[].concat(r||[]),t=i=>i%2===0?`
35
- `:" ",s=[];for(let i=0;i<4;i++){let n=t(i);e[i]?s.push(n.repeat(e[i])):s.push("")}return s}Uf.exports=Hc});var Vf=D((d3,qf)=>{"use strict";var g6=_e(),Wf={default(r,e){return e},checkbox(r,e){throw new Error("checkbox role is not implemented yet")},editable(r,e){throw new Error("editable role is not implemented yet")},expandable(r,e){throw new Error("expandable role is not implemented yet")},heading(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||"",e},input(r,e){throw new Error("input role is not implemented yet")},option(r,e){return Wf.default(r,e)},radio(r,e){throw new Error("radio role is not implemented yet")},separator(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||r.symbols.line.repeat(5),e},spacer(r,e){return e}};qf.exports=(r,e={})=>{let t=g6.merge({},Wf,e.roles);return t[r]||t.default}});var zi=D((p3,zf)=>{"use strict";var b6=Ot(),y6=$s(),w6=Vf(),oo=_e(),{reorder:Gc,scrollUp:D6,scrollDown:v6,isObject:Hf,swap:C6}=oo,zc=class extends y6{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:t,autofocus:s,suggest:i}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof i!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");Hf(t)&&(t=Object.keys(t)),Array.isArray(t)?(s!=null&&(this.index=this.findIndex(s)),t.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(t=s),typeof t=="string"&&(t=this.findIndex(t)),typeof t=="number"&&t>-1&&(this.index=Math.max(0,Math.min(t,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,t){this.state.loadingChoices=!0;let s=[],i=0,n=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let c=0;c<o.length;c++){let l=o[c]=await this.toChoice(o[c],i++,a);s.push(l),l.choices&&await n(l.choices,l)}return s};return n(e,t).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,t,s){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let i=e.value;if(e=w6(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=t,e.cursor=0,oo.define(e,"parent",s),e.level=s?s.level+1:1,e.indent==null&&(e.indent=s?s.indent+" ":e.indent||""),e.path=s?s.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,b6(e.message).length));let o={...e};return e.reset=(a=o.input,c=o.value)=>{for(let l of Object.keys(o))e[l]=o[l];e.input=a,e.value=c},i==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,t)),e}async onChoice(e,t){this.emit("choice",e,t,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,t)}async addChoice(e,t,s){let i=await this.toChoice(e,t,s);return this.choices.push(i),this.index=this.choices.length-1,this.limit=this.choices.length,i}async newItem(e,t,s){let i={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(i,t,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,t){if(this.multiple&&this[t.name])return this[t.name]();this.alert()}focus(e,t){return typeof t!="boolean"&&(t=e.enabled),t&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=t&&!this.isDisabled(e),e)}space(){if(!this.multiple)return this.alert();if(this.focused)return this.toggle(this.focused),this.render()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(t=>t.enabled);return this.choices.forEach(t=>t.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(){if(!this.choices.some(t=>!!t.parent))return this.a();let e=this.focused;return this.toggle(e.parent&&!e.choices?e.parent:e),this.render()}toggle(e,t){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof t!="boolean"&&(t=!e.enabled),e.enabled=t,e.choices&&e.choices.forEach(i=>this.toggle(i,t));let s=e.parent;for(;s;){let i=s.choices.filter(n=>this.isDisabled(n));s.enabled=i.every(n=>n.enabled===!0),s=s.parent}return Gf(this,this.choices),this.emit("toggle",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let t=s=>{let i=Number(s);if(i>this.choices.length-1)return this.alert();let n=this.focused,o=this.choices.find(a=>i===a.index);if(!o.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(o)===-1){let a=Gc(this.choices),c=a.indexOf(o);if(n.index>c){let l=a.slice(c,c+this.limit),u=a.filter(h=>!l.includes(h));this.choices=l.concat(u)}else{let l=c-this.limit+1;this.choices=a.slice(l).concat(a.slice(0,l))}}return this.index=this.choices.indexOf(o),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(s=>{let i=this.choices.length,n=this.num,o=(a=!1,c)=>{clearTimeout(this.numberTimeout),a&&(c=t(n)),this.num="",s(c)};if(n==="0"||n.length===1&&+(n+"0")>i)return o(!0);if(Number(n)>i)return o(!1,this.alert());this.numberTimeout=setTimeout(()=>o(!0),this.delay)})}home(){return this.choices=Gc(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,t=Gc(this.choices);return this.choices=t.slice(e).concat(t.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,t=this.visible.length,s=this.index;return this.options.scroll===!1&&s===0?this.alert():e>t&&s===0?this.scrollUp():(this.index=(s-1%e+e)%e,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let e=this.choices.length,t=this.visible.length,s=this.index;return this.options.scroll===!1&&s===t-1?this.alert():e>t&&s===t-1?this.scrollDown():(this.index=(s+1)%e,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=D6(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=v6(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){C6(this.choices,this.index,e)}allChoicesAreDisabled(e=this.choices){return e.every(t=>this.isDisabled(t))}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(s=>e[s]===!0)?!0:e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(t=>this.isEnabled(t));if(e.choices){let t=e.choices.filter(s=>!this.isDisabled(s));return e.enabled&&t.every(s=>this.isEnabled(s))}return e.enabled&&!this.isDisabled(e)}isChoice(e,t){return e.name===t||e.index===Number(t)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(t=>this.isChoice(e,t)):this.isChoice(e,this.initial)}map(e=[],t="value"){return[].concat(e||[]).reduce((s,i)=>(s[i]=this.find(i,t),s),{})}filter(e,t){let i=typeof e=="function"?e:(a,c)=>[a.name,c].includes(e),o=(this.options.multiple?this.state._choices:this.choices).filter(i);return t?o.map(a=>a[t]):o}find(e,t){if(Hf(e))return t?e[t]:e;let i=typeof e=="function"?e:(o,a)=>[o.name,a].includes(e),n=this.choices.find(i);if(n)return t?n[t]:n}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(o=>o.newChoice))return this.alert();let{reorder:t,sort:s}=this.options,i=this.multiple===!0,n=this.selected;return n===void 0?this.alert():(Array.isArray(n)&&t!==!1&&s!==!0&&(n=oo.reorder(n)),this.value=i?n.map(o=>o.name):n.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let t of e)this.state._choices.some(s=>s.name===t.name)||this.state._choices.push(t);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if(typeof t=="string"||typeof t=="number"){let s=this.find(t);s&&(this.initial=s.index,this.focus(s,!0))}}}get choices(){return Gf(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:t,choices:s}=this,i=e.limit||this._limit||t.limit||s.length;return Math.min(i,this.height)}set value(e){super.value=e}get value(){return typeof super.value!="string"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function Gf(r,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(oo.isAsyncFn(e))return e;e=e.call(r,r)}for(let t of e){if(Array.isArray(t.choices)){let s=t.choices.filter(i=>!r.isDisabled(i));t.enabled=s.every(i=>i.enabled===!0)}r.isDisabled(t)===!0&&delete t.enabled}return e}zf.exports=zc});var dr=D((m3,Kf)=>{"use strict";var E6=zi(),Kc=_e(),Zc=class extends E6{constructor(e){super(e),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,t){if(this.multiple)return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,t){return!this.multiple||this.options.pointer?super.pointer(e,t):""}indicator(e,t){return this.multiple?super.indicator(e,t):""}choiceMessage(e,t){let s=this.resolve(e.message,this.state,e,t);return e.role==="heading"&&!Kc.hasColor(s)&&(s=this.styles.strong(s)),this.resolve(s,this.state,e,t)}choiceSeparator(){return":"}async renderChoice(e,t){await this.onChoice(e,t);let s=this.index===t,i=await this.pointer(e,t),n=await this.indicator(e,t)+(e.pad||""),o=await this.resolve(e.hint,this.state,e,t);o&&!Kc.hasColor(o)&&(o=this.styles.muted(o));let a=this.indent(e),c=await this.choiceMessage(e,t),l=()=>[this.margin[3],a+i+n,c,this.margin[1],o].filter(Boolean).join(" ");return e.role==="heading"?l():e.disabled?(Kc.hasColor(c)||(c=this.styles.disabled(c)),l()):(s&&(c=this.styles.em(c)),l())}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let e=this.visible.map(async(n,o)=>await this.renderChoice(n,o)),t=await Promise.all(e);t.length||t.push(this.styles.danger("No matching choices"));let s=this.margin[0]+t.join(`
35
+ `:" ",s=[];for(let i=0;i<4;i++){let n=t(i);e[i]?s.push(n.repeat(e[i])):s.push("")}return s}Uf.exports=Hc});var Vf=D((d3,qf)=>{"use strict";var g6=_e(),Wf={default(r,e){return e},checkbox(r,e){throw new Error("checkbox role is not implemented yet")},editable(r,e){throw new Error("editable role is not implemented yet")},expandable(r,e){throw new Error("expandable role is not implemented yet")},heading(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||"",e},input(r,e){throw new Error("input role is not implemented yet")},option(r,e){return Wf.default(r,e)},radio(r,e){throw new Error("radio role is not implemented yet")},separator(r,e){return e.disabled="",e.indicator=[e.indicator," "].find(t=>t!=null),e.message=e.message||r.symbols.line.repeat(5),e},spacer(r,e){return e}};qf.exports=(r,e={})=>{let t=g6.merge({},Wf,e.roles);return t[r]||t.default}});var zi=D((p3,zf)=>{"use strict";var b6=Ot(),y6=$s(),w6=Vf(),oo=_e(),{reorder:Gc,scrollUp:D6,scrollDown:v6,isObject:Hf,swap:C6}=oo,zc=class extends y6{constructor(e){super(e),this.cursorHide(),this.maxSelected=e.maxSelected||1/0,this.multiple=e.multiple||!1,this.initial=e.initial||0,this.delay=e.delay||0,this.longest=0,this.num=""}async initialize(){typeof this.options.initial=="function"&&(this.initial=await this.options.initial.call(this)),await this.reset(!0),await super.initialize()}async reset(){let{choices:e,initial:t,autofocus:s,suggest:i}=this.options;if(this.state._choices=[],this.state.choices=[],this.choices=await Promise.all(await this.toChoices(e)),this.choices.forEach(n=>n.enabled=!1),typeof i!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");Hf(t)&&(t=Object.keys(t)),Array.isArray(t)?(s!=null&&(this.index=this.findIndex(s)),t.forEach(n=>this.enable(this.find(n))),await this.render()):(s!=null&&(t=s),typeof t=="string"&&(t=this.findIndex(t)),typeof t=="number"&&t>-1&&(this.index=Math.max(0,Math.min(t,this.choices.length)),this.enable(this.find(this.index)))),this.isDisabled(this.focused)&&await this.down()}async toChoices(e,t){this.state.loadingChoices=!0;let s=[],i=0,n=async(o,a)=>{typeof o=="function"&&(o=await o.call(this)),o instanceof Promise&&(o=await o);for(let c=0;c<o.length;c++){let l=o[c]=await this.toChoice(o[c],i++,a);s.push(l),l.choices&&await n(l.choices,l)}return s};return n(e,t).then(o=>(this.state.loadingChoices=!1,o))}async toChoice(e,t,s){if(typeof e=="function"&&(e=await e.call(this,this)),e instanceof Promise&&(e=await e),typeof e=="string"&&(e={name:e}),e.normalized)return e;e.normalized=!0;let i=e.value;if(e=w6(e.role,this.options)(this,e),typeof e.disabled=="string"&&!e.hint&&(e.hint=e.disabled,e.disabled=!0),e.disabled===!0&&e.hint==null&&(e.hint="(disabled)"),e.index!=null)return e;e.name=e.name||e.key||e.title||e.value||e.message,e.message=e.message||e.name||"",e.value=[e.value,e.name].find(this.isValue.bind(this)),e.input="",e.index=t,e.cursor=0,oo.define(e,"parent",s),e.level=s?s.level+1:1,e.indent==null&&(e.indent=s?s.indent+" ":e.indent||""),e.path=s?s.path+"."+e.name:e.name,e.enabled=!!(this.multiple&&!this.isDisabled(e)&&(e.enabled||this.isSelected(e))),this.isDisabled(e)||(this.longest=Math.max(this.longest,b6(e.message).length));let o={...e};return e.reset=(a=o.input,c=o.value)=>{for(let l of Object.keys(o))e[l]=o[l];e.input=a,e.value=c},i==null&&typeof e.initial=="function"&&(e.input=await e.initial.call(this,this.state,e,t)),e}async onChoice(e,t){this.emit("choice",e,t,this),typeof e.onChoice=="function"&&await e.onChoice.call(this,this.state,e,t)}async addChoice(e,t,s){let i=await this.toChoice(e,t,s);return this.choices.push(i),this.index=this.choices.length-1,this.limit=this.choices.length,i}async newItem(e,t,s){let i={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(i,t,s);return n.updateChoice=()=>{delete n.newChoice,n.name=n.message=n.input,n.input="",n.cursor=0},this.render()}indent(e){return e.indent==null?e.level>1?" ".repeat(e.level-1):"":e.indent}dispatch(e,t){if(this.multiple&&this[t.name])return this[t.name]();this.alert()}focus(e,t){return typeof t!="boolean"&&(t=e.enabled),t&&!e.enabled&&this.selected.length>=this.maxSelected?this.alert():(this.index=e.index,e.enabled=t&&!this.isDisabled(e),e)}space(){if(!this.multiple)return this.alert();if(this.focused)return this.toggle(this.focused),this.render()}a(){if(this.maxSelected<this.choices.length)return this.alert();let e=this.selectable.every(t=>t.enabled);return this.choices.forEach(t=>t.enabled=!e),this.render()}i(){return this.choices.length-this.selected.length>this.maxSelected?this.alert():(this.choices.forEach(e=>e.enabled=!e.enabled),this.render())}g(){if(!this.choices.some(t=>!!t.parent))return this.a();let e=this.focused;return this.toggle(e.parent&&!e.choices?e.parent:e),this.render()}toggle(e,t){if(!e.enabled&&this.selected.length>=this.maxSelected)return this.alert();typeof t!="boolean"&&(t=!e.enabled),e.enabled=t,e.choices&&e.choices.forEach(i=>this.toggle(i,t));let s=e.parent;for(;s;){let i=s.choices.filter(n=>this.isDisabled(n));s.enabled=i.every(n=>n.enabled===!0),s=s.parent}return Gf(this,this.choices),this.emit("toggle",e,this),e}enable(e){return this.selected.length>=this.maxSelected?this.alert():(e.enabled=!this.isDisabled(e),e.choices&&e.choices.forEach(this.enable.bind(this)),e)}disable(e){return e.enabled=!1,e.choices&&e.choices.forEach(this.disable.bind(this)),e}number(e){this.num+=e;let t=s=>{let i=Number(s);if(i>this.choices.length-1)return this.alert();let n=this.focused,o=this.choices.find(a=>i===a.index);if(!o.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(o)===-1){let a=Gc(this.choices),c=a.indexOf(o);if(n.index>c){let l=a.slice(c,c+this.limit),u=a.filter(h=>!l.includes(h));this.choices=l.concat(u)}else{let l=c-this.limit+1;this.choices=a.slice(l).concat(a.slice(0,l))}}return this.index=this.choices.indexOf(o),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(s=>{let i=this.choices.length,n=this.num,o=(a=!1,c)=>{clearTimeout(this.numberTimeout),a&&(c=t(n)),this.num="",s(c)};if(n==="0"||n.length===1&&+(n+"0")>i)return o(!0);if(Number(n)>i)return o(!1,this.alert());this.numberTimeout=setTimeout(()=>o(!0),this.delay)})}home(){return this.choices=Gc(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,t=Gc(this.choices);return this.choices=t.slice(e).concat(t.slice(0,e)),this.index=this.limit-1,this.render()}first(){return this.index=0,this.render()}last(){return this.index=this.visible.length-1,this.render()}prev(){return this.visible.length<=1?this.alert():this.up()}next(){return this.visible.length<=1?this.alert():this.down()}right(){return this.cursor>=this.input.length?this.alert():(this.cursor++,this.render())}left(){return this.cursor<=0?this.alert():(this.cursor--,this.render())}up(){let e=this.choices.length,t=this.visible.length,s=this.index;return this.options.scroll===!1&&s===0?this.alert():e>t&&s===0?this.scrollUp():(this.index=(s-1%e+e)%e,this.isDisabled()&&!this.allChoicesAreDisabled()?this.up():this.render())}down(){let e=this.choices.length,t=this.visible.length,s=this.index;return this.options.scroll===!1&&s===t-1?this.alert():e>t&&s===t-1?this.scrollDown():(this.index=(s+1)%e,this.isDisabled()&&!this.allChoicesAreDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=D6(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=v6(this.choices),this.index=e,this.isDisabled()?this.down():this.render()}async shiftUp(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index-1),await this.up(),this.sorting=!1;return}return this.scrollUp(this.index)}async shiftDown(){if(this.options.sort===!0){this.sorting=!0,this.swap(this.index+1),await this.down(),this.sorting=!1;return}return this.scrollDown(this.index)}pageUp(){return this.visible.length<=1?this.alert():(this.limit=Math.max(this.limit-1,0),this.index=Math.min(this.limit-1,this.index),this._limit=this.limit,this.isDisabled()?this.up():this.render())}pageDown(){return this.visible.length>=this.choices.length?this.alert():(this.index=Math.max(0,this.index),this.limit=Math.min(this.limit+1,this.choices.length),this._limit=this.limit,this.isDisabled()?this.down():this.render())}swap(e){C6(this.choices,this.index,e)}allChoicesAreDisabled(e=this.choices){return e.every(t=>this.isDisabled(t))}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(s=>e[s]===!0)?!0:e&&e.role==="heading"}isEnabled(e=this.focused){if(Array.isArray(e))return e.every(t=>this.isEnabled(t));if(e.choices){let t=e.choices.filter(s=>!this.isDisabled(s));return e.enabled&&t.every(s=>this.isEnabled(s))}return e.enabled&&!this.isDisabled(e)}isChoice(e,t){return e.name===t||e.index===Number(t)}isSelected(e){return Array.isArray(this.initial)?this.initial.some(t=>this.isChoice(e,t)):this.isChoice(e,this.initial)}map(e=[],t="value"){return[].concat(e||[]).reduce((s,i)=>(s[i]=this.find(i,t),s),{})}filter(e,t){let i=typeof e=="function"?e:(a,c)=>[a.name,c].includes(e),o=(this.options.multiple?this.state._choices:this.choices).filter(i);return t?o.map(a=>a[t]):o}find(e,t){if(Hf(e))return t?e[t]:e;let i=typeof e=="function"?e:(o,a)=>[o.name,a].includes(e),n=this.choices.find(i);if(n)return t?n[t]:n}findIndex(e){return this.choices.indexOf(this.find(e))}async submit(){let e=this.focused;if(!e)return this.alert();if(e.newChoice)return e.input?(e.updateChoice(),this.render()):this.alert();if(this.choices.some(o=>o.newChoice))return this.alert();let{reorder:t,sort:s}=this.options,i=this.multiple===!0,n=this.selected;return n===void 0?this.alert():(Array.isArray(n)&&t!==!1&&s!==!0&&(n=oo.reorder(n)),this.value=i?n.map(o=>o.name):n.name,super.submit())}set choices(e=[]){this.state._choices=this.state._choices||[],this.state.choices=e;for(let t of e)this.state._choices.some(s=>s.name===t.name)||this.state._choices.push(t);if(!this._initial&&this.options.initial){this._initial=!0;let t=this.initial;if(typeof t=="string"||typeof t=="number"){let s=this.find(t);s&&(this.initial=s.index,this.focus(s,!0))}}}get choices(){return Gf(this,this.state.choices||[])}set visible(e){this.state.visible=e}get visible(){return(this.state.visible||this.choices).slice(0,this.limit)}set limit(e){this.state.limit=e}get limit(){let{state:e,options:t,choices:s}=this,i=e.limit||this._limit||t.limit||s.length;return Math.min(i,this.height)}set value(e){super.value=e}get value(){return typeof super.value!="string"&&super.value===this.initial?this.input:super.value}set index(e){this.state.index=e}get index(){return Math.max(0,this.state?this.state.index:0)}get enabled(){return this.filter(this.isEnabled.bind(this))}get focused(){let e=this.choices[this.index];return e&&this.state.submitted&&this.multiple!==!0&&(e.enabled=!0),e}get selectable(){return this.choices.filter(e=>!this.isDisabled(e))}get selected(){return this.multiple?this.enabled:this.focused}};function Gf(r,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(oo.isAsyncFn(e))return e;e=e.call(r,r)}for(let t of e){if(Array.isArray(t.choices)){let s=t.choices.filter(i=>!r.isDisabled(i));t.enabled=s.every(i=>i.enabled===!0)}r.isDisabled(t)===!0&&delete t.enabled}return e}zf.exports=zc});var pr=D((m3,Kf)=>{"use strict";var E6=zi(),Kc=_e(),Zc=class extends E6{constructor(e){super(e),this.emptyError=this.options.emptyError||"No items were selected"}async dispatch(e,t){if(this.multiple)return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t);this.alert()}separator(){if(this.options.separator)return super.separator();let e=this.styles.muted(this.symbols.ellipsis);return this.state.submitted?super.separator():e}pointer(e,t){return!this.multiple||this.options.pointer?super.pointer(e,t):""}indicator(e,t){return this.multiple?super.indicator(e,t):""}choiceMessage(e,t){let s=this.resolve(e.message,this.state,e,t);return e.role==="heading"&&!Kc.hasColor(s)&&(s=this.styles.strong(s)),this.resolve(s,this.state,e,t)}choiceSeparator(){return":"}async renderChoice(e,t){await this.onChoice(e,t);let s=this.index===t,i=await this.pointer(e,t),n=await this.indicator(e,t)+(e.pad||""),o=await this.resolve(e.hint,this.state,e,t);o&&!Kc.hasColor(o)&&(o=this.styles.muted(o));let a=this.indent(e),c=await this.choiceMessage(e,t),l=()=>[this.margin[3],a+i+n,c,this.margin[1],o].filter(Boolean).join(" ");return e.role==="heading"?l():e.disabled?(Kc.hasColor(c)||(c=this.styles.disabled(c)),l()):(s&&(c=this.styles.em(c)),l())}async renderChoices(){if(this.state.loading==="choices")return this.styles.warning("Loading choices");if(this.state.submitted)return"";let e=this.visible.map(async(n,o)=>await this.renderChoice(n,o)),t=await Promise.all(e);t.length||t.push(this.styles.danger("No matching choices"));let s=this.margin[0]+t.join(`
36
36
  `),i;return this.options.choicesHeader&&(i=await this.resolve(this.options.choicesHeader,this.state)),[i,s].filter(Boolean).join(`
37
37
  `)}format(){return!this.state.submitted||this.state.cancelled?"":Array.isArray(this.selected)?this.selected.map(e=>this.styles.primary(e.name)).join(", "):this.styles.primary(this.selected.name)}async render(){let{submitted:e,size:t}=this.state,s="",i=await this.header(),n=await this.prefix(),o=await this.separator(),a=await this.message();this.options.promptLine!==!1&&(s=[n,a,o,""].join(" "),this.state.prompt=s);let c=await this.format(),l=await this.error()||await this.hint(),u=await this.renderChoices(),h=await this.footer();c&&(s+=c),l&&!s.includes(l)&&(s+=" "+l),e&&!c&&!u.trim()&&this.multiple&&this.emptyError!=null&&(s+=this.styles.danger(this.emptyError)),this.clear(t),this.write([i,s,u,h].filter(Boolean).join(`
38
- `)),this.write(this.margin[2]),this.restore()}};Kf.exports=Zc});var Yf=D((x3,Zf)=>{"use strict";var k6=dr(),S6=(r,e)=>{let t=r?new RegExp(r,"ig"):/$^/;return s=>r?s.replace(t,i=>e(i)):s},Yc=class extends k6{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:t,input:s}=this.state;return this.input=s.slice(0,t)+e+s.slice(t),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:t}=this.state;return t?(this.input=t.slice(0,e-1)+t.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:t}=this.state;return t[e]===void 0?this.alert():(this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,t=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,t);let s=e.toLowerCase();return t.filter(i=>i.message.toLowerCase().includes(s))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight||this.styles.complement,t=(n,o)=>n&&(e.stack?e(n):e.call(this,n)),s=S6(this.input,t),i=this.choices;this.choices=i.map(n=>({...n,message:s(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};Zf.exports=Yc});var Xc=D((g3,Jf)=>{"use strict";var Jc=_e();Jf.exports=(r,e={})=>{r.cursorHide();let{input:t="",initial:s="",pos:i,showCursor:n=!0,color:o}=e,a=o||r.styles.placeholder,c=Jc.inverse(r.styles.primary),l=m=>c(r.styles.black(m)),u=t,h=" ",d=l(h);if(r.blink&&r.blink.off===!0&&(l=m=>m,d=""),n&&i===0&&s===""&&t==="")return l(h);if(n&&i===0&&(t===s||t===""))return l(s[0])+a(s.slice(1));s=Jc.isPrimitive(s)?`${s}`:"",t=Jc.isPrimitive(t)?`${t}`:"";let f=s&&s.startsWith(t)&&s!==t,p=f?l(s[t.length]):d;if(i!==t.length&&n===!0&&(u=t.slice(0,i)+l(t[i])+t.slice(i+1),p=""),n===!1&&(p=""),f){let m=r.styles.unstyle(u+p);return u+p+a(s.slice(m.length))}return u+p}});var ao=D((b3,Xf)=>{"use strict";var _6=Ot(),A6=dr(),T6=Xc(),Qc=class extends A6{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(t=>t!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(t=>t.reset&&t.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let t=this.focused;if(!t)return this.alert();let{cursor:s,input:i}=t;return t.value=t.input=i.slice(0,s)+e+i.slice(s),t.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:s}=e;return e.value=e.input=s.slice(0,t-1)+s.slice(t),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:s}=e;if(s[t]===void 0)return this.alert();let i=`${s}`.slice(0,t)+`${s}`.slice(t+1);return e.value=e.input=i,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,t){return this.dispatch(e,t)}number(e,t){return this.dispatch(e,t)}next(){let e=this.focused;if(!e)return this.alert();let{initial:t,input:s}=e;return t&&t.startsWith(s)&&s!==t?(e.value=e.input=t,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,t){let s=await this.resolve(e.separator,this.state,e,t)||":";return s?" "+this.styles.disabled(s):""}async renderChoice(e,t){await this.onChoice(e,t);let{state:s,styles:i}=this,{cursor:n,initial:o="",name:a,input:c=""}=e,{muted:l,submitted:u,primary:h,danger:d}=i,f=this.index===t,p=e.validate||(()=>!0),m=await this.choiceSeparator(e,t),g=e.message;this.align==="right"&&(g=g.padStart(this.longest+1," ")),this.align==="left"&&(g=g.padEnd(this.longest+1," "));let x=this.values[a]=c||o,b=c?"success":"dark";await p.call(e,x,this.state)!==!0&&(b="danger");let y=i[b],w=y(await this.indicator(e,t))+(e.pad||""),v=this.indent(e),I=()=>[v,w,g+m,c].filter(Boolean).join(" ");if(s.submitted)return g=_6(g),c=u(c),I();if(e.format)c=await e.format.call(this,c,e,t);else{let B=this.styles.muted;c=T6(this,{input:c,initial:o,pos:n,showCursor:f,color:B})}return this.isValue(c)||(c=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[a]=await e.result.call(this,x,e,t)),f&&(g=h(g)),e.error?c+=(c?" ":"")+d(e.error.trim()):e.hint&&(c+=(c?" ":"")+l(e.hint.trim())),I()}async submit(){return this.value=this.values,super.base.submit.call(this)}};Xf.exports=Qc});var el=D((y3,ed)=>{"use strict";var F6=ao(),O6=()=>{throw new Error("expected prompt to have a custom authenticate method")},Qf=(r=O6)=>{class e extends F6{constructor(s){super(s)}async submit(){this.value=await r.call(this,this.values,this.state),super.base.submit.call(this)}static create(s){return Qf(s)}}return e};ed.exports=Qf()});var sd=D((w3,rd)=>{"use strict";var I6=el();function B6(r,e){return r.username===this.options.username&&r.password===this.options.password}var td=(r=B6)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(s){return this.options.showPassword?s:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(s.length))}}];class t extends I6.create(r){constructor(i){super({...i,choices:e})}static create(i){return td(i)}}return t};rd.exports=td()});var co=D((D3,id)=>{"use strict";var P6=$s(),{isPrimitive:R6,hasColor:M6}=_e(),tl=class extends P6{constructor(e){super(e),this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:t,state:s}=this;return s.submitted?t.success(e):t.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return R6(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return M6(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:t}=this.state,s=await this.prefix(),i=await this.separator(),n=await this.message(),o=this.styles.muted(this.default),a=[s,n,o,i].filter(Boolean).join(" ");this.state.prompt=a;let c=await this.header(),l=this.value=this.cast(e),u=await this.format(l),h=await this.error()||await this.hint(),d=await this.footer();h&&!a.includes(h)&&(u+=" "+h),a+=" "+u,this.clear(t),this.write([c,a,d].filter(Boolean).join(`
39
- `)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};id.exports=tl});var od=D((v3,nd)=>{"use strict";var $6=co(),rl=class extends $6{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};nd.exports=rl});var cd=D((C3,ad)=>{"use strict";var j6=dr(),N6=ao(),js=N6.prototype,sl=class extends j6{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(t=>t!=null),this.emptyError="",this.values={}}dispatch(e,t){let s=this.focused,i=s.parent||{};return!s.editable&&!i.editable&&(e==="a"||e==="i")?super[e]():js.dispatch.call(this,e,t)}append(e,t){return js.append.call(this,e,t)}delete(e,t){return js.delete.call(this,e,t)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?js.next.call(this):super.next()}prev(){return this.focused.editable?js.prev.call(this):super.prev()}async indicator(e,t){let s=e.indicator||"",i=e.editable?s:super.indicator(e,t);return await this.resolve(i,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,t){return e.indent="",e.editable?js.renderChoice.call(this,e,t):super.renderChoice(e,t)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let t of this.choices){if(typeof t.validate!="function"||t.role==="heading")continue;let s=t.parent?this.value[t.parent.name]:this.value;if(t.editable?s=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(s=t.enabled===!0),e=await t.validate(s,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let t=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?t[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(t[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};ad.exports=sl});var qr=D((E3,ld)=>{"use strict";var L6=$s(),U6=Rc(),W6=Xc(),{isPrimitive:q6}=_e(),il=class extends L6{constructor(e){super(e),this.initial=q6(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=this.options.keypressTimeout!==void 0?this.options.keypressTimeout:null}async keypress(e,t=e?U6(e,{}):{}){let s=Date.now(),i=s-this.lastKeypress;this.lastKeypress=s;let n=t.name==="return"||t.name==="enter",o=this.state.prevKeypress,a;if(this.state.prevKeypress=t,this.keypressTimeout!=null&&n){if(i<this.keypressTimeout)return this.submit();this.state.multilineBuffer=this.state.multilineBuffer||"",this.state.multilineBuffer+=e,a=!0,o=null}return(a||this.options.multiline&&n)&&(!o||o.name!=="return")?this.append(`
38
+ `)),this.write(this.margin[2]),this.restore()}};Kf.exports=Zc});var Yf=D((x3,Zf)=>{"use strict";var k6=pr(),S6=(r,e)=>{let t=r?new RegExp(r,"ig"):/$^/;return s=>r?s.replace(t,i=>e(i)):s},Yc=class extends k6{constructor(e){super(e),this.cursorShow()}moveCursor(e){this.state.cursor+=e}dispatch(e){return this.append(e)}space(e){return this.options.multiple?super.space(e):this.append(e)}append(e){let{cursor:t,input:s}=this.state;return this.input=s.slice(0,t)+e+s.slice(t),this.moveCursor(1),this.complete()}delete(){let{cursor:e,input:t}=this.state;return t?(this.input=t.slice(0,e-1)+t.slice(e),this.moveCursor(-1),this.complete()):this.alert()}deleteForward(){let{cursor:e,input:t}=this.state;return t[e]===void 0?this.alert():(this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.complete())}number(e){return this.append(e)}async complete(){this.completing=!0,this.choices=await this.suggest(this.input,this.state._choices),this.state.limit=void 0,this.index=Math.min(Math.max(this.visible.length-1,0),this.index),await this.render(),this.completing=!1}suggest(e=this.input,t=this.state._choices){if(typeof this.options.suggest=="function")return this.options.suggest.call(this,e,t);let s=e.toLowerCase();return t.filter(i=>i.message.toLowerCase().includes(s))}pointer(){return""}format(){if(!this.focused)return this.input;if(this.options.multiple&&this.state.submitted)return this.selected.map(e=>this.styles.primary(e.message)).join(", ");if(this.state.submitted){let e=this.value=this.input=this.focused.value;return this.styles.primary(e)}return this.input}async render(){if(this.state.status!=="pending")return super.render();let e=this.options.highlight||this.styles.complement,t=(n,o)=>n&&(e.stack?e(n):e.call(this,n)),s=S6(this.input,t),i=this.choices;this.choices=i.map(n=>({...n,message:s(n.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};Zf.exports=Yc});var Xc=D((g3,Jf)=>{"use strict";var Jc=_e();Jf.exports=(r,e={})=>{r.cursorHide();let{input:t="",initial:s="",pos:i,showCursor:n=!0,color:o}=e,a=o||r.styles.placeholder,c=Jc.inverse(r.styles.primary),l=m=>c(r.styles.black(m)),u=t,h=" ",d=l(h);if(r.blink&&r.blink.off===!0&&(l=m=>m,d=""),n&&i===0&&s===""&&t==="")return l(h);if(n&&i===0&&(t===s||t===""))return l(s[0])+a(s.slice(1));s=Jc.isPrimitive(s)?`${s}`:"",t=Jc.isPrimitive(t)?`${t}`:"";let f=s&&s.startsWith(t)&&s!==t,p=f?l(s[t.length]):d;if(i!==t.length&&n===!0&&(u=t.slice(0,i)+l(t[i])+t.slice(i+1),p=""),n===!1&&(p=""),f){let m=r.styles.unstyle(u+p);return u+p+a(s.slice(m.length))}return u+p}});var ao=D((b3,Xf)=>{"use strict";var _6=Ot(),A6=pr(),T6=Xc(),Qc=class extends A6{constructor(e){super({...e,multiple:!0}),this.type="form",this.initial=this.options.initial,this.align=[this.options.align,"right"].find(t=>t!=null),this.emptyError="",this.values={}}async reset(e){return await super.reset(),e===!0&&(this._index=this.index),this.index=this._index,this.values={},this.choices.forEach(t=>t.reset&&t.reset()),this.render()}dispatch(e){return!!e&&this.append(e)}append(e){let t=this.focused;if(!t)return this.alert();let{cursor:s,input:i}=t;return t.value=t.input=i.slice(0,s)+e+i.slice(s),t.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:s}=e;return e.value=e.input=s.slice(0,t-1)+s.slice(t),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:s}=e;if(s[t]===void 0)return this.alert();let i=`${s}`.slice(0,t)+`${s}`.slice(t+1);return e.value=e.input=i,this.render()}right(){let e=this.focused;return e?e.cursor>=e.input.length?this.alert():(e.cursor++,this.render()):this.alert()}left(){let e=this.focused;return e?e.cursor<=0?this.alert():(e.cursor--,this.render()):this.alert()}space(e,t){return this.dispatch(e,t)}number(e,t){return this.dispatch(e,t)}next(){let e=this.focused;if(!e)return this.alert();let{initial:t,input:s}=e;return t&&t.startsWith(s)&&s!==t?(e.value=e.input=t,e.cursor=e.value.length,this.render()):super.next()}prev(){let e=this.focused;return e?e.cursor===0?super.prev():(e.value=e.input="",e.cursor=0,this.render()):this.alert()}separator(){return""}format(e){return this.state.submitted?"":super.format(e)}pointer(){return""}indicator(e){return e.input?"\u29BF":"\u2299"}async choiceSeparator(e,t){let s=await this.resolve(e.separator,this.state,e,t)||":";return s?" "+this.styles.disabled(s):""}async renderChoice(e,t){await this.onChoice(e,t);let{state:s,styles:i}=this,{cursor:n,initial:o="",name:a,input:c=""}=e,{muted:l,submitted:u,primary:h,danger:d}=i,f=this.index===t,p=e.validate||(()=>!0),m=await this.choiceSeparator(e,t),g=e.message;this.align==="right"&&(g=g.padStart(this.longest+1," ")),this.align==="left"&&(g=g.padEnd(this.longest+1," "));let x=this.values[a]=c||o,b=c?"success":"dark";await p.call(e,x,this.state)!==!0&&(b="danger");let y=i[b],w=y(await this.indicator(e,t))+(e.pad||""),v=this.indent(e),I=()=>[v,w,g+m,c].filter(Boolean).join(" ");if(s.submitted)return g=_6(g),c=u(c),I();if(e.format)c=await e.format.call(this,c,e,t);else{let B=this.styles.muted;c=T6(this,{input:c,initial:o,pos:n,showCursor:f,color:B})}return this.isValue(c)||(c=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[a]=await e.result.call(this,x,e,t)),f&&(g=h(g)),e.error?c+=(c?" ":"")+d(e.error.trim()):e.hint&&(c+=(c?" ":"")+l(e.hint.trim())),I()}async submit(){return this.value=this.values,super.base.submit.call(this)}};Xf.exports=Qc});var el=D((y3,ed)=>{"use strict";var F6=ao(),O6=()=>{throw new Error("expected prompt to have a custom authenticate method")},Qf=(r=O6)=>{class e extends F6{constructor(s){super(s)}async submit(){this.value=await r.call(this,this.values,this.state),super.base.submit.call(this)}static create(s){return Qf(s)}}return e};ed.exports=Qf()});var sd=D((w3,rd)=>{"use strict";var I6=el();function B6(r,e){return r.username===this.options.username&&r.password===this.options.password}var td=(r=B6)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(s){return this.options.showPassword?s:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(s.length))}}];class t extends I6.create(r){constructor(i){super({...i,choices:e})}static create(i){return td(i)}}return t};rd.exports=td()});var co=D((D3,id)=>{"use strict";var P6=$s(),{isPrimitive:R6,hasColor:M6}=_e(),tl=class extends P6{constructor(e){super(e),this.cursorHide()}async initialize(){let e=await this.resolve(this.initial,this.state);this.input=await this.cast(e),await super.initialize()}dispatch(e){return this.isValue(e)?(this.input=e,this.submit()):this.alert()}format(e){let{styles:t,state:s}=this;return s.submitted?t.success(e):t.primary(e)}cast(e){return this.isTrue(e)}isTrue(e){return/^[ty1]/i.test(e)}isFalse(e){return/^[fn0]/i.test(e)}isValue(e){return R6(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return M6(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:t}=this.state,s=await this.prefix(),i=await this.separator(),n=await this.message(),o=this.styles.muted(this.default),a=[s,n,o,i].filter(Boolean).join(" ");this.state.prompt=a;let c=await this.header(),l=this.value=this.cast(e),u=await this.format(l),h=await this.error()||await this.hint(),d=await this.footer();h&&!a.includes(h)&&(u+=" "+h),a+=" "+u,this.clear(t),this.write([c,a,d].filter(Boolean).join(`
39
+ `)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};id.exports=tl});var od=D((v3,nd)=>{"use strict";var $6=co(),rl=class extends $6{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};nd.exports=rl});var cd=D((C3,ad)=>{"use strict";var j6=pr(),N6=ao(),js=N6.prototype,sl=class extends j6{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(t=>t!=null),this.emptyError="",this.values={}}dispatch(e,t){let s=this.focused,i=s.parent||{};return!s.editable&&!i.editable&&(e==="a"||e==="i")?super[e]():js.dispatch.call(this,e,t)}append(e,t){return js.append.call(this,e,t)}delete(e,t){return js.delete.call(this,e,t)}space(e){return this.focused.editable?this.append(e):super.space()}number(e){return this.focused.editable?this.append(e):super.number(e)}next(){return this.focused.editable?js.next.call(this):super.next()}prev(){return this.focused.editable?js.prev.call(this):super.prev()}async indicator(e,t){let s=e.indicator||"",i=e.editable?s:super.indicator(e,t);return await this.resolve(i,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":" "}async renderChoice(e,t){return e.indent="",e.editable?js.renderChoice.call(this,e,t):super.renderChoice(e,t)}error(){return""}footer(){return this.state.error}async validate(){let e=!0;for(let t of this.choices){if(typeof t.validate!="function"||t.role==="heading")continue;let s=t.parent?this.value[t.parent.name]:this.value;if(t.editable?s=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(s=t.enabled===!0),e=await t.validate(s,this.state),e!==!0)break}return e!==!0&&(this.state.error=typeof e=="string"?e:"Invalid Input"),e}submit(){if(this.focused.newChoice===!0)return super.submit();if(this.choices.some(e=>e.newChoice))return this.alert();this.value={};for(let e of this.choices){let t=e.parent?this.value[e.parent.name]:this.value;if(e.role==="heading"){this.value[e.name]={};continue}e.editable?t[e.name]=e.value===e.name?e.initial||"":e.value:this.isDisabled(e)||(t[e.name]=e.enabled===!0)}return this.base.submit.call(this)}};ad.exports=sl});var Vr=D((E3,ld)=>{"use strict";var L6=$s(),U6=Rc(),W6=Xc(),{isPrimitive:q6}=_e(),il=class extends L6{constructor(e){super(e),this.initial=q6(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[],this.keypressTimeout=this.options.keypressTimeout!==void 0?this.options.keypressTimeout:null}async keypress(e,t=e?U6(e,{}):{}){let s=Date.now(),i=s-this.lastKeypress;this.lastKeypress=s;let n=t.name==="return"||t.name==="enter",o=this.state.prevKeypress,a;if(this.state.prevKeypress=t,this.keypressTimeout!=null&&n){if(i<this.keypressTimeout)return this.submit();this.state.multilineBuffer=this.state.multilineBuffer||"",this.state.multilineBuffer+=e,a=!0,o=null}return(a||this.options.multiline&&n)&&(!o||o.name!=="return")?this.append(`
40
40
  `,t):super.keypress(e,t)}moveCursor(e){this.cursor+=e}reset(){return this.input=this.value="",this.cursor=0,this.render()}dispatch(e,t){if(!e||t.ctrl||t.code)return this.alert();this.append(e)}append(e){let{cursor:t,input:s}=this.state;this.input=`${s}`.slice(0,t)+e+`${s}`.slice(t),this.moveCursor(String(e).length),this.render()}insert(e){this.append(e)}delete(){let{cursor:e,input:t}=this.state;if(e<=0)return this.alert();this.input=`${t}`.slice(0,e-1)+`${t}`.slice(e),this.moveCursor(-1),this.render()}deleteForward(){let{cursor:e,input:t}=this.state;if(t[e]===void 0)return this.alert();this.input=`${t}`.slice(0,e)+`${t}`.slice(e+1),this.render()}cutForward(){let e=this.cursor;if(this.input.length<=e)return this.alert();this.state.clipboard.push(this.input.slice(e)),this.input=this.input.slice(0,e),this.render()}cutLeft(){let e=this.cursor;if(e===0)return this.alert();let t=this.input.slice(0,e),s=this.input.slice(e),i=t.split(" ");this.state.clipboard.push(i.pop()),this.input=i.join(" "),this.cursor=this.input.length,this.input+=s,this.render()}paste(){if(!this.state.clipboard.length)return this.alert();this.insert(this.state.clipboard.pop()),this.render()}toggleCursor(){this.state.prevCursor?(this.cursor=this.state.prevCursor,this.state.prevCursor=0):(this.state.prevCursor=this.cursor,this.cursor=0),this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.input.length-1,this.render()}next(){let e=this.initial!=null?String(this.initial):"";if(!e||!e.startsWith(this.input))return this.alert();this.input=this.initial,this.cursor=this.initial.length,this.render()}prev(){if(!this.input)return this.alert();this.reset()}backward(){return this.left()}forward(){return this.right()}right(){return this.cursor>=this.input.length?this.alert():(this.moveCursor(1),this.render())}left(){return this.cursor<=0?this.alert():(this.moveCursor(-1),this.render())}isValue(e){return!!e}async format(e=this.value){let t=await this.resolve(this.initial,this.state);return this.state.submitted?this.styles.submitted(e||t):W6(this,{input:e,initial:t,pos:this.cursor})}async render(){let e=this.state.size,t=await this.prefix(),s=await this.separator(),i=await this.message(),n=[t,i,s].filter(Boolean).join(" ");this.state.prompt=n;let o=await this.header(),a=await this.format(),c=await this.error()||await this.hint(),l=await this.footer();c&&!a.includes(c)&&(a+=" "+c),n+=" "+a,this.clear(e),this.write([o,n,l].filter(Boolean).join(`
41
- `)),this.restore()}};ld.exports=il});var hd=D((k3,ud)=>{"use strict";var V6=r=>r.filter((e,t)=>r.lastIndexOf(e)===t),lo=r=>V6(r).filter(Boolean);ud.exports=(r,e={},t="")=>{let{past:s=[],present:i=""}=e,n,o;switch(r){case"prev":case"undo":return n=s.slice(0,s.length-1),o=s[s.length-1]||"",{past:lo([t,...n]),present:o};case"next":case"redo":return n=s.slice(1),o=s[0]||"",{past:lo([...n,t]),present:o};case"save":return{past:lo([...s,t]),present:""};case"remove":return o=lo(s.filter(a=>a!==t)),i="",o.length&&(i=o.pop()),{past:o,present:i};default:throw new Error(`Invalid action: "${r}"`)}}});var ol=D((S3,dd)=>{"use strict";var H6=qr(),fd=hd(),nl=class extends H6{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let s=t.values||this.initial;this.autosave=!!t.autosave,this.store=t.store,this.data=this.store.get("values")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=fd(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=fd("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};dd.exports=nl});var md=D((_3,pd)=>{"use strict";var G6=qr(),al=class extends G6{format(){return""}};pd.exports=al});var gd=D((A3,xd)=>{"use strict";var z6=qr(),cl=class extends z6{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:t=>t;return this.list.map(e).join(", ")}async submit(e){let t=this.state.error||await this.validate(this.list,this.state);return t!==!0?(this.state.error=t,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};xd.exports=cl});var yd=D((T3,bd)=>{"use strict";var K6=dr(),ll=class extends K6{constructor(e){super({...e,multiple:!0})}};bd.exports=ll});var hl=D((F3,wd)=>{"use strict";var Z6=qr(),ul=class extends Z6{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let t=e||this.minor,s=this.toNumber(this.input);return s>this.max+t?this.alert():(this.input=`${s+t}`,this.render())}down(e){let t=e||this.minor,s=this.toNumber(this.input);return s<this.min-t?this.alert():(this.input=`${s-t}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(t=>this.isValue(t));return this.value=this.toNumber(e||0),super.submit()}};wd.exports=ul});var vd=D((O3,Dd)=>{Dd.exports=hl()});var Ed=D((I3,Cd)=>{"use strict";var Y6=qr(),fl=class extends Y6{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};Cd.exports=fl});var _d=D((B3,Sd)=>{"use strict";var J6=Ot(),X6=zi(),kd=_e(),dl=class extends X6{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`
41
+ `)),this.restore()}};ld.exports=il});var hd=D((k3,ud)=>{"use strict";var V6=r=>r.filter((e,t)=>r.lastIndexOf(e)===t),lo=r=>V6(r).filter(Boolean);ud.exports=(r,e={},t="")=>{let{past:s=[],present:i=""}=e,n,o;switch(r){case"prev":case"undo":return n=s.slice(0,s.length-1),o=s[s.length-1]||"",{past:lo([t,...n]),present:o};case"next":case"redo":return n=s.slice(1),o=s[0]||"",{past:lo([...n,t]),present:o};case"save":return{past:lo([...s,t]),present:""};case"remove":return o=lo(s.filter(a=>a!==t)),i="",o.length&&(i=o.pop()),{past:o,present:i};default:throw new Error(`Invalid action: "${r}"`)}}});var ol=D((S3,dd)=>{"use strict";var H6=Vr(),fd=hd(),nl=class extends H6{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let s=t.values||this.initial;this.autosave=!!t.autosave,this.store=t.store,this.data=this.store.get("values")||{past:[],present:s},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=fd(e,this.data,this.input),this.data.present?(this.input=this.data.present,this.cursor=this.input.length,this.render()):this.alert()):this.alert()}altUp(){return this.completion("prev")}altDown(){return this.completion("next")}prev(){return this.save(),super.prev()}save(){this.store&&(this.data=fd("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};dd.exports=nl});var md=D((_3,pd)=>{"use strict";var G6=Vr(),al=class extends G6{format(){return""}};pd.exports=al});var gd=D((A3,xd)=>{"use strict";var z6=Vr(),cl=class extends z6{constructor(e={}){super(e),this.sep=this.options.separator||/, */,this.initial=e.initial||""}split(e=this.value){return e?String(e).split(this.sep):[]}format(){let e=this.state.submitted?this.styles.primary:t=>t;return this.list.map(e).join(", ")}async submit(e){let t=this.state.error||await this.validate(this.list,this.state);return t!==!0?(this.state.error=t,super.submit()):(this.value=this.list,super.submit())}get list(){return this.split()}};xd.exports=cl});var yd=D((T3,bd)=>{"use strict";var K6=pr(),ll=class extends K6{constructor(e){super({...e,multiple:!0})}};bd.exports=ll});var hl=D((F3,wd)=>{"use strict";var Z6=Vr(),ul=class extends Z6{constructor(e={}){super({style:"number",...e}),this.min=this.isValue(e.min)?this.toNumber(e.min):-1/0,this.max=this.isValue(e.max)?this.toNumber(e.max):1/0,this.delay=e.delay!=null?e.delay:1e3,this.float=e.float!==!1,this.round=e.round===!0||e.float===!1,this.major=e.major||10,this.minor=e.minor||1,this.initial=e.initial!=null?e.initial:"",this.input=String(this.initial),this.cursor=this.input.length,this.cursorShow()}append(e){return!/[-+.]/.test(e)||e==="."&&this.input.includes(".")?this.alert("invalid number"):super.append(e)}number(e){return super.append(e)}next(){return this.input&&this.input!==this.initial?this.alert():this.isValue(this.initial)?(this.input=this.initial,this.cursor=String(this.initial).length,this.render()):this.alert()}up(e){let t=e||this.minor,s=this.toNumber(this.input);return s>this.max+t?this.alert():(this.input=`${s+t}`,this.render())}down(e){let t=e||this.minor,s=this.toNumber(this.input);return s<this.min-t?this.alert():(this.input=`${s-t}`,this.render())}shiftDown(){return this.down(this.major)}shiftUp(){return this.up(this.major)}format(e=this.input){return typeof this.options.format=="function"?this.options.format.call(this,e):this.styles.info(e)}toNumber(e=""){return this.float?+e:Math.round(+e)}isValue(e){return/^[-+]?[0-9]+((\.)|(\.[0-9]+))?$/.test(e)}submit(){let e=[this.input,this.initial].find(t=>this.isValue(t));return this.value=this.toNumber(e||0),super.submit()}};wd.exports=ul});var vd=D((O3,Dd)=>{Dd.exports=hl()});var Ed=D((I3,Cd)=>{"use strict";var Y6=Vr(),fl=class extends Y6{constructor(e){super(e),this.cursorShow()}format(e=this.input){return this.keypressed?(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(e.length)):""}};Cd.exports=fl});var _d=D((B3,Sd)=>{"use strict";var J6=Ot(),X6=zi(),kd=_e(),dl=class extends X6{constructor(e={}){super(e),this.widths=[].concat(e.messageWidth||50),this.align=[].concat(e.align||"left"),this.linebreak=e.linebreak||!1,this.edgeLength=e.edgeLength||3,this.newline=e.newline||`
42
42
  `;let t=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((s,i)=>({name:i+t})))}async reset(){return this.tableized=!1,await super.reset(),this.render()}tableize(){if(this.tableized===!0)return;this.tableized=!0;let e=0;for(let t of this.choices){e=Math.max(e,t.message.length),t.scaleIndex=t.initial||2,t.scale=[];for(let s=0;s<this.scale.length;s++)t.scale.push({index:s})}this.widths[0]=Math.min(this.widths[0],e+3)}async dispatch(e,t){if(this.multiple)return this[t.name]?await this[t.name](e,t):await super.dispatch(e,t);this.alert()}heading(e,t,s){return this.styles.strong(e)}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIndex>=this.scale.length-1?this.alert():(e.scaleIndex++,this.render())}left(){let e=this.focused;return e.scaleIndex<=0?this.alert():(e.scaleIndex--,this.render())}indent(){return""}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.index)).join(", "):""}pointer(){return""}renderScaleKey(){return this.scaleKey===!1||this.state.submitted?"":["",...this.scale.map(s=>` ${s.name} - ${s.message}`)].map(s=>this.styles.muted(s)).join(`
43
43
  `)}renderScaleHeading(e){let t=this.scale.map(c=>c.name);typeof this.options.renderScaleHeading=="function"&&(t=this.options.renderScaleHeading.call(this,e));let s=this.scaleLength-t.join("").length,i=Math.round(s/(t.length-1)),o=t.map(c=>this.styles.strong(c)).join(" ".repeat(i)),a=" ".repeat(this.widths[0]);return this.margin[3]+a+this.margin[1]+o}scaleIndicator(e,t,s){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,t,s);let i=e.scaleIndex===t.index;return t.disabled?this.styles.hint(this.symbols.radio.disabled):i?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,t){let s=e.scale.map(n=>this.scaleIndicator(e,n,t)),i=this.term==="Hyper"?"":" ";return s.join(i+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,t){await this.onChoice(e,t);let s=this.index===t,i=await this.pointer(e,t),n=await e.hint;n&&!kd.hasColor(n)&&(n=this.styles.muted(n));let o=p=>this.margin[3]+p.replace(/\s+$/,"").padEnd(this.widths[0]," "),a=this.newline,c=this.indent(e),l=await this.resolve(e.message,this.state,e,t),u=await this.renderScale(e,t),h=this.margin[1]+this.margin[3];this.scaleLength=J6(u).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-h.length);let f=kd.wordWrap(l,{width:this.widths[0],newline:a}).split(`
44
44
  `).map(p=>o(p)+this.margin[1]);return s&&(u=this.styles.info(u),f=f.map(p=>this.styles.info(p))),f[0]+=u,this.linebreak&&f.push(""),[c+i,f.join(`
@@ -51,18 +51,18 @@ Expecting one of '${s.join("', '")}'`);let i=`${e}Help`;return this.on(i,n=>{let
51
51
  `].find(b=>b!=null),o=await this.prefix(),a=await this.separator(),c=await this.message(),l=[o,c,a].filter(Boolean).join(" ");this.state.prompt=l;let u=await this.header(),h=await this.error()||"",d=await this.hint()||"",f=s?"":await this.interpolate(this.state),p=this.state.key=t[e]||"",m=await this.format(p),g=await this.footer();m&&(l+=" "+m),d&&!m&&this.state.completed===0&&(l+=" "+d),this.clear(i);let x=[u,l,f,g,h.trim()];this.write(x.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:t,keys:s,index:i}=this.state,n=t.find(o=>o.name===s[i]);return n&&n.input!=null&&(this.input=n.input,this.cursor=n.cursor),n}async submit(){typeof this.interpolate!="function"&&await this.initialize(),await this.interpolate(this.state,!0);let{invalid:e,missing:t,output:s,values:i}=this.state;if(e.size){let a="";for(let[c,l]of e)a+=`Invalid ${c}: ${l}
52
52
  `;return this.state.error=a,super.submit()}if(t.size)return this.state.error="Required: "+[...t.keys()].join(", "),super.submit();let o=tw(s).split(`
53
53
  `).map(a=>a.slice(1)).join(`
54
- `);return this.value={values:i,result:o},super.submit()}};Od.exports=xl});var Pd=D((M3,Bd)=>{"use strict";var iw="(Use <shift>+<up/down> to sort)",nw=dr(),gl=class extends nw{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,iw].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let s=await super.renderChoice(e,t),i=this.symbols.identicalTo+" ",n=this.index===t&&this.sorting?this.styles.muted(i):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${t+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Bd.exports=gl});var Md=D(($3,Rd)=>{"use strict";var ow=zi(),bl=class extends ow{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let t=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];t=t.map(s=>this.styles.muted(s)),this.state.header=t.join(`
54
+ `);return this.value={values:i,result:o},super.submit()}};Od.exports=xl});var Pd=D((M3,Bd)=>{"use strict";var iw="(Use <shift>+<up/down> to sort)",nw=pr(),gl=class extends nw{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,iw].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let s=await super.renderChoice(e,t),i=this.symbols.identicalTo+" ",n=this.index===t&&this.sorting?this.styles.muted(i):" ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${t+1} - `+s:n+s}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};Bd.exports=gl});var Md=D(($3,Rd)=>{"use strict";var ow=zi(),bl=class extends ow{constructor(e={}){if(super(e),this.emptyError=e.emptyError||"No items were selected",this.term=process.env.TERM_PROGRAM,!this.options.header){let t=["","4 - Strongly Agree","3 - Agree","2 - Neutral","1 - Disagree","0 - Strongly Disagree",""];t=t.map(s=>this.styles.muted(s)),this.state.header=t.join(`
55
55
  `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let t=await super.toChoices(...e);for(let s of t)s.scale=aw(5,this.options),s.scaleIdx=2;return t}dispatch(){this.alert()}space(){let e=this.focused,t=e.scale[e.scaleIdx],s=t.selected;return e.scale.forEach(i=>i.selected=!1),t.selected=!s,this.render()}indicator(){return""}pointer(){return""}separator(){return this.styles.muted(this.symbols.ellipsis)}right(){let e=this.focused;return e.scaleIdx>=e.scale.length-1?this.alert():(e.scaleIdx++,this.render())}left(){let e=this.focused;return e.scaleIdx<=0?this.alert():(e.scaleIdx--,this.render())}indent(){return" "}async renderChoice(e,t){await this.onChoice(e,t);let s=this.index===t,i=this.term==="Hyper",n=i?9:8,o=i?"":" ",a=this.symbols.line.repeat(n),c=" ".repeat(n+(i?0:1)),l=y=>(y?this.styles.success("\u25C9"):"\u25EF")+o,u=t+1+".",h=s?this.styles.heading:this.styles.noop,d=await this.resolve(e.message,this.state,e,t),f=this.indent(e),p=f+e.scale.map((y,w)=>l(w===e.scaleIdx)).join(a),m=y=>y===e.scaleIdx?h(y):y,g=f+e.scale.map((y,w)=>m(w)).join(c),x=()=>[u,d].filter(Boolean).join(" "),b=()=>[x(),p,g," "].filter(Boolean).join(`
56
56
  `);return s&&(p=this.styles.cyan(p),g=this.styles.cyan(g)),b()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(s,i)=>await this.renderChoice(s,i)),t=await Promise.all(e);return t.length||t.push(this.styles.danger("No matching choices")),t.join(`
57
57
  `)}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:t}=this.state,s=await this.prefix(),i=await this.separator(),n=await this.message(),o=[s,n,i].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),c=await this.format(),l=await this.error()||await this.hint(),u=await this.renderChoices(),h=await this.footer();(c||!l)&&(o+=" "+c),l&&!o.includes(l)&&(o+=" "+l),e&&!c&&!u&&this.multiple&&this.type!=="form"&&(o+=this.styles.danger(this.emptyError)),this.clear(t),this.write([o,a,u,h].filter(Boolean).join(`
58
58
  `)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function aw(r,e={}){if(Array.isArray(e.scale))return e.scale.map(s=>({...s}));let t=[];for(let s=1;s<r+1;s++)t.push({i:s,selected:!1});return t}Rd.exports=bl});var jd=D((j3,$d)=>{$d.exports=ol()});var Ld=D((N3,Nd)=>{"use strict";var cw=co(),yl=class extends cw{async initialize(){await super.initialize(),this.value=this.initial=this.resolve(this.options.initial),this.disabled=this.options.disabled||"no",this.enabled=this.options.enabled||"yes",await this.render()}reset(){this.value=this.initial,this.render()}delete(){this.alert()}toggle(){this.value=!this.value,this.render()}enable(){if(this.value===!0)return this.alert();this.value=!0,this.render()}disable(){if(this.value===!1)return this.alert();this.value=!1,this.render()}up(){this.toggle()}down(){this.toggle()}right(){this.toggle()}left(){this.toggle()}next(){this.toggle()}prev(){this.toggle()}dispatch(e="",t){switch(e.toLowerCase()){case" ":return this.toggle();case"1":case"y":case"t":return this.enable();case"0":case"n":case"f":return this.disable();default:return this.alert()}}format(){let e=s=>this.styles.primary.underline(s);return[this.value?this.disabled:e(this.disabled),this.value?e(this.enabled):this.enabled].join(this.styles.muted(" / "))}async render(){let{size:e}=this.state,t=await this.header(),s=await this.prefix(),i=await this.separator(),n=await this.message(),o=await this.format(),a=await this.error()||await this.hint(),c=await this.footer(),l=[s,n,i,o].join(" ");this.state.prompt=l,a&&!l.includes(a)&&(l+=" "+a),this.clear(e),this.write([t,l,c].filter(Boolean).join(`
59
- `)),this.write(this.margin[2]),this.restore()}};Nd.exports=yl});var Wd=D((L3,Ud)=>{"use strict";var lw=dr(),wl=class extends lw{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,t){let s=await super.toChoices(e,t);if(s.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>s.length)throw new Error("Please specify the index of the correct answer from the list of choices");return s}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Ud.exports=wl});var Vd=D(Dl=>{"use strict";var qd=_e(),fe=(r,e)=>{qd.defineExport(Dl,r,e),qd.defineExport(Dl,r.toLowerCase(),e)};fe("AutoComplete",()=>Yf());fe("BasicAuth",()=>sd());fe("Confirm",()=>od());fe("Editable",()=>cd());fe("Form",()=>ao());fe("Input",()=>ol());fe("Invisible",()=>md());fe("List",()=>gd());fe("MultiSelect",()=>yd());fe("Numeral",()=>vd());fe("Password",()=>Ed());fe("Scale",()=>_d());fe("Select",()=>dr());fe("Snippet",()=>Id());fe("Sort",()=>Pd());fe("Survey",()=>Md());fe("Text",()=>jd());fe("Toggle",()=>Ld());fe("Quiz",()=>Wd())});var Gd=D((W3,Hd)=>{Hd.exports={ArrayPrompt:zi(),AuthPrompt:el(),BooleanPrompt:co(),NumberPrompt:hl(),StringPrompt:qr()}});var Zd=D((q3,Kd)=>{"use strict";var zd=require("assert"),Cl=require("events"),pr=_e(),vt=class extends Cl{constructor(e,t){super(),this.options=pr.merge({},e),this.answers={...t}}register(e,t){if(pr.isObject(e)){for(let i of Object.keys(e))this.register(i,e[i]);return this}zd.equal(typeof t,"function","expected a function");let s=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[s]=t:this.prompts[s]=t(this.Prompt,this),this}async prompt(e=[]){for(let t of[].concat(e))try{typeof t=="function"&&(t=await t.call(this)),await this.ask(pr.merge({},this.options,t))}catch(s){return Promise.reject(s)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=pr.merge({},this.options,e),{type:s,name:i}=e,{set:n,get:o}=pr;if(typeof s=="function"&&(s=await s.call(this,e,this.answers)),!s)return this.answers[i];s==="number"&&(s="numeral"),zd(this.prompts[s],`Prompt "${s}" is not registered`);let a=new this.prompts[s](t),c=o(this.answers,i);a.state.answers=this.answers,a.enquirer=this,i&&a.on("submit",u=>{this.emit("answer",i,u,a),n(this.answers,i,u)});let l=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),l(...u)),this.emit("prompt",a,this),t.autofill&&c!=null?(a.value=a.input=c,t.autofill==="show"&&await a.submit()):c=a.value=await a.run(),c}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||$s()}static get prompts(){return Vd()}static get types(){return Gd()}static get prompt(){let e=(t,...s)=>{let i=new this(...s),n=i.emit.bind(i);return i.emit=(...o)=>(e.emit(...o),n(...o)),i.prompt(t)};return pr.mixinEmitter(e,new Cl),e}};pr.mixinEmitter(vt,new Cl);var vl=vt.prompts;for(let r of Object.keys(vl)){let e=r.toLowerCase(),t=s=>new vl[r](s).run();vt.prompt[e]=t,vt[e]=t,vt[r]||Reflect.defineProperty(vt,r,{get:()=>vl[r]})}var Ki=r=>{pr.defineExport(vt,r,()=>vt.types[r])};Ki("ArrayPrompt");Ki("AuthPrompt");Ki("BooleanPrompt");Ki("NumberPrompt");Ki("StringPrompt");Kd.exports=vt});var xr=D((ck,dp)=>{var bw=require("node:tty"),yw=bw?.WriteStream?.prototype?.hasColors?.()??!1,U=(r,e)=>{if(!yw)return i=>i;let t=`\x1B[${r}m`,s=`\x1B[${e}m`;return i=>{let n=i+"",o=n.indexOf(s);if(o===-1)return t+n+s;let a=t,c=0,u=(e===22?s:"")+t;for(;o!==-1;)a+=n.slice(c,o)+u,c=o+s.length,o=n.indexOf(s,c);return a+=n.slice(c)+s,a}},N={};N.reset=U(0,0);N.bold=U(1,22);N.dim=U(2,22);N.italic=U(3,23);N.underline=U(4,24);N.overline=U(53,55);N.inverse=U(7,27);N.hidden=U(8,28);N.strikethrough=U(9,29);N.black=U(30,39);N.red=U(31,39);N.green=U(32,39);N.yellow=U(33,39);N.blue=U(34,39);N.magenta=U(35,39);N.cyan=U(36,39);N.white=U(37,39);N.gray=U(90,39);N.bgBlack=U(40,49);N.bgRed=U(41,49);N.bgGreen=U(42,49);N.bgYellow=U(43,49);N.bgBlue=U(44,49);N.bgMagenta=U(45,49);N.bgCyan=U(46,49);N.bgWhite=U(47,49);N.bgGray=U(100,49);N.redBright=U(91,39);N.greenBright=U(92,39);N.yellowBright=U(93,39);N.blueBright=U(94,39);N.magentaBright=U(95,39);N.cyanBright=U(96,39);N.whiteBright=U(97,39);N.bgRedBright=U(101,49);N.bgGreenBright=U(102,49);N.bgYellowBright=U(103,49);N.bgBlueBright=U(104,49);N.bgMagentaBright=U(105,49);N.bgCyanBright=U(106,49);N.bgWhiteBright=U(107,49);dp.exports=N});var wp=D((_k,yp)=>{"use strict";yp.exports=_w;function Sw(r){let e={defaultWidth:0,output:process.stdout,tty:require("tty")};return r?(Object.keys(e).forEach(function(t){r[t]||(r[t]=e[t])}),r):e}function _w(r){let e=Sw(r);if(e.output.getWindowSize)return e.output.getWindowSize()[0]||e.defaultWidth;if(e.tty.getWindowSize)return e.tty.getWindowSize()[1]||e.defaultWidth;if(e.output.columns)return e.output.columns;if(process.env.CLI_WIDTH){let t=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(t)&&t!==0)return t}return e.defaultWidth}});var vp=D((Ak,Tl)=>{"use strict";var Dp=r=>Number.isNaN(r)?!1:r>=4352&&(r<=4447||r===9001||r===9002||11904<=r&&r<=12871&&r!==12351||12880<=r&&r<=19903||19968<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65131||65281<=r&&r<=65376||65504<=r&&r<=65510||110592<=r&&r<=110593||127488<=r&&r<=127569||131072<=r&&r<=262141);Tl.exports=Dp;Tl.exports.default=Dp});var Ep=D((Tk,Cp)=>{"use strict";Cp.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Ol=D((Fk,Fl)=>{"use strict";var Aw=Ot(),Tw=vp(),Fw=Ep(),kp=r=>{if(typeof r!="string"||r.length===0||(r=Aw(r),r.length===0))return 0;r=r.replace(Fw()," ");let e=0;for(let t=0;t<r.length;t++){let s=r.codePointAt(t);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&t++,e+=Tw(s)?2:1)}return e};Fl.exports=kp;Fl.exports.default=kp});var _p=D((Ok,Sp)=>{"use strict";Sp.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Il=D((Ik,Tp)=>{var en=_p(),Ap={};for(let r of Object.keys(en))Ap[en[r]]=r;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Tp.exports=T;for(let r of Object.keys(T)){if(!("channels"in T[r]))throw new Error("missing channels property: "+r);if(!("labels"in T[r]))throw new Error("missing channel labels property: "+r);if(T[r].labels.length!==T[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:e,labels:t}=T[r];delete T[r].channels,delete T[r].labels,Object.defineProperty(T[r],"channels",{value:e}),Object.defineProperty(T[r],"labels",{value:t})}T.rgb.hsl=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255,i=Math.min(e,t,s),n=Math.max(e,t,s),o=n-i,a,c;n===i?a=0:e===n?a=(t-s)/o:t===n?a=2+(s-e)/o:s===n&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+n)/2;return n===i?c=0:l<=.5?c=o/(n+i):c=o/(2-n-i),[a,c*100,l*100]};T.rgb.hsv=function(r){let e,t,s,i,n,o=r[0]/255,a=r[1]/255,c=r[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),h=function(d){return(l-d)/6/u+1/2};return u===0?(i=0,n=0):(n=u/l,e=h(o),t=h(a),s=h(c),o===l?i=s-t:a===l?i=1/3+e-s:c===l&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,n*100,l*100]};T.rgb.hwb=function(r){let e=r[0],t=r[1],s=r[2],i=T.rgb.hsl(r)[0],n=1/255*Math.min(e,Math.min(t,s));return s=1-1/255*Math.max(e,Math.max(t,s)),[i,n*100,s*100]};T.rgb.cmyk=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255,i=Math.min(1-e,1-t,1-s),n=(1-e-i)/(1-i)||0,o=(1-t-i)/(1-i)||0,a=(1-s-i)/(1-i)||0;return[n*100,o*100,a*100,i*100]};function Ow(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}T.rgb.keyword=function(r){let e=Ap[r];if(e)return e;let t=1/0,s;for(let i of Object.keys(en)){let n=en[i],o=Ow(r,n);o<t&&(t=o,s=i)}return s};T.keyword.rgb=function(r){return en[r]};T.rgb.xyz=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;let i=e*.4124+t*.3576+s*.1805,n=e*.2126+t*.7152+s*.0722,o=e*.0193+t*.1192+s*.9505;return[i*100,n*100,o*100]};T.rgb.lab=function(r){let e=T.rgb.xyz(r),t=e[0],s=e[1],i=e[2];t/=95.047,s/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*s-16,o=500*(t-s),a=200*(s-i);return[n,o,a]};T.hsl.rgb=function(r){let e=r[0]/360,t=r[1]/100,s=r[2]/100,i,n,o;if(t===0)return o=s*255,[o,o,o];s<.5?i=s*(1+t):i=s+t-s*t;let a=2*s-i,c=[0,0,0];for(let l=0;l<3;l++)n=e+1/3*-(l-1),n<0&&n++,n>1&&n--,6*n<1?o=a+(i-a)*6*n:2*n<1?o=i:3*n<2?o=a+(i-a)*(2/3-n)*6:o=a,c[l]=o*255;return c};T.hsl.hsv=function(r){let e=r[0],t=r[1]/100,s=r[2]/100,i=t,n=Math.max(s,.01);s*=2,t*=s<=1?s:2-s,i*=n<=1?n:2-n;let o=(s+t)/2,a=s===0?2*i/(n+i):2*t/(s+t);return[e,a*100,o*100]};T.hsv.rgb=function(r){let e=r[0]/60,t=r[1]/100,s=r[2]/100,i=Math.floor(e)%6,n=e-Math.floor(e),o=255*s*(1-t),a=255*s*(1-t*n),c=255*s*(1-t*(1-n));switch(s*=255,i){case 0:return[s,c,o];case 1:return[a,s,o];case 2:return[o,s,c];case 3:return[o,a,s];case 4:return[c,o,s];case 5:return[s,o,a]}};T.hsv.hsl=function(r){let e=r[0],t=r[1]/100,s=r[2]/100,i=Math.max(s,.01),n,o;o=(2-t)*s;let a=(2-t)*i;return n=t*i,n/=a<=1?a:2-a,n=n||0,o/=2,[e,n*100,o*100]};T.hwb.rgb=function(r){let e=r[0]/360,t=r[1]/100,s=r[2]/100,i=t+s,n;i>1&&(t/=i,s/=i);let o=Math.floor(6*e),a=1-s;n=6*e-o,(o&1)!==0&&(n=1-n);let c=t+n*(a-t),l,u,h;switch(o){default:case 6:case 0:l=a,u=c,h=t;break;case 1:l=c,u=a,h=t;break;case 2:l=t,u=a,h=c;break;case 3:l=t,u=c,h=a;break;case 4:l=c,u=t,h=a;break;case 5:l=a,u=t,h=c;break}return[l*255,u*255,h*255]};T.cmyk.rgb=function(r){let e=r[0]/100,t=r[1]/100,s=r[2]/100,i=r[3]/100,n=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),a=1-Math.min(1,s*(1-i)+i);return[n*255,o*255,a*255]};T.xyz.rgb=function(r){let e=r[0]/100,t=r[1]/100,s=r[2]/100,i,n,o;return i=e*3.2406+t*-1.5372+s*-.4986,n=e*-.9689+t*1.8758+s*.0415,o=e*.0557+t*-.204+s*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),[i*255,n*255,o*255]};T.xyz.lab=function(r){let e=r[0],t=r[1],s=r[2];e/=95.047,t/=100,s/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let i=116*t-16,n=500*(e-t),o=200*(t-s);return[i,n,o]};T.lab.xyz=function(r){let e=r[0],t=r[1],s=r[2],i,n,o;n=(e+16)/116,i=t/500+n,o=n-s/200;let a=n**3,c=i**3,l=o**3;return n=a>.008856?a:(n-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,n*=100,o*=108.883,[i,n,o]};T.lab.lch=function(r){let e=r[0],t=r[1],s=r[2],i;i=Math.atan2(s,t)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(t*t+s*s);return[e,o,i]};T.lch.lab=function(r){let e=r[0],t=r[1],i=r[2]/360*2*Math.PI,n=t*Math.cos(i),o=t*Math.sin(i);return[e,n,o]};T.rgb.ansi16=function(r,e=null){let[t,s,i]=r,n=e===null?T.rgb.hsv(r)[2]:e;if(n=Math.round(n/50),n===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(s/255)<<1|Math.round(t/255));return n===2&&(o+=60),o};T.hsv.ansi16=function(r){return T.rgb.ansi16(T.hsv.rgb(r),r[2])};T.rgb.ansi256=function(r){let e=r[0],t=r[1],s=r[2];return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)};T.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(r>50)+1)*.5,s=(e&1)*t*255,i=(e>>1&1)*t*255,n=(e>>2&1)*t*255;return[s,i,n]};T.ansi256.rgb=function(r){if(r>=232){let n=(r-232)*10+8;return[n,n,n]}r-=16;let e,t=Math.floor(r/36)/5*255,s=Math.floor((e=r%36)/6)/5*255,i=e%6/5*255;return[t,s,i]};T.rgb.hex=function(r){let t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};T.hex.rgb=function(r){let e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let s=parseInt(t,16),i=s>>16&255,n=s>>8&255,o=s&255;return[i,n,o]};T.rgb.hcg=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255,i=Math.max(Math.max(e,t),s),n=Math.min(Math.min(e,t),s),o=i-n,a,c;return o<1?a=n/(1-o):a=0,o<=0?c=0:i===e?c=(t-s)/o%6:i===t?c=2+(s-e)/o:c=4+(e-t)/o,c/=6,c%=1,[c*360,o*100,a*100]};T.hsl.hcg=function(r){let e=r[1]/100,t=r[2]/100,s=t<.5?2*e*t:2*e*(1-t),i=0;return s<1&&(i=(t-.5*s)/(1-s)),[r[0],s*100,i*100]};T.hsv.hcg=function(r){let e=r[1]/100,t=r[2]/100,s=e*t,i=0;return s<1&&(i=(t-s)/(1-s)),[r[0],s*100,i*100]};T.hcg.rgb=function(r){let e=r[0]/360,t=r[1]/100,s=r[2]/100;if(t===0)return[s*255,s*255,s*255];let i=[0,0,0],n=e%1*6,o=n%1,a=1-o,c=0;switch(Math.floor(n)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return c=(1-t)*s,[(t*i[0]+c)*255,(t*i[1]+c)*255,(t*i[2]+c)*255]};T.hcg.hsv=function(r){let e=r[1]/100,t=r[2]/100,s=e+t*(1-e),i=0;return s>0&&(i=e/s),[r[0],i*100,s*100]};T.hcg.hsl=function(r){let e=r[1]/100,s=r[2]/100*(1-e)+.5*e,i=0;return s>0&&s<.5?i=e/(2*s):s>=.5&&s<1&&(i=e/(2*(1-s))),[r[0],i*100,s*100]};T.hcg.hwb=function(r){let e=r[1]/100,t=r[2]/100,s=e+t*(1-e);return[r[0],(s-e)*100,(1-s)*100]};T.hwb.hcg=function(r){let e=r[1]/100,s=1-r[2]/100,i=s-e,n=0;return i<1&&(n=(s-i)/(1-i)),[r[0],i*100,n*100]};T.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};T.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};T.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};T.gray.hsl=function(r){return[0,0,r[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(r){return[0,100,r[0]]};T.gray.cmyk=function(r){return[0,0,0,r[0]]};T.gray.lab=function(r){return[r[0],0,0]};T.gray.hex=function(r){let e=Math.round(r[0]/100*255)&255,s=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(s.length)+s};T.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var Op=D((Bk,Fp)=>{var go=Il();function Iw(){let r={},e=Object.keys(go);for(let t=e.length,s=0;s<t;s++)r[e[s]]={distance:-1,parent:null};return r}function Bw(r){let e=Iw(),t=[r];for(e[r].distance=0;t.length;){let s=t.pop(),i=Object.keys(go[s]);for(let n=i.length,o=0;o<n;o++){let a=i[o],c=e[a];c.distance===-1&&(c.distance=e[s].distance+1,c.parent=s,t.unshift(a))}}return e}function Pw(r,e){return function(t){return e(r(t))}}function Rw(r,e){let t=[e[r].parent,r],s=go[e[r].parent][r],i=e[r].parent;for(;e[i].parent;)t.unshift(e[i].parent),s=Pw(go[e[i].parent][i],s),i=e[i].parent;return s.conversion=t,s}Fp.exports=function(r){let e=Bw(r),t={},s=Object.keys(e);for(let i=s.length,n=0;n<i;n++){let o=s[n];e[o].parent!==null&&(t[o]=Rw(o,e))}return t}});var Bp=D((Pk,Ip)=>{var Bl=Il(),Mw=Op(),Ws={},$w=Object.keys(Bl);function jw(r){let e=function(...t){let s=t[0];return s==null?s:(s.length>1&&(t=s),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Nw(r){let e=function(...t){let s=t[0];if(s==null)return s;s.length>1&&(t=s);let i=r(t);if(typeof i=="object")for(let n=i.length,o=0;o<n;o++)i[o]=Math.round(i[o]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}$w.forEach(r=>{Ws[r]={},Object.defineProperty(Ws[r],"channels",{value:Bl[r].channels}),Object.defineProperty(Ws[r],"labels",{value:Bl[r].labels});let e=Mw(r);Object.keys(e).forEach(s=>{let i=e[s];Ws[r][s]=Nw(i),Ws[r][s].raw=jw(i)})});Ip.exports=Ws});var Np=D((Rk,jp)=>{"use strict";var Pp=(r,e)=>(...t)=>`\x1B[${r(...t)+e}m`,Rp=(r,e)=>(...t)=>{let s=r(...t);return`\x1B[${38+e};5;${s}m`},Mp=(r,e)=>(...t)=>{let s=r(...t);return`\x1B[${38+e};2;${s[0]};${s[1]};${s[2]}m`},bo=r=>r,$p=(r,e,t)=>[r,e,t],qs=(r,e,t)=>{Object.defineProperty(r,e,{get:()=>{let s=t();return Object.defineProperty(r,e,{value:s,enumerable:!0,configurable:!0}),s},enumerable:!0,configurable:!0})},Pl,Vs=(r,e,t,s)=>{Pl===void 0&&(Pl=Bp());let i=s?10:0,n={};for(let[o,a]of Object.entries(Pl)){let c=o==="ansi16"?"ansi":o;o===e?n[c]=r(t,i):typeof a=="object"&&(n[c]=r(a[e],i))}return n};function Lw(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,s]of Object.entries(e)){for(let[i,n]of Object.entries(s))e[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},s[i]=e[i],r.set(n[0],n[1]);Object.defineProperty(e,t,{value:s,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",qs(e.color,"ansi",()=>Vs(Pp,"ansi16",bo,!1)),qs(e.color,"ansi256",()=>Vs(Rp,"ansi256",bo,!1)),qs(e.color,"ansi16m",()=>Vs(Mp,"rgb",$p,!1)),qs(e.bgColor,"ansi",()=>Vs(Pp,"ansi16",bo,!0)),qs(e.bgColor,"ansi256",()=>Vs(Rp,"ansi256",bo,!0)),qs(e.bgColor,"ansi16m",()=>Vs(Mp,"rgb",$p,!0)),e}Object.defineProperty(jp,"exports",{enumerable:!0,get:Lw})});var Wp=D((Mk,Up)=>{"use strict";var tn=Ol(),Uw=Ot(),Ww=Np(),Ml=new Set(["\x1B","\x9B"]),qw=39,Lp=r=>`${Ml.values().next().value}[${r}m`,Vw=r=>r.split(" ").map(e=>tn(e)),Rl=(r,e,t)=>{let s=[...e],i=!1,n=tn(Uw(r[r.length-1]));for(let[o,a]of s.entries()){let c=tn(a);if(n+c<=t?r[r.length-1]+=a:(r.push(a),n=0),Ml.has(a))i=!0;else if(i&&a==="m"){i=!1;continue}i||(n+=c,n===t&&o<s.length-1&&(r.push(""),n=0))}!n&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},Hw=r=>{let e=r.split(" "),t=e.length;for(;t>0&&!(tn(e[t-1])>0);)t--;return t===e.length?r:e.slice(0,t).join(" ")+e.slice(t).join("")},Gw=(r,e,t={})=>{if(t.trim!==!1&&r.trim()==="")return"";let s="",i="",n,o=Vw(r),a=[""];for(let[c,l]of r.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimLeft());let u=tn(a[a.length-1]);if(c!==0&&(u>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),u=0),(u>0||t.trim===!1)&&(a[a.length-1]+=" ",u++)),t.hard&&o[c]>e){let h=e-u,d=1+Math.floor((o[c]-h-1)/e);Math.floor((o[c]-1)/e)<d&&a.push(""),Rl(a,l,e);continue}if(u+o[c]>e&&u>0&&o[c]>0){if(t.wordWrap===!1&&u<e){Rl(a,l,e);continue}a.push("")}if(u+o[c]>e&&t.wordWrap===!1){Rl(a,l,e);continue}a[a.length-1]+=l}t.trim!==!1&&(a=a.map(Hw)),s=a.join(`
59
+ `)),this.write(this.margin[2]),this.restore()}};Nd.exports=yl});var Wd=D((L3,Ud)=>{"use strict";var lw=pr(),wl=class extends lw{constructor(e){if(super(e),typeof this.options.correctChoice!="number"||this.options.correctChoice<0)throw new Error("Please specify the index of the correct answer from the list of choices")}async toChoices(e,t){let s=await super.toChoices(e,t);if(s.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>s.length)throw new Error("Please specify the index of the correct answer from the list of choices");return s}check(e){return e.index===this.options.correctChoice}async result(e){return{selectedAnswer:e,correctAnswer:this.options.choices[this.options.correctChoice].value,correct:await this.check(this.state)}}};Ud.exports=wl});var Vd=D(Dl=>{"use strict";var qd=_e(),fe=(r,e)=>{qd.defineExport(Dl,r,e),qd.defineExport(Dl,r.toLowerCase(),e)};fe("AutoComplete",()=>Yf());fe("BasicAuth",()=>sd());fe("Confirm",()=>od());fe("Editable",()=>cd());fe("Form",()=>ao());fe("Input",()=>ol());fe("Invisible",()=>md());fe("List",()=>gd());fe("MultiSelect",()=>yd());fe("Numeral",()=>vd());fe("Password",()=>Ed());fe("Scale",()=>_d());fe("Select",()=>pr());fe("Snippet",()=>Id());fe("Sort",()=>Pd());fe("Survey",()=>Md());fe("Text",()=>jd());fe("Toggle",()=>Ld());fe("Quiz",()=>Wd())});var Gd=D((W3,Hd)=>{Hd.exports={ArrayPrompt:zi(),AuthPrompt:el(),BooleanPrompt:co(),NumberPrompt:hl(),StringPrompt:Vr()}});var Zd=D((q3,Kd)=>{"use strict";var zd=require("assert"),Cl=require("events"),mr=_e(),vt=class extends Cl{constructor(e,t){super(),this.options=mr.merge({},e),this.answers={...t}}register(e,t){if(mr.isObject(e)){for(let i of Object.keys(e))this.register(i,e[i]);return this}zd.equal(typeof t,"function","expected a function");let s=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[s]=t:this.prompts[s]=t(this.Prompt,this),this}async prompt(e=[]){for(let t of[].concat(e))try{typeof t=="function"&&(t=await t.call(this)),await this.ask(mr.merge({},this.options,t))}catch(s){return Promise.reject(s)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=mr.merge({},this.options,e),{type:s,name:i}=e,{set:n,get:o}=mr;if(typeof s=="function"&&(s=await s.call(this,e,this.answers)),!s)return this.answers[i];s==="number"&&(s="numeral"),zd(this.prompts[s],`Prompt "${s}" is not registered`);let a=new this.prompts[s](t),c=o(this.answers,i);a.state.answers=this.answers,a.enquirer=this,i&&a.on("submit",u=>{this.emit("answer",i,u,a),n(this.answers,i,u)});let l=a.emit.bind(a);return a.emit=(...u)=>(this.emit.call(this,...u),l(...u)),this.emit("prompt",a,this),t.autofill&&c!=null?(a.value=a.input=c,t.autofill==="show"&&await a.submit()):c=a.value=await a.run(),c}use(e){return e.call(this,this),this}set Prompt(e){this._Prompt=e}get Prompt(){return this._Prompt||this.constructor.Prompt}get prompts(){return this.constructor.prompts}static set Prompt(e){this._Prompt=e}static get Prompt(){return this._Prompt||$s()}static get prompts(){return Vd()}static get types(){return Gd()}static get prompt(){let e=(t,...s)=>{let i=new this(...s),n=i.emit.bind(i);return i.emit=(...o)=>(e.emit(...o),n(...o)),i.prompt(t)};return mr.mixinEmitter(e,new Cl),e}};mr.mixinEmitter(vt,new Cl);var vl=vt.prompts;for(let r of Object.keys(vl)){let e=r.toLowerCase(),t=s=>new vl[r](s).run();vt.prompt[e]=t,vt[e]=t,vt[r]||Reflect.defineProperty(vt,r,{get:()=>vl[r]})}var Ki=r=>{mr.defineExport(vt,r,()=>vt.types[r])};Ki("ArrayPrompt");Ki("AuthPrompt");Ki("BooleanPrompt");Ki("NumberPrompt");Ki("StringPrompt");Kd.exports=vt});var gr=D((ck,dp)=>{var bw=require("node:tty"),yw=bw?.WriteStream?.prototype?.hasColors?.()??!1,U=(r,e)=>{if(!yw)return i=>i;let t=`\x1B[${r}m`,s=`\x1B[${e}m`;return i=>{let n=i+"",o=n.indexOf(s);if(o===-1)return t+n+s;let a=t,c=0,u=(e===22?s:"")+t;for(;o!==-1;)a+=n.slice(c,o)+u,c=o+s.length,o=n.indexOf(s,c);return a+=n.slice(c)+s,a}},N={};N.reset=U(0,0);N.bold=U(1,22);N.dim=U(2,22);N.italic=U(3,23);N.underline=U(4,24);N.overline=U(53,55);N.inverse=U(7,27);N.hidden=U(8,28);N.strikethrough=U(9,29);N.black=U(30,39);N.red=U(31,39);N.green=U(32,39);N.yellow=U(33,39);N.blue=U(34,39);N.magenta=U(35,39);N.cyan=U(36,39);N.white=U(37,39);N.gray=U(90,39);N.bgBlack=U(40,49);N.bgRed=U(41,49);N.bgGreen=U(42,49);N.bgYellow=U(43,49);N.bgBlue=U(44,49);N.bgMagenta=U(45,49);N.bgCyan=U(46,49);N.bgWhite=U(47,49);N.bgGray=U(100,49);N.redBright=U(91,39);N.greenBright=U(92,39);N.yellowBright=U(93,39);N.blueBright=U(94,39);N.magentaBright=U(95,39);N.cyanBright=U(96,39);N.whiteBright=U(97,39);N.bgRedBright=U(101,49);N.bgGreenBright=U(102,49);N.bgYellowBright=U(103,49);N.bgBlueBright=U(104,49);N.bgMagentaBright=U(105,49);N.bgCyanBright=U(106,49);N.bgWhiteBright=U(107,49);dp.exports=N});var wp=D((_k,yp)=>{"use strict";yp.exports=_w;function Sw(r){let e={defaultWidth:0,output:process.stdout,tty:require("tty")};return r?(Object.keys(e).forEach(function(t){r[t]||(r[t]=e[t])}),r):e}function _w(r){let e=Sw(r);if(e.output.getWindowSize)return e.output.getWindowSize()[0]||e.defaultWidth;if(e.tty.getWindowSize)return e.tty.getWindowSize()[1]||e.defaultWidth;if(e.output.columns)return e.output.columns;if(process.env.CLI_WIDTH){let t=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(t)&&t!==0)return t}return e.defaultWidth}});var vp=D((Ak,Tl)=>{"use strict";var Dp=r=>Number.isNaN(r)?!1:r>=4352&&(r<=4447||r===9001||r===9002||11904<=r&&r<=12871&&r!==12351||12880<=r&&r<=19903||19968<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65131||65281<=r&&r<=65376||65504<=r&&r<=65510||110592<=r&&r<=110593||127488<=r&&r<=127569||131072<=r&&r<=262141);Tl.exports=Dp;Tl.exports.default=Dp});var Ep=D((Tk,Cp)=>{"use strict";Cp.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var Ol=D((Fk,Fl)=>{"use strict";var Aw=Ot(),Tw=vp(),Fw=Ep(),kp=r=>{if(typeof r!="string"||r.length===0||(r=Aw(r),r.length===0))return 0;r=r.replace(Fw()," ");let e=0;for(let t=0;t<r.length;t++){let s=r.codePointAt(t);s<=31||s>=127&&s<=159||s>=768&&s<=879||(s>65535&&t++,e+=Tw(s)?2:1)}return e};Fl.exports=kp;Fl.exports.default=kp});var _p=D((Ok,Sp)=>{"use strict";Sp.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Il=D((Ik,Tp)=>{var en=_p(),Ap={};for(let r of Object.keys(en))Ap[en[r]]=r;var T={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};Tp.exports=T;for(let r of Object.keys(T)){if(!("channels"in T[r]))throw new Error("missing channels property: "+r);if(!("labels"in T[r]))throw new Error("missing channel labels property: "+r);if(T[r].labels.length!==T[r].channels)throw new Error("channel and label counts mismatch: "+r);let{channels:e,labels:t}=T[r];delete T[r].channels,delete T[r].labels,Object.defineProperty(T[r],"channels",{value:e}),Object.defineProperty(T[r],"labels",{value:t})}T.rgb.hsl=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255,i=Math.min(e,t,s),n=Math.max(e,t,s),o=n-i,a,c;n===i?a=0:e===n?a=(t-s)/o:t===n?a=2+(s-e)/o:s===n&&(a=4+(e-t)/o),a=Math.min(a*60,360),a<0&&(a+=360);let l=(i+n)/2;return n===i?c=0:l<=.5?c=o/(n+i):c=o/(2-n-i),[a,c*100,l*100]};T.rgb.hsv=function(r){let e,t,s,i,n,o=r[0]/255,a=r[1]/255,c=r[2]/255,l=Math.max(o,a,c),u=l-Math.min(o,a,c),h=function(d){return(l-d)/6/u+1/2};return u===0?(i=0,n=0):(n=u/l,e=h(o),t=h(a),s=h(c),o===l?i=s-t:a===l?i=1/3+e-s:c===l&&(i=2/3+t-e),i<0?i+=1:i>1&&(i-=1)),[i*360,n*100,l*100]};T.rgb.hwb=function(r){let e=r[0],t=r[1],s=r[2],i=T.rgb.hsl(r)[0],n=1/255*Math.min(e,Math.min(t,s));return s=1-1/255*Math.max(e,Math.max(t,s)),[i,n*100,s*100]};T.rgb.cmyk=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255,i=Math.min(1-e,1-t,1-s),n=(1-e-i)/(1-i)||0,o=(1-t-i)/(1-i)||0,a=(1-s-i)/(1-i)||0;return[n*100,o*100,a*100,i*100]};function Ow(r,e){return(r[0]-e[0])**2+(r[1]-e[1])**2+(r[2]-e[2])**2}T.rgb.keyword=function(r){let e=Ap[r];if(e)return e;let t=1/0,s;for(let i of Object.keys(en)){let n=en[i],o=Ow(r,n);o<t&&(t=o,s=i)}return s};T.keyword.rgb=function(r){return en[r]};T.rgb.xyz=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,s=s>.04045?((s+.055)/1.055)**2.4:s/12.92;let i=e*.4124+t*.3576+s*.1805,n=e*.2126+t*.7152+s*.0722,o=e*.0193+t*.1192+s*.9505;return[i*100,n*100,o*100]};T.rgb.lab=function(r){let e=T.rgb.xyz(r),t=e[0],s=e[1],i=e[2];t/=95.047,s/=100,i/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,s=s>.008856?s**(1/3):7.787*s+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*s-16,o=500*(t-s),a=200*(s-i);return[n,o,a]};T.hsl.rgb=function(r){let e=r[0]/360,t=r[1]/100,s=r[2]/100,i,n,o;if(t===0)return o=s*255,[o,o,o];s<.5?i=s*(1+t):i=s+t-s*t;let a=2*s-i,c=[0,0,0];for(let l=0;l<3;l++)n=e+1/3*-(l-1),n<0&&n++,n>1&&n--,6*n<1?o=a+(i-a)*6*n:2*n<1?o=i:3*n<2?o=a+(i-a)*(2/3-n)*6:o=a,c[l]=o*255;return c};T.hsl.hsv=function(r){let e=r[0],t=r[1]/100,s=r[2]/100,i=t,n=Math.max(s,.01);s*=2,t*=s<=1?s:2-s,i*=n<=1?n:2-n;let o=(s+t)/2,a=s===0?2*i/(n+i):2*t/(s+t);return[e,a*100,o*100]};T.hsv.rgb=function(r){let e=r[0]/60,t=r[1]/100,s=r[2]/100,i=Math.floor(e)%6,n=e-Math.floor(e),o=255*s*(1-t),a=255*s*(1-t*n),c=255*s*(1-t*(1-n));switch(s*=255,i){case 0:return[s,c,o];case 1:return[a,s,o];case 2:return[o,s,c];case 3:return[o,a,s];case 4:return[c,o,s];case 5:return[s,o,a]}};T.hsv.hsl=function(r){let e=r[0],t=r[1]/100,s=r[2]/100,i=Math.max(s,.01),n,o;o=(2-t)*s;let a=(2-t)*i;return n=t*i,n/=a<=1?a:2-a,n=n||0,o/=2,[e,n*100,o*100]};T.hwb.rgb=function(r){let e=r[0]/360,t=r[1]/100,s=r[2]/100,i=t+s,n;i>1&&(t/=i,s/=i);let o=Math.floor(6*e),a=1-s;n=6*e-o,(o&1)!==0&&(n=1-n);let c=t+n*(a-t),l,u,h;switch(o){default:case 6:case 0:l=a,u=c,h=t;break;case 1:l=c,u=a,h=t;break;case 2:l=t,u=a,h=c;break;case 3:l=t,u=c,h=a;break;case 4:l=c,u=t,h=a;break;case 5:l=a,u=t,h=c;break}return[l*255,u*255,h*255]};T.cmyk.rgb=function(r){let e=r[0]/100,t=r[1]/100,s=r[2]/100,i=r[3]/100,n=1-Math.min(1,e*(1-i)+i),o=1-Math.min(1,t*(1-i)+i),a=1-Math.min(1,s*(1-i)+i);return[n*255,o*255,a*255]};T.xyz.rgb=function(r){let e=r[0]/100,t=r[1]/100,s=r[2]/100,i,n,o;return i=e*3.2406+t*-1.5372+s*-.4986,n=e*-.9689+t*1.8758+s*.0415,o=e*.0557+t*-.204+s*1.057,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,i=Math.min(Math.max(0,i),1),n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),[i*255,n*255,o*255]};T.xyz.lab=function(r){let e=r[0],t=r[1],s=r[2];e/=95.047,t/=100,s/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,s=s>.008856?s**(1/3):7.787*s+16/116;let i=116*t-16,n=500*(e-t),o=200*(t-s);return[i,n,o]};T.lab.xyz=function(r){let e=r[0],t=r[1],s=r[2],i,n,o;n=(e+16)/116,i=t/500+n,o=n-s/200;let a=n**3,c=i**3,l=o**3;return n=a>.008856?a:(n-16/116)/7.787,i=c>.008856?c:(i-16/116)/7.787,o=l>.008856?l:(o-16/116)/7.787,i*=95.047,n*=100,o*=108.883,[i,n,o]};T.lab.lch=function(r){let e=r[0],t=r[1],s=r[2],i;i=Math.atan2(s,t)*360/2/Math.PI,i<0&&(i+=360);let o=Math.sqrt(t*t+s*s);return[e,o,i]};T.lch.lab=function(r){let e=r[0],t=r[1],i=r[2]/360*2*Math.PI,n=t*Math.cos(i),o=t*Math.sin(i);return[e,n,o]};T.rgb.ansi16=function(r,e=null){let[t,s,i]=r,n=e===null?T.rgb.hsv(r)[2]:e;if(n=Math.round(n/50),n===0)return 30;let o=30+(Math.round(i/255)<<2|Math.round(s/255)<<1|Math.round(t/255));return n===2&&(o+=60),o};T.hsv.ansi16=function(r){return T.rgb.ansi16(T.hsv.rgb(r),r[2])};T.rgb.ansi256=function(r){let e=r[0],t=r[1],s=r[2];return e===t&&t===s?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(s/255*5)};T.ansi16.rgb=function(r){let e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let t=(~~(r>50)+1)*.5,s=(e&1)*t*255,i=(e>>1&1)*t*255,n=(e>>2&1)*t*255;return[s,i,n]};T.ansi256.rgb=function(r){if(r>=232){let n=(r-232)*10+8;return[n,n,n]}r-=16;let e,t=Math.floor(r/36)/5*255,s=Math.floor((e=r%36)/6)/5*255,i=e%6/5*255;return[t,s,i]};T.rgb.hex=function(r){let t=(((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255)).toString(16).toUpperCase();return"000000".substring(t.length)+t};T.hex.rgb=function(r){let e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let t=e[0];e[0].length===3&&(t=t.split("").map(a=>a+a).join(""));let s=parseInt(t,16),i=s>>16&255,n=s>>8&255,o=s&255;return[i,n,o]};T.rgb.hcg=function(r){let e=r[0]/255,t=r[1]/255,s=r[2]/255,i=Math.max(Math.max(e,t),s),n=Math.min(Math.min(e,t),s),o=i-n,a,c;return o<1?a=n/(1-o):a=0,o<=0?c=0:i===e?c=(t-s)/o%6:i===t?c=2+(s-e)/o:c=4+(e-t)/o,c/=6,c%=1,[c*360,o*100,a*100]};T.hsl.hcg=function(r){let e=r[1]/100,t=r[2]/100,s=t<.5?2*e*t:2*e*(1-t),i=0;return s<1&&(i=(t-.5*s)/(1-s)),[r[0],s*100,i*100]};T.hsv.hcg=function(r){let e=r[1]/100,t=r[2]/100,s=e*t,i=0;return s<1&&(i=(t-s)/(1-s)),[r[0],s*100,i*100]};T.hcg.rgb=function(r){let e=r[0]/360,t=r[1]/100,s=r[2]/100;if(t===0)return[s*255,s*255,s*255];let i=[0,0,0],n=e%1*6,o=n%1,a=1-o,c=0;switch(Math.floor(n)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=a,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=a,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=a}return c=(1-t)*s,[(t*i[0]+c)*255,(t*i[1]+c)*255,(t*i[2]+c)*255]};T.hcg.hsv=function(r){let e=r[1]/100,t=r[2]/100,s=e+t*(1-e),i=0;return s>0&&(i=e/s),[r[0],i*100,s*100]};T.hcg.hsl=function(r){let e=r[1]/100,s=r[2]/100*(1-e)+.5*e,i=0;return s>0&&s<.5?i=e/(2*s):s>=.5&&s<1&&(i=e/(2*(1-s))),[r[0],i*100,s*100]};T.hcg.hwb=function(r){let e=r[1]/100,t=r[2]/100,s=e+t*(1-e);return[r[0],(s-e)*100,(1-s)*100]};T.hwb.hcg=function(r){let e=r[1]/100,s=1-r[2]/100,i=s-e,n=0;return i<1&&(n=(s-i)/(1-i)),[r[0],i*100,n*100]};T.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};T.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};T.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};T.gray.hsl=function(r){return[0,0,r[0]]};T.gray.hsv=T.gray.hsl;T.gray.hwb=function(r){return[0,100,r[0]]};T.gray.cmyk=function(r){return[0,0,0,r[0]]};T.gray.lab=function(r){return[r[0],0,0]};T.gray.hex=function(r){let e=Math.round(r[0]/100*255)&255,s=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(s.length)+s};T.rgb.gray=function(r){return[(r[0]+r[1]+r[2])/3/255*100]}});var Op=D((Bk,Fp)=>{var go=Il();function Iw(){let r={},e=Object.keys(go);for(let t=e.length,s=0;s<t;s++)r[e[s]]={distance:-1,parent:null};return r}function Bw(r){let e=Iw(),t=[r];for(e[r].distance=0;t.length;){let s=t.pop(),i=Object.keys(go[s]);for(let n=i.length,o=0;o<n;o++){let a=i[o],c=e[a];c.distance===-1&&(c.distance=e[s].distance+1,c.parent=s,t.unshift(a))}}return e}function Pw(r,e){return function(t){return e(r(t))}}function Rw(r,e){let t=[e[r].parent,r],s=go[e[r].parent][r],i=e[r].parent;for(;e[i].parent;)t.unshift(e[i].parent),s=Pw(go[e[i].parent][i],s),i=e[i].parent;return s.conversion=t,s}Fp.exports=function(r){let e=Bw(r),t={},s=Object.keys(e);for(let i=s.length,n=0;n<i;n++){let o=s[n];e[o].parent!==null&&(t[o]=Rw(o,e))}return t}});var Bp=D((Pk,Ip)=>{var Bl=Il(),Mw=Op(),Ws={},$w=Object.keys(Bl);function jw(r){let e=function(...t){let s=t[0];return s==null?s:(s.length>1&&(t=s),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Nw(r){let e=function(...t){let s=t[0];if(s==null)return s;s.length>1&&(t=s);let i=r(t);if(typeof i=="object")for(let n=i.length,o=0;o<n;o++)i[o]=Math.round(i[o]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}$w.forEach(r=>{Ws[r]={},Object.defineProperty(Ws[r],"channels",{value:Bl[r].channels}),Object.defineProperty(Ws[r],"labels",{value:Bl[r].labels});let e=Mw(r);Object.keys(e).forEach(s=>{let i=e[s];Ws[r][s]=Nw(i),Ws[r][s].raw=jw(i)})});Ip.exports=Ws});var Np=D((Rk,jp)=>{"use strict";var Pp=(r,e)=>(...t)=>`\x1B[${r(...t)+e}m`,Rp=(r,e)=>(...t)=>{let s=r(...t);return`\x1B[${38+e};5;${s}m`},Mp=(r,e)=>(...t)=>{let s=r(...t);return`\x1B[${38+e};2;${s[0]};${s[1]};${s[2]}m`},bo=r=>r,$p=(r,e,t)=>[r,e,t],qs=(r,e,t)=>{Object.defineProperty(r,e,{get:()=>{let s=t();return Object.defineProperty(r,e,{value:s,enumerable:!0,configurable:!0}),s},enumerable:!0,configurable:!0})},Pl,Vs=(r,e,t,s)=>{Pl===void 0&&(Pl=Bp());let i=s?10:0,n={};for(let[o,a]of Object.entries(Pl)){let c=o==="ansi16"?"ansi":o;o===e?n[c]=r(t,i):typeof a=="object"&&(n[c]=r(a[e],i))}return n};function Lw(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,s]of Object.entries(e)){for(let[i,n]of Object.entries(s))e[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},s[i]=e[i],r.set(n[0],n[1]);Object.defineProperty(e,t,{value:s,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",qs(e.color,"ansi",()=>Vs(Pp,"ansi16",bo,!1)),qs(e.color,"ansi256",()=>Vs(Rp,"ansi256",bo,!1)),qs(e.color,"ansi16m",()=>Vs(Mp,"rgb",$p,!1)),qs(e.bgColor,"ansi",()=>Vs(Pp,"ansi16",bo,!0)),qs(e.bgColor,"ansi256",()=>Vs(Rp,"ansi256",bo,!0)),qs(e.bgColor,"ansi16m",()=>Vs(Mp,"rgb",$p,!0)),e}Object.defineProperty(jp,"exports",{enumerable:!0,get:Lw})});var Wp=D((Mk,Up)=>{"use strict";var tn=Ol(),Uw=Ot(),Ww=Np(),Ml=new Set(["\x1B","\x9B"]),qw=39,Lp=r=>`${Ml.values().next().value}[${r}m`,Vw=r=>r.split(" ").map(e=>tn(e)),Rl=(r,e,t)=>{let s=[...e],i=!1,n=tn(Uw(r[r.length-1]));for(let[o,a]of s.entries()){let c=tn(a);if(n+c<=t?r[r.length-1]+=a:(r.push(a),n=0),Ml.has(a))i=!0;else if(i&&a==="m"){i=!1;continue}i||(n+=c,n===t&&o<s.length-1&&(r.push(""),n=0))}!n&&r[r.length-1].length>0&&r.length>1&&(r[r.length-2]+=r.pop())},Hw=r=>{let e=r.split(" "),t=e.length;for(;t>0&&!(tn(e[t-1])>0);)t--;return t===e.length?r:e.slice(0,t).join(" ")+e.slice(t).join("")},Gw=(r,e,t={})=>{if(t.trim!==!1&&r.trim()==="")return"";let s="",i="",n,o=Vw(r),a=[""];for(let[c,l]of r.split(" ").entries()){t.trim!==!1&&(a[a.length-1]=a[a.length-1].trimLeft());let u=tn(a[a.length-1]);if(c!==0&&(u>=e&&(t.wordWrap===!1||t.trim===!1)&&(a.push(""),u=0),(u>0||t.trim===!1)&&(a[a.length-1]+=" ",u++)),t.hard&&o[c]>e){let h=e-u,d=1+Math.floor((o[c]-h-1)/e);Math.floor((o[c]-1)/e)<d&&a.push(""),Rl(a,l,e);continue}if(u+o[c]>e&&u>0&&o[c]>0){if(t.wordWrap===!1&&u<e){Rl(a,l,e);continue}a.push("")}if(u+o[c]>e&&t.wordWrap===!1){Rl(a,l,e);continue}a[a.length-1]+=l}t.trim!==!1&&(a=a.map(Hw)),s=a.join(`
60
60
  `);for(let[c,l]of[...s].entries()){if(i+=l,Ml.has(l)){let h=parseFloat(/\d[^m]*/.exec(s.slice(c,c+4)));n=h===qw?null:h}let u=Ww.codes.get(Number(n));n&&u&&(s[c+1]===`
61
61
  `?i+=Lp(u):l===`
62
62
  `&&(i+=Lp(n)))}return i};Up.exports=(r,e,t)=>String(r).normalize().replace(/\r\n/g,`
63
63
  `).split(`
64
64
  `).map(s=>Gw(s,e,t)).join(`
65
- `)});var Gp=D((Wk,Hp)=>{var Kw=require("stream"),$l=class extends Kw{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#r(e,...t){typeof this._dest?.[e]=="function"&&this._dest[e](...t),typeof this._src?.[e]=="function"&&this._src[e](...t)}get isTTY(){return this.#e!==null?this.#e:this.#t("isTTY",!1)}set isTTY(e){this.#e=e}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e&&this.replace?e=e.toString().replace(/./g,this.replace):e=null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#r("destroy",...e)}destroySoon(...e){return this.#r("destroySoon",...e)}close(...e){return this.#r("close",...e)}};Hp.exports=$l});var rm=D((Jl,Yl)=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var Co;Jl.default=()=>{if(typeof Yl=="object"&&typeof Yl.exports=="object")return Co=Co||require("fs"),Co;throw new Error("File system is not available")}});var Qr=D(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.default=(r,e,t)=>({confidence:t,name:e.name(r),lang:e.language?e.language():void 0})});var im=D(nn=>{"use strict";var sD=nn&&nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nn,"__esModule",{value:!0});var sm=sD(Qr()),Ql=class{name(){return"ASCII"}match(e){let t=e.rawInput;for(let s=0;s<e.rawLen;s++){let i=t[s];if(i<32||i>126)return(0,sm.default)(e,this,0)}return(0,sm.default)(e,this,100)}};nn.default=Ql});var nm=D(on=>{"use strict";var iD=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});var nD=iD(Qr()),eu=class{name(){return"UTF-8"}match(e){let t=!1,s=0,i=0,n=0,o,a=e.rawInput;e.rawLen>=3&&(a[0]&255)==239&&(a[1]&255)==187&&(a[2]&255)==191&&(t=!0);for(let c=0;c<e.rawLen;c++){let l=a[c];if((l&128)!=0){if((l&224)==192)n=1;else if((l&240)==224)n=2;else if((l&248)==240)n=3;else{if(i++,i>5)break;n=0}for(;c++,!(c>=e.rawLen);){if((a[c]&192)!=128){i++;break}if(--n==0){s++;break}}}}if(o=0,t&&i==0)o=100;else if(t&&s>i*10)o=80;else if(s>3&&i==0)o=100;else if(s>0&&i==0)o=80;else if(s==0&&i==0)o=10;else if(s>i*10)o=25;else return null;return(0,nD.default)(e,this,o)}};on.default=eu});var om=D(ot=>{"use strict";var oD=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.UTF_32LE=ot.UTF_32BE=ot.UTF_16LE=ot.UTF_16BE=void 0;var nu=oD(Qr()),tu=class{name(){return"UTF-16BE"}match(e){let t=e.rawInput;return t.length>=2&&(t[0]&255)==254&&(t[1]&255)==255?(0,nu.default)(e,this,100):null}};ot.UTF_16BE=tu;var ru=class{name(){return"UTF-16LE"}match(e){let t=e.rawInput;return t.length>=2&&(t[0]&255)==255&&(t[1]&255)==254?t.length>=4&&t[2]==0&&t[3]==0?null:(0,nu.default)(e,this,100):null}};ot.UTF_16LE=ru;var Eo=class{name(){return"UTF-32"}getChar(e,t){return-1}match(e){let t=0,s=0,i=!1,n=0,o=e.rawLen/4*4,a=e.rawInput;if(o==0)return null;this.getChar(a,0)==65279&&(i=!0);for(let c=0;c<o;c+=4){let l=this.getChar(a,c);l<0||l>=1114111||l>=55296&&l<=57343?s+=1:t+=1}return i&&s==0?n=100:i&&t>s*10?n=80:t>3&&s==0?n=100:t>0&&s==0?n=80:t>s*10&&(n=25),n==0?null:(0,nu.default)(e,this,n)}},su=class extends Eo{name(){return"UTF-32BE"}getChar(e,t){return(e[t+0]&255)<<24|(e[t+1]&255)<<16|(e[t+2]&255)<<8|e[t+3]&255}};ot.UTF_32BE=su;var iu=class extends Eo{name(){return"UTF-32LE"}getChar(e,t){return(e[t+3]&255)<<24|(e[t+2]&255)<<16|(e[t+1]&255)<<8|e[t+0]&255}};ot.UTF_32LE=iu});var cm=D(Ve=>{"use strict";var aD=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.gb_18030=Ve.euc_kr=Ve.euc_jp=Ve.big5=Ve.sjis=void 0;var cD=aD(Qr());function lD(r,e){let t=(s,i,n,o)=>{if(o<n)return-1;let a=Math.floor(n+o>>>1);return i>s[a]?t(s,i,a+1,o):i<s[a]?t(s,i,n,a-1):a};return t(r,e,0,r.length-1)}var ou=class{constructor(){this.charValue=0,this.index=0,this.nextIndex=0,this.error=!1,this.done=!1}reset(){this.charValue=0,this.index=-1,this.nextIndex=0,this.error=!1,this.done=!1}nextByte(e){return this.nextIndex>=e.rawLen?(this.done=!0,-1):e.rawInput[this.nextIndex++]&255}},es=class{constructor(){this.commonChars=[]}name(){return"mbcs"}match(e){let t=0,s=0,i=0,n=0,o=0,a=new ou;e:{for(a.reset();this.nextChar(a,e);){if(n++,a.error)i++;else{let c=a.charValue&4294967295;c>255&&(t++,this.commonChars!=null&&lD(this.commonChars,c)>=0&&s++)}if(i>=2&&i*5>=t)break e}if(t<=10&&i==0){t==0&&n<10?o=0:o=10;break e}if(t<20*i){o=0;break e}if(this.commonChars==null)o=30+t-20*i,o>100&&(o=100);else{let l=90/Math.log(t/4);o=Math.floor(Math.log(s+1)*l+10),o=Math.min(o,100)}}return o==0?null:(0,cD.default)(e,this,o)}nextChar(e,t){return!0}},au=class extends es{constructor(){super(...arguments),this.commonChars=[33088,33089,33090,33093,33115,33129,33130,33141,33142,33440,33442,33444,33449,33450,33451,33453,33455,33457,33459,33461,33463,33469,33470,33473,33476,33477,33478,33480,33481,33484,33485,33500,33504,33511,33512,33513,33514,33520,33521,33601,33603,33614,33615,33624,33630,33634,33639,33653,33654,33673,33674,33675,33677,33683,36502,37882,38314]}name(){return"Shift_JIS"}language(){return"ja"}nextChar(e,t){e.index=e.nextIndex,e.error=!1;let s=e.charValue=e.nextByte(t);if(s<0)return!1;if(s<=127||s>160&&s<=223)return!0;let i=e.nextByte(t);return i<0?!1:(e.charValue=s<<8|i,i>=64&&i<=127||i>=128&&i<=255||(e.error=!0),!0)}};Ve.sjis=au;var cu=class extends es{constructor(){super(...arguments),this.commonChars=[41280,41281,41282,41283,41287,41289,41333,41334,42048,42054,42055,42056,42065,42068,42071,42084,42090,42092,42103,42147,42148,42151,42177,42190,42193,42207,42216,42237,42304,42312,42328,42345,42445,42471,42583,42593,42594,42600,42608,42664,42675,42681,42707,42715,42726,42738,42816,42833,42841,42970,43171,43173,43181,43217,43219,43236,43260,43456,43474,43507,43627,43706,43710,43724,43772,44103,44111,44208,44242,44377,44745,45024,45290,45423,45747,45764,45935,46156,46158,46412,46501,46525,46544,46552,46705,47085,47207,47428,47832,47940,48033,48593,49860,50105,50240,50271]}name(){return"Big5"}language(){return"zh"}nextChar(e,t){e.index=e.nextIndex,e.error=!1;let s=e.charValue=e.nextByte(t);if(s<0)return!1;if(s<=127||s==255)return!0;let i=e.nextByte(t);return i<0?!1:(e.charValue=e.charValue<<8|i,(i<64||i==127||i==255)&&(e.error=!0),!0)}};Ve.big5=cu;function am(r,e){r.index=r.nextIndex,r.error=!1;let t=0,s=0,i=0;e:{if(t=r.charValue=r.nextByte(e),t<0){r.done=!0;break e}if(t<=141)break e;if(s=r.nextByte(e),r.charValue=r.charValue<<8|s,t>=161&&t<=254){s<161&&(r.error=!0);break e}if(t==142){s<161&&(r.error=!0);break e}t==143&&(i=r.nextByte(e),r.charValue=r.charValue<<8|i,i<161&&(r.error=!0))}return r.done==!1}var lu=class extends es{constructor(){super(...arguments),this.commonChars=[41377,41378,41379,41382,41404,41418,41419,41430,41431,42146,42148,42150,42152,42154,42155,42156,42157,42159,42161,42163,42165,42167,42169,42171,42173,42175,42176,42177,42179,42180,42182,42183,42184,42185,42186,42187,42190,42191,42192,42206,42207,42209,42210,42212,42216,42217,42218,42219,42220,42223,42226,42227,42402,42403,42404,42406,42407,42410,42413,42415,42416,42419,42421,42423,42424,42425,42431,42435,42438,42439,42440,42441,42443,42448,42453,42454,42455,42462,42464,42465,42469,42473,42474,42475,42476,42477,42483,47273,47572,47854,48072,48880,49079,50410,50940,51133,51896,51955,52188,52689],this.nextChar=am}name(){return"EUC-JP"}language(){return"ja"}};Ve.euc_jp=lu;var uu=class extends es{constructor(){super(...arguments),this.commonChars=[45217,45235,45253,45261,45268,45286,45293,45304,45306,45308,45496,45497,45511,45527,45538,45994,46011,46274,46287,46297,46315,46501,46517,46527,46535,46569,46835,47023,47042,47054,47270,47278,47286,47288,47291,47337,47531,47534,47564,47566,47613,47800,47822,47824,47857,48103,48115,48125,48301,48314,48338,48374,48570,48576,48579,48581,48838,48840,48863,48878,48888,48890,49057,49065,49088,49124,49131,49132,49144,49319,49327,49336,49338,49339,49341,49351,49356,49358,49359,49366,49370,49381,49403,49404,49572,49574,49590,49622,49631,49654,49656,50337,50637,50862,51151,51153,51154,51160,51173,51373],this.nextChar=am}name(){return"EUC-KR"}language(){return"ko"}};Ve.euc_kr=uu;var hu=class extends es{constructor(){super(...arguments),this.commonChars=[41377,41378,41379,41380,41392,41393,41457,41459,41889,41900,41914,45480,45496,45502,45755,46025,46070,46323,46525,46532,46563,46767,46804,46816,47010,47016,47037,47062,47069,47284,47327,47350,47531,47561,47576,47610,47613,47821,48039,48086,48097,48122,48316,48347,48382,48588,48845,48861,49076,49094,49097,49332,49389,49611,49883,50119,50396,50410,50636,50935,51192,51371,51403,51413,51431,51663,51706,51889,51893,51911,51920,51926,51957,51965,52460,52728,52906,52932,52946,52965,53173,53186,53206,53442,53445,53456,53460,53671,53930,53938,53941,53947,53972,54211,54224,54269,54466,54490,54754,54992]}name(){return"GB18030"}language(){return"zh"}nextChar(e,t){e.index=e.nextIndex,e.error=!1;let s=0,i=0,n=0,o=0;e:{if(s=e.charValue=e.nextByte(t),s<0){e.done=!0;break e}if(s<=128)break e;if(i=e.nextByte(t),e.charValue=e.charValue<<8|i,s>=129&&s<=254){if(i>=64&&i<=126||i>=80&&i<=254)break e;if(i>=48&&i<=57&&(n=e.nextByte(t),n>=129&&n<=254&&(o=e.nextByte(t),o>=48&&o<=57))){e.charValue=e.charValue<<16|n<<8|o;break e}e.error=!0;break e}}return e.done==!1}};Ve.gb_18030=hu});var um=D(re=>{"use strict";var uD=re&&re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(re,"__esModule",{value:!0});re.KOI8_R=re.windows_1256=re.windows_1251=re.ISO_8859_9=re.ISO_8859_8=re.ISO_8859_7=re.ISO_8859_6=re.ISO_8859_5=re.ISO_8859_2=re.ISO_8859_1=void 0;var lm=uD(Qr()),hD=16777215,ko=class{constructor(e,t){this.byteIndex=0,this.ngram=0,this.ngramCount=0,this.hitCount=0,this.spaceChar=32,this.ngramList=e,this.byteMap=t}search(e,t){let s=0;return e[s+32]<=t&&(s+=32),e[s+16]<=t&&(s+=16),e[s+8]<=t&&(s+=8),e[s+4]<=t&&(s+=4),e[s+2]<=t&&(s+=2),e[s+1]<=t&&(s+=1),e[s]>t&&(s-=1),s<0||e[s]!=t?-1:s}lookup(e){this.ngramCount+=1,this.search(this.ngramList,e)>=0&&(this.hitCount+=1)}addByte(e){this.ngram=(this.ngram<<8)+(e&255)&hD,this.lookup(this.ngram)}nextByte(e){return this.byteIndex>=e.inputLen?-1:e.inputBytes[this.byteIndex++]&255}parse(e,t){let s,i=!1;for(this.spaceChar=t;(s=this.nextByte(e))>=0;){let o=this.byteMap[s];o!=0&&(o==this.spaceChar&&i||this.addByte(o),i=o==this.spaceChar)}this.addByte(this.spaceChar);let n=this.hitCount/this.ngramCount;return n>.33?98:Math.floor(n*300)}},xe=class{constructor(e,t){this.fLang=e,this.fNGrams=t}},fD=r=>Array.isArray(r)&&isFinite(r[0]),at=class{constructor(){this.spaceChar=32,this.nGramLang=void 0}ngrams(){return[]}byteMap(){return[]}name(e){return"sbcs"}language(){return this.nGramLang}match(e){this.nGramLang=void 0;let t=this.ngrams();if(fD(t)){let n=new ko(t,this.byteMap()).parse(e,this.spaceChar);return n<=0?null:(0,lm.default)(e,this,n)}let s=-1;for(let i=t.length-1;i>=0;i--){let n=t[i],a=new ko(n.fNGrams,this.byteMap()).parse(e,this.spaceChar);a>s&&(s=a,this.nGramLang=n.fLang)}return s<=0?null:(0,lm.default)(e,this,s)}},fu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,170,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,186,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,255]}ngrams(){return[new xe("da",[2122086,2122100,2122853,2123118,2123122,2123375,2123873,2124064,2125157,2125671,2126053,2126697,2126708,2126953,2127465,6383136,6385184,6385252,6386208,6386720,6579488,6579566,6579570,6579572,6627443,6644768,6644837,6647328,6647396,6648352,6648421,6648608,6648864,6713202,6776096,6776174,6776178,6907749,6908960,6909543,7038240,7039845,7103858,7104871,7105637,7169380,7234661,7234848,7235360,7235429,7300896,7302432,7303712,7398688,7479396,7479397,7479411,7496992,7566437,7610483,7628064,7628146,7629164,7759218]),new xe("de",[2122094,2122101,2122341,2122849,2122853,2122857,2123113,2123621,2123873,2124142,2125161,2126691,2126693,2127214,2127461,2127471,2127717,2128501,6448498,6514720,6514789,6514804,6578547,6579566,6579570,6580581,6627428,6627443,6646126,6646132,6647328,6648352,6648608,6776174,6841710,6845472,6906728,6907168,6909472,6909541,6911008,7104867,7105637,7217249,7217252,7217267,7234592,7234661,7234848,7235360,7235429,7238757,7479396,7496805,7497065,7562088,7566437,7610468,7628064,7628142,7628146,7695972,7695975,7759218]),new xe("en",[2122016,2122094,2122341,2122607,2123375,2123873,2123877,2124142,2125153,2125670,2125938,2126437,2126689,2126708,2126952,2126959,2127720,6383972,6384672,6385184,6385252,6386464,6386720,6386789,6386793,6561889,6561908,6627425,6627443,6627444,6644768,6647412,6648352,6648608,6713202,6840692,6841632,6841714,6906912,6909472,6909543,6909806,6910752,7217249,7217268,7234592,7235360,7238688,7300640,7302688,7303712,7496992,7500576,7544929,7544948,7561577,7566368,7610484,7628146,7628897,7628901,7629167,7630624,7631648]),new xe("es",[2122016,2122593,2122607,2122853,2123116,2123118,2123123,2124142,2124897,2124911,2125921,2125935,2125938,2126197,2126437,2126693,2127214,2128160,6365283,6365284,6365285,6365292,6365296,6382441,6382703,6384672,6386208,6386464,6515187,6516590,6579488,6579564,6582048,6627428,6627429,6627436,6646816,6647328,6647412,6648608,6648692,6907246,6943598,7102752,7106419,7217253,7238757,7282788,7282789,7302688,7303712,7303968,7364978,7435621,7495968,7497075,7544932,7544933,7544944,7562528,7628064,7630624,7693600,15953440]),new xe("fr",[2122101,2122607,2122849,2122853,2122869,2123118,2123124,2124897,2124901,2125921,2125935,2125938,2126197,2126693,2126703,2127214,2154528,6385268,6386793,6513952,6516590,6579488,6579571,6583584,6627425,6627427,6627428,6627429,6627436,6627440,6627443,6647328,6647412,6648352,6648608,6648864,6649202,6909806,6910752,6911008,7102752,7103776,7103859,7169390,7217252,7234848,7238432,7238688,7302688,7302772,7304562,7435621,7479404,7496992,7544929,7544932,7544933,7544940,7544944,7610468,7628064,7629167,7693600,7696928]),new xe("it",[2122092,2122600,2122607,2122853,2122857,2123040,2124140,2124142,2124897,2125925,2125938,2127214,6365283,6365284,6365296,6365299,6386799,6514789,6516590,6579564,6580512,6627425,6627427,6627428,6627433,6627436,6627440,6627443,6646816,6646892,6647412,6648352,6841632,6889569,6889571,6889572,6889587,6906144,6908960,6909472,6909806,7102752,7103776,7104800,7105633,7234848,7235872,7237408,7238757,7282785,7282788,7282793,7282803,7302688,7302757,7366002,7495968,7496992,7563552,7627040,7628064,7629088,7630624,8022383]),new xe("nl",[2122092,2122341,2122849,2122853,2122857,2123109,2123118,2123621,2123877,2124142,2125153,2125157,2125680,2126949,2127457,2127461,2127471,2127717,2128489,6381934,6381938,6385184,6385252,6386208,6386720,6514804,6579488,6579566,6579570,6627426,6627446,6645102,6645106,6647328,6648352,6648435,6648864,6776174,6841716,6907168,6909472,6909543,6910752,7217250,7217252,7217253,7217256,7217263,7217270,7234661,7235360,7302756,7303026,7303200,7303712,7562088,7566437,7610468,7628064,7628142,7628146,7758190,7759218,7761775]),new xe("no",[2122100,2122102,2122853,2123118,2123122,2123375,2123873,2124064,2125157,2125671,2126053,2126693,2126699,2126703,2126708,2126953,2127465,2155808,6385252,6386208,6386720,6579488,6579566,6579572,6627443,6644768,6647328,6647397,6648352,6648421,6648864,6648948,6713202,6776174,6908779,6908960,6909543,7038240,7039845,7103776,7105637,7169380,7169390,7217267,7234848,7235360,7235429,7237221,7300896,7302432,7303712,7398688,7479411,7496992,7565165,7566437,7610483,7628064,7628142,7628146,7629164,7631904,7631973,7759218]),new xe("pt",[2122016,2122607,2122849,2122853,2122863,2123040,2123123,2125153,2125423,2125600,2125921,2125935,2125938,2126197,2126437,2126693,2127213,6365281,6365283,6365284,6365296,6382693,6382703,6384672,6386208,6386273,6386464,6516589,6516590,6578464,6579488,6582048,6582131,6627425,6627428,6647072,6647412,6648608,6648692,6906144,6906721,7169390,7238757,7238767,7282785,7282787,7282788,7282789,7282800,7303968,7364978,7435621,7495968,7497075,7544929,7544932,7544933,7544944,7566433,7628064,7630624,7693600,14905120,15197039]),new xe("sv",[2122100,2122102,2122853,2123118,2123510,2123873,2124064,2124142,2124655,2125157,2125667,2126053,2126699,2126703,2126708,2126953,2127457,2127465,2155634,6382693,6385184,6385252,6386208,6386804,6514720,6579488,6579566,6579570,6579572,6644768,6647328,6648352,6648864,6747762,6776174,6909036,6909543,7037216,7105568,7169380,7217267,7233824,7234661,7235360,7235429,7235950,7299944,7302432,7302688,7398688,7479393,7479411,7495968,7564129,7565165,7610483,7627040,7628064,7628146,7629164,7631904,7758194,14971424,16151072])]}name(e){return e&&e.c1Bytes?"windows-1252":"ISO-8859-1"}};re.ISO_8859_1=fu;var du=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,177,32,179,32,181,182,32,32,185,186,187,188,32,190,191,32,177,32,179,32,181,182,183,32,185,186,187,188,32,190,191,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,32]}ngrams(){return[new xe("cs",[2122016,2122361,2122863,2124389,2125409,2125413,2125600,2125668,2125935,2125938,2126072,2126447,2126693,2126703,2126708,2126959,2127392,2127481,2128481,6365296,6513952,6514720,6627440,6627443,6627446,6647072,6647533,6844192,6844260,6910836,6972704,7042149,7103776,7104800,7233824,7268640,7269408,7269664,7282800,7300206,7301737,7304052,7304480,7304801,7368548,7368554,7369327,7403621,7562528,7565173,7566433,7566441,7566446,7628146,7630573,7630624,7676016,12477728,14773997,15296623,15540336,15540339,15559968,16278884]),new xe("hu",[2122016,2122106,2122341,2123111,2123116,2123365,2123873,2123887,2124147,2124645,2124649,2124790,2124901,2125153,2125157,2125161,2125413,2126714,2126949,2156915,6365281,6365291,6365293,6365299,6384416,6385184,6388256,6447470,6448494,6645625,6646560,6646816,6646885,6647072,6647328,6648421,6648864,6648933,6648948,6781216,6844263,6909556,6910752,7020641,7075450,7169383,7170414,7217249,7233899,7234923,7234925,7238688,7300985,7544929,7567973,7567988,7568097,7596391,7610465,7631904,7659891,8021362,14773792,15299360]),new xe("pl",[2122618,2122863,2124064,2124389,2124655,2125153,2125161,2125409,2125417,2125668,2125935,2125938,2126697,2127648,2127721,2127737,2128416,2128481,6365296,6365303,6385257,6514720,6519397,6519417,6582048,6584937,6627440,6627443,6627447,6627450,6645615,6646304,6647072,6647401,6778656,6906144,6907168,6907242,7037216,7039264,7039333,7170405,7233824,7235937,7235941,7282800,7305057,7305065,7368556,7369313,7369327,7369338,7502437,7502457,7563754,7564137,7566433,7825765,7955304,7957792,8021280,8022373,8026400,15955744]),new xe("ro",[2122016,2122083,2122593,2122597,2122607,2122613,2122853,2122857,2124897,2125153,2125925,2125938,2126693,2126819,2127214,2144873,2158190,6365283,6365284,6386277,6386720,6386789,6386976,6513010,6516590,6518048,6546208,6579488,6627425,6627427,6627428,6627440,6627443,6644e3,6646048,6646885,6647412,6648692,6889569,6889571,6889572,6889584,6907168,6908192,6909472,7102752,7103776,7106418,7107945,7234848,7238770,7303712,7365998,7496992,7497057,7501088,7594784,7628064,7631477,7660320,7694624,7695392,12216608,15625760])]}name(e){return e&&e.c1Bytes?"windows-1250":"ISO-8859-2"}};re.ISO_8859_2=du;var pu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,241,242,243,244,245,246,247,248,249,250,251,252,32,254,255,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,32,241,242,243,244,245,246,247,248,249,250,251,252,32,254,255]}ngrams(){return[2150944,2151134,2151646,2152400,2152480,2153168,2153182,2153936,2153941,2154193,2154462,2154464,2154704,2154974,2154978,2155230,2156514,2158050,13688280,13689580,13884960,14015468,14015960,14016994,14017056,14164191,14210336,14211104,14216992,14407133,14407712,14413021,14536736,14538016,14538965,14538991,14540320,14540498,14557394,14557407,14557409,14602784,14602960,14603230,14604576,14605292,14605344,14606818,14671579,14672085,14672088,14672094,14733522,14734804,14803664,14803666,14803672,14806816,14865883,14868e3,14868192,14871584,15196894,15459616]}name(){return"ISO-8859-5"}language(){return"ru"}};re.ISO_8859_5=pu;var mu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]}ngrams(){return[2148324,2148326,2148551,2152932,2154986,2155748,2156006,2156743,13050055,13091104,13093408,13095200,13100064,13100227,13100231,13100232,13100234,13100236,13100237,13100239,13100243,13100249,13100258,13100261,13100264,13100266,13100320,13100576,13100746,13115591,13181127,13181153,13181156,13181157,13181160,13246663,13574343,13617440,13705415,13748512,13836487,14229703,14279913,14805536,14950599,14993696,15001888,15002144,15016135,15058720,15059232,15066656,15081671,15147207,15189792,15255524,15263264,15278279,15343815,15343845,15343848,15386912,15388960,15394336]}name(){return"ISO-8859-6"}language(){return"ar"}};re.ISO_8859_6=mu;var xu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,161,162,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,220,32,221,222,223,32,252,32,253,254,192,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,32,243,244,245,246,247,248,249,250,251,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,32]}ngrams(){return[2154989,2154992,2155497,2155753,2156016,2156320,2157281,2157797,2158049,2158368,2158817,2158831,2158833,2159604,2159605,2159847,2159855,14672160,14754017,14754036,14805280,14806304,14807292,14807584,14936545,15067424,15069728,15147252,15199520,15200800,15278324,15327520,15330014,15331872,15393257,15393268,15525152,15540449,15540453,15540464,15589664,15725088,15725856,15790069,15790575,15793184,15868129,15868133,15868138,15868144,15868148,15983904,15984416,15987951,16048416,16048617,16050157,16050162,16050666,16052e3,16052213,16054765,16379168,16706848]}name(e){return e&&e.c1Bytes?"windows-1253":"ISO-8859-7"}language(){return"el"}};re.ISO_8859_7=xu;var gu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,32,32,32,32,32]}ngrams(){return[new xe("he",[2154725,2154727,2154729,2154746,2154985,2154990,2155744,2155749,2155753,2155758,2155762,2155769,2155770,2157792,2157796,2158304,2159340,2161132,14744096,14950624,14950625,14950628,14950636,14950638,14950649,15001056,15065120,15068448,15068960,15071264,15071776,15278308,15328288,15328762,15329773,15330592,15331104,15333408,15333920,15474912,15474916,15523872,15524896,15540448,15540449,15540452,15540460,15540462,15540473,15655968,15671524,15787040,15788320,15788525,15920160,16261348,16312813,16378912,16392416,16392417,16392420,16392428,16392430,16392441]),new xe("he",[2154725,2154732,2155753,2155756,2155758,2155760,2157040,2157810,2157817,2158053,2158057,2158565,2158569,2160869,2160873,2161376,2161381,2161385,14688484,14688492,14688493,14688506,14738464,14738916,14740512,14741024,14754020,14754029,14754042,14950628,14950633,14950636,14950637,14950639,14950648,14950650,15002656,15065120,15066144,15196192,15327264,15327520,15328288,15474916,15474925,15474938,15528480,15530272,15591913,15591920,15591928,15605988,15605997,15606010,15655200,15655968,15918112,16326884,16326893,16326906,16376864,16441376,16442400,16442857])]}name(e){return e&&e.c1Bytes?"windows-1255":"ISO-8859-8"}language(){return"he"}};re.ISO_8859_8=gu;var bu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,170,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,186,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,105,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,255]}ngrams(){return[2122337,2122345,2122357,2122849,2122853,2123621,2123873,2124140,2124641,2124655,2125153,2125676,2126689,2126945,2127461,2128225,6365282,6384416,6384737,6384993,6385184,6385405,6386208,6386273,6386429,6386685,6388065,6449522,6578464,6579488,6580512,6627426,6627435,6644841,6647328,6648352,6648425,6648681,6909029,6909472,6909545,6910496,7102830,7102834,7103776,7103858,7217249,7217250,7217259,7234657,7234661,7234848,7235872,7235950,7273760,7498094,7535982,7759136,7954720,7958386,16608800,16608868,16609021,16642301]}name(e){return e&&e.c1Bytes?"windows-1254":"ISO-8859-9"}language(){return"tr"}};re.ISO_8859_9=bu;var yu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,144,131,32,131,32,32,32,32,32,32,154,32,156,157,158,159,144,32,32,32,32,32,32,32,32,32,154,32,156,157,158,159,32,162,162,188,32,180,32,32,184,32,186,32,32,32,32,191,32,32,179,179,180,181,32,32,184,32,186,32,188,190,190,191,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}ngrams(){return[2155040,2155246,2155758,2156512,2156576,2157280,2157294,2158048,2158053,2158305,2158574,2158576,2158816,2159086,2159090,2159342,2160626,2162162,14740968,14742268,14937632,15068156,15068648,15069682,15069728,15212783,15263008,15263776,15269664,15459821,15460384,15465709,15589408,15590688,15591653,15591679,15592992,15593186,15605986,15605999,15606001,15655456,15655648,15655918,15657248,15657980,15658016,15659506,15724267,15724773,15724776,15724782,15786210,15787492,15856352,15856354,15856360,15859488,15918571,15920672,15920880,15924256,16249582,16512288]}name(){return"windows-1251"}language(){return"ru"}};re.windows_1251=yu;var wu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,129,32,131,32,32,32,32,136,32,138,32,156,141,142,143,144,32,32,32,32,32,32,32,152,32,154,32,156,32,32,159,32,32,32,32,32,32,32,32,32,32,170,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,32,32,32,32,32,32,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,32,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,32,32,32,32,244,32,32,32,32,249,32,251,252,32,32,255]}ngrams(){return[2148321,2148324,2148551,2153185,2153965,2154977,2155492,2156231,13050055,13091104,13093408,13095200,13099296,13099459,13099463,13099464,13099466,13099468,13099469,13099471,13099475,13099482,13099486,13099491,13099494,13099501,13099808,13100064,13100234,13115591,13181127,13181149,13181153,13181155,13181158,13246663,13574343,13617440,13705415,13748512,13836487,14295239,14344684,14544160,14753991,14797088,14806048,14806304,14885063,14927648,14928160,14935072,14950599,15016135,15058720,15124449,15131680,15474887,15540423,15540451,15540454,15583520,15585568,15590432]}name(){return"windows-1256"}language(){return"ar"}};re.windows_1256=wu;var Du=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,163,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,163,32,32,32,32,32,32,32,32,32,32,32,32,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223]}ngrams(){return[2147535,2148640,2149313,2149327,2150081,2150085,2150338,2150607,2150610,2151105,2151375,2151380,2151631,2152224,2152399,2153153,2153684,2154196,12701385,12702936,12963032,12963529,12964820,12964896,13094688,13181136,13223200,13224224,13226272,13419982,13420832,13424846,13549856,13550880,13552069,13552081,13553440,13553623,13574352,13574355,13574359,13617103,13617696,13618392,13618464,13620180,13621024,13621185,13684684,13685445,13685449,13685455,13812183,13813188,13881632,13882561,13882569,13882583,13944268,13946656,13946834,13948960,14272544,14603471]}name(){return"KOI8-R"}language(){return"ru"}};re.KOI8_R=Du});var hm=D(Pt=>{"use strict";var dD=Pt&&Pt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.ISO_2022_CN=Pt.ISO_2022_KR=Pt.ISO_2022_JP=void 0;var pD=dD(Qr()),an=class{constructor(){this.escapeSequences=[]}name(){return"ISO_2022"}match(e){let t,s,i,n=0,o=0,a=0,c,l=e.inputBytes,u=e.inputLen;e:for(t=0;t<u;t++){if(l[t]==27){t:for(i=0;i<this.escapeSequences.length;i++){let h=this.escapeSequences[i];if(u-t<h.length)continue t;for(s=1;s<h.length;s++)if(h[s]!=l[t+s])continue t;n++,t+=h.length-1;continue e}o++}(l[t]==14||l[t]==15)&&a++}return n==0?null:(c=(100*n-100*o)/(n+o),n+a<5&&(c-=(5-(n+a))*10),c<=0?null:(0,pD.default)(e,this,c))}},vu=class extends an{constructor(){super(...arguments),this.escapeSequences=[[27,36,40,67],[27,36,40,68],[27,36,64],[27,36,65],[27,36,66],[27,38,64],[27,40,66],[27,40,72],[27,40,73],[27,40,74],[27,46,65],[27,46,70]]}name(){return"ISO-2022-JP"}language(){return"ja"}};Pt.ISO_2022_JP=vu;var Cu=class extends an{constructor(){super(...arguments),this.escapeSequences=[[27,36,41,67]]}name(){return"ISO-2022-KR"}language(){return"kr"}};Pt.ISO_2022_KR=Cu;var Eu=class extends an{constructor(){super(...arguments),this.escapeSequences=[[27,36,41,65],[27,36,41,71],[27,36,42,72],[27,36,41,69],[27,36,43,73],[27,36,43,74],[27,36,43,75],[27,36,43,76],[27,36,43,77],[27,78],[27,79]]}name(){return"ISO-2022-CN"}language(){return"zh"}};Pt.ISO_2022_CN=Eu});var fm=D(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.isByteArray=void 0;var mD=r=>r==null||typeof r!="object"?!1:isFinite(r.length)&&r.length>=0;So.isByteArray=mD});var pm=D(X=>{"use strict";var xD=X&&X.__createBinding||(Object.create?(function(r,e,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,s,i)}):(function(r,e,t,s){s===void 0&&(s=t),r[s]=e[t]})),gD=X&&X.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Ao=X&&X.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var s=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[s.length]=i);return s},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s=r(e),i=0;i<s.length;i++)s[i]!=="default"&&xD(t,e,s[i]);return gD(t,e),t}})(),Su=X&&X.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(X,"__esModule",{value:!0});X.detectFileSync=X.detectFile=X.analyse=X.detect=void 0;var dm=Su(rm()),bD=Su(im()),yD=Su(nm()),_o=Ao(om()),cn=Ao(cm()),Rt=Ao(um()),ku=Ao(hm()),wD=fm(),DD=[new yD.default,new _o.UTF_16BE,new _o.UTF_16LE,new _o.UTF_32BE,new _o.UTF_32LE,new cn.sjis,new cn.big5,new cn.euc_jp,new cn.euc_kr,new cn.gb_18030,new ku.ISO_2022_JP,new ku.ISO_2022_KR,new ku.ISO_2022_CN,new Rt.ISO_8859_1,new Rt.ISO_8859_2,new Rt.ISO_8859_5,new Rt.ISO_8859_6,new Rt.ISO_8859_7,new Rt.ISO_8859_8,new Rt.ISO_8859_9,new Rt.windows_1251,new Rt.windows_1256,new Rt.KOI8_R,new bD.default],vD=r=>{let e=(0,X.analyse)(r);return e.length>0?e[0].name:null};X.detect=vD;var CD=r=>{if(!(0,wD.isByteArray)(r))throw new Error("Input must be a byte array, e.g. Buffer or Uint8Array");let e=[];for(let n=0;n<256;n++)e[n]=0;for(let n=r.length-1;n>=0;n--)e[r[n]&255]++;let t=!1;for(let n=128;n<=159;n+=1)if(e[n]!==0){t=!0;break}let s={byteStats:e,c1Bytes:t,rawInput:r,rawLen:r.length,inputBytes:r,inputLen:r.length};return DD.map(n=>n.match(s)).filter(n=>!!n).sort((n,o)=>o.confidence-n.confidence)};X.analyse=CD;var ED=(r,e={})=>new Promise((t,s)=>{let i,n=(0,dm.default)(),o=(c,l)=>{i&&n.closeSync(i),c?s(c):l?t((0,X.detect)(l)):s(new Error("No error and no buffer received"))},a=e?.sampleSize||0;if(a>0){i=n.openSync(r,"r");let c=Buffer.allocUnsafe(a);n.read(i,c,0,a,e.offset,(l,u)=>{l?o(l,null):(u<a&&(c=c.subarray(0,u)),o(null,c))});return}n.readFile(r,o)});X.detectFile=ED;var kD=(r,e={})=>{let t=(0,dm.default)();if(e&&e.sampleSize){let s=t.openSync(r,"r"),i=Buffer.allocUnsafe(e.sampleSize),n=t.readSync(s,i,0,e.sampleSize,e.offset);return n<e.sampleSize&&(i=i.subarray(0,n)),t.closeSync(s),(0,X.detect)(i)}return(0,X.detect)(t.readFileSync(r))};X.detectFileSync=kD;X.default={analyse:X.analyse,detect:X.detect,detectFileSync:X.detectFileSync,detectFile:X.detectFile}});var Qt=D((P9,mm)=>{"use strict";var To=require("buffer"),Gs=To.Buffer,ct={},lt;for(lt in To)To.hasOwnProperty(lt)&&(lt==="SlowBuffer"||lt==="Buffer"||(ct[lt]=To[lt]));var zs=ct.Buffer={};for(lt in Gs)Gs.hasOwnProperty(lt)&&(lt==="allocUnsafe"||lt==="allocUnsafeSlow"||(zs[lt]=Gs[lt]));ct.Buffer.prototype=Gs.prototype;(!zs.from||zs.from===Uint8Array.from)&&(zs.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return Gs(r,e,t)});zs.alloc||(zs.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var s=Gs(r);return!e||e.length===0?s.fill(0):typeof t=="string"?s.fill(e,t):s.fill(e),s});if(!ct.kStringMaxLength)try{ct.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}ct.constants||(ct.constants={MAX_LENGTH:ct.kMaxLength},ct.kStringMaxLength&&(ct.constants.MAX_STRING_LENGTH=ct.kStringMaxLength));mm.exports=ct});var gm=D(Tu=>{"use strict";var xm="\uFEFF";Tu.PrependBOM=_u;function _u(r,e){this.encoder=r,this.addBOM=!0}_u.prototype.write=function(r){return this.addBOM&&(r=xm+r,this.addBOM=!1),this.encoder.write(r)};_u.prototype.end=function(){return this.encoder.end()};Tu.StripBOM=Au;function Au(r,e){this.decoder=r,this.pass=!1,this.options=e||{}}Au.prototype.write=function(r){var e=this.decoder.write(r);return this.pass||!e||(e[0]===xm&&(e=e.slice(1),typeof this.options.stripBOM=="function"&&this.options.stripBOM()),this.pass=!0),e};Au.prototype.end=function(){return this.decoder.end()}});var Fu=D((M9,bm)=>{"use strict";var SD=typeof Object.hasOwn>"u"?Function.call.bind(Object.prototype.hasOwnProperty):Object.hasOwn;function _D(r,e){for(var t in e)SD(e,t)&&(r[t]=e[t])}bm.exports=_D});var wm=D(($9,ym)=>{"use strict";var er=Qt().Buffer;ym.exports={utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:Ou};function Ou(r,e){this.enc=r.encodingName,this.bomAware=r.bomAware,this.enc==="base64"?this.encoder=Pu:this.enc==="utf8"?this.encoder=$u:this.enc==="cesu8"&&(this.enc="utf8",this.encoder=Ru,er.from("eda0bdedb2a9","hex").toString()!=="\u{1F4A9}"&&(this.decoder=Mu,this.defaultCharUnicode=e.defaultCharUnicode))}Ou.prototype.encoder=Bu;Ou.prototype.decoder=Iu;var AD=require("string_decoder").StringDecoder;function Iu(r,e){this.decoder=new AD(e.enc)}Iu.prototype.write=function(r){return er.isBuffer(r)||(r=er.from(r)),this.decoder.write(r)};Iu.prototype.end=function(){return this.decoder.end()};function Bu(r,e){this.enc=e.enc}Bu.prototype.write=function(r){return er.from(r,this.enc)};Bu.prototype.end=function(){};function Pu(r,e){this.prevStr=""}Pu.prototype.write=function(r){r=this.prevStr+r;var e=r.length-r.length%4;return this.prevStr=r.slice(e),r=r.slice(0,e),er.from(r,"base64")};Pu.prototype.end=function(){return er.from(this.prevStr,"base64")};function Ru(r,e){}Ru.prototype.write=function(r){for(var e=er.alloc(r.length*3),t=0,s=0;s<r.length;s++){var i=r.charCodeAt(s);i<128?e[t++]=i:i<2048?(e[t++]=192+(i>>>6),e[t++]=128+(i&63)):(e[t++]=224+(i>>>12),e[t++]=128+(i>>>6&63),e[t++]=128+(i&63))}return e.slice(0,t)};Ru.prototype.end=function(){};function Mu(r,e){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=e.defaultCharUnicode}Mu.prototype.write=function(r){for(var e=this.acc,t=this.contBytes,s=this.accBytes,i="",n=0;n<r.length;n++){var o=r[n];(o&192)!==128?(t>0&&(i+=this.defaultCharUnicode,t=0),o<128?i+=String.fromCharCode(o):o<224?(e=o&31,t=1,s=1):o<240?(e=o&15,t=2,s=1):i+=this.defaultCharUnicode):t>0?(e=e<<6|o&63,t--,s++,t===0&&(s===2&&e<128&&e>0?i+=this.defaultCharUnicode:s===3&&e<2048?i+=this.defaultCharUnicode:i+=String.fromCharCode(e))):i+=this.defaultCharUnicode}return this.acc=e,this.contBytes=t,this.accBytes=s,i};Mu.prototype.end=function(){var r=0;return this.contBytes>0&&(r+=this.defaultCharUnicode),r};function $u(r,e){this.highSurrogate=""}$u.prototype.write=function(r){if(this.highSurrogate&&(r=this.highSurrogate+r,this.highSurrogate=""),r.length>0){var e=r.charCodeAt(r.length-1);e>=55296&&e<56320&&(this.highSurrogate=r[r.length-1],r=r.slice(0,r.length-1))}return er.from(r,this.enc)};$u.prototype.end=function(){if(this.highSurrogate){var r=this.highSurrogate;return this.highSurrogate="",er.from(r,this.enc)}}});var Cm=D(br=>{"use strict";var Fo=Qt().Buffer;br._utf32=ju;function ju(r,e){this.iconv=e,this.bomAware=!0,this.isLE=r.isLE}br.utf32le={type:"_utf32",isLE:!0};br.utf32be={type:"_utf32",isLE:!1};br.ucs4le="utf32le";br.ucs4be="utf32be";ju.prototype.encoder=Nu;ju.prototype.decoder=Lu;function Nu(r,e){this.isLE=e.isLE,this.highSurrogate=0}Nu.prototype.write=function(r){for(var e=Fo.from(r,"ucs2"),t=Fo.alloc(e.length*2),s=this.isLE?t.writeUInt32LE:t.writeUInt32BE,i=0,n=0;n<e.length;n+=2){var o=e.readUInt16LE(n),a=o>=55296&&o<56320,c=o>=56320&&o<57344;if(this.highSurrogate)if(a||!c)s.call(t,this.highSurrogate,i),i+=4;else{var l=(this.highSurrogate-55296<<10|o-56320)+65536;s.call(t,l,i),i+=4,this.highSurrogate=0;continue}a?this.highSurrogate=o:(s.call(t,o,i),i+=4,this.highSurrogate=0)}return i<t.length&&(t=t.slice(0,i)),t};Nu.prototype.end=function(){if(this.highSurrogate){var r=Fo.alloc(4);return this.isLE?r.writeUInt32LE(this.highSurrogate,0):r.writeUInt32BE(this.highSurrogate,0),this.highSurrogate=0,r}};function Lu(r,e){this.isLE=e.isLE,this.badChar=e.iconv.defaultCharUnicode.charCodeAt(0),this.overflow=[]}Lu.prototype.write=function(r){if(r.length===0)return"";var e=0,t=0,s=Fo.alloc(r.length+4),i=0,n=this.isLE,o=this.overflow,a=this.badChar;if(o.length>0){for(;e<r.length&&o.length<4;e++)o.push(r[e]);o.length===4&&(n?t=o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24:t=o[e+3]|o[e+2]<<8|o[e+1]<<16|o[e]<<24,o.length=0,i=Dm(s,i,t,a))}for(;e<r.length-3;e+=4)n?t=r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24:t=r[e+3]|r[e+2]<<8|r[e+1]<<16|r[e]<<24,i=Dm(s,i,t,a);for(;e<r.length;e++)o.push(r[e]);return s.slice(0,i).toString("ucs2")};function Dm(r,e,t,s){if((t<0||t>1114111)&&(t=s),t>=65536){t-=65536;var i=55296|t>>10;r[e++]=i&255,r[e++]=i>>8;var t=56320|t&1023}return r[e++]=t&255,r[e++]=t>>8,e}Lu.prototype.end=function(){this.overflow.length=0};br.utf32=Uu;br.ucs4="utf32";function Uu(r,e){this.iconv=e}Uu.prototype.encoder=Wu;Uu.prototype.decoder=qu;function Wu(r,e){r=r||{},r.addBOM===void 0&&(r.addBOM=!0),this.encoder=e.iconv.getEncoder(r.defaultEncoding||"utf-32le",r)}Wu.prototype.write=function(r){return this.encoder.write(r)};Wu.prototype.end=function(){return this.encoder.end()};function qu(r,e){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=r||{},this.iconv=e.iconv}qu.prototype.write=function(r){if(!this.decoder){if(this.initialBufs.push(r),this.initialBufsLen+=r.length,this.initialBufsLen<32)return"";var e=vm(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t="",s=0;s<this.initialBufs.length;s++)t+=this.decoder.write(this.initialBufs[s]);return this.initialBufs.length=this.initialBufsLen=0,t}return this.decoder.write(r)};qu.prototype.end=function(){if(!this.decoder){var r=vm(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(r,this.options);for(var e="",t=0;t<this.initialBufs.length;t++)e+=this.decoder.write(this.initialBufs[t]);var s=this.decoder.end();return s&&(e+=s),this.initialBufs.length=this.initialBufsLen=0,e}return this.decoder.end()};function vm(r,e){var t=[],s=0,i=0,n=0,o=0,a=0;e:for(var c=0;c<r.length;c++)for(var l=r[c],u=0;u<l.length;u++)if(t.push(l[u]),t.length===4){if(s===0){if(t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0)return"utf-32le";if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)return"utf-32be"}if((t[0]!==0||t[1]>16)&&n++,(t[3]!==0||t[2]>16)&&i++,t[0]===0&&t[1]===0&&(t[2]!==0||t[3]!==0)&&a++,(t[0]!==0||t[1]!==0)&&t[2]===0&&t[3]===0&&o++,t.length=0,s++,s>=100)break e}return a-n>o-i?"utf-32be":a-n<o-i?"utf-32le":e||"utf-32le"}});var Sm=D(Zu=>{"use strict";var Em=Qt().Buffer;Zu.utf16be=Oo;function Oo(){}Oo.prototype.encoder=Vu;Oo.prototype.decoder=Hu;Oo.prototype.bomAware=!0;function Vu(){}Vu.prototype.write=function(r){for(var e=Em.from(r,"ucs2"),t=0;t<e.length;t+=2){var s=e[t];e[t]=e[t+1],e[t+1]=s}return e};Vu.prototype.end=function(){};function Hu(){this.overflowByte=-1}Hu.prototype.write=function(r){if(r.length==0)return"";var e=Em.alloc(r.length+1),t=0,s=0;for(this.overflowByte!==-1&&(e[0]=r[0],e[1]=this.overflowByte,t=1,s=2);t<r.length-1;t+=2,s+=2)e[s]=r[t+1],e[s+1]=r[t];return this.overflowByte=t==r.length-1?r[r.length-1]:-1,e.slice(0,s).toString("ucs2")};Hu.prototype.end=function(){this.overflowByte=-1};Zu.utf16=Gu;function Gu(r,e){this.iconv=e}Gu.prototype.encoder=zu;Gu.prototype.decoder=Ku;function zu(r,e){r=r||{},r.addBOM===void 0&&(r.addBOM=!0),this.encoder=e.iconv.getEncoder("utf-16le",r)}zu.prototype.write=function(r){return this.encoder.write(r)};zu.prototype.end=function(){return this.encoder.end()};function Ku(r,e){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=r||{},this.iconv=e.iconv}Ku.prototype.write=function(r){if(!this.decoder){if(this.initialBufs.push(r),this.initialBufsLen+=r.length,this.initialBufsLen<16)return"";var e=km(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t="",s=0;s<this.initialBufs.length;s++)t+=this.decoder.write(this.initialBufs[s]);return this.initialBufs.length=this.initialBufsLen=0,t}return this.decoder.write(r)};Ku.prototype.end=function(){if(!this.decoder){var r=km(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(r,this.options);for(var e="",t=0;t<this.initialBufs.length;t++)e+=this.decoder.write(this.initialBufs[t]);var s=this.decoder.end();return s&&(e+=s),this.initialBufs.length=this.initialBufsLen=0,e}return this.decoder.end()};function km(r,e){var t=[],s=0,i=0,n=0;e:for(var o=0;o<r.length;o++)for(var a=r[o],c=0;c<a.length;c++)if(t.push(a[c]),t.length===2){if(s===0){if(t[0]===255&&t[1]===254)return"utf-16le";if(t[0]===254&&t[1]===255)return"utf-16be"}if(t[0]===0&&t[1]!==0&&n++,t[0]!==0&&t[1]===0&&i++,t.length=0,s++,s>=100)break e}return n>i?"utf-16be":n<i?"utf-16le":e||"utf-16le"}});var Am=D(Po=>{"use strict";var Mt=Qt().Buffer;Po.utf7=Io;Po.unicode11utf7="utf7";function Io(r,e){this.iconv=e}Io.prototype.encoder=Ju;Io.prototype.decoder=Xu;Io.prototype.bomAware=!0;var TD=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Ju(r,e){this.iconv=e.iconv}Ju.prototype.write=function(r){return Mt.from(r.replace(TD,function(e){return"+"+(e==="+"?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))};Ju.prototype.end=function(){};function Xu(r,e){this.iconv=e.iconv,this.inBase64=!1,this.base64Accum=""}var FD=/[A-Za-z0-9\/+]/,Qu=[];for(ln=0;ln<256;ln++)Qu[ln]=FD.test(String.fromCharCode(ln));var ln,OD=43,ts=45,Yu=38;Xu.prototype.write=function(r){for(var e="",t=0,s=this.inBase64,i=this.base64Accum,n=0;n<r.length;n++)if(!s)r[n]==OD&&(e+=this.iconv.decode(r.slice(t,n),"ascii"),t=n+1,s=!0);else if(!Qu[r[n]]){if(n==t&&r[n]==ts)e+="+";else{var o=i+this.iconv.decode(r.slice(t,n),"ascii");e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}r[n]!=ts&&n--,t=n+1,s=!1,i=""}if(!s)e+=this.iconv.decode(r.slice(t),"ascii");else{var o=i+this.iconv.decode(r.slice(t),"ascii"),a=o.length-o.length%8;i=o.slice(a),o=o.slice(0,a),e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}return this.inBase64=s,this.base64Accum=i,e};Xu.prototype.end=function(){var r="";return this.inBase64&&this.base64Accum.length>0&&(r=this.iconv.decode(Mt.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",r};Po.utf7imap=Bo;function Bo(r,e){this.iconv=e}Bo.prototype.encoder=e0;Bo.prototype.decoder=t0;Bo.prototype.bomAware=!0;function e0(r,e){this.iconv=e.iconv,this.inBase64=!1,this.base64Accum=Mt.alloc(6),this.base64AccumIdx=0}e0.prototype.write=function(r){for(var e=this.inBase64,t=this.base64Accum,s=this.base64AccumIdx,i=Mt.alloc(r.length*5+10),n=0,o=0;o<r.length;o++){var a=r.charCodeAt(o);a>=32&&a<=126?(e&&(s>0&&(n+=i.write(t.slice(0,s).toString("base64").replace(/\//g,",").replace(/=+$/,""),n),s=0),i[n++]=ts,e=!1),e||(i[n++]=a,a===Yu&&(i[n++]=ts))):(e||(i[n++]=Yu,e=!0),e&&(t[s++]=a>>8,t[s++]=a&255,s==t.length&&(n+=i.write(t.toString("base64").replace(/\//g,","),n),s=0)))}return this.inBase64=e,this.base64AccumIdx=s,i.slice(0,n)};e0.prototype.end=function(){var r=Mt.alloc(10),e=0;return this.inBase64&&(this.base64AccumIdx>0&&(e+=r.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),e),this.base64AccumIdx=0),r[e++]=ts,this.inBase64=!1),r.slice(0,e)};function t0(r,e){this.iconv=e.iconv,this.inBase64=!1,this.base64Accum=""}var _m=Qu.slice();_m[44]=!0;t0.prototype.write=function(r){for(var e="",t=0,s=this.inBase64,i=this.base64Accum,n=0;n<r.length;n++)if(!s)r[n]==Yu&&(e+=this.iconv.decode(r.slice(t,n),"ascii"),t=n+1,s=!0);else if(!_m[r[n]]){if(n==t&&r[n]==ts)e+="&";else{var o=i+this.iconv.decode(r.slice(t,n),"ascii").replace(/,/g,"/");e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}r[n]!=ts&&n--,t=n+1,s=!1,i=""}if(!s)e+=this.iconv.decode(r.slice(t),"ascii");else{var o=i+this.iconv.decode(r.slice(t),"ascii").replace(/,/g,"/"),a=o.length-o.length%8;i=o.slice(a),o=o.slice(0,a),e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}return this.inBase64=s,this.base64Accum=i,e};t0.prototype.end=function(){var r="";return this.inBase64&&this.base64Accum.length>0&&(r=this.iconv.decode(Mt.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",r}});var Fm=D(Tm=>{"use strict";var Ro=Qt().Buffer;Tm._sbcs=r0;function r0(r,e){if(!r)throw new Error("SBCS codec is called without the data.");if(!r.chars||r.chars.length!==128&&r.chars.length!==256)throw new Error("Encoding '"+r.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(r.chars.length===128){for(var t="",s=0;s<128;s++)t+=String.fromCharCode(s);r.chars=t+r.chars}this.decodeBuf=Ro.from(r.chars,"ucs2");for(var i=Ro.alloc(65536,e.defaultCharSingleByte.charCodeAt(0)),s=0;s<r.chars.length;s++)i[r.chars.charCodeAt(s)]=s;this.encodeBuf=i}r0.prototype.encoder=s0;r0.prototype.decoder=i0;function s0(r,e){this.encodeBuf=e.encodeBuf}s0.prototype.write=function(r){for(var e=Ro.alloc(r.length),t=0;t<r.length;t++)e[t]=this.encodeBuf[r.charCodeAt(t)];return e};s0.prototype.end=function(){};function i0(r,e){this.decodeBuf=e.decodeBuf}i0.prototype.write=function(r){for(var e=this.decodeBuf,t=Ro.alloc(r.length*2),s=0,i=0,n=0;n<r.length;n++)s=r[n]*2,i=n*2,t[i]=e[s],t[i+1]=e[s+1];return t.toString("ucs2")};i0.prototype.end=function(){}});var Im=D((W9,Om)=>{"use strict";Om.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\u20AC\u25A0\xA0"},mik:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2514\u2534\u252C\u251C\u2500\u253C\u2563\u2551\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2510\u2591\u2592\u2593\u2502\u2524\u2116\xA7\u2557\u255D\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},cp720:{type:"_sbcs",chars:"\x80\x81\xE9\xE2\x84\xE0\x86\xE7\xEA\xEB\xE8\xEF\xEE\x8D\x8E\x8F\x90\u0651\u0652\xF4\xA4\u0640\xFB\xF9\u0621\u0622\u0623\u0624\xA3\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0636\u0637\u0638\u0639\u063A\u0641\xB5\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u2261\u064B\u064C\u064D\u064E\u064F\u0650\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}});var Pm=D((q9,Bm)=>{"use strict";Bm.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"\u20AC\uFFFD\uFFFD\uFFFD\uFFFD\u2026\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\u0160\u2039\u015A\u0164\u017D\u0179\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0161\u203A\u015B\u0165\u017E\u017A\xA0\u02C7\u02D8\u0141\xA4\u0104\xA6\xA7\xA8\xA9\u015E\xAB\xAC\xAD\xAE\u017B\xB0\xB1\u02DB\u0142\xB4\xB5\xB6\xB7\xB8\u0105\u015F\xBB\u013D\u02DD\u013E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u040C\u040B\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u045C\u045B\u045F\xA0\u040E\u045E\u0408\xA4\u0490\xA6\xA7\u0401\xA9\u0404\xAB\xAC\xAD\xAE\u0407\xB0\xB1\u0406\u0456\u0491\xB5\xB6\xB7\u0451\u2116\u0454\xBB\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\u017D\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\u017E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0385\u0386\xA3\xA4\xA5\xA6\xA7\xA8\xA9\uFFFD\xAB\xAC\xAD\xAE\u2015\xB0\xB1\xB2\xB3\u0384\xB5\xB6\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\xA1\xA2\xA3\u20AA\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\xBF\u05B0\u05B1\u05B2\u05B3\u05B4\u05B5\u05B6\u05B7\u05B8\u05B9\u05BA\u05BB\u05BC\u05BD\u05BE\u05BF\u05C0\u05C1\u05C2\u05C3\u05F0\u05F1\u05F2\u05F3\u05F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"\u20AC\u067E\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0679\u2039\u0152\u0686\u0698\u0688\u06AF\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u06A9\u2122\u0691\u203A\u0153\u200C\u200D\u06BA\xA0\u060C\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\u06BE\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\u061B\xBB\xBC\xBD\xBE\u061F\u06C1\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\xD7\u0637\u0638\u0639\u063A\u0640\u0641\u0642\u0643\xE0\u0644\xE2\u0645\u0646\u0647\u0648\xE7\xE8\xE9\xEA\xEB\u0649\u064A\xEE\xEF\u064B\u064C\u064D\u064E\xF4\u064F\u0650\xF7\u0651\xF9\u0652\xFB\xFC\u200E\u200F\u06D2"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\xA8\u02C7\xB8\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\xAF\u02DB\uFFFD\xA0\uFFFD\xA2\xA3\xA4\uFFFD\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u02D9"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u02D8\u0141\xA4\u013D\u015A\xA7\xA8\u0160\u015E\u0164\u0179\xAD\u017D\u017B\xB0\u0105\u02DB\u0142\xB4\u013E\u015B\u02C7\xB8\u0161\u015F\u0165\u017A\u02DD\u017E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0126\u02D8\xA3\xA4\uFFFD\u0124\xA7\xA8\u0130\u015E\u011E\u0134\xAD\uFFFD\u017B\xB0\u0127\xB2\xB3\xB4\xB5\u0125\xB7\xB8\u0131\u015F\u011F\u0135\xBD\uFFFD\u017C\xC0\xC1\xC2\uFFFD\xC4\u010A\u0108\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\uFFFD\xD1\xD2\xD3\xD4\u0120\xD6\xD7\u011C\xD9\xDA\xDB\xDC\u016C\u015C\xDF\xE0\xE1\xE2\uFFFD\xE4\u010B\u0109\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\uFFFD\xF1\xF2\xF3\xF4\u0121\xF6\xF7\u011D\xF9\xFA\xFB\xFC\u016D\u015D\u02D9"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0138\u0156\xA4\u0128\u013B\xA7\xA8\u0160\u0112\u0122\u0166\xAD\u017D\xAF\xB0\u0105\u02DB\u0157\xB4\u0129\u013C\u02C7\xB8\u0161\u0113\u0123\u0167\u014A\u017E\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\u012A\u0110\u0145\u014C\u0136\xD4\xD5\xD6\xD7\xD8\u0172\xDA\xDB\xDC\u0168\u016A\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\u012B\u0111\u0146\u014D\u0137\xF4\xF5\xF6\xF7\xF8\u0173\xFA\xFB\xFC\u0169\u016B\u02D9"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\uFFFD\uFFFD\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u060C\xAD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u061B\uFFFD\uFFFD\uFFFD\u061F\uFFFD\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u2018\u2019\xA3\u20AC\u20AF\xA6\xA7\xA8\xA9\u037A\xAB\xAC\xAD\uFFFD\u2015\xB0\xB1\xB2\xB3\u0384\u0385\u0386\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2017\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0112\u0122\u012A\u0128\u0136\xA7\u013B\u0110\u0160\u0166\u017D\xAD\u016A\u014A\xB0\u0105\u0113\u0123\u012B\u0129\u0137\xB7\u013C\u0111\u0161\u0167\u017E\u2015\u016B\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\xCF\xD0\u0145\u014C\xD3\xD4\xD5\xD6\u0168\xD8\u0172\xDA\xDB\xDC\xDD\xDE\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\xEF\xF0\u0146\u014D\xF3\xF4\xF5\xF6\u0169\xF8\u0173\xFA\xFB\xFC\xFD\xFE\u0138"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u201D\xA2\xA3\xA4\u201E\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\u201C\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u2019"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u1E02\u1E03\xA3\u010A\u010B\u1E0A\xA7\u1E80\xA9\u1E82\u1E0B\u1EF2\xAD\xAE\u0178\u1E1E\u1E1F\u0120\u0121\u1E40\u1E41\xB6\u1E56\u1E81\u1E57\u1E83\u1E60\u1EF3\u1E84\u1E85\u1E61\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0174\xD1\xD2\xD3\xD4\xD5\xD6\u1E6A\xD8\xD9\xDA\xDB\xDC\xDD\u0176\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0175\xF1\xF2\xF3\xF4\xF5\xF6\u1E6B\xF8\xF9\xFA\xFB\xFC\xFD\u0177\xFF"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\u0160\xA7\u0161\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u017D\xB5\xB6\xB7\u017E\xB9\xBA\xBB\u0152\u0153\u0178\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0105\u0141\u20AC\u201E\u0160\xA7\u0161\xA9\u0218\xAB\u0179\xAD\u017A\u017B\xB0\xB1\u010C\u0142\u017D\u201D\xB6\xB7\u017E\u010D\u0219\xBB\u0152\u0153\u0178\u017C\xC0\xC1\xC2\u0102\xC4\u0106\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0110\u0143\xD2\xD3\xD4\u0150\xD6\u015A\u0170\xD9\xDA\xDB\xDC\u0118\u021A\xDF\xE0\xE1\xE2\u0103\xE4\u0107\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0111\u0144\xF2\xF3\xF4\u0151\xF6\u015B\u0171\xF9\xFA\xFB\xFC\u0119\u021B\xFF"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u03C5\u03C6\u03C7\u03C8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03C9\u03AC\u03AD\u03AE\u03CA\u03AF\u03CC\u03CD\u03CB\u03CE\u0386\u0388\u0389\u038A\u038C\u038E\u038F\xB1\u2265\u2264\u03AA\u03AB\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"\u0106\xFC\xE9\u0101\xE4\u0123\xE5\u0107\u0142\u0113\u0156\u0157\u012B\u0179\xC4\xC5\xC9\xE6\xC6\u014D\xF6\u0122\xA2\u015A\u015B\xD6\xDC\xF8\xA3\xD8\xD7\xA4\u0100\u012A\xF3\u017B\u017C\u017A\u201D\xA6\xA9\xAE\xAC\xBD\xBC\u0141\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0104\u010C\u0118\u0116\u2563\u2551\u2557\u255D\u012E\u0160\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0172\u016A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u017D\u0105\u010D\u0119\u0117\u012F\u0161\u0173\u016B\u017E\u2518\u250C\u2588\u2584\u258C\u2590\u2580\xD3\xDF\u014C\u0143\xF5\xD5\xB5\u0144\u0136\u0137\u013B\u013C\u0146\u0112\u0145\u2019\xAD\xB1\u201C\xBE\xB6\xA7\xF7\u201E\xB0\u2219\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u0131\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\u016F\u0107\xE7\u0142\xEB\u0150\u0151\xEE\u0179\xC4\u0106\xC9\u0139\u013A\xF4\xF6\u013D\u013E\u015A\u015B\xD6\xDC\u0164\u0165\u0141\xD7\u010D\xE1\xED\xF3\xFA\u0104\u0105\u017D\u017E\u0118\u0119\xAC\u017A\u010C\u015F\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\u011A\u015E\u2563\u2551\u2557\u255D\u017B\u017C\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0102\u0103\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u0111\u0110\u010E\xCB\u010F\u0147\xCD\xCE\u011B\u2518\u250C\u2588\u2584\u0162\u016E\u2580\xD3\xDF\xD4\u0143\u0144\u0148\u0160\u0161\u0154\xDA\u0155\u0170\xFD\xDD\u0163\xB4\xAD\u02DD\u02DB\u02C7\u02D8\xA7\xF7\xB8\xB0\xA8\u02D9\u0171\u0158\u0159\u25A0\xA0"},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045A\u040A\u045B\u040B\u045C\u040C\u045E\u040E\u045F\u040F\u044E\u042E\u044A\u042A\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255D\u0439\u0419\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u043A\u041A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u043B\u041B\u043C\u041C\u043D\u041D\u043E\u041E\u043F\u2518\u250C\u2588\u2584\u041F\u044F\u2580\u042F\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044C\u042C\u2116\xAD\u044B\u042B\u0437\u0417\u0448\u0428\u044D\u042D\u0449\u0429\u0447\u0427\xA7\u25A0\xA0"},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\xA3\uFFFD\xD7\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAE\xAC\xBD\xBC\uFFFD\xAB\xBB\u2591\u2592\u2593\u2502\u2524\uFFFD\uFFFD\uFFFD\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\uFFFD\uFFFD\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2518\u250C\u2588\u2584\xA6\uFFFD\u2580\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xB5\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\u0131\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\u0130\xD6\xDC\xF8\xA3\xD8\u015E\u015F\xE1\xED\xF3\xFA\xF1\xD1\u011E\u011F\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xBA\xAA\xCA\xCB\xC8\uFFFD\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\uFFFD\xD7\xDA\xDB\xD9\xEC\xFF\xAF\xB4\xAD\xB1\uFFFD\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u20AC\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE3\xE0\xC1\xE7\xEA\xCA\xE8\xCD\xD4\xEC\xC3\xC2\xC9\xC0\xC8\xF4\xF5\xF2\xDA\xF9\xCC\xD5\xDC\xA2\xA3\xD9\u20A7\xD3\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xD2\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xD0\xF0\xDE\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xFE\xFB\xDD\xFD\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xC1\xCD\xD3\xDA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xC2\xE0\xB6\xE7\xEA\xEB\xE8\xEF\xEE\u2017\xC0\xA7\xC9\xC8\xCA\xF4\xCB\xCF\xFB\xF9\xA4\xD4\xDC\xA2\xA3\xD9\xDB\u0192\xA6\xB4\xF3\xFA\xA8\xB8\xB3\xAF\xCE\u2310\xAC\xBD\xBC\xBE\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:`\0\x07\b
65
+ `)});var Gp=D((Wk,Hp)=>{var Kw=require("stream"),$l=class extends Kw{#e=null;constructor(e={}){super(e),this.writable=this.readable=!0,this.muted=!1,this.on("pipe",this._onpipe),this.replace=e.replace,this._prompt=e.prompt||null,this._hadControl=!1}#t(e,t){return this._dest?this._dest[e]:this._src?this._src[e]:t}#r(e,...t){typeof this._dest?.[e]=="function"&&this._dest[e](...t),typeof this._src?.[e]=="function"&&this._src[e](...t)}get isTTY(){return this.#e!==null?this.#e:this.#t("isTTY",!1)}set isTTY(e){this.#e=e}get rows(){return this.#t("rows")}get columns(){return this.#t("columns")}mute(){this.muted=!0}unmute(){this.muted=!1}_onpipe(e){this._src=e}pipe(e,t){return this._dest=e,super.pipe(e,t)}pause(){if(this._src)return this._src.pause()}resume(){if(this._src)return this._src.resume()}write(e){if(this.muted){if(!this.replace)return!0;if(e.match(/^\u001b/))return e.indexOf(this._prompt)===0&&(e=e.slice(this._prompt.length),e=e.replace(/./g,this.replace),e=this._prompt+e),this._hadControl=!0,this.emit("data",e);this._prompt&&this._hadControl&&e.indexOf(this._prompt)===0&&(this._hadControl=!1,this.emit("data",this._prompt),e=e.slice(this._prompt.length)),e=e.toString().replace(/./g,this.replace)}this.emit("data",e)}end(e){this.muted&&(e&&this.replace?e=e.toString().replace(/./g,this.replace):e=null),e&&this.emit("data",e),this.emit("end")}destroy(...e){return this.#r("destroy",...e)}destroySoon(...e){return this.#r("destroySoon",...e)}close(...e){return this.#r("close",...e)}};Hp.exports=$l});var rm=D((Jl,Yl)=>{"use strict";Object.defineProperty(Jl,"__esModule",{value:!0});var Co;Jl.default=()=>{if(typeof Yl=="object"&&typeof Yl.exports=="object")return Co=Co||require("fs"),Co;throw new Error("File system is not available")}});var es=D(Xl=>{"use strict";Object.defineProperty(Xl,"__esModule",{value:!0});Xl.default=(r,e,t)=>({confidence:t,name:e.name(r),lang:e.language?e.language():void 0})});var im=D(nn=>{"use strict";var sD=nn&&nn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(nn,"__esModule",{value:!0});var sm=sD(es()),Ql=class{name(){return"ASCII"}match(e){let t=e.rawInput;for(let s=0;s<e.rawLen;s++){let i=t[s];if(i<32||i>126)return(0,sm.default)(e,this,0)}return(0,sm.default)(e,this,100)}};nn.default=Ql});var nm=D(on=>{"use strict";var iD=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});var nD=iD(es()),eu=class{name(){return"UTF-8"}match(e){let t=!1,s=0,i=0,n=0,o,a=e.rawInput;e.rawLen>=3&&(a[0]&255)==239&&(a[1]&255)==187&&(a[2]&255)==191&&(t=!0);for(let c=0;c<e.rawLen;c++){let l=a[c];if((l&128)!=0){if((l&224)==192)n=1;else if((l&240)==224)n=2;else if((l&248)==240)n=3;else{if(i++,i>5)break;n=0}for(;c++,!(c>=e.rawLen);){if((a[c]&192)!=128){i++;break}if(--n==0){s++;break}}}}if(o=0,t&&i==0)o=100;else if(t&&s>i*10)o=80;else if(s>3&&i==0)o=100;else if(s>0&&i==0)o=80;else if(s==0&&i==0)o=10;else if(s>i*10)o=25;else return null;return(0,nD.default)(e,this,o)}};on.default=eu});var om=D(ot=>{"use strict";var oD=ot&&ot.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ot,"__esModule",{value:!0});ot.UTF_32LE=ot.UTF_32BE=ot.UTF_16LE=ot.UTF_16BE=void 0;var nu=oD(es()),tu=class{name(){return"UTF-16BE"}match(e){let t=e.rawInput;return t.length>=2&&(t[0]&255)==254&&(t[1]&255)==255?(0,nu.default)(e,this,100):null}};ot.UTF_16BE=tu;var ru=class{name(){return"UTF-16LE"}match(e){let t=e.rawInput;return t.length>=2&&(t[0]&255)==255&&(t[1]&255)==254?t.length>=4&&t[2]==0&&t[3]==0?null:(0,nu.default)(e,this,100):null}};ot.UTF_16LE=ru;var Eo=class{name(){return"UTF-32"}getChar(e,t){return-1}match(e){let t=0,s=0,i=!1,n=0,o=e.rawLen/4*4,a=e.rawInput;if(o==0)return null;this.getChar(a,0)==65279&&(i=!0);for(let c=0;c<o;c+=4){let l=this.getChar(a,c);l<0||l>=1114111||l>=55296&&l<=57343?s+=1:t+=1}return i&&s==0?n=100:i&&t>s*10?n=80:t>3&&s==0?n=100:t>0&&s==0?n=80:t>s*10&&(n=25),n==0?null:(0,nu.default)(e,this,n)}},su=class extends Eo{name(){return"UTF-32BE"}getChar(e,t){return(e[t+0]&255)<<24|(e[t+1]&255)<<16|(e[t+2]&255)<<8|e[t+3]&255}};ot.UTF_32BE=su;var iu=class extends Eo{name(){return"UTF-32LE"}getChar(e,t){return(e[t+3]&255)<<24|(e[t+2]&255)<<16|(e[t+1]&255)<<8|e[t+0]&255}};ot.UTF_32LE=iu});var cm=D(Ve=>{"use strict";var aD=Ve&&Ve.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.gb_18030=Ve.euc_kr=Ve.euc_jp=Ve.big5=Ve.sjis=void 0;var cD=aD(es());function lD(r,e){let t=(s,i,n,o)=>{if(o<n)return-1;let a=Math.floor(n+o>>>1);return i>s[a]?t(s,i,a+1,o):i<s[a]?t(s,i,n,a-1):a};return t(r,e,0,r.length-1)}var ou=class{constructor(){this.charValue=0,this.index=0,this.nextIndex=0,this.error=!1,this.done=!1}reset(){this.charValue=0,this.index=-1,this.nextIndex=0,this.error=!1,this.done=!1}nextByte(e){return this.nextIndex>=e.rawLen?(this.done=!0,-1):e.rawInput[this.nextIndex++]&255}},ts=class{constructor(){this.commonChars=[]}name(){return"mbcs"}match(e){let t=0,s=0,i=0,n=0,o=0,a=new ou;e:{for(a.reset();this.nextChar(a,e);){if(n++,a.error)i++;else{let c=a.charValue&4294967295;c>255&&(t++,this.commonChars!=null&&lD(this.commonChars,c)>=0&&s++)}if(i>=2&&i*5>=t)break e}if(t<=10&&i==0){t==0&&n<10?o=0:o=10;break e}if(t<20*i){o=0;break e}if(this.commonChars==null)o=30+t-20*i,o>100&&(o=100);else{let l=90/Math.log(t/4);o=Math.floor(Math.log(s+1)*l+10),o=Math.min(o,100)}}return o==0?null:(0,cD.default)(e,this,o)}nextChar(e,t){return!0}},au=class extends ts{constructor(){super(...arguments),this.commonChars=[33088,33089,33090,33093,33115,33129,33130,33141,33142,33440,33442,33444,33449,33450,33451,33453,33455,33457,33459,33461,33463,33469,33470,33473,33476,33477,33478,33480,33481,33484,33485,33500,33504,33511,33512,33513,33514,33520,33521,33601,33603,33614,33615,33624,33630,33634,33639,33653,33654,33673,33674,33675,33677,33683,36502,37882,38314]}name(){return"Shift_JIS"}language(){return"ja"}nextChar(e,t){e.index=e.nextIndex,e.error=!1;let s=e.charValue=e.nextByte(t);if(s<0)return!1;if(s<=127||s>160&&s<=223)return!0;let i=e.nextByte(t);return i<0?!1:(e.charValue=s<<8|i,i>=64&&i<=127||i>=128&&i<=255||(e.error=!0),!0)}};Ve.sjis=au;var cu=class extends ts{constructor(){super(...arguments),this.commonChars=[41280,41281,41282,41283,41287,41289,41333,41334,42048,42054,42055,42056,42065,42068,42071,42084,42090,42092,42103,42147,42148,42151,42177,42190,42193,42207,42216,42237,42304,42312,42328,42345,42445,42471,42583,42593,42594,42600,42608,42664,42675,42681,42707,42715,42726,42738,42816,42833,42841,42970,43171,43173,43181,43217,43219,43236,43260,43456,43474,43507,43627,43706,43710,43724,43772,44103,44111,44208,44242,44377,44745,45024,45290,45423,45747,45764,45935,46156,46158,46412,46501,46525,46544,46552,46705,47085,47207,47428,47832,47940,48033,48593,49860,50105,50240,50271]}name(){return"Big5"}language(){return"zh"}nextChar(e,t){e.index=e.nextIndex,e.error=!1;let s=e.charValue=e.nextByte(t);if(s<0)return!1;if(s<=127||s==255)return!0;let i=e.nextByte(t);return i<0?!1:(e.charValue=e.charValue<<8|i,(i<64||i==127||i==255)&&(e.error=!0),!0)}};Ve.big5=cu;function am(r,e){r.index=r.nextIndex,r.error=!1;let t=0,s=0,i=0;e:{if(t=r.charValue=r.nextByte(e),t<0){r.done=!0;break e}if(t<=141)break e;if(s=r.nextByte(e),r.charValue=r.charValue<<8|s,t>=161&&t<=254){s<161&&(r.error=!0);break e}if(t==142){s<161&&(r.error=!0);break e}t==143&&(i=r.nextByte(e),r.charValue=r.charValue<<8|i,i<161&&(r.error=!0))}return r.done==!1}var lu=class extends ts{constructor(){super(...arguments),this.commonChars=[41377,41378,41379,41382,41404,41418,41419,41430,41431,42146,42148,42150,42152,42154,42155,42156,42157,42159,42161,42163,42165,42167,42169,42171,42173,42175,42176,42177,42179,42180,42182,42183,42184,42185,42186,42187,42190,42191,42192,42206,42207,42209,42210,42212,42216,42217,42218,42219,42220,42223,42226,42227,42402,42403,42404,42406,42407,42410,42413,42415,42416,42419,42421,42423,42424,42425,42431,42435,42438,42439,42440,42441,42443,42448,42453,42454,42455,42462,42464,42465,42469,42473,42474,42475,42476,42477,42483,47273,47572,47854,48072,48880,49079,50410,50940,51133,51896,51955,52188,52689],this.nextChar=am}name(){return"EUC-JP"}language(){return"ja"}};Ve.euc_jp=lu;var uu=class extends ts{constructor(){super(...arguments),this.commonChars=[45217,45235,45253,45261,45268,45286,45293,45304,45306,45308,45496,45497,45511,45527,45538,45994,46011,46274,46287,46297,46315,46501,46517,46527,46535,46569,46835,47023,47042,47054,47270,47278,47286,47288,47291,47337,47531,47534,47564,47566,47613,47800,47822,47824,47857,48103,48115,48125,48301,48314,48338,48374,48570,48576,48579,48581,48838,48840,48863,48878,48888,48890,49057,49065,49088,49124,49131,49132,49144,49319,49327,49336,49338,49339,49341,49351,49356,49358,49359,49366,49370,49381,49403,49404,49572,49574,49590,49622,49631,49654,49656,50337,50637,50862,51151,51153,51154,51160,51173,51373],this.nextChar=am}name(){return"EUC-KR"}language(){return"ko"}};Ve.euc_kr=uu;var hu=class extends ts{constructor(){super(...arguments),this.commonChars=[41377,41378,41379,41380,41392,41393,41457,41459,41889,41900,41914,45480,45496,45502,45755,46025,46070,46323,46525,46532,46563,46767,46804,46816,47010,47016,47037,47062,47069,47284,47327,47350,47531,47561,47576,47610,47613,47821,48039,48086,48097,48122,48316,48347,48382,48588,48845,48861,49076,49094,49097,49332,49389,49611,49883,50119,50396,50410,50636,50935,51192,51371,51403,51413,51431,51663,51706,51889,51893,51911,51920,51926,51957,51965,52460,52728,52906,52932,52946,52965,53173,53186,53206,53442,53445,53456,53460,53671,53930,53938,53941,53947,53972,54211,54224,54269,54466,54490,54754,54992]}name(){return"GB18030"}language(){return"zh"}nextChar(e,t){e.index=e.nextIndex,e.error=!1;let s=0,i=0,n=0,o=0;e:{if(s=e.charValue=e.nextByte(t),s<0){e.done=!0;break e}if(s<=128)break e;if(i=e.nextByte(t),e.charValue=e.charValue<<8|i,s>=129&&s<=254){if(i>=64&&i<=126||i>=80&&i<=254)break e;if(i>=48&&i<=57&&(n=e.nextByte(t),n>=129&&n<=254&&(o=e.nextByte(t),o>=48&&o<=57))){e.charValue=e.charValue<<16|n<<8|o;break e}e.error=!0;break e}}return e.done==!1}};Ve.gb_18030=hu});var um=D(re=>{"use strict";var uD=re&&re.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(re,"__esModule",{value:!0});re.KOI8_R=re.windows_1256=re.windows_1251=re.ISO_8859_9=re.ISO_8859_8=re.ISO_8859_7=re.ISO_8859_6=re.ISO_8859_5=re.ISO_8859_2=re.ISO_8859_1=void 0;var lm=uD(es()),hD=16777215,ko=class{constructor(e,t){this.byteIndex=0,this.ngram=0,this.ngramCount=0,this.hitCount=0,this.spaceChar=32,this.ngramList=e,this.byteMap=t}search(e,t){let s=0;return e[s+32]<=t&&(s+=32),e[s+16]<=t&&(s+=16),e[s+8]<=t&&(s+=8),e[s+4]<=t&&(s+=4),e[s+2]<=t&&(s+=2),e[s+1]<=t&&(s+=1),e[s]>t&&(s-=1),s<0||e[s]!=t?-1:s}lookup(e){this.ngramCount+=1,this.search(this.ngramList,e)>=0&&(this.hitCount+=1)}addByte(e){this.ngram=(this.ngram<<8)+(e&255)&hD,this.lookup(this.ngram)}nextByte(e){return this.byteIndex>=e.inputLen?-1:e.inputBytes[this.byteIndex++]&255}parse(e,t){let s,i=!1;for(this.spaceChar=t;(s=this.nextByte(e))>=0;){let o=this.byteMap[s];o!=0&&(o==this.spaceChar&&i||this.addByte(o),i=o==this.spaceChar)}this.addByte(this.spaceChar);let n=this.hitCount/this.ngramCount;return n>.33?98:Math.floor(n*300)}},xe=class{constructor(e,t){this.fLang=e,this.fNGrams=t}},fD=r=>Array.isArray(r)&&isFinite(r[0]),at=class{constructor(){this.spaceChar=32,this.nGramLang=void 0}ngrams(){return[]}byteMap(){return[]}name(e){return"sbcs"}language(){return this.nGramLang}match(e){this.nGramLang=void 0;let t=this.ngrams();if(fD(t)){let n=new ko(t,this.byteMap()).parse(e,this.spaceChar);return n<=0?null:(0,lm.default)(e,this,n)}let s=-1;for(let i=t.length-1;i>=0;i--){let n=t[i],a=new ko(n.fNGrams,this.byteMap()).parse(e,this.spaceChar);a>s&&(s=a,this.nGramLang=n.fLang)}return s<=0?null:(0,lm.default)(e,this,s)}},fu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,170,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,186,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,255]}ngrams(){return[new xe("da",[2122086,2122100,2122853,2123118,2123122,2123375,2123873,2124064,2125157,2125671,2126053,2126697,2126708,2126953,2127465,6383136,6385184,6385252,6386208,6386720,6579488,6579566,6579570,6579572,6627443,6644768,6644837,6647328,6647396,6648352,6648421,6648608,6648864,6713202,6776096,6776174,6776178,6907749,6908960,6909543,7038240,7039845,7103858,7104871,7105637,7169380,7234661,7234848,7235360,7235429,7300896,7302432,7303712,7398688,7479396,7479397,7479411,7496992,7566437,7610483,7628064,7628146,7629164,7759218]),new xe("de",[2122094,2122101,2122341,2122849,2122853,2122857,2123113,2123621,2123873,2124142,2125161,2126691,2126693,2127214,2127461,2127471,2127717,2128501,6448498,6514720,6514789,6514804,6578547,6579566,6579570,6580581,6627428,6627443,6646126,6646132,6647328,6648352,6648608,6776174,6841710,6845472,6906728,6907168,6909472,6909541,6911008,7104867,7105637,7217249,7217252,7217267,7234592,7234661,7234848,7235360,7235429,7238757,7479396,7496805,7497065,7562088,7566437,7610468,7628064,7628142,7628146,7695972,7695975,7759218]),new xe("en",[2122016,2122094,2122341,2122607,2123375,2123873,2123877,2124142,2125153,2125670,2125938,2126437,2126689,2126708,2126952,2126959,2127720,6383972,6384672,6385184,6385252,6386464,6386720,6386789,6386793,6561889,6561908,6627425,6627443,6627444,6644768,6647412,6648352,6648608,6713202,6840692,6841632,6841714,6906912,6909472,6909543,6909806,6910752,7217249,7217268,7234592,7235360,7238688,7300640,7302688,7303712,7496992,7500576,7544929,7544948,7561577,7566368,7610484,7628146,7628897,7628901,7629167,7630624,7631648]),new xe("es",[2122016,2122593,2122607,2122853,2123116,2123118,2123123,2124142,2124897,2124911,2125921,2125935,2125938,2126197,2126437,2126693,2127214,2128160,6365283,6365284,6365285,6365292,6365296,6382441,6382703,6384672,6386208,6386464,6515187,6516590,6579488,6579564,6582048,6627428,6627429,6627436,6646816,6647328,6647412,6648608,6648692,6907246,6943598,7102752,7106419,7217253,7238757,7282788,7282789,7302688,7303712,7303968,7364978,7435621,7495968,7497075,7544932,7544933,7544944,7562528,7628064,7630624,7693600,15953440]),new xe("fr",[2122101,2122607,2122849,2122853,2122869,2123118,2123124,2124897,2124901,2125921,2125935,2125938,2126197,2126693,2126703,2127214,2154528,6385268,6386793,6513952,6516590,6579488,6579571,6583584,6627425,6627427,6627428,6627429,6627436,6627440,6627443,6647328,6647412,6648352,6648608,6648864,6649202,6909806,6910752,6911008,7102752,7103776,7103859,7169390,7217252,7234848,7238432,7238688,7302688,7302772,7304562,7435621,7479404,7496992,7544929,7544932,7544933,7544940,7544944,7610468,7628064,7629167,7693600,7696928]),new xe("it",[2122092,2122600,2122607,2122853,2122857,2123040,2124140,2124142,2124897,2125925,2125938,2127214,6365283,6365284,6365296,6365299,6386799,6514789,6516590,6579564,6580512,6627425,6627427,6627428,6627433,6627436,6627440,6627443,6646816,6646892,6647412,6648352,6841632,6889569,6889571,6889572,6889587,6906144,6908960,6909472,6909806,7102752,7103776,7104800,7105633,7234848,7235872,7237408,7238757,7282785,7282788,7282793,7282803,7302688,7302757,7366002,7495968,7496992,7563552,7627040,7628064,7629088,7630624,8022383]),new xe("nl",[2122092,2122341,2122849,2122853,2122857,2123109,2123118,2123621,2123877,2124142,2125153,2125157,2125680,2126949,2127457,2127461,2127471,2127717,2128489,6381934,6381938,6385184,6385252,6386208,6386720,6514804,6579488,6579566,6579570,6627426,6627446,6645102,6645106,6647328,6648352,6648435,6648864,6776174,6841716,6907168,6909472,6909543,6910752,7217250,7217252,7217253,7217256,7217263,7217270,7234661,7235360,7302756,7303026,7303200,7303712,7562088,7566437,7610468,7628064,7628142,7628146,7758190,7759218,7761775]),new xe("no",[2122100,2122102,2122853,2123118,2123122,2123375,2123873,2124064,2125157,2125671,2126053,2126693,2126699,2126703,2126708,2126953,2127465,2155808,6385252,6386208,6386720,6579488,6579566,6579572,6627443,6644768,6647328,6647397,6648352,6648421,6648864,6648948,6713202,6776174,6908779,6908960,6909543,7038240,7039845,7103776,7105637,7169380,7169390,7217267,7234848,7235360,7235429,7237221,7300896,7302432,7303712,7398688,7479411,7496992,7565165,7566437,7610483,7628064,7628142,7628146,7629164,7631904,7631973,7759218]),new xe("pt",[2122016,2122607,2122849,2122853,2122863,2123040,2123123,2125153,2125423,2125600,2125921,2125935,2125938,2126197,2126437,2126693,2127213,6365281,6365283,6365284,6365296,6382693,6382703,6384672,6386208,6386273,6386464,6516589,6516590,6578464,6579488,6582048,6582131,6627425,6627428,6647072,6647412,6648608,6648692,6906144,6906721,7169390,7238757,7238767,7282785,7282787,7282788,7282789,7282800,7303968,7364978,7435621,7495968,7497075,7544929,7544932,7544933,7544944,7566433,7628064,7630624,7693600,14905120,15197039]),new xe("sv",[2122100,2122102,2122853,2123118,2123510,2123873,2124064,2124142,2124655,2125157,2125667,2126053,2126699,2126703,2126708,2126953,2127457,2127465,2155634,6382693,6385184,6385252,6386208,6386804,6514720,6579488,6579566,6579570,6579572,6644768,6647328,6648352,6648864,6747762,6776174,6909036,6909543,7037216,7105568,7169380,7217267,7233824,7234661,7235360,7235429,7235950,7299944,7302432,7302688,7398688,7479393,7479411,7495968,7564129,7565165,7610483,7627040,7628064,7628146,7629164,7631904,7758194,14971424,16151072])]}name(e){return e&&e.c1Bytes?"windows-1252":"ISO-8859-1"}};re.ISO_8859_1=fu;var du=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,177,32,179,32,181,182,32,32,185,186,187,188,32,190,191,32,177,32,179,32,181,182,183,32,185,186,187,188,32,190,191,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,32]}ngrams(){return[new xe("cs",[2122016,2122361,2122863,2124389,2125409,2125413,2125600,2125668,2125935,2125938,2126072,2126447,2126693,2126703,2126708,2126959,2127392,2127481,2128481,6365296,6513952,6514720,6627440,6627443,6627446,6647072,6647533,6844192,6844260,6910836,6972704,7042149,7103776,7104800,7233824,7268640,7269408,7269664,7282800,7300206,7301737,7304052,7304480,7304801,7368548,7368554,7369327,7403621,7562528,7565173,7566433,7566441,7566446,7628146,7630573,7630624,7676016,12477728,14773997,15296623,15540336,15540339,15559968,16278884]),new xe("hu",[2122016,2122106,2122341,2123111,2123116,2123365,2123873,2123887,2124147,2124645,2124649,2124790,2124901,2125153,2125157,2125161,2125413,2126714,2126949,2156915,6365281,6365291,6365293,6365299,6384416,6385184,6388256,6447470,6448494,6645625,6646560,6646816,6646885,6647072,6647328,6648421,6648864,6648933,6648948,6781216,6844263,6909556,6910752,7020641,7075450,7169383,7170414,7217249,7233899,7234923,7234925,7238688,7300985,7544929,7567973,7567988,7568097,7596391,7610465,7631904,7659891,8021362,14773792,15299360]),new xe("pl",[2122618,2122863,2124064,2124389,2124655,2125153,2125161,2125409,2125417,2125668,2125935,2125938,2126697,2127648,2127721,2127737,2128416,2128481,6365296,6365303,6385257,6514720,6519397,6519417,6582048,6584937,6627440,6627443,6627447,6627450,6645615,6646304,6647072,6647401,6778656,6906144,6907168,6907242,7037216,7039264,7039333,7170405,7233824,7235937,7235941,7282800,7305057,7305065,7368556,7369313,7369327,7369338,7502437,7502457,7563754,7564137,7566433,7825765,7955304,7957792,8021280,8022373,8026400,15955744]),new xe("ro",[2122016,2122083,2122593,2122597,2122607,2122613,2122853,2122857,2124897,2125153,2125925,2125938,2126693,2126819,2127214,2144873,2158190,6365283,6365284,6386277,6386720,6386789,6386976,6513010,6516590,6518048,6546208,6579488,6627425,6627427,6627428,6627440,6627443,6644e3,6646048,6646885,6647412,6648692,6889569,6889571,6889572,6889584,6907168,6908192,6909472,7102752,7103776,7106418,7107945,7234848,7238770,7303712,7365998,7496992,7497057,7501088,7594784,7628064,7631477,7660320,7694624,7695392,12216608,15625760])]}name(e){return e&&e.c1Bytes?"windows-1250":"ISO-8859-2"}};re.ISO_8859_2=du;var pu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,241,242,243,244,245,246,247,248,249,250,251,252,32,254,255,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,32,241,242,243,244,245,246,247,248,249,250,251,252,32,254,255]}ngrams(){return[2150944,2151134,2151646,2152400,2152480,2153168,2153182,2153936,2153941,2154193,2154462,2154464,2154704,2154974,2154978,2155230,2156514,2158050,13688280,13689580,13884960,14015468,14015960,14016994,14017056,14164191,14210336,14211104,14216992,14407133,14407712,14413021,14536736,14538016,14538965,14538991,14540320,14540498,14557394,14557407,14557409,14602784,14602960,14603230,14604576,14605292,14605344,14606818,14671579,14672085,14672088,14672094,14733522,14734804,14803664,14803666,14803672,14806816,14865883,14868e3,14868192,14871584,15196894,15459616]}name(){return"ISO-8859-5"}language(){return"ru"}};re.ISO_8859_5=pu;var mu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32]}ngrams(){return[2148324,2148326,2148551,2152932,2154986,2155748,2156006,2156743,13050055,13091104,13093408,13095200,13100064,13100227,13100231,13100232,13100234,13100236,13100237,13100239,13100243,13100249,13100258,13100261,13100264,13100266,13100320,13100576,13100746,13115591,13181127,13181153,13181156,13181157,13181160,13246663,13574343,13617440,13705415,13748512,13836487,14229703,14279913,14805536,14950599,14993696,15001888,15002144,15016135,15058720,15059232,15066656,15081671,15147207,15189792,15255524,15263264,15278279,15343815,15343845,15343848,15386912,15388960,15394336]}name(){return"ISO-8859-6"}language(){return"ar"}};re.ISO_8859_6=mu;var xu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,161,162,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,220,32,221,222,223,32,252,32,253,254,192,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,32,243,244,245,246,247,248,249,250,251,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,32]}ngrams(){return[2154989,2154992,2155497,2155753,2156016,2156320,2157281,2157797,2158049,2158368,2158817,2158831,2158833,2159604,2159605,2159847,2159855,14672160,14754017,14754036,14805280,14806304,14807292,14807584,14936545,15067424,15069728,15147252,15199520,15200800,15278324,15327520,15330014,15331872,15393257,15393268,15525152,15540449,15540453,15540464,15589664,15725088,15725856,15790069,15790575,15793184,15868129,15868133,15868138,15868144,15868148,15983904,15984416,15987951,16048416,16048617,16050157,16050162,16050666,16052e3,16052213,16054765,16379168,16706848]}name(e){return e&&e.c1Bytes?"windows-1253":"ISO-8859-7"}language(){return"el"}};re.ISO_8859_7=xu;var gu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,32,32,32,32,32]}ngrams(){return[new xe("he",[2154725,2154727,2154729,2154746,2154985,2154990,2155744,2155749,2155753,2155758,2155762,2155769,2155770,2157792,2157796,2158304,2159340,2161132,14744096,14950624,14950625,14950628,14950636,14950638,14950649,15001056,15065120,15068448,15068960,15071264,15071776,15278308,15328288,15328762,15329773,15330592,15331104,15333408,15333920,15474912,15474916,15523872,15524896,15540448,15540449,15540452,15540460,15540462,15540473,15655968,15671524,15787040,15788320,15788525,15920160,16261348,16312813,16378912,16392416,16392417,16392420,16392428,16392430,16392441]),new xe("he",[2154725,2154732,2155753,2155756,2155758,2155760,2157040,2157810,2157817,2158053,2158057,2158565,2158569,2160869,2160873,2161376,2161381,2161385,14688484,14688492,14688493,14688506,14738464,14738916,14740512,14741024,14754020,14754029,14754042,14950628,14950633,14950636,14950637,14950639,14950648,14950650,15002656,15065120,15066144,15196192,15327264,15327520,15328288,15474916,15474925,15474938,15528480,15530272,15591913,15591920,15591928,15605988,15605997,15606010,15655200,15655968,15918112,16326884,16326893,16326906,16376864,16441376,16442400,16442857])]}name(e){return e&&e.c1Bytes?"windows-1255":"ISO-8859-8"}language(){return"he"}};re.ISO_8859_8=gu;var bu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,170,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,186,32,32,32,32,32,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,105,254,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,32,248,249,250,251,252,253,254,255]}ngrams(){return[2122337,2122345,2122357,2122849,2122853,2123621,2123873,2124140,2124641,2124655,2125153,2125676,2126689,2126945,2127461,2128225,6365282,6384416,6384737,6384993,6385184,6385405,6386208,6386273,6386429,6386685,6388065,6449522,6578464,6579488,6580512,6627426,6627435,6644841,6647328,6648352,6648425,6648681,6909029,6909472,6909545,6910496,7102830,7102834,7103776,7103858,7217249,7217250,7217259,7234657,7234661,7234848,7235872,7235950,7273760,7498094,7535982,7759136,7954720,7958386,16608800,16608868,16609021,16642301]}name(e){return e&&e.c1Bytes?"windows-1254":"ISO-8859-9"}language(){return"tr"}};re.ISO_8859_9=bu;var yu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,144,131,32,131,32,32,32,32,32,32,154,32,156,157,158,159,144,32,32,32,32,32,32,32,32,32,154,32,156,157,158,159,32,162,162,188,32,180,32,32,184,32,186,32,32,32,32,191,32,32,179,179,180,181,32,32,184,32,186,32,188,190,190,191,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}ngrams(){return[2155040,2155246,2155758,2156512,2156576,2157280,2157294,2158048,2158053,2158305,2158574,2158576,2158816,2159086,2159090,2159342,2160626,2162162,14740968,14742268,14937632,15068156,15068648,15069682,15069728,15212783,15263008,15263776,15269664,15459821,15460384,15465709,15589408,15590688,15591653,15591679,15592992,15593186,15605986,15605999,15606001,15655456,15655648,15655918,15657248,15657980,15658016,15659506,15724267,15724773,15724776,15724782,15786210,15787492,15856352,15856354,15856360,15859488,15918571,15920672,15920880,15924256,16249582,16512288]}name(){return"windows-1251"}language(){return"ru"}};re.windows_1251=yu;var wu=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,129,32,131,32,32,32,32,136,32,138,32,156,141,142,143,144,32,32,32,32,32,32,32,152,32,154,32,156,32,32,159,32,32,32,32,32,32,32,32,32,32,170,32,32,32,32,32,32,32,32,32,32,181,32,32,32,32,32,32,32,32,32,32,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,32,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,32,32,32,32,244,32,32,32,32,249,32,251,252,32,32,255]}ngrams(){return[2148321,2148324,2148551,2153185,2153965,2154977,2155492,2156231,13050055,13091104,13093408,13095200,13099296,13099459,13099463,13099464,13099466,13099468,13099469,13099471,13099475,13099482,13099486,13099491,13099494,13099501,13099808,13100064,13100234,13115591,13181127,13181149,13181153,13181155,13181158,13246663,13574343,13617440,13705415,13748512,13836487,14295239,14344684,14544160,14753991,14797088,14806048,14806304,14885063,14927648,14928160,14935072,14950599,15016135,15058720,15124449,15131680,15474887,15540423,15540451,15540454,15583520,15585568,15590432]}name(){return"windows-1256"}language(){return"ar"}};re.windows_1256=wu;var Du=class extends at{byteMap(){return[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,0,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,163,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,163,32,32,32,32,32,32,32,32,32,32,32,32,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223]}ngrams(){return[2147535,2148640,2149313,2149327,2150081,2150085,2150338,2150607,2150610,2151105,2151375,2151380,2151631,2152224,2152399,2153153,2153684,2154196,12701385,12702936,12963032,12963529,12964820,12964896,13094688,13181136,13223200,13224224,13226272,13419982,13420832,13424846,13549856,13550880,13552069,13552081,13553440,13553623,13574352,13574355,13574359,13617103,13617696,13618392,13618464,13620180,13621024,13621185,13684684,13685445,13685449,13685455,13812183,13813188,13881632,13882561,13882569,13882583,13944268,13946656,13946834,13948960,14272544,14603471]}name(){return"KOI8-R"}language(){return"ru"}};re.KOI8_R=Du});var hm=D(Pt=>{"use strict";var dD=Pt&&Pt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pt,"__esModule",{value:!0});Pt.ISO_2022_CN=Pt.ISO_2022_KR=Pt.ISO_2022_JP=void 0;var pD=dD(es()),an=class{constructor(){this.escapeSequences=[]}name(){return"ISO_2022"}match(e){let t,s,i,n=0,o=0,a=0,c,l=e.inputBytes,u=e.inputLen;e:for(t=0;t<u;t++){if(l[t]==27){t:for(i=0;i<this.escapeSequences.length;i++){let h=this.escapeSequences[i];if(u-t<h.length)continue t;for(s=1;s<h.length;s++)if(h[s]!=l[t+s])continue t;n++,t+=h.length-1;continue e}o++}(l[t]==14||l[t]==15)&&a++}return n==0?null:(c=(100*n-100*o)/(n+o),n+a<5&&(c-=(5-(n+a))*10),c<=0?null:(0,pD.default)(e,this,c))}},vu=class extends an{constructor(){super(...arguments),this.escapeSequences=[[27,36,40,67],[27,36,40,68],[27,36,64],[27,36,65],[27,36,66],[27,38,64],[27,40,66],[27,40,72],[27,40,73],[27,40,74],[27,46,65],[27,46,70]]}name(){return"ISO-2022-JP"}language(){return"ja"}};Pt.ISO_2022_JP=vu;var Cu=class extends an{constructor(){super(...arguments),this.escapeSequences=[[27,36,41,67]]}name(){return"ISO-2022-KR"}language(){return"kr"}};Pt.ISO_2022_KR=Cu;var Eu=class extends an{constructor(){super(...arguments),this.escapeSequences=[[27,36,41,65],[27,36,41,71],[27,36,42,72],[27,36,41,69],[27,36,43,73],[27,36,43,74],[27,36,43,75],[27,36,43,76],[27,36,43,77],[27,78],[27,79]]}name(){return"ISO-2022-CN"}language(){return"zh"}};Pt.ISO_2022_CN=Eu});var fm=D(So=>{"use strict";Object.defineProperty(So,"__esModule",{value:!0});So.isByteArray=void 0;var mD=r=>r==null||typeof r!="object"?!1:isFinite(r.length)&&r.length>=0;So.isByteArray=mD});var pm=D(X=>{"use strict";var xD=X&&X.__createBinding||(Object.create?(function(r,e,t,s){s===void 0&&(s=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,s,i)}):(function(r,e,t,s){s===void 0&&(s=t),r[s]=e[t]})),gD=X&&X.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Ao=X&&X.__importStar||(function(){var r=function(e){return r=Object.getOwnPropertyNames||function(t){var s=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[s.length]=i);return s},r(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s=r(e),i=0;i<s.length;i++)s[i]!=="default"&&xD(t,e,s[i]);return gD(t,e),t}})(),Su=X&&X.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(X,"__esModule",{value:!0});X.detectFileSync=X.detectFile=X.analyse=X.detect=void 0;var dm=Su(rm()),bD=Su(im()),yD=Su(nm()),_o=Ao(om()),cn=Ao(cm()),Rt=Ao(um()),ku=Ao(hm()),wD=fm(),DD=[new yD.default,new _o.UTF_16BE,new _o.UTF_16LE,new _o.UTF_32BE,new _o.UTF_32LE,new cn.sjis,new cn.big5,new cn.euc_jp,new cn.euc_kr,new cn.gb_18030,new ku.ISO_2022_JP,new ku.ISO_2022_KR,new ku.ISO_2022_CN,new Rt.ISO_8859_1,new Rt.ISO_8859_2,new Rt.ISO_8859_5,new Rt.ISO_8859_6,new Rt.ISO_8859_7,new Rt.ISO_8859_8,new Rt.ISO_8859_9,new Rt.windows_1251,new Rt.windows_1256,new Rt.KOI8_R,new bD.default],vD=r=>{let e=(0,X.analyse)(r);return e.length>0?e[0].name:null};X.detect=vD;var CD=r=>{if(!(0,wD.isByteArray)(r))throw new Error("Input must be a byte array, e.g. Buffer or Uint8Array");let e=[];for(let n=0;n<256;n++)e[n]=0;for(let n=r.length-1;n>=0;n--)e[r[n]&255]++;let t=!1;for(let n=128;n<=159;n+=1)if(e[n]!==0){t=!0;break}let s={byteStats:e,c1Bytes:t,rawInput:r,rawLen:r.length,inputBytes:r,inputLen:r.length};return DD.map(n=>n.match(s)).filter(n=>!!n).sort((n,o)=>o.confidence-n.confidence)};X.analyse=CD;var ED=(r,e={})=>new Promise((t,s)=>{let i,n=(0,dm.default)(),o=(c,l)=>{i&&n.closeSync(i),c?s(c):l?t((0,X.detect)(l)):s(new Error("No error and no buffer received"))},a=e?.sampleSize||0;if(a>0){i=n.openSync(r,"r");let c=Buffer.allocUnsafe(a);n.read(i,c,0,a,e.offset,(l,u)=>{l?o(l,null):(u<a&&(c=c.subarray(0,u)),o(null,c))});return}n.readFile(r,o)});X.detectFile=ED;var kD=(r,e={})=>{let t=(0,dm.default)();if(e&&e.sampleSize){let s=t.openSync(r,"r"),i=Buffer.allocUnsafe(e.sampleSize),n=t.readSync(s,i,0,e.sampleSize,e.offset);return n<e.sampleSize&&(i=i.subarray(0,n)),t.closeSync(s),(0,X.detect)(i)}return(0,X.detect)(t.readFileSync(r))};X.detectFileSync=kD;X.default={analyse:X.analyse,detect:X.detect,detectFileSync:X.detectFileSync,detectFile:X.detectFile}});var Qt=D((P9,mm)=>{"use strict";var To=require("buffer"),Gs=To.Buffer,ct={},lt;for(lt in To)To.hasOwnProperty(lt)&&(lt==="SlowBuffer"||lt==="Buffer"||(ct[lt]=To[lt]));var zs=ct.Buffer={};for(lt in Gs)Gs.hasOwnProperty(lt)&&(lt==="allocUnsafe"||lt==="allocUnsafeSlow"||(zs[lt]=Gs[lt]));ct.Buffer.prototype=Gs.prototype;(!zs.from||zs.from===Uint8Array.from)&&(zs.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return Gs(r,e,t)});zs.alloc||(zs.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var s=Gs(r);return!e||e.length===0?s.fill(0):typeof t=="string"?s.fill(e,t):s.fill(e),s});if(!ct.kStringMaxLength)try{ct.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}ct.constants||(ct.constants={MAX_LENGTH:ct.kMaxLength},ct.kStringMaxLength&&(ct.constants.MAX_STRING_LENGTH=ct.kStringMaxLength));mm.exports=ct});var gm=D(Tu=>{"use strict";var xm="\uFEFF";Tu.PrependBOM=_u;function _u(r,e){this.encoder=r,this.addBOM=!0}_u.prototype.write=function(r){return this.addBOM&&(r=xm+r,this.addBOM=!1),this.encoder.write(r)};_u.prototype.end=function(){return this.encoder.end()};Tu.StripBOM=Au;function Au(r,e){this.decoder=r,this.pass=!1,this.options=e||{}}Au.prototype.write=function(r){var e=this.decoder.write(r);return this.pass||!e||(e[0]===xm&&(e=e.slice(1),typeof this.options.stripBOM=="function"&&this.options.stripBOM()),this.pass=!0),e};Au.prototype.end=function(){return this.decoder.end()}});var Fu=D((M9,bm)=>{"use strict";var SD=typeof Object.hasOwn>"u"?Function.call.bind(Object.prototype.hasOwnProperty):Object.hasOwn;function _D(r,e){for(var t in e)SD(e,t)&&(r[t]=e[t])}bm.exports=_D});var wm=D(($9,ym)=>{"use strict";var er=Qt().Buffer;ym.exports={utf8:{type:"_internal",bomAware:!0},cesu8:{type:"_internal",bomAware:!0},unicode11utf8:"utf8",ucs2:{type:"_internal",bomAware:!0},utf16le:"ucs2",binary:{type:"_internal"},base64:{type:"_internal"},hex:{type:"_internal"},_internal:Ou};function Ou(r,e){this.enc=r.encodingName,this.bomAware=r.bomAware,this.enc==="base64"?this.encoder=Pu:this.enc==="utf8"?this.encoder=$u:this.enc==="cesu8"&&(this.enc="utf8",this.encoder=Ru,er.from("eda0bdedb2a9","hex").toString()!=="\u{1F4A9}"&&(this.decoder=Mu,this.defaultCharUnicode=e.defaultCharUnicode))}Ou.prototype.encoder=Bu;Ou.prototype.decoder=Iu;var AD=require("string_decoder").StringDecoder;function Iu(r,e){this.decoder=new AD(e.enc)}Iu.prototype.write=function(r){return er.isBuffer(r)||(r=er.from(r)),this.decoder.write(r)};Iu.prototype.end=function(){return this.decoder.end()};function Bu(r,e){this.enc=e.enc}Bu.prototype.write=function(r){return er.from(r,this.enc)};Bu.prototype.end=function(){};function Pu(r,e){this.prevStr=""}Pu.prototype.write=function(r){r=this.prevStr+r;var e=r.length-r.length%4;return this.prevStr=r.slice(e),r=r.slice(0,e),er.from(r,"base64")};Pu.prototype.end=function(){return er.from(this.prevStr,"base64")};function Ru(r,e){}Ru.prototype.write=function(r){for(var e=er.alloc(r.length*3),t=0,s=0;s<r.length;s++){var i=r.charCodeAt(s);i<128?e[t++]=i:i<2048?(e[t++]=192+(i>>>6),e[t++]=128+(i&63)):(e[t++]=224+(i>>>12),e[t++]=128+(i>>>6&63),e[t++]=128+(i&63))}return e.slice(0,t)};Ru.prototype.end=function(){};function Mu(r,e){this.acc=0,this.contBytes=0,this.accBytes=0,this.defaultCharUnicode=e.defaultCharUnicode}Mu.prototype.write=function(r){for(var e=this.acc,t=this.contBytes,s=this.accBytes,i="",n=0;n<r.length;n++){var o=r[n];(o&192)!==128?(t>0&&(i+=this.defaultCharUnicode,t=0),o<128?i+=String.fromCharCode(o):o<224?(e=o&31,t=1,s=1):o<240?(e=o&15,t=2,s=1):i+=this.defaultCharUnicode):t>0?(e=e<<6|o&63,t--,s++,t===0&&(s===2&&e<128&&e>0?i+=this.defaultCharUnicode:s===3&&e<2048?i+=this.defaultCharUnicode:i+=String.fromCharCode(e))):i+=this.defaultCharUnicode}return this.acc=e,this.contBytes=t,this.accBytes=s,i};Mu.prototype.end=function(){var r=0;return this.contBytes>0&&(r+=this.defaultCharUnicode),r};function $u(r,e){this.highSurrogate=""}$u.prototype.write=function(r){if(this.highSurrogate&&(r=this.highSurrogate+r,this.highSurrogate=""),r.length>0){var e=r.charCodeAt(r.length-1);e>=55296&&e<56320&&(this.highSurrogate=r[r.length-1],r=r.slice(0,r.length-1))}return er.from(r,this.enc)};$u.prototype.end=function(){if(this.highSurrogate){var r=this.highSurrogate;return this.highSurrogate="",er.from(r,this.enc)}}});var Cm=D(yr=>{"use strict";var Fo=Qt().Buffer;yr._utf32=ju;function ju(r,e){this.iconv=e,this.bomAware=!0,this.isLE=r.isLE}yr.utf32le={type:"_utf32",isLE:!0};yr.utf32be={type:"_utf32",isLE:!1};yr.ucs4le="utf32le";yr.ucs4be="utf32be";ju.prototype.encoder=Nu;ju.prototype.decoder=Lu;function Nu(r,e){this.isLE=e.isLE,this.highSurrogate=0}Nu.prototype.write=function(r){for(var e=Fo.from(r,"ucs2"),t=Fo.alloc(e.length*2),s=this.isLE?t.writeUInt32LE:t.writeUInt32BE,i=0,n=0;n<e.length;n+=2){var o=e.readUInt16LE(n),a=o>=55296&&o<56320,c=o>=56320&&o<57344;if(this.highSurrogate)if(a||!c)s.call(t,this.highSurrogate,i),i+=4;else{var l=(this.highSurrogate-55296<<10|o-56320)+65536;s.call(t,l,i),i+=4,this.highSurrogate=0;continue}a?this.highSurrogate=o:(s.call(t,o,i),i+=4,this.highSurrogate=0)}return i<t.length&&(t=t.slice(0,i)),t};Nu.prototype.end=function(){if(this.highSurrogate){var r=Fo.alloc(4);return this.isLE?r.writeUInt32LE(this.highSurrogate,0):r.writeUInt32BE(this.highSurrogate,0),this.highSurrogate=0,r}};function Lu(r,e){this.isLE=e.isLE,this.badChar=e.iconv.defaultCharUnicode.charCodeAt(0),this.overflow=[]}Lu.prototype.write=function(r){if(r.length===0)return"";var e=0,t=0,s=Fo.alloc(r.length+4),i=0,n=this.isLE,o=this.overflow,a=this.badChar;if(o.length>0){for(;e<r.length&&o.length<4;e++)o.push(r[e]);o.length===4&&(n?t=o[e]|o[e+1]<<8|o[e+2]<<16|o[e+3]<<24:t=o[e+3]|o[e+2]<<8|o[e+1]<<16|o[e]<<24,o.length=0,i=Dm(s,i,t,a))}for(;e<r.length-3;e+=4)n?t=r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24:t=r[e+3]|r[e+2]<<8|r[e+1]<<16|r[e]<<24,i=Dm(s,i,t,a);for(;e<r.length;e++)o.push(r[e]);return s.slice(0,i).toString("ucs2")};function Dm(r,e,t,s){if((t<0||t>1114111)&&(t=s),t>=65536){t-=65536;var i=55296|t>>10;r[e++]=i&255,r[e++]=i>>8;var t=56320|t&1023}return r[e++]=t&255,r[e++]=t>>8,e}Lu.prototype.end=function(){this.overflow.length=0};yr.utf32=Uu;yr.ucs4="utf32";function Uu(r,e){this.iconv=e}Uu.prototype.encoder=Wu;Uu.prototype.decoder=qu;function Wu(r,e){r=r||{},r.addBOM===void 0&&(r.addBOM=!0),this.encoder=e.iconv.getEncoder(r.defaultEncoding||"utf-32le",r)}Wu.prototype.write=function(r){return this.encoder.write(r)};Wu.prototype.end=function(){return this.encoder.end()};function qu(r,e){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=r||{},this.iconv=e.iconv}qu.prototype.write=function(r){if(!this.decoder){if(this.initialBufs.push(r),this.initialBufsLen+=r.length,this.initialBufsLen<32)return"";var e=vm(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t="",s=0;s<this.initialBufs.length;s++)t+=this.decoder.write(this.initialBufs[s]);return this.initialBufs.length=this.initialBufsLen=0,t}return this.decoder.write(r)};qu.prototype.end=function(){if(!this.decoder){var r=vm(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(r,this.options);for(var e="",t=0;t<this.initialBufs.length;t++)e+=this.decoder.write(this.initialBufs[t]);var s=this.decoder.end();return s&&(e+=s),this.initialBufs.length=this.initialBufsLen=0,e}return this.decoder.end()};function vm(r,e){var t=[],s=0,i=0,n=0,o=0,a=0;e:for(var c=0;c<r.length;c++)for(var l=r[c],u=0;u<l.length;u++)if(t.push(l[u]),t.length===4){if(s===0){if(t[0]===255&&t[1]===254&&t[2]===0&&t[3]===0)return"utf-32le";if(t[0]===0&&t[1]===0&&t[2]===254&&t[3]===255)return"utf-32be"}if((t[0]!==0||t[1]>16)&&n++,(t[3]!==0||t[2]>16)&&i++,t[0]===0&&t[1]===0&&(t[2]!==0||t[3]!==0)&&a++,(t[0]!==0||t[1]!==0)&&t[2]===0&&t[3]===0&&o++,t.length=0,s++,s>=100)break e}return a-n>o-i?"utf-32be":a-n<o-i?"utf-32le":e||"utf-32le"}});var Sm=D(Zu=>{"use strict";var Em=Qt().Buffer;Zu.utf16be=Oo;function Oo(){}Oo.prototype.encoder=Vu;Oo.prototype.decoder=Hu;Oo.prototype.bomAware=!0;function Vu(){}Vu.prototype.write=function(r){for(var e=Em.from(r,"ucs2"),t=0;t<e.length;t+=2){var s=e[t];e[t]=e[t+1],e[t+1]=s}return e};Vu.prototype.end=function(){};function Hu(){this.overflowByte=-1}Hu.prototype.write=function(r){if(r.length==0)return"";var e=Em.alloc(r.length+1),t=0,s=0;for(this.overflowByte!==-1&&(e[0]=r[0],e[1]=this.overflowByte,t=1,s=2);t<r.length-1;t+=2,s+=2)e[s]=r[t+1],e[s+1]=r[t];return this.overflowByte=t==r.length-1?r[r.length-1]:-1,e.slice(0,s).toString("ucs2")};Hu.prototype.end=function(){this.overflowByte=-1};Zu.utf16=Gu;function Gu(r,e){this.iconv=e}Gu.prototype.encoder=zu;Gu.prototype.decoder=Ku;function zu(r,e){r=r||{},r.addBOM===void 0&&(r.addBOM=!0),this.encoder=e.iconv.getEncoder("utf-16le",r)}zu.prototype.write=function(r){return this.encoder.write(r)};zu.prototype.end=function(){return this.encoder.end()};function Ku(r,e){this.decoder=null,this.initialBufs=[],this.initialBufsLen=0,this.options=r||{},this.iconv=e.iconv}Ku.prototype.write=function(r){if(!this.decoder){if(this.initialBufs.push(r),this.initialBufsLen+=r.length,this.initialBufsLen<16)return"";var e=km(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(e,this.options);for(var t="",s=0;s<this.initialBufs.length;s++)t+=this.decoder.write(this.initialBufs[s]);return this.initialBufs.length=this.initialBufsLen=0,t}return this.decoder.write(r)};Ku.prototype.end=function(){if(!this.decoder){var r=km(this.initialBufs,this.options.defaultEncoding);this.decoder=this.iconv.getDecoder(r,this.options);for(var e="",t=0;t<this.initialBufs.length;t++)e+=this.decoder.write(this.initialBufs[t]);var s=this.decoder.end();return s&&(e+=s),this.initialBufs.length=this.initialBufsLen=0,e}return this.decoder.end()};function km(r,e){var t=[],s=0,i=0,n=0;e:for(var o=0;o<r.length;o++)for(var a=r[o],c=0;c<a.length;c++)if(t.push(a[c]),t.length===2){if(s===0){if(t[0]===255&&t[1]===254)return"utf-16le";if(t[0]===254&&t[1]===255)return"utf-16be"}if(t[0]===0&&t[1]!==0&&n++,t[0]!==0&&t[1]===0&&i++,t.length=0,s++,s>=100)break e}return n>i?"utf-16be":n<i?"utf-16le":e||"utf-16le"}});var Am=D(Po=>{"use strict";var Mt=Qt().Buffer;Po.utf7=Io;Po.unicode11utf7="utf7";function Io(r,e){this.iconv=e}Io.prototype.encoder=Ju;Io.prototype.decoder=Xu;Io.prototype.bomAware=!0;var TD=/[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;function Ju(r,e){this.iconv=e.iconv}Ju.prototype.write=function(r){return Mt.from(r.replace(TD,function(e){return"+"+(e==="+"?"":this.iconv.encode(e,"utf16-be").toString("base64").replace(/=+$/,""))+"-"}.bind(this)))};Ju.prototype.end=function(){};function Xu(r,e){this.iconv=e.iconv,this.inBase64=!1,this.base64Accum=""}var FD=/[A-Za-z0-9\/+]/,Qu=[];for(ln=0;ln<256;ln++)Qu[ln]=FD.test(String.fromCharCode(ln));var ln,OD=43,rs=45,Yu=38;Xu.prototype.write=function(r){for(var e="",t=0,s=this.inBase64,i=this.base64Accum,n=0;n<r.length;n++)if(!s)r[n]==OD&&(e+=this.iconv.decode(r.slice(t,n),"ascii"),t=n+1,s=!0);else if(!Qu[r[n]]){if(n==t&&r[n]==rs)e+="+";else{var o=i+this.iconv.decode(r.slice(t,n),"ascii");e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}r[n]!=rs&&n--,t=n+1,s=!1,i=""}if(!s)e+=this.iconv.decode(r.slice(t),"ascii");else{var o=i+this.iconv.decode(r.slice(t),"ascii"),a=o.length-o.length%8;i=o.slice(a),o=o.slice(0,a),e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}return this.inBase64=s,this.base64Accum=i,e};Xu.prototype.end=function(){var r="";return this.inBase64&&this.base64Accum.length>0&&(r=this.iconv.decode(Mt.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",r};Po.utf7imap=Bo;function Bo(r,e){this.iconv=e}Bo.prototype.encoder=e0;Bo.prototype.decoder=t0;Bo.prototype.bomAware=!0;function e0(r,e){this.iconv=e.iconv,this.inBase64=!1,this.base64Accum=Mt.alloc(6),this.base64AccumIdx=0}e0.prototype.write=function(r){for(var e=this.inBase64,t=this.base64Accum,s=this.base64AccumIdx,i=Mt.alloc(r.length*5+10),n=0,o=0;o<r.length;o++){var a=r.charCodeAt(o);a>=32&&a<=126?(e&&(s>0&&(n+=i.write(t.slice(0,s).toString("base64").replace(/\//g,",").replace(/=+$/,""),n),s=0),i[n++]=rs,e=!1),e||(i[n++]=a,a===Yu&&(i[n++]=rs))):(e||(i[n++]=Yu,e=!0),e&&(t[s++]=a>>8,t[s++]=a&255,s==t.length&&(n+=i.write(t.toString("base64").replace(/\//g,","),n),s=0)))}return this.inBase64=e,this.base64AccumIdx=s,i.slice(0,n)};e0.prototype.end=function(){var r=Mt.alloc(10),e=0;return this.inBase64&&(this.base64AccumIdx>0&&(e+=r.write(this.base64Accum.slice(0,this.base64AccumIdx).toString("base64").replace(/\//g,",").replace(/=+$/,""),e),this.base64AccumIdx=0),r[e++]=rs,this.inBase64=!1),r.slice(0,e)};function t0(r,e){this.iconv=e.iconv,this.inBase64=!1,this.base64Accum=""}var _m=Qu.slice();_m[44]=!0;t0.prototype.write=function(r){for(var e="",t=0,s=this.inBase64,i=this.base64Accum,n=0;n<r.length;n++)if(!s)r[n]==Yu&&(e+=this.iconv.decode(r.slice(t,n),"ascii"),t=n+1,s=!0);else if(!_m[r[n]]){if(n==t&&r[n]==rs)e+="&";else{var o=i+this.iconv.decode(r.slice(t,n),"ascii").replace(/,/g,"/");e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}r[n]!=rs&&n--,t=n+1,s=!1,i=""}if(!s)e+=this.iconv.decode(r.slice(t),"ascii");else{var o=i+this.iconv.decode(r.slice(t),"ascii").replace(/,/g,"/"),a=o.length-o.length%8;i=o.slice(a),o=o.slice(0,a),e+=this.iconv.decode(Mt.from(o,"base64"),"utf16-be")}return this.inBase64=s,this.base64Accum=i,e};t0.prototype.end=function(){var r="";return this.inBase64&&this.base64Accum.length>0&&(r=this.iconv.decode(Mt.from(this.base64Accum,"base64"),"utf16-be")),this.inBase64=!1,this.base64Accum="",r}});var Fm=D(Tm=>{"use strict";var Ro=Qt().Buffer;Tm._sbcs=r0;function r0(r,e){if(!r)throw new Error("SBCS codec is called without the data.");if(!r.chars||r.chars.length!==128&&r.chars.length!==256)throw new Error("Encoding '"+r.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(r.chars.length===128){for(var t="",s=0;s<128;s++)t+=String.fromCharCode(s);r.chars=t+r.chars}this.decodeBuf=Ro.from(r.chars,"ucs2");for(var i=Ro.alloc(65536,e.defaultCharSingleByte.charCodeAt(0)),s=0;s<r.chars.length;s++)i[r.chars.charCodeAt(s)]=s;this.encodeBuf=i}r0.prototype.encoder=s0;r0.prototype.decoder=i0;function s0(r,e){this.encodeBuf=e.encodeBuf}s0.prototype.write=function(r){for(var e=Ro.alloc(r.length),t=0;t<r.length;t++)e[t]=this.encodeBuf[r.charCodeAt(t)];return e};s0.prototype.end=function(){};function i0(r,e){this.decodeBuf=e.decodeBuf}i0.prototype.write=function(r){for(var e=this.decodeBuf,t=Ro.alloc(r.length*2),s=0,i=0,n=0;n<r.length;n++)s=r[n]*2,i=n*2,t[i]=e[s],t[i+1]=e[s+1];return t.toString("ucs2")};i0.prototype.end=function(){}});var Im=D((W9,Om)=>{"use strict";Om.exports={10029:"maccenteuro",maccenteuro:{type:"_sbcs",chars:"\xC4\u0100\u0101\xC9\u0104\xD6\xDC\xE1\u0105\u010C\xE4\u010D\u0106\u0107\xE9\u0179\u017A\u010E\xED\u010F\u0112\u0113\u0116\xF3\u0117\xF4\xF6\xF5\xFA\u011A\u011B\xFC\u2020\xB0\u0118\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\u0119\xA8\u2260\u0123\u012E\u012F\u012A\u2264\u2265\u012B\u0136\u2202\u2211\u0142\u013B\u013C\u013D\u013E\u0139\u013A\u0145\u0146\u0143\xAC\u221A\u0144\u0147\u2206\xAB\xBB\u2026\xA0\u0148\u0150\xD5\u0151\u014C\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\u014D\u0154\u0155\u0158\u2039\u203A\u0159\u0156\u0157\u0160\u201A\u201E\u0161\u015A\u015B\xC1\u0164\u0165\xCD\u017D\u017E\u016A\xD3\xD4\u016B\u016E\xDA\u016F\u0170\u0171\u0172\u0173\xDD\xFD\u0137\u017B\u0141\u017C\u0122\u02C7"},808:"cp808",ibm808:"cp808",cp808:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\u20AC\u25A0\xA0"},mik:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2514\u2534\u252C\u251C\u2500\u253C\u2563\u2551\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2510\u2591\u2592\u2593\u2502\u2524\u2116\xA7\u2557\u255D\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},cp720:{type:"_sbcs",chars:"\x80\x81\xE9\xE2\x84\xE0\x86\xE7\xEA\xEB\xE8\xEF\xEE\x8D\x8E\x8F\x90\u0651\u0652\xF4\xA4\u0640\xFB\xF9\u0621\u0622\u0623\u0624\xA3\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0636\u0637\u0638\u0639\u063A\u0641\xB5\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u2261\u064B\u064C\u064D\u064E\u064F\u0650\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ascii8bit:"ascii",usascii:"ascii",ansix34:"ascii",ansix341968:"ascii",ansix341986:"ascii",csascii:"ascii",cp367:"ascii",ibm367:"ascii",isoir6:"ascii",iso646us:"ascii",iso646irv:"ascii",us:"ascii",latin1:"iso88591",latin2:"iso88592",latin3:"iso88593",latin4:"iso88594",latin5:"iso88599",latin6:"iso885910",latin7:"iso885913",latin8:"iso885914",latin9:"iso885915",latin10:"iso885916",csisolatin1:"iso88591",csisolatin2:"iso88592",csisolatin3:"iso88593",csisolatin4:"iso88594",csisolatincyrillic:"iso88595",csisolatinarabic:"iso88596",csisolatingreek:"iso88597",csisolatinhebrew:"iso88598",csisolatin5:"iso88599",csisolatin6:"iso885910",l1:"iso88591",l2:"iso88592",l3:"iso88593",l4:"iso88594",l5:"iso88599",l6:"iso885910",l7:"iso885913",l8:"iso885914",l9:"iso885915",l10:"iso885916",isoir14:"iso646jp",isoir57:"iso646cn",isoir100:"iso88591",isoir101:"iso88592",isoir109:"iso88593",isoir110:"iso88594",isoir144:"iso88595",isoir127:"iso88596",isoir126:"iso88597",isoir138:"iso88598",isoir148:"iso88599",isoir157:"iso885910",isoir166:"tis620",isoir179:"iso885913",isoir199:"iso885914",isoir203:"iso885915",isoir226:"iso885916",cp819:"iso88591",ibm819:"iso88591",cyrillic:"iso88595",arabic:"iso88596",arabic8:"iso88596",ecma114:"iso88596",asmo708:"iso88596",greek:"iso88597",greek8:"iso88597",ecma118:"iso88597",elot928:"iso88597",hebrew:"iso88598",hebrew8:"iso88598",turkish:"iso88599",turkish8:"iso88599",thai:"iso885911",thai8:"iso885911",celtic:"iso885914",celtic8:"iso885914",isoceltic:"iso885914",tis6200:"tis620",tis62025291:"tis620",tis62025330:"tis620",1e4:"macroman",10006:"macgreek",10007:"maccyrillic",10079:"maciceland",10081:"macturkish",cspc8codepage437:"cp437",cspc775baltic:"cp775",cspc850multilingual:"cp850",cspcp852:"cp852",cspc862latinhebrew:"cp862",cpgr:"cp869",msee:"cp1250",mscyrl:"cp1251",msansi:"cp1252",msgreek:"cp1253",msturk:"cp1254",mshebr:"cp1255",msarab:"cp1256",winbaltrim:"cp1257",cp20866:"koi8r",20866:"koi8r",ibm878:"koi8r",cskoi8r:"koi8r",cp21866:"koi8u",21866:"koi8u",ibm1168:"koi8u",strk10482002:"rk1048",tcvn5712:"tcvn",tcvn57121:"tcvn",gb198880:"iso646cn",cn:"iso646cn",csiso14jisc6220ro:"iso646jp",jisc62201969ro:"iso646jp",jp:"iso646jp",cshproman8:"hproman8",r8:"hproman8",roman8:"hproman8",xroman8:"hproman8",ibm1051:"hproman8",mac:"macintosh",csmacintosh:"macintosh"}});var Pm=D((q9,Bm)=>{"use strict";Bm.exports={437:"cp437",737:"cp737",775:"cp775",850:"cp850",852:"cp852",855:"cp855",856:"cp856",857:"cp857",858:"cp858",860:"cp860",861:"cp861",862:"cp862",863:"cp863",864:"cp864",865:"cp865",866:"cp866",869:"cp869",874:"windows874",922:"cp922",1046:"cp1046",1124:"cp1124",1125:"cp1125",1129:"cp1129",1133:"cp1133",1161:"cp1161",1162:"cp1162",1163:"cp1163",1250:"windows1250",1251:"windows1251",1252:"windows1252",1253:"windows1253",1254:"windows1254",1255:"windows1255",1256:"windows1256",1257:"windows1257",1258:"windows1258",28591:"iso88591",28592:"iso88592",28593:"iso88593",28594:"iso88594",28595:"iso88595",28596:"iso88596",28597:"iso88597",28598:"iso88598",28599:"iso88599",28600:"iso885910",28601:"iso885911",28603:"iso885913",28604:"iso885914",28605:"iso885915",28606:"iso885916",windows874:{type:"_sbcs",chars:"\u20AC\uFFFD\uFFFD\uFFFD\uFFFD\u2026\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"},win874:"windows874",cp874:"windows874",windows1250:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\u0160\u2039\u015A\u0164\u017D\u0179\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0161\u203A\u015B\u0165\u017E\u017A\xA0\u02C7\u02D8\u0141\xA4\u0104\xA6\xA7\xA8\xA9\u015E\xAB\xAC\xAD\xAE\u017B\xB0\xB1\u02DB\u0142\xB4\xB5\xB6\xB7\xB8\u0105\u015F\xBB\u013D\u02DD\u013E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9"},win1250:"windows1250",cp1250:"windows1250",windows1251:{type:"_sbcs",chars:"\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u040C\u040B\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u045C\u045B\u045F\xA0\u040E\u045E\u0408\xA4\u0490\xA6\xA7\u0401\xA9\u0404\xAB\xAC\xAD\xAE\u0407\xB0\xB1\u0406\u0456\u0491\xB5\xB6\xB7\u0451\u2116\u0454\xBB\u0458\u0405\u0455\u0457\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},win1251:"windows1251",cp1251:"windows1251",windows1252:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\u017D\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\u017E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},win1252:"windows1252",cp1252:"windows1252",windows1253:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\u0385\u0386\xA3\xA4\xA5\xA6\xA7\xA8\xA9\uFFFD\xAB\xAC\xAD\xAE\u2015\xB0\xB1\xB2\xB3\u0384\xB5\xB6\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD"},win1253:"windows1253",cp1253:"windows1253",windows1254:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF"},win1254:"windows1254",cp1254:"windows1254",windows1255:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\xA0\xA1\xA2\xA3\u20AA\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\xBF\u05B0\u05B1\u05B2\u05B3\u05B4\u05B5\u05B6\u05B7\u05B8\u05B9\u05BA\u05BB\u05BC\u05BD\u05BE\u05BF\u05C0\u05C1\u05C2\u05C3\u05F0\u05F1\u05F2\u05F3\u05F4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD"},win1255:"windows1255",cp1255:"windows1255",windows1256:{type:"_sbcs",chars:"\u20AC\u067E\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0679\u2039\u0152\u0686\u0698\u0688\u06AF\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u06A9\u2122\u0691\u203A\u0153\u200C\u200D\u06BA\xA0\u060C\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\u06BE\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\u061B\xBB\xBC\xBD\xBE\u061F\u06C1\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\xD7\u0637\u0638\u0639\u063A\u0640\u0641\u0642\u0643\xE0\u0644\xE2\u0645\u0646\u0647\u0648\xE7\xE8\xE9\xEA\xEB\u0649\u064A\xEE\xEF\u064B\u064C\u064D\u064E\xF4\u064F\u0650\xF7\u0651\xF9\u0652\xFB\xFC\u200E\u200F\u06D2"},win1256:"windows1256",cp1256:"windows1256",windows1257:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\uFFFD\u201E\u2026\u2020\u2021\uFFFD\u2030\uFFFD\u2039\uFFFD\xA8\u02C7\xB8\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\xAF\u02DB\uFFFD\xA0\uFFFD\xA2\xA3\xA4\uFFFD\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u02D9"},win1257:"windows1257",cp1257:"windows1257",windows1258:{type:"_sbcs",chars:"\u20AC\uFFFD\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\uFFFD\u2039\u0152\uFFFD\uFFFD\uFFFD\uFFFD\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\uFFFD\u203A\u0153\uFFFD\uFFFD\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"},win1258:"windows1258",cp1258:"windows1258",iso88591:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},cp28591:"iso88591",iso88592:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u02D8\u0141\xA4\u013D\u015A\xA7\xA8\u0160\u015E\u0164\u0179\xAD\u017D\u017B\xB0\u0105\u02DB\u0142\xB4\u013E\u015B\u02C7\xB8\u0161\u015F\u0165\u017A\u02DD\u017E\u017C\u0154\xC1\xC2\u0102\xC4\u0139\u0106\xC7\u010C\xC9\u0118\xCB\u011A\xCD\xCE\u010E\u0110\u0143\u0147\xD3\xD4\u0150\xD6\xD7\u0158\u016E\xDA\u0170\xDC\xDD\u0162\xDF\u0155\xE1\xE2\u0103\xE4\u013A\u0107\xE7\u010D\xE9\u0119\xEB\u011B\xED\xEE\u010F\u0111\u0144\u0148\xF3\xF4\u0151\xF6\xF7\u0159\u016F\xFA\u0171\xFC\xFD\u0163\u02D9"},cp28592:"iso88592",iso88593:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0126\u02D8\xA3\xA4\uFFFD\u0124\xA7\xA8\u0130\u015E\u011E\u0134\xAD\uFFFD\u017B\xB0\u0127\xB2\xB3\xB4\xB5\u0125\xB7\xB8\u0131\u015F\u011F\u0135\xBD\uFFFD\u017C\xC0\xC1\xC2\uFFFD\xC4\u010A\u0108\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\uFFFD\xD1\xD2\xD3\xD4\u0120\xD6\xD7\u011C\xD9\xDA\xDB\xDC\u016C\u015C\xDF\xE0\xE1\xE2\uFFFD\xE4\u010B\u0109\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\uFFFD\xF1\xF2\xF3\xF4\u0121\xF6\xF7\u011D\xF9\xFA\xFB\xFC\u016D\u015D\u02D9"},cp28593:"iso88593",iso88594:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0138\u0156\xA4\u0128\u013B\xA7\xA8\u0160\u0112\u0122\u0166\xAD\u017D\xAF\xB0\u0105\u02DB\u0157\xB4\u0129\u013C\u02C7\xB8\u0161\u0113\u0123\u0167\u014A\u017E\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\u012A\u0110\u0145\u014C\u0136\xD4\xD5\xD6\xD7\xD8\u0172\xDA\xDB\xDC\u0168\u016A\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\u012B\u0111\u0146\u014D\u0137\xF4\xF5\xF6\xF7\xF8\u0173\xFA\xFB\xFC\u0169\u016B\u02D9"},cp28594:"iso88594",iso88595:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0403\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0453\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F"},cp28595:"iso88595",iso88596:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\uFFFD\uFFFD\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u060C\xAD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u061B\uFFFD\uFFFD\uFFFD\u061F\uFFFD\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\u0638\u0639\u063A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},cp28596:"iso88596",iso88597:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u2018\u2019\xA3\u20AC\u20AF\xA6\xA7\xA8\xA9\u037A\xAB\xAC\xAD\uFFFD\u2015\xB0\xB1\xB2\xB3\u0384\u0385\u0386\xB7\u0388\u0389\u038A\xBB\u038C\xBD\u038E\u038F\u0390\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\uFFFD\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03AA\u03AB\u03AC\u03AD\u03AE\u03AF\u03B0\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C2\u03C3\u03C4\u03C5\u03C6\u03C7\u03C8\u03C9\u03CA\u03CB\u03CC\u03CD\u03CE\uFFFD"},cp28597:"iso88597",iso88598:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xD7\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xF7\xBB\xBC\xBD\xBE\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2017\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\uFFFD\u200E\u200F\uFFFD"},cp28598:"iso88598",iso88599:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u011E\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u0130\u015E\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u011F\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u0131\u015F\xFF"},cp28599:"iso88599",iso885910:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0112\u0122\u012A\u0128\u0136\xA7\u013B\u0110\u0160\u0166\u017D\xAD\u016A\u014A\xB0\u0105\u0113\u0123\u012B\u0129\u0137\xB7\u013C\u0111\u0161\u0167\u017E\u2015\u016B\u014B\u0100\xC1\xC2\xC3\xC4\xC5\xC6\u012E\u010C\xC9\u0118\xCB\u0116\xCD\xCE\xCF\xD0\u0145\u014C\xD3\xD4\xD5\xD6\u0168\xD8\u0172\xDA\xDB\xDC\xDD\xDE\xDF\u0101\xE1\xE2\xE3\xE4\xE5\xE6\u012F\u010D\xE9\u0119\xEB\u0117\xED\xEE\xEF\xF0\u0146\u014D\xF3\xF4\xF5\xF6\u0169\xF8\u0173\xFA\xFB\xFC\xFD\xFE\u0138"},cp28600:"iso885910",iso885911:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"},cp28601:"iso885911",iso885913:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u201D\xA2\xA3\xA4\u201E\xA6\xA7\xD8\xA9\u0156\xAB\xAC\xAD\xAE\xC6\xB0\xB1\xB2\xB3\u201C\xB5\xB6\xB7\xF8\xB9\u0157\xBB\xBC\xBD\xBE\xE6\u0104\u012E\u0100\u0106\xC4\xC5\u0118\u0112\u010C\xC9\u0179\u0116\u0122\u0136\u012A\u013B\u0160\u0143\u0145\xD3\u014C\xD5\xD6\xD7\u0172\u0141\u015A\u016A\xDC\u017B\u017D\xDF\u0105\u012F\u0101\u0107\xE4\xE5\u0119\u0113\u010D\xE9\u017A\u0117\u0123\u0137\u012B\u013C\u0161\u0144\u0146\xF3\u014D\xF5\xF6\xF7\u0173\u0142\u015B\u016B\xFC\u017C\u017E\u2019"},cp28603:"iso885913",iso885914:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u1E02\u1E03\xA3\u010A\u010B\u1E0A\xA7\u1E80\xA9\u1E82\u1E0B\u1EF2\xAD\xAE\u0178\u1E1E\u1E1F\u0120\u0121\u1E40\u1E41\xB6\u1E56\u1E81\u1E57\u1E83\u1E60\u1EF3\u1E84\u1E85\u1E61\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0174\xD1\xD2\xD3\xD4\xD5\xD6\u1E6A\xD8\xD9\xDA\xDB\xDC\xDD\u0176\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0175\xF1\xF2\xF3\xF4\xF5\xF6\u1E6B\xF8\xF9\xFA\xFB\xFC\xFD\u0177\xFF"},cp28604:"iso885914",iso885915:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\u0160\xA7\u0161\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u017D\xB5\xB6\xB7\u017E\xB9\xBA\xBB\u0152\u0153\u0178\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},cp28605:"iso885915",iso885916:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0104\u0105\u0141\u20AC\u201E\u0160\xA7\u0161\xA9\u0218\xAB\u0179\xAD\u017A\u017B\xB0\xB1\u010C\u0142\u017D\u201D\xB6\xB7\u017E\u010D\u0219\xBB\u0152\u0153\u0178\u017C\xC0\xC1\xC2\u0102\xC4\u0106\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0110\u0143\xD2\xD3\xD4\u0150\xD6\u015A\u0170\xD9\xDA\xDB\xDC\u0118\u021A\xDF\xE0\xE1\xE2\u0103\xE4\u0107\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0111\u0144\xF2\xF3\xF4\u0151\xF6\u015B\u0171\xF9\xFA\xFB\xFC\u0119\u021B\xFF"},cp28606:"iso885916",cp437:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm437:"cp437",csibm437:"cp437",cp737:{type:"_sbcs",chars:"\u0391\u0392\u0393\u0394\u0395\u0396\u0397\u0398\u0399\u039A\u039B\u039C\u039D\u039E\u039F\u03A0\u03A1\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u03C5\u03C6\u03C7\u03C8\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03C9\u03AC\u03AD\u03AE\u03CA\u03AF\u03CC\u03CD\u03CB\u03CE\u0386\u0388\u0389\u038A\u038C\u038E\u038F\xB1\u2265\u2264\u03AA\u03AB\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm737:"cp737",csibm737:"cp737",cp775:{type:"_sbcs",chars:"\u0106\xFC\xE9\u0101\xE4\u0123\xE5\u0107\u0142\u0113\u0156\u0157\u012B\u0179\xC4\xC5\xC9\xE6\xC6\u014D\xF6\u0122\xA2\u015A\u015B\xD6\xDC\xF8\xA3\xD8\xD7\xA4\u0100\u012A\xF3\u017B\u017C\u017A\u201D\xA6\xA9\xAE\xAC\xBD\xBC\u0141\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0104\u010C\u0118\u0116\u2563\u2551\u2557\u255D\u012E\u0160\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0172\u016A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u017D\u0105\u010D\u0119\u0117\u012F\u0161\u0173\u016B\u017E\u2518\u250C\u2588\u2584\u258C\u2590\u2580\xD3\xDF\u014C\u0143\xF5\xD5\xB5\u0144\u0136\u0137\u013B\u013C\u0146\u0112\u0145\u2019\xAD\xB1\u201C\xBE\xB6\xA7\xF7\u201E\xB0\u2219\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm775:"cp775",csibm775:"cp775",cp850:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u0131\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm850:"cp850",csibm850:"cp850",cp852:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\u016F\u0107\xE7\u0142\xEB\u0150\u0151\xEE\u0179\xC4\u0106\xC9\u0139\u013A\xF4\xF6\u013D\u013E\u015A\u015B\xD6\xDC\u0164\u0165\u0141\xD7\u010D\xE1\xED\xF3\xFA\u0104\u0105\u017D\u017E\u0118\u0119\xAC\u017A\u010C\u015F\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\u011A\u015E\u2563\u2551\u2557\u255D\u017B\u017C\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u0102\u0103\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u0111\u0110\u010E\xCB\u010F\u0147\xCD\xCE\u011B\u2518\u250C\u2588\u2584\u0162\u016E\u2580\xD3\xDF\xD4\u0143\u0144\u0148\u0160\u0161\u0154\xDA\u0155\u0170\xFD\xDD\u0163\xB4\xAD\u02DD\u02DB\u02C7\u02D8\xA7\xF7\xB8\xB0\xA8\u02D9\u0171\u0158\u0159\u25A0\xA0"},ibm852:"cp852",csibm852:"cp852",cp855:{type:"_sbcs",chars:"\u0452\u0402\u0453\u0403\u0451\u0401\u0454\u0404\u0455\u0405\u0456\u0406\u0457\u0407\u0458\u0408\u0459\u0409\u045A\u040A\u045B\u040B\u045C\u040C\u045E\u040E\u045F\u040F\u044E\u042E\u044A\u042A\u0430\u0410\u0431\u0411\u0446\u0426\u0434\u0414\u0435\u0415\u0444\u0424\u0433\u0413\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u0445\u0425\u0438\u0418\u2563\u2551\u2557\u255D\u0439\u0419\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u043A\u041A\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\u043B\u041B\u043C\u041C\u043D\u041D\u043E\u041E\u043F\u2518\u250C\u2588\u2584\u041F\u044F\u2580\u042F\u0440\u0420\u0441\u0421\u0442\u0422\u0443\u0423\u0436\u0416\u0432\u0412\u044C\u042C\u2116\xAD\u044B\u042B\u0437\u0417\u0448\u0428\u044D\u042D\u0449\u0429\u0447\u0427\xA7\u25A0\xA0"},ibm855:"cp855",csibm855:"cp855",cp856:{type:"_sbcs",chars:"\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\uFFFD\xA3\uFFFD\xD7\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAE\xAC\xBD\xBC\uFFFD\xAB\xBB\u2591\u2592\u2593\u2502\u2524\uFFFD\uFFFD\uFFFD\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\uFFFD\uFFFD\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u2518\u250C\u2588\u2584\xA6\uFFFD\u2580\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xB5\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm856:"cp856",csibm856:"cp856",cp857:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\u0131\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\u0130\xD6\xDC\xF8\xA3\xD8\u015E\u015F\xE1\xED\xF3\xFA\xF1\xD1\u011E\u011F\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xBA\xAA\xCA\xCB\xC8\uFFFD\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\uFFFD\xD7\xDA\xDB\xD9\xEC\xFF\xAF\xB4\xAD\xB1\uFFFD\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm857:"cp857",csibm857:"cp857",cp858:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\xD7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xAE\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\xC1\xC2\xC0\xA9\u2563\u2551\u2557\u255D\xA2\xA5\u2510\u2514\u2534\u252C\u251C\u2500\u253C\xE3\xC3\u255A\u2554\u2569\u2566\u2560\u2550\u256C\xA4\xF0\xD0\xCA\xCB\xC8\u20AC\xCD\xCE\xCF\u2518\u250C\u2588\u2584\xA6\xCC\u2580\xD3\xDF\xD4\xD2\xF5\xD5\xB5\xFE\xDE\xDA\xDB\xD9\xFD\xDD\xAF\xB4\xAD\xB1\u2017\xBE\xB6\xA7\xF7\xB8\xB0\xA8\xB7\xB9\xB3\xB2\u25A0\xA0"},ibm858:"cp858",csibm858:"cp858",cp860:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE3\xE0\xC1\xE7\xEA\xCA\xE8\xCD\xD4\xEC\xC3\xC2\xC9\xC0\xC8\xF4\xF5\xF2\xDA\xF9\xCC\xD5\xDC\xA2\xA3\xD9\u20A7\xD3\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\xD2\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm860:"cp860",csibm860:"cp860",cp861:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xD0\xF0\xDE\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xFE\xFB\xDD\xFD\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xC1\xCD\xD3\xDA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm861:"cp861",csibm861:"cp861",cp862:{type:"_sbcs",chars:"\u05D0\u05D1\u05D2\u05D3\u05D4\u05D5\u05D6\u05D7\u05D8\u05D9\u05DA\u05DB\u05DC\u05DD\u05DE\u05DF\u05E0\u05E1\u05E2\u05E3\u05E4\u05E5\u05E6\u05E7\u05E8\u05E9\u05EA\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm862:"cp862",csibm862:"cp862",cp863:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xC2\xE0\xB6\xE7\xEA\xEB\xE8\xEF\xEE\u2017\xC0\xA7\xC9\xC8\xCA\xF4\xCB\xCF\xFB\xF9\xA4\xD4\xDC\xA2\xA3\xD9\xDB\u0192\xA6\xB4\xF3\xFA\xA8\xB8\xB3\xAF\xCE\u2310\xAC\xBD\xBC\xBE\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm863:"cp863",csibm863:"cp863",cp864:{type:"_sbcs",chars:`\0\x07\b
66
66
  \v\f\r\x1B !"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE97\uFE9B\uFE9F\uFEA3\u060C\xAD\uFEA7\uFEB3\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFEB7\u061B\uFEBB\uFEBF\uFECA\u061F\uFECB\u0621\u0622\u0623\u0624\u0625\u0626\u0627\u0628\u0629\u062A\u062B\u062C\u062D\u062E\u062F\u0630\u0631\u0632\u0633\u0634\u0635\u0636\u0637\uFEC7\u0639\u063A\uFECC\uFE82\uFE84\uFE8E\uFED3\u0640\u0641\u0642\u0643\u0644\u0645\u0646\u0647\u0648\u0649\u064A\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652\uFED7\uFEDB\uFEDF\uF8FC\uFEF5\uFEF7\uFEF9\uFEFB\uFEE3\uFEE7\uFEEC\uFEE9\uFFFD"},ibm1046:"cp1046",csibm1046:"cp1046",cp1124:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0401\u0402\u0490\u0404\u0405\u0406\u0407\u0408\u0409\u040A\u040B\u040C\xAD\u040E\u040F\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u2116\u0451\u0452\u0491\u0454\u0455\u0456\u0457\u0458\u0459\u045A\u045B\u045C\xA7\u045E\u045F"},ibm1124:"cp1124",csibm1124:"cp1124",cp1125:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0490\u0491\u0404\u0454\u0406\u0456\u0407\u0457\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm1125:"cp1125",csibm1125:"cp1125",cp1129:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\u0153\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u0178\xB5\xB6\xB7\u0152\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"},ibm1129:"cp1129",csibm1129:"cp1129",cp1133:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E81\u0E82\u0E84\u0E87\u0E88\u0EAA\u0E8A\u0E8D\u0E94\u0E95\u0E96\u0E97\u0E99\u0E9A\u0E9B\u0E9C\u0E9D\u0E9E\u0E9F\u0EA1\u0EA2\u0EA3\u0EA5\u0EA7\u0EAB\u0EAD\u0EAE\uFFFD\uFFFD\uFFFD\u0EAF\u0EB0\u0EB2\u0EB3\u0EB4\u0EB5\u0EB6\u0EB7\u0EB8\u0EB9\u0EBC\u0EB1\u0EBB\u0EBD\uFFFD\uFFFD\uFFFD\u0EC0\u0EC1\u0EC2\u0EC3\u0EC4\u0EC8\u0EC9\u0ECA\u0ECB\u0ECC\u0ECD\u0EC6\uFFFD\u0EDC\u0EDD\u20AD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0ED0\u0ED1\u0ED2\u0ED3\u0ED4\u0ED5\u0ED6\u0ED7\u0ED8\u0ED9\uFFFD\uFFFD\xA2\xAC\xA6\uFFFD"},ibm1133:"cp1133",csibm1133:"cp1133",cp1161:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E48\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\u0E49\u0E4A\u0E4B\u20AC\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\xA2\xAC\xA6\xA0"},ibm1161:"cp1161",csibm1161:"cp1161",cp1162:{type:"_sbcs",chars:"\u20AC\x81\x82\x83\x84\u2026\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"},ibm1162:"cp1162",csibm1162:"cp1162",cp1163:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\u20AC\xA5\xA6\xA7\u0153\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\u0178\xB5\xB6\xB7\u0152\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\u0102\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\u0300\xCD\xCE\xCF\u0110\xD1\u0309\xD3\xD4\u01A0\xD6\xD7\xD8\xD9\xDA\xDB\xDC\u01AF\u0303\xDF\xE0\xE1\xE2\u0103\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\u0301\xED\xEE\xEF\u0111\xF1\u0323\xF3\xF4\u01A1\xF6\xF7\xF8\xF9\xFA\xFB\xFC\u01B0\u20AB\xFF"},ibm1163:"cp1163",csibm1163:"cp1163",maccroatian:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\u0160\u2122\xB4\xA8\u2260\u017D\xD8\u221E\xB1\u2264\u2265\u2206\xB5\u2202\u2211\u220F\u0161\u222B\xAA\xBA\u2126\u017E\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u0106\xAB\u010C\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u0110\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\uFFFD\xA9\u2044\xA4\u2039\u203A\xC6\xBB\u2013\xB7\u201A\u201E\u2030\xC2\u0107\xC1\u010D\xC8\xCD\xCE\xCF\xCC\xD3\xD4\u0111\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u03C0\xCB\u02DA\xB8\xCA\xE6\u02C7"},maccyrillic:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\xA2\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u2202\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\xA4"},macgreek:{type:"_sbcs",chars:"\xC4\xB9\xB2\xC9\xB3\xD6\xDC\u0385\xE0\xE2\xE4\u0384\xA8\xE7\xE9\xE8\xEA\xEB\xA3\u2122\xEE\xEF\u2022\xBD\u2030\xF4\xF6\xA6\xAD\xF9\xFB\xFC\u2020\u0393\u0394\u0398\u039B\u039E\u03A0\xDF\xAE\xA9\u03A3\u03AA\xA7\u2260\xB0\u0387\u0391\xB1\u2264\u2265\xA5\u0392\u0395\u0396\u0397\u0399\u039A\u039C\u03A6\u03AB\u03A8\u03A9\u03AC\u039D\xAC\u039F\u03A1\u2248\u03A4\xAB\xBB\u2026\xA0\u03A5\u03A7\u0386\u0388\u0153\u2013\u2015\u201C\u201D\u2018\u2019\xF7\u0389\u038A\u038C\u038E\u03AD\u03AE\u03AF\u03CC\u038F\u03CD\u03B1\u03B2\u03C8\u03B4\u03B5\u03C6\u03B3\u03B7\u03B9\u03BE\u03BA\u03BB\u03BC\u03BD\u03BF\u03C0\u03CE\u03C1\u03C3\u03C4\u03B8\u03C9\u03C2\u03C7\u03C5\u03B6\u03CA\u03CB\u0390\u03B0\uFFFD"},maciceland:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\xDD\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\xD0\xF0\xDE\xFE\xFD\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},macroman:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},macromania:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\u0102\u015E\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\u0103\u015F\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\u0162\u0163\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},macthai:{type:"_sbcs",chars:"\xAB\xBB\u2026\uF88C\uF88F\uF892\uF895\uF898\uF88B\uF88E\uF891\uF894\uF897\u201C\u201D\uF899\uFFFD\u2022\uF884\uF889\uF885\uF886\uF887\uF888\uF88A\uF88D\uF890\uF893\uF896\u2018\u2019\uFFFD\xA0\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFEFF\u200B\u2013\u2014\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u2122\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\xAE\xA9\uFFFD\uFFFD\uFFFD\uFFFD"},macturkish:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u011E\u011F\u0130\u0131\u015E\u015F\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\uFFFD\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},macukraine:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u2020\xB0\u0490\xA3\xA7\u2022\xB6\u0406\xAE\xA9\u2122\u0402\u0452\u2260\u0403\u0453\u221E\xB1\u2264\u2265\u0456\xB5\u0491\u0408\u0404\u0454\u0407\u0457\u0409\u0459\u040A\u045A\u0458\u0405\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\u040B\u045B\u040C\u045C\u0455\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u201E\u040E\u045E\u040F\u045F\u2116\u0401\u0451\u044F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\xA4"},koi8r:{type:"_sbcs",chars:"\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u2553\u2554\u2555\u2556\u2557\u2558\u2559\u255A\u255B\u255C\u255D\u255E\u255F\u2560\u2561\u0401\u2562\u2563\u2564\u2565\u2566\u2567\u2568\u2569\u256A\u256B\u256C\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"},koi8u:{type:"_sbcs",chars:"\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u0454\u2554\u0456\u0457\u2557\u2558\u2559\u255A\u255B\u0491\u255D\u255E\u255F\u2560\u2561\u0401\u0404\u2563\u0406\u0407\u2566\u2567\u2568\u2569\u256A\u0490\u256C\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"},koi8ru:{type:"_sbcs",chars:"\u2500\u2502\u250C\u2510\u2514\u2518\u251C\u2524\u252C\u2534\u253C\u2580\u2584\u2588\u258C\u2590\u2591\u2592\u2593\u2320\u25A0\u2219\u221A\u2248\u2264\u2265\xA0\u2321\xB0\xB2\xB7\xF7\u2550\u2551\u2552\u0451\u0454\u2554\u0456\u0457\u2557\u2558\u2559\u255A\u255B\u0491\u045E\u255E\u255F\u2560\u2561\u0401\u0404\u2563\u0406\u0407\u2566\u2567\u2568\u2569\u256A\u0490\u040E\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"},koi8t:{type:"_sbcs",chars:"\u049B\u0493\u201A\u0492\u201E\u2026\u2020\u2021\uFFFD\u2030\u04B3\u2039\u04B2\u04B7\u04B6\uFFFD\u049A\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\uFFFD\u203A\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04EF\u04EE\u0451\xA4\u04E3\xA6\xA7\uFFFD\uFFFD\uFFFD\xAB\xAC\xAD\xAE\uFFFD\xB0\xB1\xB2\u0401\uFFFD\u04E2\xB6\xB7\uFFFD\u2116\uFFFD\xBB\uFFFD\uFFFD\uFFFD\xA9\u044E\u0430\u0431\u0446\u0434\u0435\u0444\u0433\u0445\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u044F\u0440\u0441\u0442\u0443\u0436\u0432\u044C\u044B\u0437\u0448\u044D\u0449\u0447\u044A\u042E\u0410\u0411\u0426\u0414\u0415\u0424\u0413\u0425\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u042F\u0420\u0421\u0422\u0423\u0416\u0412\u042C\u042B\u0417\u0428\u042D\u0429\u0427\u042A"},armscii8:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\uFFFD\u0587\u0589)(\xBB\xAB\u2014.\u055D,-\u058A\u2026\u055C\u055B\u055E\u0531\u0561\u0532\u0562\u0533\u0563\u0534\u0564\u0535\u0565\u0536\u0566\u0537\u0567\u0538\u0568\u0539\u0569\u053A\u056A\u053B\u056B\u053C\u056C\u053D\u056D\u053E\u056E\u053F\u056F\u0540\u0570\u0541\u0571\u0542\u0572\u0543\u0573\u0544\u0574\u0545\u0575\u0546\u0576\u0547\u0577\u0548\u0578\u0549\u0579\u054A\u057A\u054B\u057B\u054C\u057C\u054D\u057D\u054E\u057E\u054F\u057F\u0550\u0580\u0551\u0581\u0552\u0582\u0553\u0583\u0554\u0584\u0555\u0585\u0556\u0586\u055A\uFFFD"},rk1048:{type:"_sbcs",chars:"\u0402\u0403\u201A\u0453\u201E\u2026\u2020\u2021\u20AC\u2030\u0409\u2039\u040A\u049A\u04BA\u040F\u0452\u2018\u2019\u201C\u201D\u2022\u2013\u2014\uFFFD\u2122\u0459\u203A\u045A\u049B\u04BB\u045F\xA0\u04B0\u04B1\u04D8\xA4\u04E8\xA6\xA7\u0401\xA9\u0492\xAB\xAC\xAD\xAE\u04AE\xB0\xB1\u0406\u0456\u04E9\xB5\xB6\xB7\u0451\u2116\u0493\xBB\u04D9\u04A2\u04A3\u04AF\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},tcvn:{type:"_sbcs",chars:`\0\xDA\u1EE4\u1EEA\u1EEC\u1EEE\x07\b
67
67
  \v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0`},georgianacademy:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},georgianps:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},pt154:{type:"_sbcs",chars:"\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},viscii:{type:"_sbcs",chars:`\0\u1EB2\u1EB4\u1EAA\x07\b
68
68
  \v\f\r\u1EF6\u1EF8\x1B\u1EF4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE`},iso646cn:{type:"_sbcs",chars:`\0\x07\b
@@ -73,33 +73,33 @@ Expecting one of '${s.join("', '")}'`);let i=`${e}Help`;return this.on(i,n=>{let
73
73
  `).reduce(function(i,n){return K2(n)>i?K2(n):i},0)}function Wn(r,e){return Array(e+1).join(r)}function PC(r,e,t,s){let i=zt(r);if(e+1>=i){let n=e-i;switch(s){case"right":{r=Wn(t,n)+r;break}case"center":{let o=Math.ceil(n/2),a=n-o;r=Wn(t,a)+r+Wn(t,o);break}default:{r=r+Wn(t,n);break}}}return r}var Ai={};function qn(r,e,t){e="\x1B["+e+"m",t="\x1B["+t+"m",Ai[e]={set:r,to:!0},Ai[t]={set:r,to:!1},Ai[r]={on:e,off:t}}qn("bold",1,22);qn("italics",3,23);qn("underline",4,24);qn("inverse",7,27);qn("strikethrough",9,29);function Z2(r,e){let t=e[1]?parseInt(e[1].split(";")[0]):0;if(t>=30&&t<=39||t>=90&&t<=97){r.lastForegroundAdded=e[0];return}if(t>=40&&t<=49||t>=100&&t<=107){r.lastBackgroundAdded=e[0];return}if(t===0){for(let i in r)Object.prototype.hasOwnProperty.call(r,i)&&delete r[i];return}let s=Ai[e[0]];s&&(r[s.set]=s.to)}function RC(r){let e=Ga(!0),t=e.exec(r),s={};for(;t!==null;)Z2(s,t),t=e.exec(r);return s}function Y2(r,e){let t=r.lastBackgroundAdded,s=r.lastForegroundAdded;return delete r.lastBackgroundAdded,delete r.lastForegroundAdded,Object.keys(r).forEach(function(i){r[i]&&(e+=Ai[i].off)}),t&&t!="\x1B[49m"&&(e+="\x1B[49m"),s&&s!="\x1B[39m"&&(e+="\x1B[39m"),e}function MC(r,e){let t=r.lastBackgroundAdded,s=r.lastForegroundAdded;return delete r.lastBackgroundAdded,delete r.lastForegroundAdded,Object.keys(r).forEach(function(i){r[i]&&(e=Ai[i].on+e)}),t&&t!="\x1B[49m"&&(e=t+e),s&&s!="\x1B[39m"&&(e=s+e),e}function $C(r,e){if(r.length===zt(r))return r.substr(0,e);for(;zt(r)>e;)r=r.slice(0,-1);return r}function jC(r,e){let t=Ga(!0),s=r.split(Ga()),i=0,n=0,o="",a,c={};for(;n<e;){a=t.exec(r);let l=s[i];if(i++,n+zt(l)>e&&(l=$C(l,e-n)),o+=l,n+=zt(l),n<e){if(!a)break;o+=a[0],Z2(c,a)}}return Y2(c,o)}function NC(r,e,t){if(t=t||"\u2026",zt(r)<=e)return r;e-=zt(t);let i=jC(r,e);i+=t;let n="\x1B]8;;\x07";return r.includes(n)&&!i.includes(n)&&(i+=n),i}function LC(){return{chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],rowHeights:[],colAligns:[],rowAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]}}function UC(r,e){r=r||{},e=e||LC();let t=Object.assign({},e,r);return t.chars=Object.assign({},e.chars,r.chars),t.style=Object.assign({},e.style,r.style),t}function WC(r,e){let t=[],s=e.split(/(\s+)/g),i=[],n=0,o;for(let a=0;a<s.length;a+=2){let c=s[a],l=n+zt(c);n>0&&o&&(l+=o.length),l>r?(n!==0&&t.push(i.join("")),i=[c],n=zt(c)):(i.push(o||"",c),n=l),o=s[a+1]}return n&&t.push(i.join("")),t}function qC(r,e){let t=[],s="";function i(o,a){for(s.length&&a&&(s+=a),s+=o;s.length>r;)t.push(s.slice(0,r)),s=s.slice(r)}let n=e.split(/(\s+)/g);for(let o=0;o<n.length;o+=2)i(n[o],o&&n[o-1]);return s.length&&t.push(s),t}function VC(r,e,t=!0){let s=[];e=e.split(`
74
74
  `);let i=t?WC:qC;for(let n=0;n<e.length;n++)s.push.apply(s,i(r,e[n]));return s}function HC(r){let e={},t=[];for(let s=0;s<r.length;s++){let i=MC(e,r[s]);e=RC(i);let n=Object.assign({},e);t.push(Y2(n,i))}return t}function GC(r,e){return["\x1B]","8",";",";",r||e,"\x07",e,"\x1B]","8",";",";","\x07"].join("")}J2.exports={strlen:zt,repeat:Wn,pad:PC,truncate:NC,mergeOptions:UC,wordWrap:VC,colorizeLines:HC,hyperlink:GC}});var t1=D((dO,e1)=>{var Q2={};e1.exports=Q2;var X2={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],brightRed:[91,39],brightGreen:[92,39],brightYellow:[93,39],brightBlue:[94,39],brightMagenta:[95,39],brightCyan:[96,39],brightWhite:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgGray:[100,49],bgGrey:[100,49],bgBrightRed:[101,49],bgBrightGreen:[102,49],bgBrightYellow:[103,49],bgBrightBlue:[104,49],bgBrightMagenta:[105,49],bgBrightCyan:[106,49],bgBrightWhite:[107,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(X2).forEach(function(r){var e=X2[r],t=Q2[r]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var s1=D((pO,r1)=>{"use strict";r1.exports=function(r,e){e=e||process.argv;var t=e.indexOf("--"),s=/^-{1,2}/.test(r)?"":"--",i=e.indexOf(s+r);return i!==-1&&(t===-1?!0:i<t)}});var n1=D((mO,i1)=>{"use strict";var zC=require("os"),Tt=s1(),Ne=process.env,Ti=void 0;Tt("no-color")||Tt("no-colors")||Tt("color=false")?Ti=!1:(Tt("color")||Tt("colors")||Tt("color=true")||Tt("color=always"))&&(Ti=!0);"FORCE_COLOR"in Ne&&(Ti=Ne.FORCE_COLOR.length===0||parseInt(Ne.FORCE_COLOR,10)!==0);function KC(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function ZC(r){if(Ti===!1)return 0;if(Tt("color=16m")||Tt("color=full")||Tt("color=truecolor"))return 3;if(Tt("color=256"))return 2;if(r&&!r.isTTY&&Ti!==!0)return 0;var e=Ti?1:0;if(process.platform==="win32"){var t=zC.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in Ne)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(function(i){return i in Ne})||Ne.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in Ne)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Ne.TEAMCITY_VERSION)?1:0;if("TERM_PROGRAM"in Ne){var s=parseInt((Ne.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Ne.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Hyper":return 3;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Ne.TERM)?2:/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(Ne.TERM)||"COLORTERM"in Ne?1:(Ne.TERM==="dumb",e)}function fh(r){var e=ZC(r);return KC(e)}i1.exports={supportsColor:fh,stdout:fh(process.stdout),stderr:fh(process.stderr)}});var a1=D((xO,o1)=>{o1.exports=function(e,t){var s="";e=e||"Run the trap, drop the bass",e=e.split("");var i={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(n){n=n.toLowerCase();var o=i[n]||[" "],a=Math.floor(Math.random()*o.length);typeof i[n]<"u"?s+=i[n][a]:s+=n}),s}});var l1=D((gO,c1)=>{c1.exports=function(e,t){e=e||" he is here ";var s={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},i=[].concat(s.up,s.down,s.mid);function n(c){var l=Math.floor(Math.random()*c);return l}function o(c){var l=!1;return i.filter(function(u){l=u===c}),l}function a(c,l){var u="",h,d;l=l||{},l.up=typeof l.up<"u"?l.up:!0,l.mid=typeof l.mid<"u"?l.mid:!0,l.down=typeof l.down<"u"?l.down:!0,l.size=typeof l.size<"u"?l.size:"maxi",c=c.split("");for(d in c)if(!o(d)){switch(u=u+c[d],h={up:0,down:0,mid:0},l.size){case"mini":h.up=n(8),h.mid=n(2),h.down=n(8);break;case"maxi":h.up=n(16)+3,h.mid=n(4)+1,h.down=n(64)+3;break;default:h.up=n(8)+1,h.mid=n(6)/2,h.down=n(8)+1;break}var f=["up","mid","down"];for(var p in f)for(var m=f[p],g=0;g<=h[m];g++)l[m]&&(u=u+s[m][n(s[m].length)])}return u}return a(e,t)}});var h1=D((bO,u1)=>{u1.exports=function(r){return function(e,t,s){if(e===" ")return e;switch(t%3){case 0:return r.red(e);case 1:return r.white(e);case 2:return r.blue(e)}}}});var d1=D((yO,f1)=>{f1.exports=function(r){return function(e,t,s){return t%2===0?e:r.inverse(e)}}});var m1=D((wO,p1)=>{p1.exports=function(r){var e=["red","yellow","green","blue","magenta"];return function(t,s,i){return t===" "?t:r[e[s++%e.length]](t)}}});var g1=D((DO,x1)=>{x1.exports=function(r){var e=["underline","inverse","grey","yellow","red","green","blue","white","cyan","magenta","brightYellow","brightRed","brightGreen","brightBlue","brightWhite","brightCyan","brightMagenta"];return function(t,s,i){return t===" "?t:r[e[Math.round(Math.random()*(e.length-2))]](t)}}});var C1=D((CO,v1)=>{var V={};v1.exports=V;V.themes={};var YC=require("util"),As=V.styles=t1(),y1=Object.defineProperties,JC=new RegExp(/[\r\n]+/g);V.supportsColor=n1().supportsColor;typeof V.enabled>"u"&&(V.enabled=V.supportsColor()!==!1);V.enable=function(){V.enabled=!0};V.disable=function(){V.enabled=!1};V.stripColors=V.strip=function(r){return(""+r).replace(/\x1B\[\d+m/g,"")};var vO=V.stylize=function(e,t){if(!V.enabled)return e+"";var s=As[t];return!s&&t in V?V[t](e):s.open+e+s.close},XC=/[|\\{}()[\]^$+*?.]/g,QC=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(XC,"\\$&")};function w1(r){var e=function t(){return t7.apply(t,arguments)};return e._styles=r,e.__proto__=e7,e}var D1=(function(){var r={};return As.grey=As.gray,Object.keys(As).forEach(function(e){As[e].closeRe=new RegExp(QC(As[e].close),"g"),r[e]={get:function(){return w1(this._styles.concat(e))}}}),r})(),e7=y1(function(){},D1);function t7(){var r=Array.prototype.slice.call(arguments),e=r.map(function(o){return o!=null&&o.constructor===String?o:YC.inspect(o)}).join(" ");if(!V.enabled||!e)return e;for(var t=e.indexOf(`
75
75
  `)!=-1,s=this._styles,i=s.length;i--;){var n=As[s[i]];e=n.open+e.replace(n.closeRe,n.open)+n.close,t&&(e=e.replace(JC,function(o){return n.close+o+n.open}))}return e}V.setTheme=function(r){if(typeof r=="string"){console.log("colors.setTheme now only accepts an object, not a string. If you are trying to set a theme from a file, it is now your (the caller's) responsibility to require the file. The old syntax looked like colors.setTheme(__dirname + '/../themes/generic-logging.js'); The new syntax looks like colors.setTheme(require(__dirname + '/../themes/generic-logging.js'));");return}for(var e in r)(function(t){V[t]=function(s){if(typeof r[t]=="object"){var i=s;for(var n in r[t])i=V[r[t][n]](i);return i}return V[r[t]](s)}})(e)};function r7(){var r={};return Object.keys(D1).forEach(function(e){r[e]={get:function(){return w1([e])}}}),r}var s7=function(e,t){var s=t.split("");return s=s.map(e),s.join("")};V.trap=a1();V.zalgo=l1();V.maps={};V.maps.america=h1()(V);V.maps.zebra=d1()(V);V.maps.rainbow=m1()(V);V.maps.random=g1()(V);for(b1 in V.maps)(function(r){V[r]=function(e){return s7(V.maps[r],e)}})(b1);var b1;y1(V,r7())});var k1=D((EO,E1)=>{var i7=C1();E1.exports=i7});var T1=D((kO,za)=>{var{info:n7,debug:A1}=Ha(),Xe=hh(),ph=class r{constructor(e){this.setOptions(e),this.x=null,this.y=null}setOptions(e){["boolean","number","bigint","string"].indexOf(typeof e)!==-1&&(e={content:""+e}),e=e||{},this.options=e;let t=e.content;if(["boolean","number","bigint","string"].indexOf(typeof t)!==-1)this.content=String(t);else if(!t)this.content=this.options.href||"";else throw new Error("Content needs to be a primitive, got: "+typeof t);this.colSpan=e.colSpan||1,this.rowSpan=e.rowSpan||1,this.options.href&&Object.defineProperty(this,"href",{get(){return this.options.href}})}mergeTableOptions(e,t){this.cells=t;let s=this.options.chars||{},i=e.chars,n=this.chars={};a7.forEach(function(c){dh(s,i,c,n)}),this.truncate=this.options.truncate||e.truncate;let o=this.options.style=this.options.style||{},a=e.style;dh(o,a,"padding-left",this),dh(o,a,"padding-right",this),this.head=o.head||a.head,this.border=o.border||a.border,this.fixedWidth=e.colWidths[this.x],this.lines=this.computeLines(e),this.desiredWidth=Xe.strlen(this.content)+this.paddingLeft+this.paddingRight,this.desiredHeight=this.lines.length}computeLines(e){let t=e.wordWrap||e.textWrap,{wordWrap:s=t}=this.options;if(this.fixedWidth&&s){if(this.fixedWidth-=this.paddingLeft+this.paddingRight,this.colSpan){let o=1;for(;o<this.colSpan;)this.fixedWidth+=e.colWidths[this.x+o],o++}let{wrapOnWordBoundary:i=!0}=e,{wrapOnWordBoundary:n=i}=this.options;return this.wrapLines(Xe.wordWrap(this.fixedWidth,this.content,n))}return this.wrapLines(this.content.split(`
76
- `))}wrapLines(e){let t=Xe.colorizeLines(e);return this.href?t.map(s=>Xe.hyperlink(this.href,s)):t}init(e){let t=this.x,s=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(s,s+this.rowSpan),this.width=this.widths.reduce(_1,-1),this.height=this.heights.reduce(_1,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[s],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let s=Xe.truncate(this.content,10,this.truncate);e||n7(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${s}`);let i=Math.max(this.height-this.lines.length,0),n;switch(this.vAlign){case"center":n=Math.ceil(i/2);break;case"bottom":n=i;break;default:n=0}if(e<n||e>=n+this.lines.length)return this.drawEmpty(this.drawRight,t);let o=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-n,this.drawRight,o,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(s,i){t.push(this._topLeftChar(i)),t.push(Xe.repeat(this.chars[this.y==0?"top":"mid"],s))},this):(t.push(this._topLeftChar(0)),t.push(Xe.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,s;if(this.y==0)s=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)s="leftMid";else if(s=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof r.ColSpanCell&&(s=e==0?"topMid":"mid"),e==0)){let n=1;for(;this.cells[this.y][t-n]instanceof r.ColSpanCell;)n++;this.cells[this.y][t-n]instanceof r.RowSpanCell&&(s="leftMid")}return this.chars[s]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let s=k1();for(let i=this[e].length-1;i>=0;i--)s=s[this[e][i]];return s(t)}catch{return t}else return t}drawLine(e,t,s,i){let n=this.chars[this.x==0?"left":"middle"];if(this.x&&i&&this.cells){let d=this.cells[this.y+i][this.x-1];for(;d instanceof Vn;)d=this.cells[d.y][d.x-1];d instanceof Hn||(n=this.chars.rightMid)}let o=Xe.repeat(" ",this.paddingLeft),a=t?this.chars.right:"",c=Xe.repeat(" ",this.paddingRight),l=this.lines[e],u=this.width-(this.paddingLeft+this.paddingRight);s&&(l+=this.truncate||"\u2026");let h=Xe.truncate(l,u,this.truncate);return h=Xe.pad(h,u," ",this.hAlign),h=o+h+c,this.stylizeLine(n,h,a)}stylizeLine(e,t,s){return e=this.wrapWithStyleColors("border",e),s=this.wrapWithStyleColors("border",s),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+s}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],s=Xe.repeat(this.chars.bottom,this.width),i=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+s+i)}drawEmpty(e,t){let s=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let o=this.cells[this.y+t][this.x-1];for(;o instanceof Vn;)o=this.cells[o.y][o.x-1];o instanceof Hn||(s=this.chars.rightMid)}let i=e?this.chars.right:"",n=Xe.repeat(" ",this.width);return this.stylizeLine(s,n,i)}},Vn=class{constructor(){}draw(e){return typeof e=="number"&&A1(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Hn=class{constructor(e){this.originalCell=e}init(e){let t=this.y,s=this.originalCell.y;this.cellOffset=t-s,this.offset=o7(e.rowHeights,s,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(A1(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}};function S1(...r){return r.filter(e=>e!=null).shift()}function dh(r,e,t,s){let i=t.split("-");i.length>1?(i[1]=i[1].charAt(0).toUpperCase()+i[1].substr(1),i=i.join(""),s[i]=S1(r[i],r[t],e[i],e[t])):s[t]=S1(r[t],e[t])}function o7(r,e,t){let s=r[e];for(let i=1;i<t;i++)s+=1+r[e+i];return s}function _1(r,e){return r+e+1}var a7=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];za.exports=ph;za.exports.ColSpanCell=Vn;za.exports.RowSpanCell=Hn});var I1=D((SO,O1)=>{var{warn:c7,debug:l7}=Ha(),mh=T1(),{ColSpanCell:u7,RowSpanCell:h7}=mh;(function(){function r(f,p){return f[p]>0?r(f,p+1):p}function e(f){let p={};f.forEach(function(m,g){let x=0;m.forEach(function(b){b.y=g,b.x=g?r(p,x):x;let y=b.rowSpan||1,w=b.colSpan||1;if(y>1)for(let v=0;v<w;v++)p[b.x+v]=y;x=b.x+w}),Object.keys(p).forEach(b=>{p[b]--,p[b]<1&&delete p[b]})})}function t(f){let p=0;return f.forEach(function(m){m.forEach(function(g){p=Math.max(p,g.x+(g.colSpan||1))})}),p}function s(f){return f.length}function i(f,p){let m=f.y,g=f.y-1+(f.rowSpan||1),x=p.y,b=p.y-1+(p.rowSpan||1),y=!(m>b||x>g),w=f.x,v=f.x-1+(f.colSpan||1),I=p.x,B=p.x-1+(p.colSpan||1),H=!(w>B||I>v);return y&&H}function n(f,p,m){let g=Math.min(f.length-1,m),x={x:p,y:m};for(let b=0;b<=g;b++){let y=f[b];for(let w=0;w<y.length;w++)if(i(x,y[w]))return!0}return!1}function o(f,p,m,g){for(let x=m;x<g;x++)if(n(f,x,p))return!1;return!0}function a(f){f.forEach(function(p,m){p.forEach(function(g){for(let x=1;x<g.rowSpan;x++){let b=new h7(g);b.x=g.x,b.y=g.y+x,b.colSpan=g.colSpan,l(b,f[m+x])}})})}function c(f){for(let p=f.length-1;p>=0;p--){let m=f[p];for(let g=0;g<m.length;g++){let x=m[g];for(let b=1;b<x.colSpan;b++){let y=new u7;y.x=x.x+b,y.y=x.y,m.splice(g+1,0,y)}}}}function l(f,p){let m=0;for(;m<p.length&&p[m].x<f.x;)m++;p.splice(m,0,f)}function u(f){let p=s(f),m=t(f);l7(`Max rows: ${p}; Max cols: ${m}`);for(let g=0;g<p;g++)for(let x=0;x<m;x++)if(!n(f,x,g)){let b={x,y:g,colSpan:1,rowSpan:1};for(x++;x<m&&!n(f,x,g);)b.colSpan++,x++;let y=g+1;for(;y<p&&o(f,y,b.x,b.x+b.colSpan);)b.rowSpan++,y++;let w=new mh(b);w.x=b.x,w.y=b.y,c7(`Missing cell at ${w.y}-${w.x}.`),l(w,f[g])}}function h(f){return f.map(function(p){if(!Array.isArray(p)){let m=Object.keys(p)[0];p=p[m],Array.isArray(p)?(p=p.slice(),p.unshift(m)):p=[m,p]}return p.map(function(m){return new mh(m)})})}function d(f){let p=h(f);return e(p),u(p),a(p),c(p),p}O1.exports={makeTableLayout:d,layoutTable:e,addRowSpanCells:a,maxWidth:t,fillInTable:u,computeWidths:F1("colSpan","desiredWidth","x",1),computeHeights:F1("rowSpan","desiredHeight","y",1)}})();function F1(r,e,t,s){return function(i,n){let o=[],a=[],c={};n.forEach(function(l){l.forEach(function(u){(u[r]||1)>1?a.push(u):o[u[t]]=Math.max(o[u[t]]||0,u[e]||0,s)})}),i.forEach(function(l,u){typeof l=="number"&&(o[u]=l)});for(let l=a.length-1;l>=0;l--){let u=a[l],h=u[r],d=u[t],f=o[d],p=typeof i[d]=="number"?0:1;if(typeof f=="number")for(let m=1;m<h;m++)f+=1+o[d+m],typeof i[d+m]!="number"&&p++;else f=e==="desiredWidth"?u.desiredWidth-1:1,(!c[d]||c[d]<f)&&(c[d]=f);if(u[e]>f){let m=0;for(;p>0&&u[e]>f;){if(typeof i[d+m]!="number"){let g=Math.round((u[e]-f)/p);f+=g,o[d+m]+=g,p--}m++}}}Object.assign(i,o,c);for(let l=0;l<i.length;l++)i[l]=Math.max(s,i[l]||0)}}});var P1=D((_O,B1)=>{var lr=Ha(),f7=hh(),xh=I1(),Ka=class extends Array{constructor(e){super();let t=f7.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":lr.setDebugLevel(lr.WARN);break;case"number":lr.setDebugLevel(t.debug);break;case"string":lr.setDebugLevel(parseInt(t.debug,10));break;default:lr.setDebugLevel(lr.WARN),lr.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return lr.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let s=xh.makeTableLayout(e);s.forEach(function(n){n.forEach(function(o){o.mergeTableOptions(this.options,s)},this)},this),xh.computeWidths(this.options.colWidths,s),xh.computeHeights(this.options.rowHeights,s),s.forEach(function(n){n.forEach(function(o){o.init(this.options)},this)},this);let i=[];for(let n=0;n<s.length;n++){let o=s[n],a=this.options.rowHeights[n];(n===0||!this.options.style.compact||n==1&&t)&&gh(o,"top",i);for(let c=0;c<a;c++)gh(o,c,i);n+1==s.length&&gh(o,"bottom",i)}return i.join(`
76
+ `))}wrapLines(e){let t=Xe.colorizeLines(e);return this.href?t.map(s=>Xe.hyperlink(this.href,s)):t}init(e){let t=this.x,s=this.y;this.widths=e.colWidths.slice(t,t+this.colSpan),this.heights=e.rowHeights.slice(s,s+this.rowSpan),this.width=this.widths.reduce(_1,-1),this.height=this.heights.reduce(_1,-1),this.hAlign=this.options.hAlign||e.colAligns[t],this.vAlign=this.options.vAlign||e.rowAligns[s],this.drawRight=t+this.colSpan==e.colWidths.length}draw(e,t){if(e=="top")return this.drawTop(this.drawRight);if(e=="bottom")return this.drawBottom(this.drawRight);let s=Xe.truncate(this.content,10,this.truncate);e||n7(`${this.y}-${this.x}: ${this.rowSpan-e}x${this.colSpan} Cell ${s}`);let i=Math.max(this.height-this.lines.length,0),n;switch(this.vAlign){case"center":n=Math.ceil(i/2);break;case"bottom":n=i;break;default:n=0}if(e<n||e>=n+this.lines.length)return this.drawEmpty(this.drawRight,t);let o=this.lines.length>this.height&&e+1>=this.height;return this.drawLine(e-n,this.drawRight,o,t)}drawTop(e){let t=[];return this.cells?this.widths.forEach(function(s,i){t.push(this._topLeftChar(i)),t.push(Xe.repeat(this.chars[this.y==0?"top":"mid"],s))},this):(t.push(this._topLeftChar(0)),t.push(Xe.repeat(this.chars[this.y==0?"top":"mid"],this.width))),e&&t.push(this.chars[this.y==0?"topRight":"rightMid"]),this.wrapWithStyleColors("border",t.join(""))}_topLeftChar(e){let t=this.x+e,s;if(this.y==0)s=t==0?"topLeft":e==0?"topMid":"top";else if(t==0)s="leftMid";else if(s=e==0?"midMid":"bottomMid",this.cells&&(this.cells[this.y-1][t]instanceof r.ColSpanCell&&(s=e==0?"topMid":"mid"),e==0)){let n=1;for(;this.cells[this.y][t-n]instanceof r.ColSpanCell;)n++;this.cells[this.y][t-n]instanceof r.RowSpanCell&&(s="leftMid")}return this.chars[s]}wrapWithStyleColors(e,t){if(this[e]&&this[e].length)try{let s=k1();for(let i=this[e].length-1;i>=0;i--)s=s[this[e][i]];return s(t)}catch{return t}else return t}drawLine(e,t,s,i){let n=this.chars[this.x==0?"left":"middle"];if(this.x&&i&&this.cells){let d=this.cells[this.y+i][this.x-1];for(;d instanceof Vn;)d=this.cells[d.y][d.x-1];d instanceof Hn||(n=this.chars.rightMid)}let o=Xe.repeat(" ",this.paddingLeft),a=t?this.chars.right:"",c=Xe.repeat(" ",this.paddingRight),l=this.lines[e],u=this.width-(this.paddingLeft+this.paddingRight);s&&(l+=this.truncate||"\u2026");let h=Xe.truncate(l,u,this.truncate);return h=Xe.pad(h,u," ",this.hAlign),h=o+h+c,this.stylizeLine(n,h,a)}stylizeLine(e,t,s){return e=this.wrapWithStyleColors("border",e),s=this.wrapWithStyleColors("border",s),this.y===0&&(t=this.wrapWithStyleColors("head",t)),e+t+s}drawBottom(e){let t=this.chars[this.x==0?"bottomLeft":"bottomMid"],s=Xe.repeat(this.chars.bottom,this.width),i=e?this.chars.bottomRight:"";return this.wrapWithStyleColors("border",t+s+i)}drawEmpty(e,t){let s=this.chars[this.x==0?"left":"middle"];if(this.x&&t&&this.cells){let o=this.cells[this.y+t][this.x-1];for(;o instanceof Vn;)o=this.cells[o.y][o.x-1];o instanceof Hn||(s=this.chars.rightMid)}let i=e?this.chars.right:"",n=Xe.repeat(" ",this.width);return this.stylizeLine(s,n,i)}},Vn=class{constructor(){}draw(e){return typeof e=="number"&&A1(`${this.y}-${this.x}: 1x1 ColSpanCell`),""}init(){}mergeTableOptions(){}},Hn=class{constructor(e){this.originalCell=e}init(e){let t=this.y,s=this.originalCell.y;this.cellOffset=t-s,this.offset=o7(e.rowHeights,s,this.cellOffset)}draw(e){return e=="top"?this.originalCell.draw(this.offset,this.cellOffset):e=="bottom"?this.originalCell.draw("bottom"):(A1(`${this.y}-${this.x}: 1x${this.colSpan} RowSpanCell for ${this.originalCell.content}`),this.originalCell.draw(this.offset+1+e))}mergeTableOptions(){}};function S1(...r){return r.filter(e=>e!=null).shift()}function dh(r,e,t,s){let i=t.split("-");i.length>1?(i[1]=i[1].charAt(0).toUpperCase()+i[1].substr(1),i=i.join(""),s[i]=S1(r[i],r[t],e[i],e[t])):s[t]=S1(r[t],e[t])}function o7(r,e,t){let s=r[e];for(let i=1;i<t;i++)s+=1+r[e+i];return s}function _1(r,e){return r+e+1}var a7=["top","top-mid","top-left","top-right","bottom","bottom-mid","bottom-left","bottom-right","left","left-mid","mid","mid-mid","right","right-mid","middle"];za.exports=ph;za.exports.ColSpanCell=Vn;za.exports.RowSpanCell=Hn});var I1=D((SO,O1)=>{var{warn:c7,debug:l7}=Ha(),mh=T1(),{ColSpanCell:u7,RowSpanCell:h7}=mh;(function(){function r(f,p){return f[p]>0?r(f,p+1):p}function e(f){let p={};f.forEach(function(m,g){let x=0;m.forEach(function(b){b.y=g,b.x=g?r(p,x):x;let y=b.rowSpan||1,w=b.colSpan||1;if(y>1)for(let v=0;v<w;v++)p[b.x+v]=y;x=b.x+w}),Object.keys(p).forEach(b=>{p[b]--,p[b]<1&&delete p[b]})})}function t(f){let p=0;return f.forEach(function(m){m.forEach(function(g){p=Math.max(p,g.x+(g.colSpan||1))})}),p}function s(f){return f.length}function i(f,p){let m=f.y,g=f.y-1+(f.rowSpan||1),x=p.y,b=p.y-1+(p.rowSpan||1),y=!(m>b||x>g),w=f.x,v=f.x-1+(f.colSpan||1),I=p.x,B=p.x-1+(p.colSpan||1),H=!(w>B||I>v);return y&&H}function n(f,p,m){let g=Math.min(f.length-1,m),x={x:p,y:m};for(let b=0;b<=g;b++){let y=f[b];for(let w=0;w<y.length;w++)if(i(x,y[w]))return!0}return!1}function o(f,p,m,g){for(let x=m;x<g;x++)if(n(f,x,p))return!1;return!0}function a(f){f.forEach(function(p,m){p.forEach(function(g){for(let x=1;x<g.rowSpan;x++){let b=new h7(g);b.x=g.x,b.y=g.y+x,b.colSpan=g.colSpan,l(b,f[m+x])}})})}function c(f){for(let p=f.length-1;p>=0;p--){let m=f[p];for(let g=0;g<m.length;g++){let x=m[g];for(let b=1;b<x.colSpan;b++){let y=new u7;y.x=x.x+b,y.y=x.y,m.splice(g+1,0,y)}}}}function l(f,p){let m=0;for(;m<p.length&&p[m].x<f.x;)m++;p.splice(m,0,f)}function u(f){let p=s(f),m=t(f);l7(`Max rows: ${p}; Max cols: ${m}`);for(let g=0;g<p;g++)for(let x=0;x<m;x++)if(!n(f,x,g)){let b={x,y:g,colSpan:1,rowSpan:1};for(x++;x<m&&!n(f,x,g);)b.colSpan++,x++;let y=g+1;for(;y<p&&o(f,y,b.x,b.x+b.colSpan);)b.rowSpan++,y++;let w=new mh(b);w.x=b.x,w.y=b.y,c7(`Missing cell at ${w.y}-${w.x}.`),l(w,f[g])}}function h(f){return f.map(function(p){if(!Array.isArray(p)){let m=Object.keys(p)[0];p=p[m],Array.isArray(p)?(p=p.slice(),p.unshift(m)):p=[m,p]}return p.map(function(m){return new mh(m)})})}function d(f){let p=h(f);return e(p),u(p),a(p),c(p),p}O1.exports={makeTableLayout:d,layoutTable:e,addRowSpanCells:a,maxWidth:t,fillInTable:u,computeWidths:F1("colSpan","desiredWidth","x",1),computeHeights:F1("rowSpan","desiredHeight","y",1)}})();function F1(r,e,t,s){return function(i,n){let o=[],a=[],c={};n.forEach(function(l){l.forEach(function(u){(u[r]||1)>1?a.push(u):o[u[t]]=Math.max(o[u[t]]||0,u[e]||0,s)})}),i.forEach(function(l,u){typeof l=="number"&&(o[u]=l)});for(let l=a.length-1;l>=0;l--){let u=a[l],h=u[r],d=u[t],f=o[d],p=typeof i[d]=="number"?0:1;if(typeof f=="number")for(let m=1;m<h;m++)f+=1+o[d+m],typeof i[d+m]!="number"&&p++;else f=e==="desiredWidth"?u.desiredWidth-1:1,(!c[d]||c[d]<f)&&(c[d]=f);if(u[e]>f){let m=0;for(;p>0&&u[e]>f;){if(typeof i[d+m]!="number"){let g=Math.round((u[e]-f)/p);f+=g,o[d+m]+=g,p--}m++}}}Object.assign(i,o,c);for(let l=0;l<i.length;l++)i[l]=Math.max(s,i[l]||0)}}});var P1=D((_O,B1)=>{var ur=Ha(),f7=hh(),xh=I1(),Ka=class extends Array{constructor(e){super();let t=f7.mergeOptions(e);if(Object.defineProperty(this,"options",{value:t,enumerable:t.debug}),t.debug){switch(typeof t.debug){case"boolean":ur.setDebugLevel(ur.WARN);break;case"number":ur.setDebugLevel(t.debug);break;case"string":ur.setDebugLevel(parseInt(t.debug,10));break;default:ur.setDebugLevel(ur.WARN),ur.warn(`Debug option is expected to be boolean, number, or string. Received a ${typeof t.debug}`)}Object.defineProperty(this,"messages",{get(){return ur.debugMessages()}})}}toString(){let e=this,t=this.options.head&&this.options.head.length;t?(e=[this.options.head],this.length&&e.push.apply(e,this)):this.options.style.head=[];let s=xh.makeTableLayout(e);s.forEach(function(n){n.forEach(function(o){o.mergeTableOptions(this.options,s)},this)},this),xh.computeWidths(this.options.colWidths,s),xh.computeHeights(this.options.rowHeights,s),s.forEach(function(n){n.forEach(function(o){o.init(this.options)},this)},this);let i=[];for(let n=0;n<s.length;n++){let o=s[n],a=this.options.rowHeights[n];(n===0||!this.options.style.compact||n==1&&t)&&gh(o,"top",i);for(let c=0;c<a;c++)gh(o,c,i);n+1==s.length&&gh(o,"bottom",i)}return i.join(`
77
77
  `)}get width(){return this.toString().split(`
78
- `)[0].length}};Ka.reset=()=>lr.reset();function gh(r,e,t){let s=[];r.forEach(function(n){s.push(n.draw(e))});let i=s.join("");i.length&&t.push(i)}B1.exports=Ka});var bh=D((AO,R1)=>{R1.exports=P1()});var Lb=require("node:process"),wt=_(require("chalk"));var Gh=_(Hh(),1),{program:bE,createCommand:yE,createArgument:wE,createOption:DE,CommanderError:vE,InvalidArgumentError:CE,InvalidOptionArgumentError:EE,Command:Se,Argument:kE,Option:SE,Help:_E}=Gh.default;var eo={};Bh(eo,{ConEmu:()=>Qh,beep:()=>My,clearScreen:()=>Fy,clearTerminal:()=>By,clearViewport:()=>Oy,cursorBackward:()=>my,cursorDown:()=>dy,cursorForward:()=>py,cursorGetPosition:()=>by,cursorHide:()=>Dy,cursorLeft:()=>Yh,cursorMove:()=>fy,cursorNextLine:()=>yy,cursorPrevLine:()=>wy,cursorRestorePosition:()=>gy,cursorSavePosition:()=>xy,cursorShow:()=>vy,cursorTo:()=>hy,cursorUp:()=>Zh,enterAlternativeScreen:()=>Py,eraseDown:()=>Sy,eraseEndLine:()=>Ey,eraseLine:()=>Jh,eraseLines:()=>Cy,eraseScreen:()=>Qn,eraseStartLine:()=>ky,eraseUp:()=>_y,exitAlternativeScreen:()=>Ry,iTerm:()=>Xh,image:()=>jy,link:()=>$y,scrollDown:()=>Ty,scrollUp:()=>Ay,setCwd:()=>Ny});var Nr=_(require("node:process"),1),zh=_(require("node:os"),1);var Is=globalThis.window?.document!==void 0,TE=globalThis.process?.versions?.node!==void 0,FE=globalThis.process?.versions?.bun!==void 0,OE=globalThis.Deno?.version?.deno!==void 0,IE=globalThis.process?.versions?.electron!==void 0,BE=globalThis.navigator?.userAgent?.includes("jsdom")===!0,PE=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,RE=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,ME=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,$E=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,qi=globalThis.navigator?.userAgentData?.platform,jE=qi==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",NE=qi==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",LE=qi==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",UE=qi==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),WE=qi==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var Z="\x1B[",Bs="\x1B]",Lr="\x07",Vi=";",Kh=!Is&&Nr.default.env.TERM_PROGRAM==="Apple_Terminal",ly=!Is&&Nr.default.platform==="win32",uy=!Is&&(Nr.default.env.TERM?.startsWith("screen")||Nr.default.env.TERM?.startsWith("tmux")||Nr.default.env.TMUX!==void 0),Ac=Is?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:Nr.default.cwd,Ps=r=>uy?"\x1BPtmux;"+r.replaceAll("\x1B","\x1B\x1B")+"\x1B\\":r,hy=(r,e)=>{if(typeof r!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?Z+(r+1)+"G":Z+(e+1)+Vi+(r+1)+"H"},fy=(r,e)=>{if(typeof r!="number")throw new TypeError("The `x` argument is required");let t="";return r<0?t+=Z+-r+"D":r>0&&(t+=Z+r+"C"),e<0?t+=Z+-e+"A":e>0&&(t+=Z+e+"B"),t},Zh=(r=1)=>Z+r+"A",dy=(r=1)=>Z+r+"B",py=(r=1)=>Z+r+"C",my=(r=1)=>Z+r+"D",Yh=Z+"G",xy=Kh?"\x1B7":Z+"s",gy=Kh?"\x1B8":Z+"u",by=Z+"6n",yy=Z+"E",wy=Z+"F",Dy=Z+"?25l",vy=Z+"?25h",Cy=r=>{let e="";for(let t=0;t<r;t++)e+=Jh+(t<r-1?Zh():"");return r&&(e+=Yh),e},Ey=Z+"K",ky=Z+"1K",Jh=Z+"2K",Sy=Z+"J",_y=Z+"1J",Qn=Z+"2J",Ay=Z+"S",Ty=Z+"T",Fy="\x1Bc",Oy=`${Qn}${Z}H`,Iy=()=>{if(Is||!ly)return!1;let r=zh.default.release().split("."),e=Number(r[0]),t=Number(r[2]??0);return e<10||e===10&&t<10586},By=Iy()?`${Qn}${Z}0f`:`${Qn}${Z}3J${Z}H`,Py=Z+"?1049h",Ry=Z+"?1049l",My=Lr,$y=(r,e)=>{let t=Ps(`${Bs}8${Vi}${Vi}${e}${Lr}`),s=Ps(`${Bs}8${Vi}${Vi}${Lr}`);return t+r+s},jy=(r,e={})=>{let t=`${Bs}1337;File=inline=1`;e.width&&(t+=`;width=${e.width}`),e.height&&(t+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0");let s=Buffer.from(r);return Ps(t+`;size=${s.byteLength}:`+s.toString("base64")+Lr)},Xh={setCwd:(r=Ac())=>Ps(`${Bs}50;CurrentDir=${r}${Lr}`),annotation(r,e={}){let t=`${Bs}1337;`,s=e.x!==void 0,i=e.y!==void 0;if((s||i)&&!(s&&i&&e.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return r=r.replaceAll("|",""),t+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?t+=(s?[r,e.length,e.x,e.y]:[e.length,r]).join("|"):t+=r,Ps(t+Lr)}},Qh={setCwd:(r=Ac())=>Ps(`${Bs}9;9;${r}${Lr}`)},Ny=(r=Ac())=>Xh.setCwd(r)+Qh.setCwd(r);var to=_(af(),1);function Yt(r,e,{target:t="stdout",...s}={}){return to.default[t]?eo.link(r,e):s.fallback===!1?r:typeof s.fallback=="function"?s.fallback(r,e):`${r} (\u200B${e}\u200B)`}Yt.isSupported=to.default.stdout;Yt.stderr=(r,e,t={})=>Yt(r,e,{target:"stderr",...t});Yt.stderr.isSupported=to.default.stderr;var It=require("listr2"),uw=Object.defineProperty,Yd=(r,e)=>uw(r,"name",{value:e,configurable:!0}),Q=class extends It.ListrPromptAdapter{static{Yd(this,"ListrEnquirerPromptAdapter")}error;prompt;get instance(){return this.prompt}async run(r,e){Array.isArray(r)?r.length===1&&(r=r.map(i=>({...i,name:"default"}))):r=[{...r,name:"default"}],r=r.map(i=>({onCancel:Yd(()=>(this.error=new It.PromptError("Cancelled prompt."),!0),"onCancel"),...i,stdout:e?.stdout??this.wrapper.stdout(It.ListrTaskEventType.PROMPT)}));let t;if(e?.enquirer)t=e.enquirer;else try{t=await Promise.resolve().then(()=>_(Zd(),1)).then(i=>i.default?new i.default:new i)}catch{throw this.reportFailed(),new It.PromptError("Enquirer is a optional peer dependency that must be installed separately.")}this.reportStarted(),this.task.on(It.ListrTaskEventType.STATE,i=>{i===It.ListrTaskState.SKIPPED&&this.prompt&&!this.error&&this.cancel({throw:!1})});let s;try{s=await t.once("prompt",i=>this.prompt=i).prompt(r)}catch(i){throw this.reportFailed(),this.error?this.error:i}return this.reportCompleted(),r.length===1?s.default:s}cancel(r){!this.prompt||this.error||(r?.throw?this.prompt.cancel():this.prompt.submit(),this.reportFailed())}};var ur=_(require("chalk"));var Ls=require("node:fs"),sp=require("node:os"),ip=require("node:path");var mr=require("node:crypto"),Ns=require("node:fs"),Vr=require("node:os"),Jd=require("node:path"),El=(0,Jd.join)((0,Vr.homedir)(),".platform-sdk-keys"),Xd="aes-256-gcm";function Qd(){let r=`${(0,Vr.hostname)()}:${(0,Vr.userInfo)().username}:${(0,Vr.homedir)()}`;return(0,mr.createHash)("sha256").update(r).digest()}function ep(){if(!(0,Ns.existsSync)(El))return{};try{return JSON.parse((0,Ns.readFileSync)(El,"utf-8"))}catch{return{}}}function hw(r){(0,Ns.writeFileSync)(El,JSON.stringify(r,null,2),{mode:384})}function fw(r){let e=Qd(),t=(0,mr.randomBytes)(16),s=(0,mr.createCipheriv)(Xd,e,t),i=s.update(r,"utf8","hex");return i+=s.final("hex"),{iv:t.toString("hex"),tag:s.getAuthTag().toString("hex"),data:i}}function dw(r){let e=Qd(),t=Buffer.from(r.iv,"hex"),s=Buffer.from(r.tag,"hex"),i=(0,mr.createDecipheriv)(Xd,e,t);i.setAuthTag(s);let n=i.update(r.data,"hex","utf8");return n+=i.final("utf8"),n}async function tp(r,e){let t=ep();t[r]=fw(e),hw(t)}async function uo(r){let t=ep()[r];if(!t)return null;try{return dw(t)}catch{return null}}var Zi={openai:{id:"openai",name:"OpenAI",defaultApiKeyEnvVar:"OPENAI_API_KEY",defaultModel:"gpt-4o-mini",modelsApiUrl:"https://api.openai.com/v1/models",apiKeyUrl:"https://platform.openai.com/api-keys",buildHeaders:r=>({Authorization:`Bearer ${r}`}),parseModelsResponse:r=>r.data??[],modelFilters:[/^gpt-4/,/^gpt-3\.5/,/^o1/,/^o3/]},anthropic:{id:"anthropic",name:"Anthropic (Claude)",defaultApiKeyEnvVar:"ANTHROPIC_API_KEY",defaultModel:"claude-sonnet-4-20250514",modelsApiUrl:"https://api.anthropic.com/v1/models",apiKeyUrl:"https://console.anthropic.com/settings/keys",buildHeaders:r=>({"x-api-key":r,"anthropic-version":"2023-06-01"}),parseModelsResponse:r=>(r.data??[]).map(t=>({id:t.id,created:new Date(t.created_at).getTime()})),modelFilters:[/^claude-/]}};function rp(){return Object.entries(Zi).map(([r,e])=>({name:e.name,value:r}))}function Yi(r){let e=Zi[r];if(!e)throw new Error(`Unknown AI provider: ${r}`);return e}var Hr=(0,ip.join)((0,sp.homedir)(),".platform-sdk-ai.json");function pw(){let r="anthropic",e=Zi[r];return{provider:r,model:e.defaultModel}}var kl=pw();function Ji(){return(0,Ls.existsSync)(Hr)}function ho(){if(!Ji())throw new Error("AI configuration not found. Please run 'pf ai:setup' to configure your AI provider.");try{let r=(0,Ls.readFileSync)(Hr,"utf-8"),e=JSON.parse(r);return{...kl,...e}}catch{throw new Error(`Failed to load AI configuration from ${Hr}. Please run 'pf setup --ai' again.`)}}function np(r){let e=JSON.stringify(r,null,2);(0,Ls.writeFileSync)(Hr,e,"utf-8")}async function op(r,e){await tp(r,e)}async function ap(r){let e=await uo(r.provider);if(e)return e;let t=Zi[r.provider],s=process.env[t.defaultApiKeyEnvVar];if(s)return s;throw new Error("API key not found. Please run 'pf setup --ai' to configure your API key.")}async function mw(r,e,t,s){let{createOpenAI:i}=await import("@ai-sdk/openai"),n=i({apiKey:t});if(s.onToken){let{streamText:c}=await import("ai"),l=c({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature}),u="";for await(let h of(await l).textStream)u+=h,s.onToken(h);return u}let{generateText:o}=await import("ai"),{text:a}=await o({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature});return a}async function xw(r,e,t,s){let{createAnthropic:i}=await import("@ai-sdk/anthropic"),n=i({apiKey:t});if(s.onToken){let{streamText:c}=await import("ai"),l=c({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature}),u="";for await(let h of(await l).textStream)u+=h,s.onToken(h);return u}let{generateText:o}=await import("ai"),{text:a}=await o({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature});return a}async function cp(r,e,t={}){let{system:s,maxTokens:i=4096,temperature:n=.7,onToken:o}=t,a=await ap(r);switch(r.provider){case"openai":return mw(e,r.model,a,{system:s,maxTokens:i,temperature:n,onToken:o});case"anthropic":return xw(e,r.model,a,{system:s,maxTokens:i,temperature:n,onToken:o});default:throw new Error(`Unsupported AI provider: ${r.provider}`)}}var Oa=require("node:fs"),gi=require("node:path");var ve=(r,e=[])=>r.name==="up"||e.includes("vim")&&r.name==="k"||e.includes("emacs")&&r.ctrl&&r.name==="p",We=(r,e=[])=>r.name==="down"||e.includes("vim")&&r.name==="j"||e.includes("emacs")&&r.ctrl&&r.name==="n",Sl=r=>r.name==="space",Gr=r=>r.name==="backspace",Xt=r=>r.name==="tab",Xi=r=>"1234567890".includes(r.name),ae=r=>r.name==="enter"||r.name==="return";var fo=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},po=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Qi=class extends Error{name="ExitPromptError"},mo=class extends Error{name="HookError"},Bt=class extends Error{name="ValidationError"};var fp=require("node:async_hooks");var xo=require("node:async_hooks");var lp=new xo.AsyncLocalStorage;function gw(r){return{rl:r,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function up(r,e){let t=gw(r);return lp.run(t,()=>{function s(i){t.handleChange=()=>{t.index=0,i()},t.handleChange()}return e(s)})}function zr(){let r=lp.getStore();if(!r)throw new mo("[Inquirer] Hook functions can only be called from within a prompt");return r}function _l(){return zr().rl}function Al(r){let e=(...t)=>{let s=zr(),i=!1,n=s.handleChange;s.handleChange=()=>{i=!0};let o=r(...t);return i&&n(),s.handleChange=n,o};return xo.AsyncResource.bind(e)}function Us(r){let e=zr(),{index:t}=e,s={get(){return e.hooks[t]},set(n){e.hooks[t]=n},initialized:t in e.hooks},i=r(s);return e.index++,i}function hp(){zr().handleChange()}var Kr={queue(r){let e=zr(),{index:t}=e;e.hooksEffect.push(()=>{e.hooksCleanup[t]?.();let s=r(_l());if(s!=null&&typeof s!="function")throw new Bt("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[t]=s})},run(){let r=zr();Al(()=>{r.hooksEffect.forEach(e=>{e()}),r.hooksEffect.length=0})()},clearAll(){let r=zr();r.hooksCleanup.forEach(e=>{e?.()}),r.hooksEffect.length=0,r.hooksCleanup.length=0}};function R(r){return Us(e=>{let t=fp.AsyncResource.bind(function(n){e.get()!==n&&(e.set(n),hp())});if(e.initialized)return[e.get(),t];let s=typeof r=="function"?r():r;return e.set(s),[s,t]})}function Ze(r,e){Us(t=>{let s=t.get();(!Array.isArray(s)||e.some((n,o)=>!Object.is(n,s[o])))&&Kr.queue(r),t.set(e)})}var nt=_(xr(),1);var Ct=_(require("node:process"),1);function ww(){return Ct.default.platform!=="win32"?Ct.default.env.TERM!=="linux":!!Ct.default.env.WT_SESSION||!!Ct.default.env.TERMINUS_SUBLIME||Ct.default.env.ConEmuTask==="{cmd::Cmder}"||Ct.default.env.TERM_PROGRAM==="Terminus-Sublime"||Ct.default.env.TERM_PROGRAM==="vscode"||Ct.default.env.TERM==="xterm-256color"||Ct.default.env.TERM==="alacritty"||Ct.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var pp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},mp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Dw={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},vw={...pp,...mp},Cw={...pp,...Dw},Ew=ww(),kw=Ew?vw:Cw,it=kw,lk=Object.entries(mp);var xp={prefix:{idle:nt.default.blue("?"),done:nt.default.green(it.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(r=>nt.default.yellow(r))},style:{answer:nt.default.cyan,message:nt.default.bold,error:r=>nt.default.red(`> ${r}`),defaultAnswer:r=>nt.default.dim(`(${r})`),help:nt.default.dim,highlight:nt.default.cyan,key:r=>nt.default.cyan(nt.default.bold(`<${r}>`))}};function gp(r){if(typeof r!="object"||r===null)return!1;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function bp(...r){let e={};for(let t of r)for(let[s,i]of Object.entries(t)){let n=e[s];e[s]=gp(n)&&gp(i)?bp(n,i):i}return e}function ie(...r){let e=[xp,...r.filter(t=>t!=null)];return bp(...e)}function ce({status:r="idle",theme:e}){let[t,s]=R(!1),[i,n]=R(0),{prefix:o,spinner:a}=ie(e);return Ze(()=>{if(r==="loading"){let l,u=-1,h=setTimeout(()=>{s(!0),l=setInterval(()=>{u=u+1,n(u%a.frames.length)},a.interval)},300);return()=>{clearTimeout(h),clearInterval(l)}}else s(!1)},[r]),t?a.frames[i]:typeof o=="string"?o:o[r==="loading"?"idle":r]??o.idle}function qe(r,e){return Us(t=>{let s=t.get();if(!s||s.dependencies.length!==e.length||s.dependencies.some((i,n)=>i!==e[n])){let i=r();return t.set({value:i,dependencies:e}),i}return s.value})}function Zr(r){return R({current:r})[0]}function le(r){let e=Zr(r);e.current=r,Ze(t=>{let s=!1,i=Al((n,o)=>{s||e.current(o,t)});return t.input.on("keypress",i),()=>{s=!0,t.input.removeListener("keypress",i)}},[])}var qp=_(wp(),1),Vp=_(Wp(),1);function rn(r,e){return r.split(`
78
+ `)[0].length}};Ka.reset=()=>ur.reset();function gh(r,e,t){let s=[];r.forEach(function(n){s.push(n.draw(e))});let i=s.join("");i.length&&t.push(i)}B1.exports=Ka});var bh=D((AO,R1)=>{R1.exports=P1()});var Lb=require("node:process"),wt=_(require("chalk"));var Gh=_(Hh(),1),{program:bE,createCommand:yE,createArgument:wE,createOption:DE,CommanderError:vE,InvalidArgumentError:CE,InvalidOptionArgumentError:EE,Command:Se,Argument:kE,Option:SE,Help:_E}=Gh.default;var eo={};Bh(eo,{ConEmu:()=>Qh,beep:()=>My,clearScreen:()=>Fy,clearTerminal:()=>By,clearViewport:()=>Oy,cursorBackward:()=>my,cursorDown:()=>dy,cursorForward:()=>py,cursorGetPosition:()=>by,cursorHide:()=>Dy,cursorLeft:()=>Yh,cursorMove:()=>fy,cursorNextLine:()=>yy,cursorPrevLine:()=>wy,cursorRestorePosition:()=>gy,cursorSavePosition:()=>xy,cursorShow:()=>vy,cursorTo:()=>hy,cursorUp:()=>Zh,enterAlternativeScreen:()=>Py,eraseDown:()=>Sy,eraseEndLine:()=>Ey,eraseLine:()=>Jh,eraseLines:()=>Cy,eraseScreen:()=>Qn,eraseStartLine:()=>ky,eraseUp:()=>_y,exitAlternativeScreen:()=>Ry,iTerm:()=>Xh,image:()=>jy,link:()=>$y,scrollDown:()=>Ty,scrollUp:()=>Ay,setCwd:()=>Ny});var Lr=_(require("node:process"),1),zh=_(require("node:os"),1);var Is=globalThis.window?.document!==void 0,TE=globalThis.process?.versions?.node!==void 0,FE=globalThis.process?.versions?.bun!==void 0,OE=globalThis.Deno?.version?.deno!==void 0,IE=globalThis.process?.versions?.electron!==void 0,BE=globalThis.navigator?.userAgent?.includes("jsdom")===!0,PE=typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope,RE=typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope,ME=typeof SharedWorkerGlobalScope<"u"&&globalThis instanceof SharedWorkerGlobalScope,$E=typeof ServiceWorkerGlobalScope<"u"&&globalThis instanceof ServiceWorkerGlobalScope,qi=globalThis.navigator?.userAgentData?.platform,jE=qi==="macOS"||globalThis.navigator?.platform==="MacIntel"||globalThis.navigator?.userAgent?.includes(" Mac ")===!0||globalThis.process?.platform==="darwin",NE=qi==="Windows"||globalThis.navigator?.platform==="Win32"||globalThis.process?.platform==="win32",LE=qi==="Linux"||globalThis.navigator?.platform?.startsWith("Linux")===!0||globalThis.navigator?.userAgent?.includes(" Linux ")===!0||globalThis.process?.platform==="linux",UE=qi==="iOS"||globalThis.navigator?.platform==="MacIntel"&&globalThis.navigator?.maxTouchPoints>1||/iPad|iPhone|iPod/.test(globalThis.navigator?.platform),WE=qi==="Android"||globalThis.navigator?.platform==="Android"||globalThis.navigator?.userAgent?.includes(" Android ")===!0||globalThis.process?.platform==="android";var Z="\x1B[",Bs="\x1B]",Ur="\x07",Vi=";",Kh=!Is&&Lr.default.env.TERM_PROGRAM==="Apple_Terminal",ly=!Is&&Lr.default.platform==="win32",uy=!Is&&(Lr.default.env.TERM?.startsWith("screen")||Lr.default.env.TERM?.startsWith("tmux")||Lr.default.env.TMUX!==void 0),Ac=Is?()=>{throw new Error("`process.cwd()` only works in Node.js, not the browser.")}:Lr.default.cwd,Ps=r=>uy?"\x1BPtmux;"+r.replaceAll("\x1B","\x1B\x1B")+"\x1B\\":r,hy=(r,e)=>{if(typeof r!="number")throw new TypeError("The `x` argument is required");return typeof e!="number"?Z+(r+1)+"G":Z+(e+1)+Vi+(r+1)+"H"},fy=(r,e)=>{if(typeof r!="number")throw new TypeError("The `x` argument is required");let t="";return r<0?t+=Z+-r+"D":r>0&&(t+=Z+r+"C"),e<0?t+=Z+-e+"A":e>0&&(t+=Z+e+"B"),t},Zh=(r=1)=>Z+r+"A",dy=(r=1)=>Z+r+"B",py=(r=1)=>Z+r+"C",my=(r=1)=>Z+r+"D",Yh=Z+"G",xy=Kh?"\x1B7":Z+"s",gy=Kh?"\x1B8":Z+"u",by=Z+"6n",yy=Z+"E",wy=Z+"F",Dy=Z+"?25l",vy=Z+"?25h",Cy=r=>{let e="";for(let t=0;t<r;t++)e+=Jh+(t<r-1?Zh():"");return r&&(e+=Yh),e},Ey=Z+"K",ky=Z+"1K",Jh=Z+"2K",Sy=Z+"J",_y=Z+"1J",Qn=Z+"2J",Ay=Z+"S",Ty=Z+"T",Fy="\x1Bc",Oy=`${Qn}${Z}H`,Iy=()=>{if(Is||!ly)return!1;let r=zh.default.release().split("."),e=Number(r[0]),t=Number(r[2]??0);return e<10||e===10&&t<10586},By=Iy()?`${Qn}${Z}0f`:`${Qn}${Z}3J${Z}H`,Py=Z+"?1049h",Ry=Z+"?1049l",My=Ur,$y=(r,e)=>{let t=Ps(`${Bs}8${Vi}${Vi}${e}${Ur}`),s=Ps(`${Bs}8${Vi}${Vi}${Ur}`);return t+r+s},jy=(r,e={})=>{let t=`${Bs}1337;File=inline=1`;e.width&&(t+=`;width=${e.width}`),e.height&&(t+=`;height=${e.height}`),e.preserveAspectRatio===!1&&(t+=";preserveAspectRatio=0");let s=Buffer.from(r);return Ps(t+`;size=${s.byteLength}:`+s.toString("base64")+Ur)},Xh={setCwd:(r=Ac())=>Ps(`${Bs}50;CurrentDir=${r}${Ur}`),annotation(r,e={}){let t=`${Bs}1337;`,s=e.x!==void 0,i=e.y!==void 0;if((s||i)&&!(s&&i&&e.length!==void 0))throw new Error("`x`, `y` and `length` must be defined when `x` or `y` is defined");return r=r.replaceAll("|",""),t+=e.isHidden?"AddHiddenAnnotation=":"AddAnnotation=",e.length>0?t+=(s?[r,e.length,e.x,e.y]:[e.length,r]).join("|"):t+=r,Ps(t+Ur)}},Qh={setCwd:(r=Ac())=>Ps(`${Bs}9;9;${r}${Ur}`)},Ny=(r=Ac())=>Xh.setCwd(r)+Qh.setCwd(r);var to=_(af(),1);function Yt(r,e,{target:t="stdout",...s}={}){return to.default[t]?eo.link(r,e):s.fallback===!1?r:typeof s.fallback=="function"?s.fallback(r,e):`${r} (\u200B${e}\u200B)`}Yt.isSupported=to.default.stdout;Yt.stderr=(r,e,t={})=>Yt(r,e,{target:"stderr",...t});Yt.stderr.isSupported=to.default.stderr;var It=require("listr2"),uw=Object.defineProperty,Yd=(r,e)=>uw(r,"name",{value:e,configurable:!0}),Q=class extends It.ListrPromptAdapter{static{Yd(this,"ListrEnquirerPromptAdapter")}error;prompt;get instance(){return this.prompt}async run(r,e){Array.isArray(r)?r.length===1&&(r=r.map(i=>({...i,name:"default"}))):r=[{...r,name:"default"}],r=r.map(i=>({onCancel:Yd(()=>(this.error=new It.PromptError("Cancelled prompt."),!0),"onCancel"),...i,stdout:e?.stdout??this.wrapper.stdout(It.ListrTaskEventType.PROMPT)}));let t;if(e?.enquirer)t=e.enquirer;else try{t=await Promise.resolve().then(()=>_(Zd(),1)).then(i=>i.default?new i.default:new i)}catch{throw this.reportFailed(),new It.PromptError("Enquirer is a optional peer dependency that must be installed separately.")}this.reportStarted(),this.task.on(It.ListrTaskEventType.STATE,i=>{i===It.ListrTaskState.SKIPPED&&this.prompt&&!this.error&&this.cancel({throw:!1})});let s;try{s=await t.once("prompt",i=>this.prompt=i).prompt(r)}catch(i){throw this.reportFailed(),this.error?this.error:i}return this.reportCompleted(),r.length===1?s.default:s}cancel(r){!this.prompt||this.error||(r?.throw?this.prompt.cancel():this.prompt.submit(),this.reportFailed())}};var hr=_(require("chalk"));var Ls=require("node:fs"),sp=require("node:os"),ip=require("node:path");var xr=require("node:crypto"),Ns=require("node:fs"),Hr=require("node:os"),Jd=require("node:path"),El=(0,Jd.join)((0,Hr.homedir)(),".platform-sdk-keys"),Xd="aes-256-gcm";function Qd(){let r=`${(0,Hr.hostname)()}:${(0,Hr.userInfo)().username}:${(0,Hr.homedir)()}`;return(0,xr.createHash)("sha256").update(r).digest()}function ep(){if(!(0,Ns.existsSync)(El))return{};try{return JSON.parse((0,Ns.readFileSync)(El,"utf-8"))}catch{return{}}}function hw(r){(0,Ns.writeFileSync)(El,JSON.stringify(r,null,2),{mode:384})}function fw(r){let e=Qd(),t=(0,xr.randomBytes)(16),s=(0,xr.createCipheriv)(Xd,e,t),i=s.update(r,"utf8","hex");return i+=s.final("hex"),{iv:t.toString("hex"),tag:s.getAuthTag().toString("hex"),data:i}}function dw(r){let e=Qd(),t=Buffer.from(r.iv,"hex"),s=Buffer.from(r.tag,"hex"),i=(0,xr.createDecipheriv)(Xd,e,t);i.setAuthTag(s);let n=i.update(r.data,"hex","utf8");return n+=i.final("utf8"),n}async function tp(r,e){let t=ep();t[r]=fw(e),hw(t)}async function uo(r){let t=ep()[r];if(!t)return null;try{return dw(t)}catch{return null}}var Zi={openai:{id:"openai",name:"OpenAI",defaultApiKeyEnvVar:"OPENAI_API_KEY",defaultModel:"gpt-4o-mini",modelsApiUrl:"https://api.openai.com/v1/models",apiKeyUrl:"https://platform.openai.com/api-keys",buildHeaders:r=>({Authorization:`Bearer ${r}`}),parseModelsResponse:r=>r.data??[],modelFilters:[/^gpt-4/,/^gpt-3\.5/,/^o1/,/^o3/]},anthropic:{id:"anthropic",name:"Anthropic (Claude)",defaultApiKeyEnvVar:"ANTHROPIC_API_KEY",defaultModel:"claude-sonnet-4-20250514",modelsApiUrl:"https://api.anthropic.com/v1/models",apiKeyUrl:"https://console.anthropic.com/settings/keys",buildHeaders:r=>({"x-api-key":r,"anthropic-version":"2023-06-01"}),parseModelsResponse:r=>(r.data??[]).map(t=>({id:t.id,created:new Date(t.created_at).getTime()})),modelFilters:[/^claude-/]}};function rp(){return Object.entries(Zi).map(([r,e])=>({name:e.name,value:r}))}function Yi(r){let e=Zi[r];if(!e)throw new Error(`Unknown AI provider: ${r}`);return e}var Gr=(0,ip.join)((0,sp.homedir)(),".platform-sdk-ai.json");function pw(){let r="anthropic",e=Zi[r];return{provider:r,model:e.defaultModel}}var kl=pw();function Ji(){return(0,Ls.existsSync)(Gr)}function ho(){if(!Ji())throw new Error("AI configuration not found. Please run 'pf ai:setup' to configure your AI provider.");try{let r=(0,Ls.readFileSync)(Gr,"utf-8"),e=JSON.parse(r);return{...kl,...e}}catch{throw new Error(`Failed to load AI configuration from ${Gr}. Please run 'pf setup --ai' again.`)}}function np(r){let e=JSON.stringify(r,null,2);(0,Ls.writeFileSync)(Gr,e,"utf-8")}async function op(r,e){await tp(r,e)}async function ap(r){let e=await uo(r.provider);if(e)return e;let t=Zi[r.provider],s=process.env[t.defaultApiKeyEnvVar];if(s)return s;throw new Error("API key not found. Please run 'pf setup --ai' to configure your API key.")}async function mw(r,e,t,s){let{createOpenAI:i}=await import("@ai-sdk/openai"),n=i({apiKey:t});if(s.onToken){let{streamText:c}=await import("ai"),l=c({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature}),u="";for await(let h of(await l).textStream)u+=h,s.onToken(h);return u}let{generateText:o}=await import("ai"),{text:a}=await o({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature});return a}async function xw(r,e,t,s){let{createAnthropic:i}=await import("@ai-sdk/anthropic"),n=i({apiKey:t});if(s.onToken){let{streamText:c}=await import("ai"),l=c({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature}),u="";for await(let h of(await l).textStream)u+=h,s.onToken(h);return u}let{generateText:o}=await import("ai"),{text:a}=await o({model:n(e),prompt:r,system:s.system,maxOutputTokens:s.maxTokens,temperature:s.temperature});return a}async function cp(r,e,t={}){let{system:s,maxTokens:i=4096,temperature:n=.7,onToken:o}=t,a=await ap(r);switch(r.provider){case"openai":return mw(e,r.model,a,{system:s,maxTokens:i,temperature:n,onToken:o});case"anthropic":return xw(e,r.model,a,{system:s,maxTokens:i,temperature:n,onToken:o});default:throw new Error(`Unsupported AI provider: ${r.provider}`)}}var Oa=require("node:fs"),gi=require("node:path");var ve=(r,e=[])=>r.name==="up"||e.includes("vim")&&r.name==="k"||e.includes("emacs")&&r.ctrl&&r.name==="p",We=(r,e=[])=>r.name==="down"||e.includes("vim")&&r.name==="j"||e.includes("emacs")&&r.ctrl&&r.name==="n",Sl=r=>r.name==="space",zr=r=>r.name==="backspace",Xt=r=>r.name==="tab",Xi=r=>"1234567890".includes(r.name),ae=r=>r.name==="enter"||r.name==="return";var fo=class extends Error{name="AbortPromptError";message="Prompt was aborted";constructor(e){super(),this.cause=e?.cause}},po=class extends Error{name="CancelPromptError";message="Prompt was canceled"},Qi=class extends Error{name="ExitPromptError"},mo=class extends Error{name="HookError"},Bt=class extends Error{name="ValidationError"};var fp=require("node:async_hooks");var xo=require("node:async_hooks");var lp=new xo.AsyncLocalStorage;function gw(r){return{rl:r,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function up(r,e){let t=gw(r);return lp.run(t,()=>{function s(i){t.handleChange=()=>{t.index=0,i()},t.handleChange()}return e(s)})}function Kr(){let r=lp.getStore();if(!r)throw new mo("[Inquirer] Hook functions can only be called from within a prompt");return r}function _l(){return Kr().rl}function Al(r){let e=(...t)=>{let s=Kr(),i=!1,n=s.handleChange;s.handleChange=()=>{i=!0};let o=r(...t);return i&&n(),s.handleChange=n,o};return xo.AsyncResource.bind(e)}function Us(r){let e=Kr(),{index:t}=e,s={get(){return e.hooks[t]},set(n){e.hooks[t]=n},initialized:t in e.hooks},i=r(s);return e.index++,i}function hp(){Kr().handleChange()}var Zr={queue(r){let e=Kr(),{index:t}=e;e.hooksEffect.push(()=>{e.hooksCleanup[t]?.();let s=r(_l());if(s!=null&&typeof s!="function")throw new Bt("useEffect return value must be a cleanup function or nothing.");e.hooksCleanup[t]=s})},run(){let r=Kr();Al(()=>{r.hooksEffect.forEach(e=>{e()}),r.hooksEffect.length=0})()},clearAll(){let r=Kr();r.hooksCleanup.forEach(e=>{e?.()}),r.hooksEffect.length=0,r.hooksCleanup.length=0}};function R(r){return Us(e=>{let t=fp.AsyncResource.bind(function(n){e.get()!==n&&(e.set(n),hp())});if(e.initialized)return[e.get(),t];let s=typeof r=="function"?r():r;return e.set(s),[s,t]})}function Ze(r,e){Us(t=>{let s=t.get();(!Array.isArray(s)||e.some((n,o)=>!Object.is(n,s[o])))&&Zr.queue(r),t.set(e)})}var nt=_(gr(),1);var Ct=_(require("node:process"),1);function ww(){return Ct.default.platform!=="win32"?Ct.default.env.TERM!=="linux":!!Ct.default.env.WT_SESSION||!!Ct.default.env.TERMINUS_SUBLIME||Ct.default.env.ConEmuTask==="{cmd::Cmder}"||Ct.default.env.TERM_PROGRAM==="Terminus-Sublime"||Ct.default.env.TERM_PROGRAM==="vscode"||Ct.default.env.TERM==="xterm-256color"||Ct.default.env.TERM==="alacritty"||Ct.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var pp={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},mp={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},Dw={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},vw={...pp,...mp},Cw={...pp,...Dw},Ew=ww(),kw=Ew?vw:Cw,it=kw,lk=Object.entries(mp);var xp={prefix:{idle:nt.default.blue("?"),done:nt.default.green(it.tick)},spinner:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"].map(r=>nt.default.yellow(r))},style:{answer:nt.default.cyan,message:nt.default.bold,error:r=>nt.default.red(`> ${r}`),defaultAnswer:r=>nt.default.dim(`(${r})`),help:nt.default.dim,highlight:nt.default.cyan,key:r=>nt.default.cyan(nt.default.bold(`<${r}>`))}};function gp(r){if(typeof r!="object"||r===null)return!1;let e=r;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function bp(...r){let e={};for(let t of r)for(let[s,i]of Object.entries(t)){let n=e[s];e[s]=gp(n)&&gp(i)?bp(n,i):i}return e}function ie(...r){let e=[xp,...r.filter(t=>t!=null)];return bp(...e)}function ce({status:r="idle",theme:e}){let[t,s]=R(!1),[i,n]=R(0),{prefix:o,spinner:a}=ie(e);return Ze(()=>{if(r==="loading"){let l,u=-1,h=setTimeout(()=>{s(!0),l=setInterval(()=>{u=u+1,n(u%a.frames.length)},a.interval)},300);return()=>{clearTimeout(h),clearInterval(l)}}else s(!1)},[r]),t?a.frames[i]:typeof o=="string"?o:o[r==="loading"?"idle":r]??o.idle}function qe(r,e){return Us(t=>{let s=t.get();if(!s||s.dependencies.length!==e.length||s.dependencies.some((i,n)=>i!==e[n])){let i=r();return t.set({value:i,dependencies:e}),i}return s.value})}function Yr(r){return R({current:r})[0]}function le(r){let e=Yr(r);e.current=r,Ze(t=>{let s=!1,i=Al((n,o)=>{s||e.current(o,t)});return t.input.on("keypress",i),()=>{s=!0,t.input.removeListener("keypress",i)}},[])}var qp=_(wp(),1),Vp=_(Wp(),1);function rn(r,e){return r.split(`
79
79
  `).flatMap(t=>(0,Vp.default)(t,e,{trim:!1,hard:!0}).split(`
80
80
  `).map(s=>s.trimEnd())).join(`
81
- `)}function yo(){return(0,qp.default)({defaultWidth:80,output:_l().output})}function zw({active:r,renderedItems:e,pageSize:t,loop:s}){let i=Zr({lastPointer:r,lastActive:void 0}),{lastPointer:n,lastActive:o}=i.current,a=Math.floor(t/2),c=e.reduce((h,d)=>h+d.length,0),l=e.slice(0,r).reduce((h,d)=>h+d.length,0),u=l;if(c>t)if(s)u=n,o!=null&&o<r&&r-o<t&&(u=Math.min(a,Math.abs(r-o)===1?Math.min(n+(e[o]?.length??0),Math.max(l,n)):n+r-o));else{let h=e.slice(r).reduce((d,f)=>d+f.length,0);u=h<t-a?t-h:Math.min(l,a)}return i.current.lastPointer=u,i.current.lastActive=r,u}function Yr({items:r,active:e,renderItem:t,pageSize:s,loop:i=!0}){let n=yo(),o=x=>(x%r.length+r.length)%r.length,a=r.map((x,b)=>x==null?[]:rn(t({item:x,index:b,isActive:b===e}),n).split(`
81
+ `)}function yo(){return(0,qp.default)({defaultWidth:80,output:_l().output})}function zw({active:r,renderedItems:e,pageSize:t,loop:s}){let i=Yr({lastPointer:r,lastActive:void 0}),{lastPointer:n,lastActive:o}=i.current,a=Math.floor(t/2),c=e.reduce((h,d)=>h+d.length,0),l=e.slice(0,r).reduce((h,d)=>h+d.length,0),u=l;if(c>t)if(s)u=n,o!=null&&o<r&&r-o<t&&(u=Math.min(a,Math.abs(r-o)===1?Math.min(n+(e[o]?.length??0),Math.max(l,n)):n+r-o));else{let h=e.slice(r).reduce((d,f)=>d+f.length,0);u=h<t-a?t-h:Math.min(l,a)}return i.current.lastPointer=u,i.current.lastActive=r,u}function Jr({items:r,active:e,renderItem:t,pageSize:s,loop:i=!0}){let n=yo(),o=x=>(x%r.length+r.length)%r.length,a=r.map((x,b)=>x==null?[]:rn(t({item:x,index:b,isActive:b===e}),n).split(`
82
82
  `)),c=a.reduce((x,b)=>x+b.length,0),l=x=>a[x]??[],u=zw({active:e,renderedItems:a,pageSize:s,loop:i}),h=l(e).slice(0,s),d=u+h.length<=s?u:s-h.length,f=Array.from({length:s});f.splice(d,h.length,...h);let p=new Set([e]),m=d+h.length,g=o(e+1);for(;m<s&&!p.has(g)&&(i&&c>s?g!==e:g>e);){let b=l(g).slice(0,s-m);f.splice(m,b.length,...b),p.add(g),m+=b.length,g=o(g+1)}for(m=d-1,g=o(e-1);m>=0&&!p.has(g)&&(i&&c>s?g!==e:g<e);){let x=l(g),b=x.slice(Math.max(0,x.length-m-1));f.splice(m-b.length+1,b.length,...b),p.add(g),m-=b.length,g=o(g-1)}return f.filter(x=>typeof x=="string").join(`
83
- `)}var Xp=_(require("node:readline"),1),Qp=require("node:async_hooks"),em=_(Gp(),1);var Jr=[];Jr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Jr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Jr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wo=r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function",jl=Symbol.for("signal-exit emitter"),Nl=globalThis,Zw=Object.defineProperty.bind(Object),Ll=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Nl[jl])return Nl[jl];Zw(Nl,jl,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let s=this.listeners[e],i=s.indexOf(t);i!==-1&&(i===0&&s.length===1?s.length=0:s.splice(i,1))}emit(e,t,s){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let n of this.listeners[e])i=n(t,s)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,s)||i),i}},Do=class{},Yw=r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),Ul=class extends Do{onExit(){return()=>{}}load(){}unload(){}},Wl=class extends Do{#e=ql.platform==="win32"?"SIGINT":"SIGHUP";#t=new Ll;#r;#i;#o;#d={};#h=!1;constructor(e){super(),this.#r=e,this.#d={};for(let t of Jr)this.#d[t]=()=>{let s=this.#r.listeners(t),{count:i}=this.#t,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(i+=n.__signal_exit_emitter__.count),s.length===i){this.unload();let o=this.#t.emit("exit",null,t),a=t==="SIGHUP"?this.#e:t;o||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#i=e.emit}onExit(e,t){if(!wo(this.#r))return()=>{};this.#h===!1&&this.load();let s=t?.alwaysLast?"afterExit":"exit";return this.#t.on(s,e),()=>{this.#t.removeListener(s,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#h){this.#h=!0,this.#t.count+=1;for(let e of Jr)try{let t=this.#d[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#a(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#h&&(this.#h=!1,Jr.forEach(e=>{let t=this.#d[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#i,this.#r.reallyExit=this.#o,this.#t.count-=1)}#u(e){return wo(this.#r)?(this.#r.exitCode=e||0,this.#t.emit("exit",this.#r.exitCode,null),this.#o.call(this.#r,this.#r.exitCode)):0}#a(e,...t){let s=this.#i;if(e==="exit"&&wo(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=s.call(this.#r,e,...t);return this.#t.emit("exit",this.#r.exitCode,null),i}else return s.call(this.#r,e,...t)}},ql=globalThis.process,{onExit:zp,load:Hk,unload:Gk}=Yw(wo(ql)?new Wl(ql):new Ul);var Jp=require("node:util");var Hs="\x1B[?25l",Zp="\x1B[?25h",Vl=(r=1)=>r>0?`\x1B[${r}A`:"",Hl=(r=1)=>r>0?`\x1B[${r}B`:"",Gl=(r,e)=>typeof e=="number"&&!Number.isNaN(e)?`\x1B[${e+1};${r+1}H`:`\x1B[${r+1}G`,Kp="\x1B[2K",zl=r=>r>0?(Kp+Vl(1)).repeat(r-1)+Kp+"\x1B[G":"";var Yp=r=>r.split(`
83
+ `)}var Xp=_(require("node:readline"),1),Qp=require("node:async_hooks"),em=_(Gp(),1);var Xr=[];Xr.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&Xr.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Xr.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var wo=r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function",jl=Symbol.for("signal-exit emitter"),Nl=globalThis,Zw=Object.defineProperty.bind(Object),Ll=class{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(Nl[jl])return Nl[jl];Zw(Nl,jl,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let s=this.listeners[e],i=s.indexOf(t);i!==-1&&(i===0&&s.length===1?s.length=0:s.splice(i,1))}emit(e,t,s){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let n of this.listeners[e])i=n(t,s)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,s)||i),i}},Do=class{},Yw=r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),Ul=class extends Do{onExit(){return()=>{}}load(){}unload(){}},Wl=class extends Do{#e=ql.platform==="win32"?"SIGINT":"SIGHUP";#t=new Ll;#r;#i;#o;#d={};#h=!1;constructor(e){super(),this.#r=e,this.#d={};for(let t of Xr)this.#d[t]=()=>{let s=this.#r.listeners(t),{count:i}=this.#t,n=e;if(typeof n.__signal_exit_emitter__=="object"&&typeof n.__signal_exit_emitter__.count=="number"&&(i+=n.__signal_exit_emitter__.count),s.length===i){this.unload();let o=this.#t.emit("exit",null,t),a=t==="SIGHUP"?this.#e:t;o||e.kill(e.pid,a)}};this.#o=e.reallyExit,this.#i=e.emit}onExit(e,t){if(!wo(this.#r))return()=>{};this.#h===!1&&this.load();let s=t?.alwaysLast?"afterExit":"exit";return this.#t.on(s,e),()=>{this.#t.removeListener(s,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#h){this.#h=!0,this.#t.count+=1;for(let e of Xr)try{let t=this.#d[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#a(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#h&&(this.#h=!1,Xr.forEach(e=>{let t=this.#d[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#i,this.#r.reallyExit=this.#o,this.#t.count-=1)}#u(e){return wo(this.#r)?(this.#r.exitCode=e||0,this.#t.emit("exit",this.#r.exitCode,null),this.#o.call(this.#r,this.#r.exitCode)):0}#a(e,...t){let s=this.#i;if(e==="exit"&&wo(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=s.call(this.#r,e,...t);return this.#t.emit("exit",this.#r.exitCode,null),i}else return s.call(this.#r,e,...t)}},ql=globalThis.process,{onExit:zp,load:Hk,unload:Gk}=Yw(wo(ql)?new Wl(ql):new Ul);var Jp=require("node:util");var Hs="\x1B[?25l",Zp="\x1B[?25h",Vl=(r=1)=>r>0?`\x1B[${r}A`:"",Hl=(r=1)=>r>0?`\x1B[${r}B`:"",Gl=(r,e)=>typeof e=="number"&&!Number.isNaN(e)?`\x1B[${e+1};${r+1}H`:`\x1B[${r+1}G`,Kp="\x1B[2K",zl=r=>r>0?(Kp+Vl(1)).repeat(r-1)+Kp+"\x1B[G":"";var Yp=r=>r.split(`
84
84
  `).length,Jw=r=>r.split(`
85
85
  `).pop()??"",sn=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,t=""){let s=Jw(e),i=(0,Jp.stripVTControlCharacters)(s),n=i;this.rl.line.length>0&&(n=n.slice(0,-this.rl.line.length)),this.rl.setPrompt(n),this.cursorPos=this.rl.getCursorPos();let o=yo();e=rn(e,o),t=rn(t,o),i.length%o===0&&(e+=`
86
86
  `);let a=e+(t?`
87
87
  `+t:""),l=Math.floor(i.length/o)-this.cursorPos.rows+(t?Yp(t):0);l>0&&(a+=Vl(l)),a+=Gl(this.cursorPos.cols),this.write(Hl(this.extraLinesUnderPrompt)+zl(this.height)+a),this.extraLinesUnderPrompt=l,this.height=Yp(a)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(Gl(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt("");let t=Hl(this.extraLinesUnderPrompt);t+=e?zl(this.height):`
88
- `,t+=Zp,this.write(t),this.rl.close()}};var vo=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}};function Xw(){let r=Error.prepareStackTrace,e=[];try{Error.prepareStackTrace=(t,s)=>{let i=s.slice(1);return e=i,i},new Error().stack}catch{return e}return Error.prepareStackTrace=r,e}function ue(r){let e=Xw();return(s,i={})=>{let{input:n=process.stdin,signal:o}=i,a=new Set,c=new em.default;c.pipe(i.output??process.stdout);let l=Xp.createInterface({terminal:!0,input:n,output:c}),u=new sn(l),{promise:h,resolve:d,reject:f}=vo.withResolver(),p=()=>f(new po);if(o){let x=()=>f(new fo({cause:o.reason}));if(o.aborted)return x(),Object.assign(h,{cancel:p});o.addEventListener("abort",x),a.add(()=>o.removeEventListener("abort",x))}a.add(zp((x,b)=>{f(new Qi(`User force closed the prompt with ${x} ${b}`))}));let m=()=>f(new Qi("User force closed the prompt with SIGINT"));l.on("SIGINT",m),a.add(()=>l.removeListener("SIGINT",m));let g=()=>u.checkCursorPos();return l.input.on("keypress",g),a.add(()=>l.input.removeListener("keypress",g)),up(l,x=>{let b=Qp.AsyncResource.bind(()=>Kr.clearAll());return l.on("close",b),a.add(()=>l.removeListener("close",b)),x(()=>{try{let y=r(s,I=>{setImmediate(()=>d(I))});if(y===void 0){let I=e[1]?.getFileName();throw new Error(`Prompt functions must return a string.
89
- at ${I}`)}let[w,v]=typeof y=="string"?[y]:y;u.render(w,v),Kr.run()}catch(y){f(y)}}),Object.assign(h.then(y=>(Kr.clearAll(),y),y=>{throw Kr.clearAll(),y}).finally(()=>{a.forEach(y=>y()),u.done({clearContent:!!i.clearPromptOnDone}),c.end()}).then(()=>h),{cancel:p})})}}var tm=_(xr(),1);var z=class{separator=tm.default.dim(Array.from({length:15}).join(it.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};var Xr=_(xr(),1);var Qw={icon:{checked:Xr.default.green(it.circleFilled),unchecked:it.circle,cursor:it.pointer},style:{disabledChoice:r=>Xr.default.dim(`- ${r}`),renderSelectedChoices:r=>r.map(e=>e.short).join(", "),description:r=>Xr.default.cyan(r),keysHelpTip:r=>r.map(([e,t])=>`${Xr.default.bold(e)} ${Xr.default.dim(t)}`).join(Xr.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function gr(r){return!z.isSeparator(r)&&!r.disabled}function Kl(r){return gr(r)&&r.checked}function Zl(r){return gr(r)?{...r,checked:!r.checked}:r}function eD(r){return function(e){return gr(e)?{...e,checked:r}:e}}function tD(r){return r.map(e=>{if(z.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let t=e.name??String(e.value),s={value:e.value,name:t,short:e.short??t,checkedName:e.checkedName??t,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(s.description=e.description),s})}var rD=ue((r,e)=>{let{instructions:t,pageSize:s=7,loop:i=!0,required:n,validate:o=()=>!0}=r,a={all:"a",invert:"i",...r.shortcuts},c=ie(Qw,r.theme),{keybindings:l}=c,[u,h]=R("idle"),d=ce({status:u,theme:c}),[f,p]=R(tD(r.choices)),m=qe(()=>{let A=f.findIndex(gr),E=f.findLastIndex(gr);if(A===-1)throw new Bt("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:A,last:E}},[f]),[g,x]=R(m.first),[b,y]=R();le(async A=>{if(ae(A)){let E=f.filter(Kl),$=await o([...E]);n&&!f.some(Kl)?y("At least one choice must be selected"):$===!0?(h("done"),e(E.map(te=>te.value))):y($||"You must select a valid value")}else if(ve(A,l)||We(A,l)){if(i||ve(A,l)&&g!==m.first||We(A,l)&&g!==m.last){let E=ve(A,l)?-1:1,$=g;do $=($+E+f.length)%f.length;while(!gr(f[$]));x($)}}else if(Sl(A))y(void 0),p(f.map((E,$)=>$===g?Zl(E):E));else if(A.name===a.all){let E=f.some($=>gr($)&&!$.checked);p(f.map(eD(E)))}else if(A.name===a.invert)p(f.map(Zl));else if(Xi(A)){let E=Number(A.name)-1,$=-1,te=f.findIndex(Ft=>z.isSeparator(Ft)?!1:($++,$===E)),we=f[te];we&&gr(we)&&(x(te),p(f.map((Ft,Ui)=>Ui===te?Zl(Ft):Ft)))}});let w=c.style.message(r.message,u),v,I=Yr({items:f,active:g,renderItem({item:A,isActive:E}){if(z.isSeparator(A))return` ${A.separator}`;if(A.disabled){let Ui=typeof A.disabled=="string"?A.disabled:"(disabled)";return c.style.disabledChoice(`${A.name} ${Ui}`)}E&&(v=A.description);let $=A.checked?c.icon.checked:c.icon.unchecked,te=A.checked?A.checkedName:A.name,we=E?c.style.highlight:Ui=>Ui,Ft=E?c.icon.cursor:" ";return we(`${Ft}${$} ${te}`)},pageSize:s,loop:i});if(u==="done"){let A=f.filter(Kl),E=c.style.answer(c.style.renderSelectedChoices(A,f));return[d,w,E].filter(Boolean).join(" ")}let B;if(c.helpMode!=="never"&&t!==!1)if(typeof t=="string")B=t;else{let A=[["\u2191\u2193","navigate"],["space","select"]];a.all&&A.push([a.all,"all"]),a.invert&&A.push([a.invert,"invert"]),A.push(["\u23CE","submit"]),B=c.style.keysHelpTip(A)}return`${[[d,w].filter(Boolean).join(" "),I," ",v?c.style.description(v):"",b?c.style.error(b):"",B].filter(Boolean).join(`
90
- `).trimEnd()}${Hs}`});var rx=_(pm(),1),Go=require("child_process"),Zs=require("fs"),Ho=_(require("node:path"),1),sx=_(require("node:os"),1),ix=require("node:crypto"),u0=_(ex(),1);var Wo=class extends Error{originalError;constructor(e){super(`Failed to create temporary file. ${e.message}`),this.originalError=e}};var hn=class extends Error{originalError;constructor(e){super(`Failed to launch editor. ${e.message}`),this.originalError=e}};var qo=class extends Error{originalError;constructor(e){super(`Failed to read temporary file. ${e.message}`),this.originalError=e}};var Vo=class extends Error{originalError;constructor(e){super(`Failed to remove temporary file. ${e.message}`),this.originalError=e}};function nx(r="",e,t){let s=new h0(r,t);s.runAsync((i,n)=>{if(i)setImmediate(e,i,void 0);else try{s.cleanup(),setImmediate(e,void 0,n)}catch(o){setImmediate(e,o,void 0)}})}function tx(r){return r?r.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function WD(r){let e=[],t="";for(let s=0;s<r.length;s++){let i=r.charAt(s);s>0&&i===" "&&r[s-1]!=="\\"&&t.length>0?(e.push(t),t=""):t=`${t}${i}`}return t.length>0&&e.push(t),e}var h0=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(e="",t){this.text=e,t&&(this.fileOptions=t),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(e){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(e,void 0,this.text)}catch(t){setImmediate(e,t,void 0)}})}catch(t){setImmediate(e,t,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let e=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",t=WD(e).map(i=>i.replace("\\ "," ")),s=t.shift();this.editor={args:t,bin:s}}createTemporaryFile(){try{let e=this.fileOptions.dir??sx.default.tmpdir(),t=(0,ix.randomUUID)(),s=tx(this.fileOptions.prefix),i=tx(this.fileOptions.postfix),n=`${s}${t}${i}`,o=Ho.default.resolve(e,n),a=Ho.default.resolve(e)+Ho.default.sep;if(!o.startsWith(a))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let c={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(c.mode=this.fileOptions.mode),(0,Zs.writeFileSync)(this.tempFile,this.text,c)}catch(e){throw new Wo(e)}}readTemporaryFile(){try{let e=(0,Zs.readFileSync)(this.tempFile);if(e.length===0)this.text="";else{let t=(0,rx.detect)(e)??"utf8";u0.default.encodingExists(t)||(t="utf8"),this.text=u0.default.decode(e,t)}}catch(e){throw new qo(e)}}removeTemporaryFile(){try{(0,Zs.unlinkSync)(this.tempFile)}catch(e){throw new Vo(e)}}launchEditor(){try{let e=(0,Go.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=e.status??0}catch(e){throw new hn(e)}}launchEditorAsync(e){try{(0,Go.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",s=>{this.lastExitStatus=s,setImmediate(e)})}catch(t){throw new hn(t)}}};var qD={validationFailureMode:"keep"},VD=ue((r,e)=>{let{waitForUserInput:t=!0,file:{postfix:s=r.postfix??".txt",...i}={},validate:n=()=>!0}=r,o=ie(qD,r.theme),[a,c]=R("idle"),[l="",u]=R(r.default),[h,d]=R(),f=ce({status:a,theme:o});function p(b){b.pause();let y=async(w,v)=>{if(b.resume(),w)d(w.toString());else{c("loading");let I=v??"",B=await n(I);B===!0?(d(void 0),c("done"),e(I)):(o.validationFailureMode==="clear"?u(r.default):u(I),d(B||"You must provide a valid value"),c("idle"))}};nx(l,(w,v)=>void y(w,v),{postfix:s,...i})}Ze(b=>{t||p(b)},[]),le((b,y)=>{a==="idle"&&ae(b)&&p(y)});let m=o.style.message(r.message,a),g="";if(a==="loading")g=o.style.help("Received");else if(a==="idle"){let b=o.style.key("enter");g=o.style.help(`Press ${b} to launch your preferred editor.`)}let x="";return h&&(x=o.style.error(h)),[[f,m,g].filter(Boolean).join(" "),x]});function ox(r,e){let t=e!==!1;return/^(y|yes)/i.test(r)?t=!0:/^(n|no)/i.test(r)&&(t=!1),t}function ax(r){return r?"Yes":"No"}var zo=ue((r,e)=>{let{transformer:t=ax}=r,[s,i]=R("idle"),[n,o]=R(""),a=ie(r.theme),c=ce({status:s,theme:a});le((d,f)=>{if(s==="idle")if(ae(d)){let p=ox(n,r.default);o(t(p)),i("done"),e(p)}else if(Xt(d)){let p=ax(!ox(n,r.default));f.clearLine(0),f.write(p),o(p)}else o(f.line)});let l=n,u="";s==="done"?l=a.style.answer(n):u=` ${a.style.defaultAnswer(r.default===!1?"y/N":"Y/n")}`;let h=a.style.message(r.message,s);return`${c} ${h}${u} ${l}`});var HD={validationFailureMode:"keep"},fn=ue((r,e)=>{let{prefill:t="tab"}=r,s=ie(HD,r.theme),[i,n]=R("idle"),[o="",a]=R(r.default),[c,l]=R(),[u,h]=R(""),d=ce({status:i,theme:s});async function f(b){let{required:y,pattern:w,patternError:v="Invalid input"}=r;return y&&!b?"You must provide a value":w&&!w.test(b)?v:typeof r.validate=="function"?await r.validate(b)||"You must provide a valid value":!0}le(async(b,y)=>{if(i==="idle")if(ae(b)){let w=u||o;n("loading");let v=await f(w);v===!0?(h(w),n("done"),e(w)):(s.validationFailureMode==="clear"?h(""):y.write(u),l(v),n("idle"))}else Gr(b)&&!u?a(void 0):Xt(b)&&!u?(a(void 0),y.clearLine(0),y.write(o),h(o)):(h(y.line),l(void 0))}),Ze(b=>{t==="editable"&&o&&(b.write(o),h(o))},[]);let p=s.style.message(r.message,i),m=u;typeof r.transformer=="function"?m=r.transformer(u,{isFinal:i==="done"}):i==="done"&&(m=s.style.answer(u));let g;o&&i!=="done"&&!u&&(g=s.style.defaultAnswer(o));let x="";return c&&(x=s.style.error(c)),[[d,p,g,m].filter(b=>b!==void 0).join(" "),x]});function GD(r,e,t){let s=r*Math.pow(10,6),i=e*Math.pow(10,6),n=t*Math.pow(10,6);return(s-(Number.isFinite(t)?n:0))%i===0}function cx(r,{min:e,max:t,step:s}){return r==null||Number.isNaN(r)?!1:r<e||r>t?`Value must be between ${e} and ${t}`:s!=="any"&&!GD(r,s,e)?`Value must be a multiple of ${s}${Number.isFinite(e)?` starting from ${e}`:""}`:!0}var zD=ue((r,e)=>{let{validate:t=()=>!0,min:s=-1/0,max:i=1/0,step:n=1,required:o=!1}=r,a=ie(r.theme),[c,l]=R("idle"),[u,h]=R(""),d=cx(r.default,{min:s,max:i,step:n})===!0?r.default?.toString():void 0,[f="",p]=R(d),[m,g]=R(),x=ce({status:c,theme:a});le(async(I,B)=>{if(c==="idle")if(ae(I)){let H=u||f,A=H===""?void 0:Number(H);l("loading");let E=!0;(o||A!=null)&&(E=cx(A,{min:s,max:i,step:n})),E===!0&&(E=await t(A)),E===!0?(h(String(A??"")),l("done"),e(A)):(B.write(u),g(E||"You must provide a valid numeric value"),l("idle"))}else Gr(I)&&!u?p(void 0):Xt(I)&&!u?(p(void 0),B.clearLine(0),B.write(f),h(f)):(h(B.line),g(void 0))});let b=a.style.message(r.message,c),y=u;c==="done"&&(y=a.style.answer(u));let w;f&&c!=="done"&&!u&&(w=a.style.defaultAnswer(f));let v="";return m&&(v=a.style.error(m)),[[x,b,w,y].filter(I=>I!==void 0).join(" "),v]});var f0=_(xr(),1);function KD(r){return r.map(e=>{if(z.isSeparator(e))return e;let t="name"in e?e.name:String(e.value);return{value:"value"in e?e.value:t,name:t,key:e.key.toLowerCase()}})}var ZD={key:"h",name:"Help, list all options",value:void 0},YD=ue((r,e)=>{let{default:t="h"}=r,s=qe(()=>KD(r.choices),[r.choices]),[i,n]=R("idle"),[o,a]=R(""),[c,l]=R(r.expanded??!1),[u,h]=R(),d=ie(r.theme),f=ce({theme:d,status:i});le((v,I)=>{if(ae(v)){let B=(o||t).toLowerCase();if(B==="h"&&!c)l(!0);else{let H=s.find(A=>!z.isSeparator(A)&&A.key===B);H?(n("done"),a(B),e(H.value)):h(o===""?"Please input a value":`"${f0.default.red(o)}" isn't an available option`)}}else a(I.line),h(void 0)});let p=d.style.message(r.message,i);if(i==="done"){let v=s.find(I=>!z.isSeparator(I)&&I.key===o.toLowerCase());return`${f} ${p} ${d.style.answer(v.name)}`}let m=c?s:[...s,ZD],g="",x=m.map(v=>z.isSeparator(v)?"":v.key===t?v.key.toUpperCase():v.key).join("");x=` ${d.style.defaultAnswer(x)}`,c&&(x="",g=m.map(v=>{if(z.isSeparator(v))return` ${v.separator}`;let I=` ${v.key}) ${v.name}`;return v.key===o.toLowerCase()?d.style.highlight(I):I}).join(`
88
+ `,t+=Zp,this.write(t),this.rl.close()}};var vo=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((i,n)=>{e=i,t=n}),resolve:e,reject:t}}};function Xw(){let r=Error.prepareStackTrace,e=[];try{Error.prepareStackTrace=(t,s)=>{let i=s.slice(1);return e=i,i},new Error().stack}catch{return e}return Error.prepareStackTrace=r,e}function ue(r){let e=Xw();return(s,i={})=>{let{input:n=process.stdin,signal:o}=i,a=new Set,c=new em.default;c.pipe(i.output??process.stdout);let l=Xp.createInterface({terminal:!0,input:n,output:c}),u=new sn(l),{promise:h,resolve:d,reject:f}=vo.withResolver(),p=()=>f(new po);if(o){let x=()=>f(new fo({cause:o.reason}));if(o.aborted)return x(),Object.assign(h,{cancel:p});o.addEventListener("abort",x),a.add(()=>o.removeEventListener("abort",x))}a.add(zp((x,b)=>{f(new Qi(`User force closed the prompt with ${x} ${b}`))}));let m=()=>f(new Qi("User force closed the prompt with SIGINT"));l.on("SIGINT",m),a.add(()=>l.removeListener("SIGINT",m));let g=()=>u.checkCursorPos();return l.input.on("keypress",g),a.add(()=>l.input.removeListener("keypress",g)),up(l,x=>{let b=Qp.AsyncResource.bind(()=>Zr.clearAll());return l.on("close",b),a.add(()=>l.removeListener("close",b)),x(()=>{try{let y=r(s,I=>{setImmediate(()=>d(I))});if(y===void 0){let I=e[1]?.getFileName();throw new Error(`Prompt functions must return a string.
89
+ at ${I}`)}let[w,v]=typeof y=="string"?[y]:y;u.render(w,v),Zr.run()}catch(y){f(y)}}),Object.assign(h.then(y=>(Zr.clearAll(),y),y=>{throw Zr.clearAll(),y}).finally(()=>{a.forEach(y=>y()),u.done({clearContent:!!i.clearPromptOnDone}),c.end()}).then(()=>h),{cancel:p})})}}var tm=_(gr(),1);var z=class{separator=tm.default.dim(Array.from({length:15}).join(it.line));type="separator";constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="separator")}};var Qr=_(gr(),1);var Qw={icon:{checked:Qr.default.green(it.circleFilled),unchecked:it.circle,cursor:it.pointer},style:{disabledChoice:r=>Qr.default.dim(`- ${r}`),renderSelectedChoices:r=>r.map(e=>e.short).join(", "),description:r=>Qr.default.cyan(r),keysHelpTip:r=>r.map(([e,t])=>`${Qr.default.bold(e)} ${Qr.default.dim(t)}`).join(Qr.default.dim(" \u2022 "))},helpMode:"always",keybindings:[]};function br(r){return!z.isSeparator(r)&&!r.disabled}function Kl(r){return br(r)&&r.checked}function Zl(r){return br(r)?{...r,checked:!r.checked}:r}function eD(r){return function(e){return br(e)?{...e,checked:r}:e}}function tD(r){return r.map(e=>{if(z.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,checkedName:e,disabled:!1,checked:!1};let t=e.name??String(e.value),s={value:e.value,name:t,short:e.short??t,checkedName:e.checkedName??t,disabled:e.disabled??!1,checked:e.checked??!1};return e.description&&(s.description=e.description),s})}var rD=ue((r,e)=>{let{instructions:t,pageSize:s=7,loop:i=!0,required:n,validate:o=()=>!0}=r,a={all:"a",invert:"i",...r.shortcuts},c=ie(Qw,r.theme),{keybindings:l}=c,[u,h]=R("idle"),d=ce({status:u,theme:c}),[f,p]=R(tD(r.choices)),m=qe(()=>{let A=f.findIndex(br),E=f.findLastIndex(br);if(A===-1)throw new Bt("[checkbox prompt] No selectable choices. All choices are disabled.");return{first:A,last:E}},[f]),[g,x]=R(m.first),[b,y]=R();le(async A=>{if(ae(A)){let E=f.filter(Kl),$=await o([...E]);n&&!f.some(Kl)?y("At least one choice must be selected"):$===!0?(h("done"),e(E.map(te=>te.value))):y($||"You must select a valid value")}else if(ve(A,l)||We(A,l)){if(i||ve(A,l)&&g!==m.first||We(A,l)&&g!==m.last){let E=ve(A,l)?-1:1,$=g;do $=($+E+f.length)%f.length;while(!br(f[$]));x($)}}else if(Sl(A))y(void 0),p(f.map((E,$)=>$===g?Zl(E):E));else if(A.name===a.all){let E=f.some($=>br($)&&!$.checked);p(f.map(eD(E)))}else if(A.name===a.invert)p(f.map(Zl));else if(Xi(A)){let E=Number(A.name)-1,$=-1,te=f.findIndex(Ft=>z.isSeparator(Ft)?!1:($++,$===E)),we=f[te];we&&br(we)&&(x(te),p(f.map((Ft,Ui)=>Ui===te?Zl(Ft):Ft)))}});let w=c.style.message(r.message,u),v,I=Jr({items:f,active:g,renderItem({item:A,isActive:E}){if(z.isSeparator(A))return` ${A.separator}`;if(A.disabled){let Ui=typeof A.disabled=="string"?A.disabled:"(disabled)";return c.style.disabledChoice(`${A.name} ${Ui}`)}E&&(v=A.description);let $=A.checked?c.icon.checked:c.icon.unchecked,te=A.checked?A.checkedName:A.name,we=E?c.style.highlight:Ui=>Ui,Ft=E?c.icon.cursor:" ";return we(`${Ft}${$} ${te}`)},pageSize:s,loop:i});if(u==="done"){let A=f.filter(Kl),E=c.style.answer(c.style.renderSelectedChoices(A,f));return[d,w,E].filter(Boolean).join(" ")}let B;if(c.helpMode!=="never"&&t!==!1)if(typeof t=="string")B=t;else{let A=[["\u2191\u2193","navigate"],["space","select"]];a.all&&A.push([a.all,"all"]),a.invert&&A.push([a.invert,"invert"]),A.push(["\u23CE","submit"]),B=c.style.keysHelpTip(A)}return`${[[d,w].filter(Boolean).join(" "),I," ",v?c.style.description(v):"",b?c.style.error(b):"",B].filter(Boolean).join(`
90
+ `).trimEnd()}${Hs}`});var rx=_(pm(),1),Go=require("child_process"),Zs=require("fs"),Ho=_(require("node:path"),1),sx=_(require("node:os"),1),ix=require("node:crypto"),u0=_(ex(),1);var Wo=class extends Error{originalError;constructor(e){super(`Failed to create temporary file. ${e.message}`),this.originalError=e}};var hn=class extends Error{originalError;constructor(e){super(`Failed to launch editor. ${e.message}`),this.originalError=e}};var qo=class extends Error{originalError;constructor(e){super(`Failed to read temporary file. ${e.message}`),this.originalError=e}};var Vo=class extends Error{originalError;constructor(e){super(`Failed to remove temporary file. ${e.message}`),this.originalError=e}};function nx(r="",e,t){let s=new h0(r,t);s.runAsync((i,n)=>{if(i)setImmediate(e,i,void 0);else try{s.cleanup(),setImmediate(e,void 0,n)}catch(o){setImmediate(e,o,void 0)}})}function tx(r){return r?r.replace(/[^a-zA-Z0-9_.-]/g,"_"):""}function WD(r){let e=[],t="";for(let s=0;s<r.length;s++){let i=r.charAt(s);s>0&&i===" "&&r[s-1]!=="\\"&&t.length>0?(e.push(t),t=""):t=`${t}${i}`}return t.length>0&&e.push(t),e}var h0=class{text="";tempFile;editor;lastExitStatus=0;fileOptions={};get temp_file(){return console.log("DEPRECATED: temp_file. Use tempFile moving forward."),this.tempFile}get last_exit_status(){return console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward."),this.lastExitStatus}constructor(e="",t){this.text=e,t&&(this.fileOptions=t),this.determineEditor(),this.createTemporaryFile()}run(){return this.launchEditor(),this.readTemporaryFile(),this.text}runAsync(e){try{this.launchEditorAsync(()=>{try{this.readTemporaryFile(),setImmediate(e,void 0,this.text)}catch(t){setImmediate(e,t,void 0)}})}catch(t){setImmediate(e,t,void 0)}}cleanup(){this.removeTemporaryFile()}determineEditor(){let e=process.env.VISUAL?process.env.VISUAL:process.env.EDITOR?process.env.EDITOR:process.platform.startsWith("win")?"notepad":"vim",t=WD(e).map(i=>i.replace("\\ "," ")),s=t.shift();this.editor={args:t,bin:s}}createTemporaryFile(){try{let e=this.fileOptions.dir??sx.default.tmpdir(),t=(0,ix.randomUUID)(),s=tx(this.fileOptions.prefix),i=tx(this.fileOptions.postfix),n=`${s}${t}${i}`,o=Ho.default.resolve(e,n),a=Ho.default.resolve(e)+Ho.default.sep;if(!o.startsWith(a))throw new Error("Resolved temporary file escaped the base directory");this.tempFile=o;let c={encoding:"utf8",flag:"wx"};Object.prototype.hasOwnProperty.call(this.fileOptions,"mode")&&(c.mode=this.fileOptions.mode),(0,Zs.writeFileSync)(this.tempFile,this.text,c)}catch(e){throw new Wo(e)}}readTemporaryFile(){try{let e=(0,Zs.readFileSync)(this.tempFile);if(e.length===0)this.text="";else{let t=(0,rx.detect)(e)??"utf8";u0.default.encodingExists(t)||(t="utf8"),this.text=u0.default.decode(e,t)}}catch(e){throw new qo(e)}}removeTemporaryFile(){try{(0,Zs.unlinkSync)(this.tempFile)}catch(e){throw new Vo(e)}}launchEditor(){try{let e=(0,Go.spawnSync)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"});this.lastExitStatus=e.status??0}catch(e){throw new hn(e)}}launchEditorAsync(e){try{(0,Go.spawn)(this.editor.bin,this.editor.args.concat([this.tempFile]),{stdio:"inherit"}).on("exit",s=>{this.lastExitStatus=s,setImmediate(e)})}catch(t){throw new hn(t)}}};var qD={validationFailureMode:"keep"},VD=ue((r,e)=>{let{waitForUserInput:t=!0,file:{postfix:s=r.postfix??".txt",...i}={},validate:n=()=>!0}=r,o=ie(qD,r.theme),[a,c]=R("idle"),[l="",u]=R(r.default),[h,d]=R(),f=ce({status:a,theme:o});function p(b){b.pause();let y=async(w,v)=>{if(b.resume(),w)d(w.toString());else{c("loading");let I=v??"",B=await n(I);B===!0?(d(void 0),c("done"),e(I)):(o.validationFailureMode==="clear"?u(r.default):u(I),d(B||"You must provide a valid value"),c("idle"))}};nx(l,(w,v)=>void y(w,v),{postfix:s,...i})}Ze(b=>{t||p(b)},[]),le((b,y)=>{a==="idle"&&ae(b)&&p(y)});let m=o.style.message(r.message,a),g="";if(a==="loading")g=o.style.help("Received");else if(a==="idle"){let b=o.style.key("enter");g=o.style.help(`Press ${b} to launch your preferred editor.`)}let x="";return h&&(x=o.style.error(h)),[[f,m,g].filter(Boolean).join(" "),x]});function ox(r,e){let t=e!==!1;return/^(y|yes)/i.test(r)?t=!0:/^(n|no)/i.test(r)&&(t=!1),t}function ax(r){return r?"Yes":"No"}var zo=ue((r,e)=>{let{transformer:t=ax}=r,[s,i]=R("idle"),[n,o]=R(""),a=ie(r.theme),c=ce({status:s,theme:a});le((d,f)=>{if(s==="idle")if(ae(d)){let p=ox(n,r.default);o(t(p)),i("done"),e(p)}else if(Xt(d)){let p=ax(!ox(n,r.default));f.clearLine(0),f.write(p),o(p)}else o(f.line)});let l=n,u="";s==="done"?l=a.style.answer(n):u=` ${a.style.defaultAnswer(r.default===!1?"y/N":"Y/n")}`;let h=a.style.message(r.message,s);return`${c} ${h}${u} ${l}`});var HD={validationFailureMode:"keep"},fn=ue((r,e)=>{let{prefill:t="tab"}=r,s=ie(HD,r.theme),[i,n]=R("idle"),[o="",a]=R(r.default),[c,l]=R(),[u,h]=R(""),d=ce({status:i,theme:s});async function f(b){let{required:y,pattern:w,patternError:v="Invalid input"}=r;return y&&!b?"You must provide a value":w&&!w.test(b)?v:typeof r.validate=="function"?await r.validate(b)||"You must provide a valid value":!0}le(async(b,y)=>{if(i==="idle")if(ae(b)){let w=u||o;n("loading");let v=await f(w);v===!0?(h(w),n("done"),e(w)):(s.validationFailureMode==="clear"?h(""):y.write(u),l(v),n("idle"))}else zr(b)&&!u?a(void 0):Xt(b)&&!u?(a(void 0),y.clearLine(0),y.write(o),h(o)):(h(y.line),l(void 0))}),Ze(b=>{t==="editable"&&o&&(b.write(o),h(o))},[]);let p=s.style.message(r.message,i),m=u;typeof r.transformer=="function"?m=r.transformer(u,{isFinal:i==="done"}):i==="done"&&(m=s.style.answer(u));let g;o&&i!=="done"&&!u&&(g=s.style.defaultAnswer(o));let x="";return c&&(x=s.style.error(c)),[[d,p,g,m].filter(b=>b!==void 0).join(" "),x]});function GD(r,e,t){let s=r*Math.pow(10,6),i=e*Math.pow(10,6),n=t*Math.pow(10,6);return(s-(Number.isFinite(t)?n:0))%i===0}function cx(r,{min:e,max:t,step:s}){return r==null||Number.isNaN(r)?!1:r<e||r>t?`Value must be between ${e} and ${t}`:s!=="any"&&!GD(r,s,e)?`Value must be a multiple of ${s}${Number.isFinite(e)?` starting from ${e}`:""}`:!0}var zD=ue((r,e)=>{let{validate:t=()=>!0,min:s=-1/0,max:i=1/0,step:n=1,required:o=!1}=r,a=ie(r.theme),[c,l]=R("idle"),[u,h]=R(""),d=cx(r.default,{min:s,max:i,step:n})===!0?r.default?.toString():void 0,[f="",p]=R(d),[m,g]=R(),x=ce({status:c,theme:a});le(async(I,B)=>{if(c==="idle")if(ae(I)){let H=u||f,A=H===""?void 0:Number(H);l("loading");let E=!0;(o||A!=null)&&(E=cx(A,{min:s,max:i,step:n})),E===!0&&(E=await t(A)),E===!0?(h(String(A??"")),l("done"),e(A)):(B.write(u),g(E||"You must provide a valid numeric value"),l("idle"))}else zr(I)&&!u?p(void 0):Xt(I)&&!u?(p(void 0),B.clearLine(0),B.write(f),h(f)):(h(B.line),g(void 0))});let b=a.style.message(r.message,c),y=u;c==="done"&&(y=a.style.answer(u));let w;f&&c!=="done"&&!u&&(w=a.style.defaultAnswer(f));let v="";return m&&(v=a.style.error(m)),[[x,b,w,y].filter(I=>I!==void 0).join(" "),v]});var f0=_(gr(),1);function KD(r){return r.map(e=>{if(z.isSeparator(e))return e;let t="name"in e?e.name:String(e.value);return{value:"value"in e?e.value:t,name:t,key:e.key.toLowerCase()}})}var ZD={key:"h",name:"Help, list all options",value:void 0},YD=ue((r,e)=>{let{default:t="h"}=r,s=qe(()=>KD(r.choices),[r.choices]),[i,n]=R("idle"),[o,a]=R(""),[c,l]=R(r.expanded??!1),[u,h]=R(),d=ie(r.theme),f=ce({theme:d,status:i});le((v,I)=>{if(ae(v)){let B=(o||t).toLowerCase();if(B==="h"&&!c)l(!0);else{let H=s.find(A=>!z.isSeparator(A)&&A.key===B);H?(n("done"),a(B),e(H.value)):h(o===""?"Please input a value":`"${f0.default.red(o)}" isn't an available option`)}}else a(I.line),h(void 0)});let p=d.style.message(r.message,i);if(i==="done"){let v=s.find(I=>!z.isSeparator(I)&&I.key===o.toLowerCase());return`${f} ${p} ${d.style.answer(v.name)}`}let m=c?s:[...s,ZD],g="",x=m.map(v=>z.isSeparator(v)?"":v.key===t?v.key.toUpperCase():v.key).join("");x=` ${d.style.defaultAnswer(x)}`,c&&(x="",g=m.map(v=>{if(z.isSeparator(v))return` ${v.separator}`;let I=` ${v.key}) ${v.name}`;return v.key===o.toLowerCase()?d.style.highlight(I):I}).join(`
91
91
  `));let b="",y=s.find(v=>!z.isSeparator(v)&&v.key===o.toLowerCase());y&&(b=`${f0.default.cyan(">>")} ${y.name}`);let w="";return u&&(w=d.style.error(u)),[`${f} ${p}${x} ${o}`,[g,b,w].filter(Boolean).join(`
92
- `)]});var ux=_(xr(),1),JD=/\d+/;function rs(r){return r!=null&&!z.isSeparator(r)}function XD(r){let e=0;return r.map(t=>{if(z.isSeparator(t))return t;if(e+=1,typeof t=="string")return{value:t,name:t,short:t,key:String(e)};let s=t.name??String(t.value);return{value:t.value,name:s,short:t.short??s,key:t.key??String(e)}})}function lx(r,e){let t,s=e.filter(rs);if(t=s.find(i=>i.key===r),!t&&JD.test(r)){let i=Number.parseInt(r,10)-1;t=s[i]}return t?[t,e.indexOf(t)]:[void 0,void 0]}var QD=ue((r,e)=>{let{loop:t=!0}=r,s=qe(()=>XD(r.choices),[r.choices]),[i,n]=R("idle"),[o,a]=R(""),[c,l]=R(),u=ie(r.theme),h=ce({status:i,theme:u}),d=qe(()=>{let g=s.findIndex(rs),x=s.findLastIndex(rs);if(g===-1)throw new Bt("[select prompt] No selectable choices. All choices are disabled.");return{first:g,last:x}},[s]);le((g,x)=>{if(ae(g)){let[b]=lx(o,s);rs(b)?(a(b.short),n("done"),e(b.value)):l(o===""?"Please input a value":`"${ux.default.red(o)}" isn't an available option`)}else if(ve(g)||We(g)){x.clearLine(0);let[b,y]=lx(o,s);if(b){if(t||ve(g)&&y!==d.first||We(g)&&y!==d.last){let w=ve(g)?-1:1,v=y;do v=(v+w+s.length)%s.length;while(!rs(s[v]));a(s[v].key)}}else{let w=We(g)?s.find(rs):s.findLast(rs);a(w.key)}}else a(x.line),l(void 0)});let f=u.style.message(r.message,i);if(i==="done")return`${h} ${f} ${u.style.answer(o)}`;let p=s.map(g=>{if(z.isSeparator(g))return` ${g.separator}`;let x=` ${g.key}) ${g.name}`;return g.key===o.toLowerCase()?u.style.highlight(x):x}).join(`
92
+ `)]});var ux=_(gr(),1),JD=/\d+/;function ss(r){return r!=null&&!z.isSeparator(r)}function XD(r){let e=0;return r.map(t=>{if(z.isSeparator(t))return t;if(e+=1,typeof t=="string")return{value:t,name:t,short:t,key:String(e)};let s=t.name??String(t.value);return{value:t.value,name:s,short:t.short??s,key:t.key??String(e)}})}function lx(r,e){let t,s=e.filter(ss);if(t=s.find(i=>i.key===r),!t&&JD.test(r)){let i=Number.parseInt(r,10)-1;t=s[i]}return t?[t,e.indexOf(t)]:[void 0,void 0]}var QD=ue((r,e)=>{let{loop:t=!0}=r,s=qe(()=>XD(r.choices),[r.choices]),[i,n]=R("idle"),[o,a]=R(""),[c,l]=R(),u=ie(r.theme),h=ce({status:i,theme:u}),d=qe(()=>{let g=s.findIndex(ss),x=s.findLastIndex(ss);if(g===-1)throw new Bt("[select prompt] No selectable choices. All choices are disabled.");return{first:g,last:x}},[s]);le((g,x)=>{if(ae(g)){let[b]=lx(o,s);ss(b)?(a(b.short),n("done"),e(b.value)):l(o===""?"Please input a value":`"${ux.default.red(o)}" isn't an available option`)}else if(ve(g)||We(g)){x.clearLine(0);let[b,y]=lx(o,s);if(b){if(t||ve(g)&&y!==d.first||We(g)&&y!==d.last){let w=ve(g)?-1:1,v=y;do v=(v+w+s.length)%s.length;while(!ss(s[v]));a(s[v].key)}}else{let w=We(g)?s.find(ss):s.findLast(ss);a(w.key)}}else a(x.line),l(void 0)});let f=u.style.message(r.message,i);if(i==="done")return`${h} ${f} ${u.style.answer(o)}`;let p=s.map(g=>{if(z.isSeparator(g))return` ${g.separator}`;let x=` ${g.key}) ${g.name}`;return g.key===o.toLowerCase()?u.style.highlight(x):x}).join(`
93
93
  `),m="";return c&&(m=u.style.error(c)),[`${h} ${f} ${o}`,[p,m].filter(Boolean).join(`
94
- `)]});var d0=ue((r,e)=>{let{validate:t=()=>!0}=r,s=ie(r.theme),[i,n]=R("idle"),[o,a]=R(),[c,l]=R(""),u=ce({status:i,theme:s});le(async(m,g)=>{if(i==="idle")if(ae(m)){let x=c;n("loading");let b=await t(x);b===!0?(l(x),n("done"),e(x)):(g.write(c),a(b||"You must provide a valid value"),n("idle"))}else l(g.line),a(void 0)});let h=s.style.message(r.message,i),d="",f;r.mask?d=(typeof r.mask=="string"?r.mask:"*").repeat(c.length):i!=="done"&&(f=`${s.style.help("[input is masked]")}${Hs}`),i==="done"&&(d=s.style.answer(d));let p="";return o&&(p=s.style.error(o)),[[u,h,r.mask?d:f].join(" "),p]});var ss=_(xr(),1);var ev={icon:{cursor:it.pointer},style:{disabled:r=>ss.default.dim(`- ${r}`),searchTerm:r=>ss.default.cyan(r),description:r=>ss.default.cyan(r),keysHelpTip:r=>r.map(([e,t])=>`${ss.default.bold(e)} ${ss.default.dim(t)}`).join(ss.default.dim(" \u2022 "))},helpMode:"always"};function p0(r){return!z.isSeparator(r)&&!r.disabled}function tv(r){return r.map(e=>{if(z.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let t=e.name??String(e.value),s={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(s.description=e.description),s})}var rv=ue((r,e)=>{let{pageSize:t=7,validate:s=()=>!0}=r,i=ie(ev,r.theme),[n,o]=R("loading"),[a,c]=R(""),[l,u]=R([]),[h,d]=R(),f=ce({status:n,theme:i}),p=qe(()=>{let E=l.findIndex(p0),$=l.findLastIndex(p0);return{first:E,last:$}},[l]),[m=p.first,g]=R();Ze(()=>{let E=new AbortController;return o("loading"),d(void 0),(async()=>{try{let te=await r.source(a||void 0,{signal:E.signal});E.signal.aborted||(g(void 0),d(void 0),u(tv(te)),o("idle"))}catch(te){!E.signal.aborted&&te instanceof Error&&d(te.message)}})(),()=>{E.abort()}},[a]);let x=l[m];le(async(E,$)=>{if(ae(E))if(x){o("loading");let te=await s(x.value);o("idle"),te===!0?(o("done"),e(x.value)):x.name===a?d(te||"You must provide a valid value"):($.write(x.name),c(x.name))}else $.write(a);else if(Xt(E)&&x)$.clearLine(0),$.write(x.name),c(x.name);else if(n!=="loading"&&(ve(E)||We(E))){if($.clearLine(0),ve(E)&&m!==p.first||We(E)&&m!==p.last){let te=ve(E)?-1:1,we=m;do we=(we+te+l.length)%l.length;while(!p0(l[we]));g(we)}}else c($.line)});let b=i.style.message(r.message,n),y;if(i.helpMode!=="never")if(r.instructions){let{pager:E,navigation:$}=r.instructions;y=i.style.help(l.length>t?E:$)}else y=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let w=Yr({items:l,active:m,renderItem({item:E,isActive:$}){if(z.isSeparator(E))return` ${E.separator}`;if(E.disabled){let Ft=typeof E.disabled=="string"?E.disabled:"(disabled)";return i.style.disabled(`${E.name} ${Ft}`)}let te=$?i.style.highlight:Ft=>Ft,we=$?i.icon.cursor:" ";return te(`${we} ${E.name}`)},pageSize:t,loop:!1}),v;h?v=i.style.error(h):l.length===0&&a!==""&&n==="idle"&&(v=i.style.error("No results found"));let I;if(n==="done"&&x)return[f,b,i.style.answer(x.short)].filter(Boolean).join(" ").trimEnd();I=i.style.searchTerm(a);let B=x?.description,H=[f,b,I].filter(Boolean).join(" ").trimEnd(),A=[v??w," ",B?i.style.description(B):"",y].filter(Boolean).join(`
95
- `).trimEnd();return[H,A]});var Js=_(xr(),1);var sv={icon:{cursor:it.pointer},style:{disabled:r=>Js.default.dim(`- ${r}`),description:r=>Js.default.cyan(r),keysHelpTip:r=>r.map(([e,t])=>`${Js.default.bold(e)} ${Js.default.dim(t)}`).join(Js.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function Ys(r){return!z.isSeparator(r)&&!r.disabled}function iv(r){return r.map(e=>{if(z.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let t=e.name??String(e.value),s={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(s.description=e.description),s})}var Ko=ue((r,e)=>{let{loop:t=!0,pageSize:s=7}=r,i=ie(sv,r.theme),{keybindings:n}=i,[o,a]=R("idle"),c=ce({status:o,theme:i}),l=Zr(),u=!n.includes("vim"),h=qe(()=>iv(r.choices),[r.choices]),d=qe(()=>{let B=h.findIndex(Ys),H=h.findLastIndex(Ys);if(B===-1)throw new Bt("[select prompt] No selectable choices. All choices are disabled.");return{first:B,last:H}},[h]),f=qe(()=>"default"in r?h.findIndex(B=>Ys(B)&&B.value===r.default):-1,[r.default,h]),[p,m]=R(f===-1?d.first:f),g=h[p];le((B,H)=>{if(clearTimeout(l.current),ae(B))a("done"),e(g.value);else if(ve(B,n)||We(B,n)){if(H.clearLine(0),t||ve(B,n)&&p!==d.first||We(B,n)&&p!==d.last){let A=ve(B,n)?-1:1,E=p;do E=(E+A+h.length)%h.length;while(!Ys(h[E]));m(E)}}else if(Xi(B)&&!Number.isNaN(Number(H.line))){let A=Number(H.line)-1,E=-1,$=h.findIndex(we=>z.isSeparator(we)?!1:(E++,E===A)),te=h[$];te!=null&&Ys(te)&&m($),l.current=setTimeout(()=>{H.clearLine(0)},700)}else if(Gr(B))H.clearLine(0);else if(u){let A=H.line.toLowerCase(),E=h.findIndex($=>z.isSeparator($)||!Ys($)?!1:$.name.toLowerCase().startsWith(A));E!==-1&&m(E),l.current=setTimeout(()=>{H.clearLine(0)},700)}}),Ze(()=>()=>{clearTimeout(l.current)},[]);let x=i.style.message(r.message,o),b;if(i.helpMode!=="never")if(r.instructions){let{pager:B,navigation:H}=r.instructions;b=i.style.help(h.length>s?B:H)}else b=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let y=0,w=Yr({items:h,active:p,renderItem({item:B,isActive:H,index:A}){if(z.isSeparator(B))return y++,` ${B.separator}`;let E=i.indexMode==="number"?`${A+1-y}. `:"";if(B.disabled){let we=typeof B.disabled=="string"?B.disabled:"(disabled)";return i.style.disabled(`${E}${B.name} ${we}`)}let $=H?i.style.highlight:we=>we,te=H?i.icon.cursor:" ";return $(`${te} ${E}${B.name}`)},pageSize:s,loop:t});if(o==="done")return[c,x,i.style.answer(g.short)].filter(Boolean).join(" ");let{description:v}=g;return`${[[c,x].filter(Boolean).join(" "),w," ",v?i.style.description(v):"",b].filter(Boolean).join(`
94
+ `)]});var d0=ue((r,e)=>{let{validate:t=()=>!0}=r,s=ie(r.theme),[i,n]=R("idle"),[o,a]=R(),[c,l]=R(""),u=ce({status:i,theme:s});le(async(m,g)=>{if(i==="idle")if(ae(m)){let x=c;n("loading");let b=await t(x);b===!0?(l(x),n("done"),e(x)):(g.write(c),a(b||"You must provide a valid value"),n("idle"))}else l(g.line),a(void 0)});let h=s.style.message(r.message,i),d="",f;r.mask?d=(typeof r.mask=="string"?r.mask:"*").repeat(c.length):i!=="done"&&(f=`${s.style.help("[input is masked]")}${Hs}`),i==="done"&&(d=s.style.answer(d));let p="";return o&&(p=s.style.error(o)),[[u,h,r.mask?d:f].join(" "),p]});var is=_(gr(),1);var ev={icon:{cursor:it.pointer},style:{disabled:r=>is.default.dim(`- ${r}`),searchTerm:r=>is.default.cyan(r),description:r=>is.default.cyan(r),keysHelpTip:r=>r.map(([e,t])=>`${is.default.bold(e)} ${is.default.dim(t)}`).join(is.default.dim(" \u2022 "))},helpMode:"always"};function p0(r){return!z.isSeparator(r)&&!r.disabled}function tv(r){return r.map(e=>{if(z.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let t=e.name??String(e.value),s={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(s.description=e.description),s})}var rv=ue((r,e)=>{let{pageSize:t=7,validate:s=()=>!0}=r,i=ie(ev,r.theme),[n,o]=R("loading"),[a,c]=R(""),[l,u]=R([]),[h,d]=R(),f=ce({status:n,theme:i}),p=qe(()=>{let E=l.findIndex(p0),$=l.findLastIndex(p0);return{first:E,last:$}},[l]),[m=p.first,g]=R();Ze(()=>{let E=new AbortController;return o("loading"),d(void 0),(async()=>{try{let te=await r.source(a||void 0,{signal:E.signal});E.signal.aborted||(g(void 0),d(void 0),u(tv(te)),o("idle"))}catch(te){!E.signal.aborted&&te instanceof Error&&d(te.message)}})(),()=>{E.abort()}},[a]);let x=l[m];le(async(E,$)=>{if(ae(E))if(x){o("loading");let te=await s(x.value);o("idle"),te===!0?(o("done"),e(x.value)):x.name===a?d(te||"You must provide a valid value"):($.write(x.name),c(x.name))}else $.write(a);else if(Xt(E)&&x)$.clearLine(0),$.write(x.name),c(x.name);else if(n!=="loading"&&(ve(E)||We(E))){if($.clearLine(0),ve(E)&&m!==p.first||We(E)&&m!==p.last){let te=ve(E)?-1:1,we=m;do we=(we+te+l.length)%l.length;while(!p0(l[we]));g(we)}}else c($.line)});let b=i.style.message(r.message,n),y;if(i.helpMode!=="never")if(r.instructions){let{pager:E,navigation:$}=r.instructions;y=i.style.help(l.length>t?E:$)}else y=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let w=Jr({items:l,active:m,renderItem({item:E,isActive:$}){if(z.isSeparator(E))return` ${E.separator}`;if(E.disabled){let Ft=typeof E.disabled=="string"?E.disabled:"(disabled)";return i.style.disabled(`${E.name} ${Ft}`)}let te=$?i.style.highlight:Ft=>Ft,we=$?i.icon.cursor:" ";return te(`${we} ${E.name}`)},pageSize:t,loop:!1}),v;h?v=i.style.error(h):l.length===0&&a!==""&&n==="idle"&&(v=i.style.error("No results found"));let I;if(n==="done"&&x)return[f,b,i.style.answer(x.short)].filter(Boolean).join(" ").trimEnd();I=i.style.searchTerm(a);let B=x?.description,H=[f,b,I].filter(Boolean).join(" ").trimEnd(),A=[v??w," ",B?i.style.description(B):"",y].filter(Boolean).join(`
95
+ `).trimEnd();return[H,A]});var Js=_(gr(),1);var sv={icon:{cursor:it.pointer},style:{disabled:r=>Js.default.dim(`- ${r}`),description:r=>Js.default.cyan(r),keysHelpTip:r=>r.map(([e,t])=>`${Js.default.bold(e)} ${Js.default.dim(t)}`).join(Js.default.dim(" \u2022 "))},helpMode:"always",indexMode:"hidden",keybindings:[]};function Ys(r){return!z.isSeparator(r)&&!r.disabled}function iv(r){return r.map(e=>{if(z.isSeparator(e))return e;if(typeof e=="string")return{value:e,name:e,short:e,disabled:!1};let t=e.name??String(e.value),s={value:e.value,name:t,short:e.short??t,disabled:e.disabled??!1};return e.description&&(s.description=e.description),s})}var Ko=ue((r,e)=>{let{loop:t=!0,pageSize:s=7}=r,i=ie(sv,r.theme),{keybindings:n}=i,[o,a]=R("idle"),c=ce({status:o,theme:i}),l=Yr(),u=!n.includes("vim"),h=qe(()=>iv(r.choices),[r.choices]),d=qe(()=>{let B=h.findIndex(Ys),H=h.findLastIndex(Ys);if(B===-1)throw new Bt("[select prompt] No selectable choices. All choices are disabled.");return{first:B,last:H}},[h]),f=qe(()=>"default"in r?h.findIndex(B=>Ys(B)&&B.value===r.default):-1,[r.default,h]),[p,m]=R(f===-1?d.first:f),g=h[p];le((B,H)=>{if(clearTimeout(l.current),ae(B))a("done"),e(g.value);else if(ve(B,n)||We(B,n)){if(H.clearLine(0),t||ve(B,n)&&p!==d.first||We(B,n)&&p!==d.last){let A=ve(B,n)?-1:1,E=p;do E=(E+A+h.length)%h.length;while(!Ys(h[E]));m(E)}}else if(Xi(B)&&!Number.isNaN(Number(H.line))){let A=Number(H.line)-1,E=-1,$=h.findIndex(we=>z.isSeparator(we)?!1:(E++,E===A)),te=h[$];te!=null&&Ys(te)&&m($),l.current=setTimeout(()=>{H.clearLine(0)},700)}else if(zr(B))H.clearLine(0);else if(u){let A=H.line.toLowerCase(),E=h.findIndex($=>z.isSeparator($)||!Ys($)?!1:$.name.toLowerCase().startsWith(A));E!==-1&&m(E),l.current=setTimeout(()=>{H.clearLine(0)},700)}}),Ze(()=>()=>{clearTimeout(l.current)},[]);let x=i.style.message(r.message,o),b;if(i.helpMode!=="never")if(r.instructions){let{pager:B,navigation:H}=r.instructions;b=i.style.help(h.length>s?B:H)}else b=i.style.keysHelpTip([["\u2191\u2193","navigate"],["\u23CE","select"]]);let y=0,w=Jr({items:h,active:p,renderItem({item:B,isActive:H,index:A}){if(z.isSeparator(B))return y++,` ${B.separator}`;let E=i.indexMode==="number"?`${A+1-y}. `:"";if(B.disabled){let we=typeof B.disabled=="string"?B.disabled:"(disabled)";return i.style.disabled(`${E}${B.name} ${we}`)}let $=H?i.style.highlight:we=>we,te=H?i.icon.cursor:" ";return $(`${te} ${E}${B.name}`)},pageSize:s,loop:t});if(o==="done")return[c,x,i.style.answer(g.short)].filter(Boolean).join(" ");let{description:v}=g;return`${[[c,x].filter(Boolean).join(" "),w," ",v?i.style.description(v):"",b].filter(Boolean).join(`
96
96
  `).trimEnd()}${Hs}`});var J=_(require("chalk")),C2=_(require("ora"));var us=require("node:fs"),o2=require("node:path"),eh=require("node:process"),a2=require("execa");var dn=_(require("chalk"));function m0(r,e){if(r.length===0)return"No entries to display.";let t=e?.title||"Benchmark Results",s=e?.footer||"",i=e?.maxBarWidth||50,n=e?.unit||"",o=Math.max(...r.map(c=>c.value)),a=[];a.push(""),a.push(t),a.push("");for(let c of r){let l=nv(c.barColor??e?.barColor),u=ov(c,o,i,l,n,e?.labelColor);a.push(u)}return s&&(a.push(""),a.push(s)),a.join(`
97
- `)}function nv(r){return r?dn.default[r]("\u2587"):"\u2587"}function ov(r,e,t,s,i,n){let o=Math.round(r.value/e*t),a=r.barColor?dn.default[r.barColor](s.repeat(o)):s.repeat(o),c=r.color??n;return`${dn.default.bold(c?dn.default[c](r.label.padEnd(12)):r.label.padEnd(12))} ${a} ${r.value.toLocaleString()}${i?` ${i}`:""}`}var Zo=_(require("chalk"));var x0=require("listr2");var pn=_(require("chalk")),O={logs:[],breakLine:()=>(console.log(),O),success:(r,...e)=>(console.log(pn.default.green(`\u2714 ${r}`),...e),O),info:(r,...e)=>(console.log(pn.default.cyan(`\u{1F6C8} ${r}`),...e),O),warn:(r,...e)=>(console.warn(pn.default.yellow(`\u26A0\uFE0E ${r}`),...e),O),error:(r,...e)=>(console.error(pn.default.red(`\u2716 ${r}`),...e),O),log:(r,...e)=>(console.log(r,...e),O.logs.push({message:r,context:e.join()}),O),getStoredLogs:r=>r?O.logs.filter(e=>e.context?.includes(r)):O.logs,storeLog:(r,e)=>O.logs.push({message:r,context:e})};function yr(r){let e=new Se(r.name).description(Zo.default.bold(r.description)).showHelpAfterError();return r.arguments?.map(([t,s])=>e.argument(t,s)),r.options?.map(([t,s])=>e.option(t,s)),r.exampleUsage&&e.addHelpText("after",()=>`${Zo.default.cyan.bold(`
97
+ `)}function nv(r){return r?dn.default[r]("\u2587"):"\u2587"}function ov(r,e,t,s,i,n){let o=Math.round(r.value/e*t),a=r.barColor?dn.default[r.barColor](s.repeat(o)):s.repeat(o),c=r.color??n;return`${dn.default.bold(c?dn.default[c](r.label.padEnd(12)):r.label.padEnd(12))} ${a} ${r.value.toLocaleString()}${i?` ${i}`:""}`}var Zo=_(require("chalk"));var x0=require("listr2");var pn=_(require("chalk")),O={logs:[],breakLine:()=>(console.log(),O),success:(r,...e)=>(console.log(pn.default.green(`\u2714 ${r}`),...e),O),info:(r,...e)=>(console.log(pn.default.cyan(`\u{1F6C8} ${r}`),...e),O),warn:(r,...e)=>(console.warn(pn.default.yellow(`\u26A0\uFE0E ${r}`),...e),O),error:(r,...e)=>(console.error(pn.default.red(`\u2716 ${r}`),...e),O),log:(r,...e)=>(console.log(r,...e),O.logs.push({message:r,context:e.join()}),O),getStoredLogs:r=>r?O.logs.filter(e=>e.context?.includes(r)):O.logs,storeLog:(r,e)=>O.logs.push({message:r,context:e})};function wr(r){let e=new Se(r.name).description(Zo.default.bold(r.description)).showHelpAfterError();return r.arguments?.map(([t,s])=>e.argument(t,s)),r.options?.map(([t,s])=>e.option(t,s)),r.exampleUsage&&e.addHelpText("after",()=>`${Zo.default.cyan.bold(`
98
98
  Example:`)}
99
99
  ${Zo.default.bold(r.exampleUsage)}
100
- `),r.additionalInfo&&e.addHelpText("after",()=>(typeof r.additionalInfo=="function"?r.additionalInfo():r.additionalInfo)??""),e.action(async(...t)=>{try{let s=t.at(-1),i=s.args,n=s.opts(),o=av(r.arguments??[],i);if(r.shouldSkipWorkflow?.(o,n)){await r.onSkipWorkflow?.(o,n);return}let a=await r.buildContext(o,n);r.prompts?.length&&await new x0.Listr(hx(r.prompts,a),{rendererOptions:{lazy:!0,showErrorMessage:!1}}).run(a),await new x0.Listr(hx(r.actions,a),{rendererOptions:{lazy:!1,showErrorMessage:!1,clearOutput:!0}}).run(a),await r.onComplete?.(a)}catch(s){let i=s;O.error(i.message)}}),e}function av(r,e){let t={};return r.forEach(([s],i)=>{let n=s.replace(/[<>[\]]/g,"");t[n]=e[i]}),t}function hx(r,e){return r.map(t=>typeof t=="function"?t(e):t)}function fx(r,e,t){let s=e.split("."),i=r;for(;s.length>1;){let n=s.shift();n in i||(i[n]={}),i=i[n]}i[s[0]]=t}var dx=require("execa");function mn(r){try{return(0,dx.execaSync)(r,["--version"]),!0}catch{return!1}}var _r=require("node:path"),Wg=require("fs-extra");var yx=_(require("node:process"),1);var mx=_(require("node:process"),1);var xx=require("node:url"),gx=_(require("node:fs"),1),is=_(require("node:path"),1),px=r=>r instanceof URL?(0,xx.fileURLToPath)(r):r;function bx(r,{cwd:e=mx.default.cwd(),type:t="file",stopAt:s}={}){let i=is.default.resolve(px(e)??""),{root:n}=is.default.parse(i);s=is.default.resolve(i,px(s)??n);let o=is.default.isAbsolute(r);for(;i;){let a=o?r:is.default.join(i,r);try{let c=gx.default.statSync(a,{throwIfNoEntry:!1});if(t==="file"&&c?.isFile()||t==="directory"&&c?.isDirectory())return a}catch{}if(i===s||i===n)break;i=is.default.dirname(i)}}function g0({cwd:r=yx.default.cwd()}={}){return bx("package.json",{cwd:r})}var b0=(r,e,t)=>{let s=r instanceof RegExp?wx(r,t):r,i=e instanceof RegExp?wx(e,t):e,n=s!==null&&i!=null&&cv(s,i,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+s.length,n[1]),post:t.slice(n[1]+i.length)}},wx=(r,e)=>{let t=e.match(r);return t?t[0]:null},cv=(r,e,t)=>{let s,i,n,o,a,c=t.indexOf(r),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(r===e)return[c,l];for(s=[],n=t.length;u>=0&&!a;){if(u===c)s.push(u),c=t.indexOf(r,u+1);else if(s.length===1){let h=s.pop();h!==void 0&&(a=[h,l])}else i=s.pop(),i!==void 0&&i<n&&(n=i,o=l),l=t.indexOf(e,u+1);u=c<l&&c>=0?c:l}s.length&&o!==void 0&&(a=[n,o])}return a};var Dx="\0SLASH"+Math.random()+"\0",vx="\0OPEN"+Math.random()+"\0",w0="\0CLOSE"+Math.random()+"\0",Cx="\0COMMA"+Math.random()+"\0",Ex="\0PERIOD"+Math.random()+"\0",lv=new RegExp(Dx,"g"),uv=new RegExp(vx,"g"),hv=new RegExp(w0,"g"),fv=new RegExp(Cx,"g"),dv=new RegExp(Ex,"g"),pv=/\\\\/g,mv=/\\{/g,xv=/\\}/g,gv=/\\,/g,bv=/\\./g;function y0(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function yv(r){return r.replace(pv,Dx).replace(mv,vx).replace(xv,w0).replace(gv,Cx).replace(bv,Ex)}function wv(r){return r.replace(lv,"\\").replace(uv,"{").replace(hv,"}").replace(fv,",").replace(dv,".")}function kx(r){if(!r)return[""];let e=[],t=b0("{","}",r);if(!t)return r.split(",");let{pre:s,body:i,post:n}=t,o=s.split(",");o[o.length-1]+="{"+i+"}";let a=kx(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Sx(r){return r?(r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),xn(yv(r),!0).map(wv)):[]}function Dv(r){return"{"+r+"}"}function vv(r){return/^-?0\d/.test(r)}function Cv(r,e){return r<=e}function Ev(r,e){return r>=e}function xn(r,e){let t=[],s=b0("{","}",r);if(!s)return[r];let i=s.pre,n=s.post.length?xn(s.post,!1):[""];if(/\$$/.test(s.pre))for(let o=0;o<n.length;o++){let a=i+"{"+s.body+"}"+n[o];t.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),c=o||a,l=s.body.indexOf(",")>=0;if(!c&&!l)return s.post.match(/,(?!,).*\}/)?(r=s.pre+"{"+s.body+w0+s.post,xn(r)):[r];let u;if(c)u=s.body.split(/\.\./);else if(u=kx(s.body),u.length===1&&u[0]!==void 0&&(u=xn(u[0],!1).map(Dv),u.length===1))return n.map(d=>s.pre+u[0]+d);let h;if(c&&u[0]!==void 0&&u[1]!==void 0){let d=y0(u[0]),f=y0(u[1]),p=Math.max(u[0].length,u[1].length),m=u.length===3&&u[2]!==void 0?Math.abs(y0(u[2])):1,g=Cv;f<d&&(m*=-1,g=Ev);let b=u.some(vv);h=[];for(let y=d;g(y,f);y+=m){let w;if(a)w=String.fromCharCode(y),w==="\\"&&(w="");else if(w=String(y),b){let v=p-w.length;if(v>0){let I=new Array(v+1).join("0");y<0?w="-"+I+w.slice(1):w=I+w}}h.push(w)}}else{h=[];for(let d=0;d<u.length;d++)h.push.apply(h,xn(u[d],!1))}for(let d=0;d<h.length;d++)for(let f=0;f<n.length;f++){let p=i+h[d]+n[f];(!e||c||p)&&t.push(p)}}return t}var gn=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var kv={"[: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]},bn=r=>r.replace(/[[\]\\-]/g,"\\$&"),Sv=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_x=r=>r.join(""),Ax=(r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let s=[],i=[],n=t+1,o=!1,a=!1,c=!1,l=!1,u=t,h="";e:for(;n<r.length;){let m=r.charAt(n);if((m==="!"||m==="^")&&n===t+1){l=!0,n++;continue}if(m==="]"&&o&&!c){u=n+1;break}if(o=!0,m==="\\"&&!c){c=!0,n++;continue}if(m==="["&&!c){for(let[g,[x,b,y]]of Object.entries(kv))if(r.startsWith(g,n)){if(h)return["$.",!1,r.length-t,!0];n+=g.length,y?i.push(x):s.push(x),a=a||b;continue e}}if(c=!1,h){m>h?s.push(bn(h)+"-"+bn(m)):m===h&&s.push(bn(m)),h="",n++;continue}if(r.startsWith("-]",n+1)){s.push(bn(m+"-")),n+=2;continue}if(r.startsWith("-",n+1)){h=m,n+=2;continue}s.push(bn(m)),n++}if(u<n)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let m=s[0].length===2?s[0].slice(-1):s[0];return[Sv(m),!1,u-t,!1]}let d="["+(l?"^":"")+_x(s)+"]",f="["+(l?"":"^")+_x(i)+"]";return[s.length&&i.length?"("+d+"|"+f+")":s.length?d:f,a,u-t,!0]};var Et=(r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?r.replace(/\[([^\/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var _v=new Set(["!","?","+","*","@"]),Tx=r=>_v.has(r),Av="(?!(?:^|/)\\.\\.?(?:$|/))",Yo="(?!\\.)",Tv=new Set(["[","."]),Fv=new Set(["..","."]),Ov=new Set("().*{}+?[]^$\\!"),Iv=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),D0="[^/]",Fx=D0+"*?",Ox=D0+"+?",Xs=class r{type;#e;#t;#r=!1;#i=[];#o;#d;#h;#u=!1;#a;#p;#f=!1;constructor(e,t,s={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?s:this.#e.#a,this.#h=this.#e===this?[]:this.#e.#h,e==="!"&&!this.#e.#u&&this.#h.push(this),this.#d=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#p=this.#i.map(e=>String(e)).join("")}#c(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#h.pop();){if(e.type!=="!")continue;let t=e,s=t.#o;for(;s;){for(let i=t.#d+1;!s.type&&i<s.#i.length;i++)for(let n of e.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#i[i])}t=s,s=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof r&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#d===0)return!0;let e=this.#o;for(let t=0;t<this.#d;t++){let s=e.#i[t];if(!(s instanceof r&&s.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#d===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new r(this.type,e);for(let s of this.#i)t.copyIn(s);return t}static#n(e,t,s,i){let n=!1,o=!1,a=-1,c=!1;if(t.type===null){let f=s,p="";for(;f<e.length;){let m=e.charAt(f++);if(n||m==="\\"){n=!n,p+=m;continue}if(o){f===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(f===a+2&&c)&&(o=!1),p+=m;continue}else if(m==="["){o=!0,a=f,c=!1,p+=m;continue}if(!i.noext&&Tx(m)&&e.charAt(f)==="("){t.push(p),p="";let g=new r(m,t);f=r.#n(e,g,f,i),t.push(g);continue}p+=m}return t.push(p),f}let l=s+1,u=new r(null,t),h=[],d="";for(;l<e.length;){let f=e.charAt(l++);if(n||f==="\\"){n=!n,d+=f;continue}if(o){l===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===a+2&&c)&&(o=!1),d+=f;continue}else if(f==="["){o=!0,a=l,c=!1,d+=f;continue}if(Tx(f)&&e.charAt(l)==="("){u.push(d),d="";let p=new r(f,u);u.push(p),l=r.#n(e,p,l,i);continue}if(f==="|"){u.push(d),d="",h.push(u),u=new r(null,t);continue}if(f===")")return d===""&&t.#i.length===0&&(t.#f=!0),u.push(d),d="",t.push(...h,u),l;d+=f}return t.type=null,t.#t=void 0,t.#i=[e.substring(s-1)],l}static fromGlob(e,t={}){let s=new r(null,void 0,t);return r.#n(e,s,0,t),s}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,s,i,n]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let a=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#c(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#i.some(f=>typeof f!="string"),l=this.#i.map(f=>{let[p,m,g,x]=typeof f=="string"?r.#D(f,this.#t,c):f.toRegExpSource(e);return this.#t=this.#t||g,this.#r=this.#r||x,p}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&Fv.has(this.#i[0]))){let p=Tv,m=t&&p.has(l.charAt(0))||l.startsWith("\\.")&&p.has(l.charAt(2))||l.startsWith("\\.\\.")&&p.has(l.charAt(4)),g=!t&&!e&&p.has(l.charAt(0));u=m?Av:g?Yo:""}let h="";return this.isEnd()&&this.#e.#u&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[u+l+h,Et(l),this.#t=!!this.#t,this.#r]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#m(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,Et(this.toString()),!1,!1]}let o=!s||e||t||!Yo?"":this.#m(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!t?Yo:"")+Ox;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Yo:"")+Fx+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+n+c}return[a,Et(n),this.#t=!!this.#t,this.#r]}#m(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[s,i,n,o]=t.toRegExpSource(e);return this.#r=this.#r||o,s}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#D(e,t,s=!1){let i=!1,n="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,n+=(Ov.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?n+="\\\\":i=!0;continue}if(c==="["){let[l,u,h,d]=Ax(e,a);if(h){n+=l,o=o||u,a+=h-1,t=t||d;continue}}if(c==="*"){n+=s&&e==="*"?Ox:Fx,t=!0;continue}if(c==="?"){n+=D0,t=!0;continue}n+=Iv(c)}return[n,Et(e),!!t,o]}};var Qs=(r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var Re=(r,e,t={})=>(gn(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ye(e,t).match(r)),Bv=/^\*+([^+@!?\*\[\(]*)$/,Pv=r=>e=>!e.startsWith(".")&&e.endsWith(r),Rv=r=>e=>e.endsWith(r),Mv=r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),$v=r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),jv=/^\*+\.\*+$/,Nv=r=>!r.startsWith(".")&&r.includes("."),Lv=r=>r!=="."&&r!==".."&&r.includes("."),Uv=/^\.\*+$/,Wv=r=>r!=="."&&r!==".."&&r.startsWith("."),qv=/^\*+$/,Vv=r=>r.length!==0&&!r.startsWith("."),Hv=r=>r.length!==0&&r!=="."&&r!=="..",Gv=/^\?+([^+@!?\*\[\(]*)?$/,zv=([r,e=""])=>{let t=Px([r]);return e?(e=e.toLowerCase(),s=>t(s)&&s.toLowerCase().endsWith(e)):t},Kv=([r,e=""])=>{let t=Rx([r]);return e?(e=e.toLowerCase(),s=>t(s)&&s.toLowerCase().endsWith(e)):t},Zv=([r,e=""])=>{let t=Rx([r]);return e?s=>t(s)&&s.endsWith(e):t},Yv=([r,e=""])=>{let t=Px([r]);return e?s=>t(s)&&s.endsWith(e):t},Px=([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},Rx=([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},Mx=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ix={win32:{sep:"\\"},posix:{sep:"/"}},Jv=Mx==="win32"?Ix.win32.sep:Ix.posix.sep;Re.sep=Jv;var Ee=Symbol("globstar **");Re.GLOBSTAR=Ee;var Xv="[^/]",Qv=Xv+"*?",e8="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",t8="(?:(?!(?:\\/|^)\\.).)*?",r8=(r,e={})=>t=>Re(t,r,e);Re.filter=r8;var ht=(r,e={})=>Object.assign({},r,e),s8=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Re;let e=Re;return Object.assign((s,i,n={})=>e(s,i,ht(r,n)),{Minimatch:class extends e.Minimatch{constructor(i,n={}){super(i,ht(r,n))}static defaults(i){return e.defaults(ht(r,i)).Minimatch}},AST:class extends e.AST{constructor(i,n,o={}){super(i,n,ht(r,o))}static fromGlob(i,n={}){return e.AST.fromGlob(i,ht(r,n))}},unescape:(s,i={})=>e.unescape(s,ht(r,i)),escape:(s,i={})=>e.escape(s,ht(r,i)),filter:(s,i={})=>e.filter(s,ht(r,i)),defaults:s=>e.defaults(ht(r,s)),makeRe:(s,i={})=>e.makeRe(s,ht(r,i)),braceExpand:(s,i={})=>e.braceExpand(s,ht(r,i)),match:(s,i,n={})=>e.match(s,i,ht(r,n)),sep:e.sep,GLOBSTAR:Ee})};Re.defaults=s8;var $x=(r,e={})=>(gn(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:Sx(r));Re.braceExpand=$x;var i8=(r,e={})=>new Ye(r,e).makeRe();Re.makeRe=i8;var n8=(r,e,t={})=>{let s=new Ye(e,t);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(e),r};Re.match=n8;var Bx=/[?*]|[+@!]\(.*?\)|\[|\]/,o8=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){gn(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Mx,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.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 e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.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 i=this.globParts.map((n,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Bx.test(n[2]))&&!Bx.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let s=0;s<e.length;s++)for(let i=0;i<e[s].length;i++)e[s][i]==="**"&&(e[s][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let s=-1;for(;(s=t.indexOf("**",s+1))!==-1;){let i=s;for(;t[i+1]==="**";)i++;i!==s&&t.splice(s,i-s)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let s=0;for(;(s=e.indexOf("..",s+1))!==-1;){let i=e[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(s-1,2),s-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let s of e){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let o=i;for(;s[o+1]==="**";)o++;o>i&&s.splice(i+1,o-i);let a=s[i+1],c=s[i+2],l=s[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(t=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(t=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...c),s.length===0&&s.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let s=t+1;s<e.length;s++){let i=this.partsMatch(e[t],e[s],!this.preserveMultipleSlashes);if(i){e[t]=[],e[s]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,s=!1){let i=0,n=0,o=[],a="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])o.push(a==="b"?t[n]:e[i]),i++,n++;else if(s&&e[i]==="**"&&t[n]===e[i+1])o.push(e[i]),i++;else if(s&&t[n]==="**"&&e[i]===t[n+1])o.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(t[n]),i++,n++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,s=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,s++;s&&(this.pattern=e.slice(s)),this.negate=t}matchOne(e,t,s=!1){let i=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),y=g?3:m?0:void 0,w=b?3:x?0:void 0;if(typeof y=="number"&&typeof w=="number"){let[v,I]=[e[y],t[w]];v.toLowerCase()===I.toLowerCase()&&(t[w]=v,w>y?t=t.slice(w):y>w&&(e=e.slice(y)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],h=e[o];if(this.debug(t,u,h),u===!1)return!1;if(u===Ee){this.debug("GLOBSTAR",[t,u,h]);var d=o,f=a+1;if(f===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<c;){var p=e[d];if(this.debug(`
100
+ `),r.additionalInfo&&e.addHelpText("after",()=>(typeof r.additionalInfo=="function"?r.additionalInfo():r.additionalInfo)??""),e.action(async(...t)=>{try{let s=t.at(-1),i=s.args,n=s.opts(),o=av(r.arguments??[],i);if(r.shouldSkipWorkflow?.(o,n)){await r.onSkipWorkflow?.(o,n);return}let a=await r.buildContext(o,n);r.prompts?.length&&await new x0.Listr(hx(r.prompts,a),{rendererOptions:{lazy:!0,showErrorMessage:!1}}).run(a),await new x0.Listr(hx(r.actions,a),{rendererOptions:{lazy:!1,showErrorMessage:!1,clearOutput:!0}}).run(a),await r.onComplete?.(a)}catch(s){let i=s;O.error(i.message)}}),e}function av(r,e){let t={};return r.forEach(([s],i)=>{let n=s.replace(/[<>[\]]/g,"");t[n]=e[i]}),t}function hx(r,e){return r.map(t=>typeof t=="function"?t(e):t)}function fx(r,e,t){let s=e.split("."),i=r;for(;s.length>1;){let n=s.shift();n in i||(i[n]={}),i=i[n]}i[s[0]]=t}var dx=require("execa");function mn(r){try{return(0,dx.execaSync)(r,["--version"]),!0}catch{return!1}}var Ar=require("node:path"),Wg=require("fs-extra");var yx=_(require("node:process"),1);var mx=_(require("node:process"),1);var xx=require("node:url"),gx=_(require("node:fs"),1),ns=_(require("node:path"),1),px=r=>r instanceof URL?(0,xx.fileURLToPath)(r):r;function bx(r,{cwd:e=mx.default.cwd(),type:t="file",stopAt:s}={}){let i=ns.default.resolve(px(e)??""),{root:n}=ns.default.parse(i);s=ns.default.resolve(i,px(s)??n);let o=ns.default.isAbsolute(r);for(;i;){let a=o?r:ns.default.join(i,r);try{let c=gx.default.statSync(a,{throwIfNoEntry:!1});if(t==="file"&&c?.isFile()||t==="directory"&&c?.isDirectory())return a}catch{}if(i===s||i===n)break;i=ns.default.dirname(i)}}function g0({cwd:r=yx.default.cwd()}={}){return bx("package.json",{cwd:r})}var b0=(r,e,t)=>{let s=r instanceof RegExp?wx(r,t):r,i=e instanceof RegExp?wx(e,t):e,n=s!==null&&i!=null&&cv(s,i,t);return n&&{start:n[0],end:n[1],pre:t.slice(0,n[0]),body:t.slice(n[0]+s.length,n[1]),post:t.slice(n[1]+i.length)}},wx=(r,e)=>{let t=e.match(r);return t?t[0]:null},cv=(r,e,t)=>{let s,i,n,o,a,c=t.indexOf(r),l=t.indexOf(e,c+1),u=c;if(c>=0&&l>0){if(r===e)return[c,l];for(s=[],n=t.length;u>=0&&!a;){if(u===c)s.push(u),c=t.indexOf(r,u+1);else if(s.length===1){let h=s.pop();h!==void 0&&(a=[h,l])}else i=s.pop(),i!==void 0&&i<n&&(n=i,o=l),l=t.indexOf(e,u+1);u=c<l&&c>=0?c:l}s.length&&o!==void 0&&(a=[n,o])}return a};var Dx="\0SLASH"+Math.random()+"\0",vx="\0OPEN"+Math.random()+"\0",w0="\0CLOSE"+Math.random()+"\0",Cx="\0COMMA"+Math.random()+"\0",Ex="\0PERIOD"+Math.random()+"\0",lv=new RegExp(Dx,"g"),uv=new RegExp(vx,"g"),hv=new RegExp(w0,"g"),fv=new RegExp(Cx,"g"),dv=new RegExp(Ex,"g"),pv=/\\\\/g,mv=/\\{/g,xv=/\\}/g,gv=/\\,/g,bv=/\\./g;function y0(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function yv(r){return r.replace(pv,Dx).replace(mv,vx).replace(xv,w0).replace(gv,Cx).replace(bv,Ex)}function wv(r){return r.replace(lv,"\\").replace(uv,"{").replace(hv,"}").replace(fv,",").replace(dv,".")}function kx(r){if(!r)return[""];let e=[],t=b0("{","}",r);if(!t)return r.split(",");let{pre:s,body:i,post:n}=t,o=s.split(",");o[o.length-1]+="{"+i+"}";let a=kx(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Sx(r){return r?(r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),xn(yv(r),!0).map(wv)):[]}function Dv(r){return"{"+r+"}"}function vv(r){return/^-?0\d/.test(r)}function Cv(r,e){return r<=e}function Ev(r,e){return r>=e}function xn(r,e){let t=[],s=b0("{","}",r);if(!s)return[r];let i=s.pre,n=s.post.length?xn(s.post,!1):[""];if(/\$$/.test(s.pre))for(let o=0;o<n.length;o++){let a=i+"{"+s.body+"}"+n[o];t.push(a)}else{let o=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),a=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),c=o||a,l=s.body.indexOf(",")>=0;if(!c&&!l)return s.post.match(/,(?!,).*\}/)?(r=s.pre+"{"+s.body+w0+s.post,xn(r)):[r];let u;if(c)u=s.body.split(/\.\./);else if(u=kx(s.body),u.length===1&&u[0]!==void 0&&(u=xn(u[0],!1).map(Dv),u.length===1))return n.map(d=>s.pre+u[0]+d);let h;if(c&&u[0]!==void 0&&u[1]!==void 0){let d=y0(u[0]),f=y0(u[1]),p=Math.max(u[0].length,u[1].length),m=u.length===3&&u[2]!==void 0?Math.abs(y0(u[2])):1,g=Cv;f<d&&(m*=-1,g=Ev);let b=u.some(vv);h=[];for(let y=d;g(y,f);y+=m){let w;if(a)w=String.fromCharCode(y),w==="\\"&&(w="");else if(w=String(y),b){let v=p-w.length;if(v>0){let I=new Array(v+1).join("0");y<0?w="-"+I+w.slice(1):w=I+w}}h.push(w)}}else{h=[];for(let d=0;d<u.length;d++)h.push.apply(h,xn(u[d],!1))}for(let d=0;d<h.length;d++)for(let f=0;f<n.length;f++){let p=i+h[d]+n[f];(!e||c||p)&&t.push(p)}}return t}var gn=r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")};var kv={"[: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]},bn=r=>r.replace(/[[\]\\-]/g,"\\$&"),Sv=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),_x=r=>r.join(""),Ax=(r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let s=[],i=[],n=t+1,o=!1,a=!1,c=!1,l=!1,u=t,h="";e:for(;n<r.length;){let m=r.charAt(n);if((m==="!"||m==="^")&&n===t+1){l=!0,n++;continue}if(m==="]"&&o&&!c){u=n+1;break}if(o=!0,m==="\\"&&!c){c=!0,n++;continue}if(m==="["&&!c){for(let[g,[x,b,y]]of Object.entries(kv))if(r.startsWith(g,n)){if(h)return["$.",!1,r.length-t,!0];n+=g.length,y?i.push(x):s.push(x),a=a||b;continue e}}if(c=!1,h){m>h?s.push(bn(h)+"-"+bn(m)):m===h&&s.push(bn(m)),h="",n++;continue}if(r.startsWith("-]",n+1)){s.push(bn(m+"-")),n+=2;continue}if(r.startsWith("-",n+1)){h=m,n+=2;continue}s.push(bn(m)),n++}if(u<n)return["",!1,0,!1];if(!s.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){let m=s[0].length===2?s[0].slice(-1):s[0];return[Sv(m),!1,u-t,!1]}let d="["+(l?"^":"")+_x(s)+"]",f="["+(l?"":"^")+_x(i)+"]";return[s.length&&i.length?"("+d+"|"+f+")":s.length?d:f,a,u-t,!0]};var Et=(r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^\/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?r.replace(/\[([^\/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");var _v=new Set(["!","?","+","*","@"]),Tx=r=>_v.has(r),Av="(?!(?:^|/)\\.\\.?(?:$|/))",Yo="(?!\\.)",Tv=new Set(["[","."]),Fv=new Set(["..","."]),Ov=new Set("().*{}+?[]^$\\!"),Iv=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),D0="[^/]",Fx=D0+"*?",Ox=D0+"+?",Xs=class r{type;#e;#t;#r=!1;#i=[];#o;#d;#h;#u=!1;#a;#p;#f=!1;constructor(e,t,s={}){this.type=e,e&&(this.#t=!0),this.#o=t,this.#e=this.#o?this.#o.#e:this,this.#a=this.#e===this?s:this.#e.#a,this.#h=this.#e===this?[]:this.#e.#h,e==="!"&&!this.#e.#u&&this.#h.push(this),this.#d=this.#o?this.#o.#i.length:0}get hasMagic(){if(this.#t!==void 0)return this.#t;for(let e of this.#i)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#t=!0;return this.#t}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#i.map(e=>String(e)).join("|")+")":this.#p=this.#i.map(e=>String(e)).join("")}#c(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#h.pop();){if(e.type!=="!")continue;let t=e,s=t.#o;for(;s;){for(let i=t.#d+1;!s.type&&i<s.#i.length;i++)for(let n of e.#i){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#i[i])}t=s,s=t.#o}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof r&&t.#o===this))throw new Error("invalid part: "+t);this.#i.push(t)}}toJSON(){let e=this.type===null?this.#i.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#i.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#o?.isStart())return!1;if(this.#d===0)return!0;let e=this.#o;for(let t=0;t<this.#d;t++){let s=e.#i[t];if(!(s instanceof r&&s.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#o?.type==="!")return!0;if(!this.#o?.isEnd())return!1;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#i.length:0;return this.#d===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new r(this.type,e);for(let s of this.#i)t.copyIn(s);return t}static#n(e,t,s,i){let n=!1,o=!1,a=-1,c=!1;if(t.type===null){let f=s,p="";for(;f<e.length;){let m=e.charAt(f++);if(n||m==="\\"){n=!n,p+=m;continue}if(o){f===a+1?(m==="^"||m==="!")&&(c=!0):m==="]"&&!(f===a+2&&c)&&(o=!1),p+=m;continue}else if(m==="["){o=!0,a=f,c=!1,p+=m;continue}if(!i.noext&&Tx(m)&&e.charAt(f)==="("){t.push(p),p="";let g=new r(m,t);f=r.#n(e,g,f,i),t.push(g);continue}p+=m}return t.push(p),f}let l=s+1,u=new r(null,t),h=[],d="";for(;l<e.length;){let f=e.charAt(l++);if(n||f==="\\"){n=!n,d+=f;continue}if(o){l===a+1?(f==="^"||f==="!")&&(c=!0):f==="]"&&!(l===a+2&&c)&&(o=!1),d+=f;continue}else if(f==="["){o=!0,a=l,c=!1,d+=f;continue}if(Tx(f)&&e.charAt(l)==="("){u.push(d),d="";let p=new r(f,u);u.push(p),l=r.#n(e,p,l,i);continue}if(f==="|"){u.push(d),d="",h.push(u),u=new r(null,t);continue}if(f===")")return d===""&&t.#i.length===0&&(t.#f=!0),u.push(d),d="",t.push(...h,u),l;d+=f}return t.type=null,t.#t=void 0,t.#i=[e.substring(s-1)],l}static fromGlob(e,t={}){let s=new r(null,void 0,t);return r.#n(e,s,0,t),s}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,s,i,n]=this.toRegExpSource();if(!(i||this.#t||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let a=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#a}toRegExpSource(e){let t=e??!!this.#a.dot;if(this.#e===this&&this.#c(),!this.type){let c=this.isStart()&&this.isEnd()&&!this.#i.some(f=>typeof f!="string"),l=this.#i.map(f=>{let[p,m,g,x]=typeof f=="string"?r.#D(f,this.#t,c):f.toRegExpSource(e);return this.#t=this.#t||g,this.#r=this.#r||x,p}).join(""),u="";if(this.isStart()&&typeof this.#i[0]=="string"&&!(this.#i.length===1&&Fv.has(this.#i[0]))){let p=Tv,m=t&&p.has(l.charAt(0))||l.startsWith("\\.")&&p.has(l.charAt(2))||l.startsWith("\\.\\.")&&p.has(l.charAt(4)),g=!t&&!e&&p.has(l.charAt(0));u=m?Av:g?Yo:""}let h="";return this.isEnd()&&this.#e.#u&&this.#o?.type==="!"&&(h="(?:$|\\/)"),[u+l+h,Et(l),this.#t=!!this.#t,this.#r]}let s=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#m(t);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let c=this.toString();return this.#i=[c],this.type=null,this.#t=void 0,[c,Et(this.toString()),!1,!1]}let o=!s||e||t||!Yo?"":this.#m(!0);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!t?Yo:"")+Ox;else{let c=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Yo:"")+Fx+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+n+c}return[a,Et(n),this.#t=!!this.#t,this.#r]}#m(e){return this.#i.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[s,i,n,o]=t.toRegExpSource(e);return this.#r=this.#r||o,s}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#D(e,t,s=!1){let i=!1,n="",o=!1;for(let a=0;a<e.length;a++){let c=e.charAt(a);if(i){i=!1,n+=(Ov.has(c)?"\\":"")+c;continue}if(c==="\\"){a===e.length-1?n+="\\\\":i=!0;continue}if(c==="["){let[l,u,h,d]=Ax(e,a);if(h){n+=l,o=o||u,a+=h-1,t=t||d;continue}}if(c==="*"){n+=s&&e==="*"?Ox:Fx,t=!0;continue}if(c==="?"){n+=D0,t=!0;continue}n+=Iv(c)}return[n,Et(e),!!t,o]}};var Qs=(r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&");var Re=(r,e,t={})=>(gn(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Ye(e,t).match(r)),Bv=/^\*+([^+@!?\*\[\(]*)$/,Pv=r=>e=>!e.startsWith(".")&&e.endsWith(r),Rv=r=>e=>e.endsWith(r),Mv=r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),$v=r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),jv=/^\*+\.\*+$/,Nv=r=>!r.startsWith(".")&&r.includes("."),Lv=r=>r!=="."&&r!==".."&&r.includes("."),Uv=/^\.\*+$/,Wv=r=>r!=="."&&r!==".."&&r.startsWith("."),qv=/^\*+$/,Vv=r=>r.length!==0&&!r.startsWith("."),Hv=r=>r.length!==0&&r!=="."&&r!=="..",Gv=/^\?+([^+@!?\*\[\(]*)?$/,zv=([r,e=""])=>{let t=Px([r]);return e?(e=e.toLowerCase(),s=>t(s)&&s.toLowerCase().endsWith(e)):t},Kv=([r,e=""])=>{let t=Rx([r]);return e?(e=e.toLowerCase(),s=>t(s)&&s.toLowerCase().endsWith(e)):t},Zv=([r,e=""])=>{let t=Rx([r]);return e?s=>t(s)&&s.endsWith(e):t},Yv=([r,e=""])=>{let t=Px([r]);return e?s=>t(s)&&s.endsWith(e):t},Px=([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},Rx=([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},Mx=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",Ix={win32:{sep:"\\"},posix:{sep:"/"}},Jv=Mx==="win32"?Ix.win32.sep:Ix.posix.sep;Re.sep=Jv;var Ee=Symbol("globstar **");Re.GLOBSTAR=Ee;var Xv="[^/]",Qv=Xv+"*?",e8="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",t8="(?:(?!(?:\\/|^)\\.).)*?",r8=(r,e={})=>t=>Re(t,r,e);Re.filter=r8;var ht=(r,e={})=>Object.assign({},r,e),s8=r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return Re;let e=Re;return Object.assign((s,i,n={})=>e(s,i,ht(r,n)),{Minimatch:class extends e.Minimatch{constructor(i,n={}){super(i,ht(r,n))}static defaults(i){return e.defaults(ht(r,i)).Minimatch}},AST:class extends e.AST{constructor(i,n,o={}){super(i,n,ht(r,o))}static fromGlob(i,n={}){return e.AST.fromGlob(i,ht(r,n))}},unescape:(s,i={})=>e.unescape(s,ht(r,i)),escape:(s,i={})=>e.escape(s,ht(r,i)),filter:(s,i={})=>e.filter(s,ht(r,i)),defaults:s=>e.defaults(ht(r,s)),makeRe:(s,i={})=>e.makeRe(s,ht(r,i)),braceExpand:(s,i={})=>e.braceExpand(s,ht(r,i)),match:(s,i,n={})=>e.match(s,i,ht(r,n)),sep:e.sep,GLOBSTAR:Ee})};Re.defaults=s8;var $x=(r,e={})=>(gn(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:Sx(r));Re.braceExpand=$x;var i8=(r,e={})=>new Ye(r,e).makeRe();Re.makeRe=i8;var n8=(r,e,t={})=>{let s=new Ye(e,t);return r=r.filter(i=>s.match(i)),s.options.nonull&&!r.length&&r.push(e),r};Re.match=n8;var Bx=/[?*]|[+@!]\(.*?\)|\[|\]/,o8=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Ye=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){gn(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||Mx,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.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 e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.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 i=this.globParts.map((n,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=n[0]===""&&n[1]===""&&(n[2]==="?"||!Bx.test(n[2]))&&!Bx.test(n[3]),l=/^[a-z]:/i.test(n[0]);if(c)return[...n.slice(0,4),...n.slice(4).map(u=>this.parse(u))];if(l)return[n[0],...n.slice(1).map(u=>this.parse(u))]}return n.map(c=>this.parse(c))});if(this.debug(this.pattern,i),this.set=i.filter(n=>n.indexOf(!1)===-1),this.isWindows)for(let n=0;n<this.set.length;n++){let o=this.set[n];o[0]===""&&o[1]===""&&this.globParts[n][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let s=0;s<e.length;s++)for(let i=0;i<e[s].length;i++)e[s][i]==="**"&&(e[s][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let s=-1;for(;(s=t.indexOf("**",s+1))!==-1;){let i=s;for(;t[i+1]==="**";)i++;i!==s&&t.splice(s,i-s)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((s,i)=>{let n=s[s.length-1];return i==="**"&&n==="**"?s:i===".."&&n&&n!==".."&&n!=="."&&n!=="**"?(s.pop(),s):(s.push(i),s)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let n=e[i];i===1&&n===""&&e[0]===""||(n==="."||n==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let s=0;for(;(s=e.indexOf("..",s+1))!==-1;){let i=e[s-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(s-1,2),s-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let s of e){let i=-1;for(;(i=s.indexOf("**",i+1))!==-1;){let o=i;for(;s[o+1]==="**";)o++;o>i&&s.splice(i+1,o-i);let a=s[i+1],c=s[i+2],l=s[i+3];if(a!==".."||!c||c==="."||c===".."||!l||l==="."||l==="..")continue;t=!0,s.splice(i,1);let u=s.slice(0);u[i]="**",e.push(u),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<s.length-1;o++){let a=s[o];o===1&&a===""&&s[0]===""||(a==="."||a==="")&&(t=!0,s.splice(o,1),o--)}s[0]==="."&&s.length===2&&(s[1]==="."||s[1]==="")&&(t=!0,s.pop())}let n=0;for(;(n=s.indexOf("..",n+1))!==-1;){let o=s[n-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let c=n===1&&s[n+1]==="**"?["."]:[];s.splice(n-1,2,...c),s.length===0&&s.push(""),n-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let s=t+1;s<e.length;s++){let i=this.partsMatch(e[t],e[s],!this.preserveMultipleSlashes);if(i){e[t]=[],e[s]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,s=!1){let i=0,n=0,o=[],a="";for(;i<e.length&&n<t.length;)if(e[i]===t[n])o.push(a==="b"?t[n]:e[i]),i++,n++;else if(s&&e[i]==="**"&&t[n]===e[i+1])o.push(e[i]),i++;else if(s&&t[n]==="**"&&e[i]===t[n+1])o.push(t[n]),n++;else if(e[i]==="*"&&t[n]&&(this.options.dot||!t[n].startsWith("."))&&t[n]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,n++}else if(t[n]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(t[n]),i++,n++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,s=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,s++;s&&(this.pattern=e.slice(s)),this.negate=t}matchOne(e,t,s=!1){let i=this.options;if(this.isWindows){let m=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),g=!m&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),x=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),b=!x&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),y=g?3:m?0:void 0,w=b?3:x?0:void 0;if(typeof y=="number"&&typeof w=="number"){let[v,I]=[e[y],t[w]];v.toLowerCase()===I.toLowerCase()&&(t[w]=v,w>y?t=t.slice(w):y>w&&(e=e.slice(y)))}}let{optimizationLevel:n=1}=this.options;n>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,c=e.length,l=t.length;o<c&&a<l;o++,a++){this.debug("matchOne loop");var u=t[a],h=e[o];if(this.debug(t,u,h),u===!1)return!1;if(u===Ee){this.debug("GLOBSTAR",[t,u,h]);var d=o,f=a+1;if(f===l){for(this.debug("** at the end");o<c;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<c;){var p=e[d];if(this.debug(`
101
101
  globstar while`,e,d,t,f,p),this.matchOne(e.slice(d),t.slice(f),s))return this.debug("globstar found match!",d,c,p),!0;if(p==="."||p===".."||!i.dot&&p.charAt(0)==="."){this.debug("dot detected!",e,d,t,f);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(s&&(this.debug(`
102
- >>> no match, partial?`,e,d,t,f),d===c))}let m;if(typeof u=="string"?(m=h===u,this.debug("string match",u,h,m)):(m=u.test(h),this.debug("pattern match",u,h,m)),!m)return!1}if(o===c&&a===l)return!0;if(o===c)return s;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return $x(this.pattern,this.options)}parse(e){gn(e);let t=this.options;if(e==="**")return Ee;if(e==="")return"";let s,i=null;(s=e.match(qv))?i=t.dot?Hv:Vv:(s=e.match(Bv))?i=(t.nocase?t.dot?$v:Mv:t.dot?Rv:Pv)(s[1]):(s=e.match(Gv))?i=(t.nocase?t.dot?Kv:zv:t.dot?Zv:Yv)(s):(s=e.match(jv))?i=t.dot?Lv:Nv:(s=e.match(Uv))&&(i=Wv);let n=Xs.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,s=t.noglobstar?Qv:t.dot?e8:t8,i=new Set(t.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(h=>{if(h instanceof RegExp)for(let d of h.flags.split(""))i.add(d);return typeof h=="string"?o8(h):h===Ee?Ee:h._src});l.forEach((h,d)=>{let f=l[d+1],p=l[d-1];h!==Ee||p===Ee||(p===void 0?f!==void 0&&f!==Ee?l[d+1]="(?:\\/|"+s+"\\/)?"+f:l[d]=s:f===void 0?l[d-1]=p+"(?:\\/|\\/"+s+")?":f!==Ee&&(l[d-1]=p+"(?:\\/|\\/"+s+"\\/)"+f,l[d+1]=Ee))});let u=l.filter(h=>h!==Ee);if(this.partial&&u.length>=1){let h=[];for(let d=1;d<=u.length;d++)h.push(u.slice(0,d).join("/"));return"(?:"+h.join("|")+")"}return u.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];n="^"+o+n+a+"$",this.partial&&(n="^(?:\\/|"+o+n.slice(1,-1)+a+")$"),this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let s=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<n.length;a++){let c=n[a],l=i;if(s.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(e){return Re.defaults(e).Minimatch}};Re.AST=Xs;Re.Minimatch=Ye;Re.escape=Qs;Re.unescape=Et;var ag=require("node:url");var a8=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nx=new Set,v0=typeof process=="object"&&process?process:{},Lx=(r,e,t,s)=>{typeof v0.emitWarning=="function"?v0.emitWarning(r,e,t,s):console.error(`[${t}] ${e}: ${r}`)},Jo=globalThis.AbortController,jx=globalThis.AbortSignal;if(typeof Jo>"u"){jx=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,i){this._onabort.push(i)}},Jo=class{constructor(){e()}signal=new jx;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s)}}};let r=v0.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=!1,Lx("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",e))}}var c8=r=>!Nx.has(r),O_=Symbol("type"),wr=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),Ux=r=>wr(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?ei:null:null,ei=class extends Array{constructor(e){super(e),this.fill(0)}},C0=class r{heap;length;static#e=!1;static create(e){let t=Ux(e);if(!t)return[];r.#e=!0;let s=new r(e,t);return r.#e=!1,s}constructor(e,t){if(!r.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},ns=class r{#e;#t;#r;#i;#o;#d;#h;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#p;#f;#c;#n;#m;#D;#w;#x;#A;#g;#E;#k;#b;#y;#v;#S;#s;#P;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#b,autopurgeTimers:e.#y,sizes:e.#E,keyMap:e.#f,keyList:e.#c,valList:e.#n,next:e.#m,prev:e.#D,get head(){return e.#w},get tail(){return e.#x},free:e.#A,isBackgroundFetch:t=>e.#l(t),backgroundFetch:(t,s,i,n)=>e.#W(t,s,i,n),moveToTail:t=>e.#M(t),indexes:t=>e.#F(t),rindexes:t=>e.#O(t),isStale:t=>e.#C(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#a}get fetchMethod(){return this.#d}get memoMethod(){return this.#h}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:x,memoMethod:b,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:I,ignoreFetchAbort:B,perf:H}=e;if(H!==void 0&&typeof H?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=H??a8,t!==0&&!wr(t))throw new TypeError("max option must be a nonnegative integer");let A=t?Ux(t):Array;if(!A)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!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(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#h=b,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=x,this.#S=!!x,this.#f=new Map,this.#c=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#m=new A(t),this.#D=new A(t),this.#w=0,this.#x=0,this.#A=C0.create(t),this.#a=0,this.#p=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#i=u),typeof h=="function"?(this.#o=h,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#v=!!this.#r,this.#P=!!this.#i,this.#s=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#t!==0&&!wr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!wr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=wr(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!wr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let E="LRU_CACHE_UNBOUNDED";c8(E)&&(Nx.add(E),Lx("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,r))}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#I(){let e=new ei(this.#e),t=new ei(this.#e);this.#b=e,this.#k=t;let s=this.ttlAutopurge?new Array(this.#e):void 0;this.#y=s,this.#j=(o,a,c=this.#u.now())=>{if(t[o]=a!==0?c:0,e[o]=a,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),a!==0&&s){let l=setTimeout(()=>{this.#C(o)&&this.#T(this.#c[o],"expire")},a+1);l.unref&&l.unref(),s[o]=l}},this.#_=o=>{t[o]=e[o]!==0?this.#u.now():0},this.#B=(o,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=i||n();let u=o.now-l;o.remainingTTL=c-u}};let i=0,n=()=>{let o=this.#u.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#f.get(o);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(i||n())-l;return c-u},this.#C=o=>{let a=t[o],c=e[o];return!!c&&!!a&&(i||n())-a>c}}#_=()=>{};#B=()=>{};#j=()=>{};#C=()=>!1;#V(){let e=new ei(this.#e);this.#p=0,this.#E=e,this.#$=t=>{this.#p-=e[t],e[t]=0},this.#N=(t,s,i,n)=>{if(this.#l(s))return 0;if(!wr(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,t),!wr(i))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 i},this.#R=(t,s,i)=>{if(e[t]=s,this.#t){let n=this.#t-e[t];for(;this.#p>n;)this.#U(!0)}this.#p+=e[t],i&&(i.entrySize=s,i.totalCalculatedSize=this.#p)}}#$=e=>{};#R=(e,t,s)=>{};#N=(e,t,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#F({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#x;!(!this.#L(t)||((e||!this.#C(t))&&(yield t),t===this.#w));)t=this.#D[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#w;!(!this.#L(t)||((e||!this.#C(t))&&(yield t),t===this.#x));)t=this.#m[t]}#L(e){return e!==void 0&&this.#f.get(this.#c[e])===e}*entries(){for(let e of this.#F())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*keys(){for(let e of this.#F()){let t=this.#c[e];t!==void 0&&!this.#l(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#c[e];t!==void 0&&!this.#l(this.#n[e])&&(yield t)}}*values(){for(let e of this.#F())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let s of this.#F()){let i=this.#n[s],n=this.#l(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#c[s],this))return this.get(this.#c[s],t)}}forEach(e,t=this){for(let s of this.#F()){let i=this.#n[s],n=this.#l(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#c[s],this)}}rforEach(e,t=this){for(let s of this.#O()){let i=this.#n[s],n=this.#l(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#c[s],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#C(t)&&(this.#T(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#f.get(e);if(t===void 0)return;let s=this.#n[t],i=this.#l(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#b&&this.#k){let o=this.#b[t],a=this.#k[t];if(o&&a){let c=o-(this.#u.now()-a);n.ttl=c,n.start=Date.now()}}return this.#E&&(n.size=this.#E[t]),n}dump(){let e=[];for(let t of this.#F({allowStale:!0})){let s=this.#c[t],i=this.#n[t],n=this.#l(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#b&&this.#k){o.ttl=this.#b[t];let a=this.#u.now()-this.#k[t];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[t]),e.unshift([s,o])}return e}load(e){this.clear();for(let[t,s]of e){if(s.start){let i=Date.now()-s.start;s.start=this.#u.now()-i}this.set(t,s.value,s)}}set(e,t,s={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,u=this.#N(e,t,s.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#T(e,"set"),this;let h=this.#a===0?void 0:this.#f.get(e);if(h===void 0)h=this.#a===0?this.#x:this.#A.length!==0?this.#A.pop():this.#a===this.#e?this.#U(!1):this.#a,this.#c[h]=e,this.#n[h]=t,this.#f.set(e,h),this.#m[this.#x]=h,this.#D[h]=this.#x,this.#x=h,this.#a++,this.#R(h,u,c),c&&(c.set="add"),l=!1,this.#P&&this.#i?.(t,e,"add");else{this.#M(h);let d=this.#n[h];if(t!==d){if(this.#S&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#v&&this.#r?.(f,e,"set"),this.#s&&this.#g?.push([f,e,"set"]))}else o||(this.#v&&this.#r?.(d,e,"set"),this.#s&&this.#g?.push([d,e,"set"]));if(this.#$(h),this.#R(h,u,c),this.#n[h]=t,c){c.set="replace";let f=d&&this.#l(d)?d.__staleWhileFetching:d;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#P&&this.onInsert?.(t,e,t===d?"update":"replace")}if(i!==0&&!this.#b&&this.#I(),this.#b&&(l||this.#j(h,i,n),c&&this.#B(c,h)),!o&&this.#s&&this.#g){let d=this.#g,f;for(;f=d?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#w];if(this.#U(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#o?.(...t)}}}#U(e){let t=this.#w,s=this.#c[t],i=this.#n[t];return this.#S&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#s)&&(this.#v&&this.#r?.(i,s,"evict"),this.#s&&this.#g?.push([i,s,"evict"])),this.#$(t),this.#y?.[t]&&(clearTimeout(this.#y[t]),this.#y[t]=void 0),e&&(this.#c[t]=void 0,this.#n[t]=void 0,this.#A.push(t)),this.#a===1?(this.#w=this.#x=0,this.#A.length=0):this.#w=this.#m[t],this.#f.delete(s),this.#a--,t}has(e,t={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=t,n=this.#f.get(e);if(n!==void 0){let o=this.#n[n];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(n))i&&(i.has="stale",this.#B(i,n));else return s&&this.#_(n),i&&(i.has="hit",this.#B(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:s=this.allowStale}=t,i=this.#f.get(e);if(i===void 0||!s&&this.#C(i))return;let n=this.#n[i];return this.#l(n)?n.__staleWhileFetching:n}#W(e,t,s,i){let n=t===void 0?void 0:this.#n[t];if(this.#l(n))return n;let o=new Jo,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:i},l=(m,g=!1)=>{let{aborted:x}=o.signal,b=s.ignoreFetchAbort&&m!==void 0;if(s.status&&(x&&!g?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,b&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),x&&!b&&!g)return h(o.signal.reason);let y=f,w=this.#n[t];return(w===f||b&&g&&w===void 0)&&(m===void 0?y.__staleWhileFetching!==void 0?this.#n[t]=y.__staleWhileFetching:this.#T(e,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=m),h(m)),h=m=>{let{aborted:g}=o.signal,x=g&&s.allowStaleOnFetchAbort,b=x||s.allowStaleOnFetchRejection,y=b||s.noDeleteOnFetchRejection,w=f;if(this.#n[t]===f&&(!y||w.__staleWhileFetching===void 0?this.#T(e,"fetch"):x||(this.#n[t]=w.__staleWhileFetching)),b)return s.status&&w.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},d=(m,g)=>{let x=this.#d?.(e,n,c);x&&x instanceof Promise&&x.then(b=>m(b===void 0?void 0:b),g),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(m(void 0),s.allowStaleOnFetchAbort&&(m=b=>l(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);let f=new Promise(d).then(l,u),p=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,p,{...c.options,status:void 0}),t=this.#f.get(e)):this.#n[t]=p,p}#l(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Jo}async fetch(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:x,signal:b}=t;if(!this.#S)return x&&(x.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:x});let y={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:x,signal:b},w=this.#f.get(e);if(w===void 0){x&&(x.fetch="miss");let v=this.#W(e,w,y,m);return v.__returned=v}else{let v=this.#n[w];if(this.#l(v)){let E=s&&v.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",E&&(x.returnedStale=!0)),E?v.__staleWhileFetching:v.__returned=v}let I=this.#C(w);if(!g&&!I)return x&&(x.fetch="hit"),this.#M(w),i&&this.#_(w),x&&this.#B(x,w),v;let B=this.#W(e,w,y,m),A=B.__staleWhileFetching!==void 0&&s;return x&&(x.fetch=I?"stale":"refresh",A&&I&&(x.returnedStale=!0)),A?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,t={}){let s=await this.fetch(e,t);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,t={}){let s=this.#h;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let c=s(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=this.#f.get(e);if(a!==void 0){let c=this.#n[a],l=this.#l(c);return o&&this.#B(o,a),this.#C(a)?(o&&(o.get="stale"),l?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?c.__staleWhileFetching:void 0):(n||this.#T(e,"expire"),o&&s&&(o.returnedStale=!0),s?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#M(a),i&&this.#_(a),c))}else o&&(o.get="miss")}#q(e,t){this.#D[t]=e,this.#m[e]=t}#M(e){e!==this.#x&&(e===this.#w?this.#w=this.#m[e]:this.#q(this.#D[e],this.#m[e]),this.#q(this.#x,e),this.#x=e)}delete(e){return this.#T(e,"delete")}#T(e,t){let s=!1;if(this.#a!==0){let i=this.#f.get(e);if(i!==void 0)if(this.#y?.[i]&&(clearTimeout(this.#y?.[i]),this.#y[i]=void 0),s=!0,this.#a===1)this.#H(t);else{this.#$(i);let n=this.#n[i];if(this.#l(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#s)&&(this.#v&&this.#r?.(n,e,t),this.#s&&this.#g?.push([n,e,t])),this.#f.delete(e),this.#c[i]=void 0,this.#n[i]=void 0,i===this.#x)this.#x=this.#D[i];else if(i===this.#w)this.#w=this.#m[i];else{let o=this.#D[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#D[a]=this.#D[i]}this.#a--,this.#A.push(i)}}if(this.#s&&this.#g?.length){let i=this.#g,n;for(;n=i?.shift();)this.#o?.(...n)}return s}clear(){return this.#H("delete")}#H(e){for(let t of this.#O({allowStale:!0})){let s=this.#n[t];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#c[t];this.#v&&this.#r?.(s,i,e),this.#s&&this.#g?.push([s,i,e])}}if(this.#f.clear(),this.#n.fill(void 0),this.#c.fill(void 0),this.#b&&this.#k){this.#b.fill(0),this.#k.fill(0);for(let t of this.#y??[])t!==void 0&&clearTimeout(t);this.#y?.fill(void 0)}if(this.#E&&this.#E.fill(0),this.#w=0,this.#x=0,this.#A.length=0,this.#p=0,this.#a=0,this.#s&&this.#g){let t=this.#g,s;for(;s=t?.shift();)this.#o?.(...s)}}};var si=require("node:path"),Jx=require("node:url"),Nt=require("fs"),b8=_(require("node:fs"),1),Cr=require("node:fs/promises");var ia=require("node:events"),F0=_(require("node:stream"),1),Gx=require("node:string_decoder"),Wx=typeof process=="object"&&process?process:{stdout:null,stderr:null},l8=r=>!!r&&typeof r=="object"&&(r instanceof vr||r instanceof F0.default||u8(r)||h8(r)),u8=r=>!!r&&typeof r=="object"&&r instanceof ia.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==F0.default.Writable.prototype.pipe,h8=r=>!!r&&typeof r=="object"&&r instanceof ia.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",rr=Symbol("EOF"),sr=Symbol("maybeEmitEnd"),Dr=Symbol("emittedEnd"),Xo=Symbol("emittingEnd"),yn=Symbol("emittedError"),Qo=Symbol("closed"),qx=Symbol("read"),ea=Symbol("flush"),Vx=Symbol("flushChunk"),kt=Symbol("encoding"),ti=Symbol("decoder"),ge=Symbol("flowing"),wn=Symbol("paused"),ri=Symbol("resume"),be=Symbol("buffer"),Me=Symbol("pipes"),ye=Symbol("bufferLength"),E0=Symbol("bufferPush"),ta=Symbol("bufferShift"),Ae=Symbol("objectMode"),he=Symbol("destroyed"),k0=Symbol("error"),S0=Symbol("emitData"),Hx=Symbol("emitEnd"),_0=Symbol("emitEnd2"),$t=Symbol("async"),A0=Symbol("abort"),ra=Symbol("aborted"),Dn=Symbol("signal"),os=Symbol("dataListeners"),Je=Symbol("discarded"),vn=r=>Promise.resolve().then(r),f8=r=>r(),d8=r=>r==="end"||r==="finish"||r==="prefinish",p8=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,m8=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),sa=class{src;dest;opts;ondrain;constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[ri](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},T0=class extends sa{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},x8=r=>!!r.objectMode,g8=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",vr=class extends ia.EventEmitter{[ge]=!1;[wn]=!1;[Me]=[];[be]=[];[Ae];[kt];[$t];[ti];[rr]=!1;[Dr]=!1;[Xo]=!1;[Qo]=!1;[yn]=null;[ye]=0;[he]=!1;[Dn];[ra]=!1;[os]=0;[Je]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");x8(t)?(this[Ae]=!0,this[kt]=null):g8(t)?(this[kt]=t.encoding,this[Ae]=!1):(this[Ae]=!1,this[kt]=null),this[$t]=!!t.async,this[ti]=this[kt]?new Gx.StringDecoder(this[kt]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[be]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Me]});let{signal:s}=t;s&&(this[Dn]=s,s.aborted?this[A0]():s.addEventListener("abort",()=>this[A0]()))}get bufferLength(){return this[ye]}get encoding(){return this[kt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Ae]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[$t]}set async(e){this[$t]=this[$t]||!!e}[A0](){this[ra]=!0,this.emit("abort",this[Dn]?.reason),this.destroy(this[Dn]?.reason)}get aborted(){return this[ra]}set aborted(e){}write(e,t,s){if(this[ra])return!1;if(this[rr])throw new Error("write after end");if(this[he])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[$t]?vn:f8;if(!this[Ae]&&!Buffer.isBuffer(e)){if(m8(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(p8(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ae]?(this[ge]&&this[ye]!==0&&this[ea](!0),this[ge]?this.emit("data",e):this[E0](e),this[ye]!==0&&this.emit("readable"),s&&i(s),this[ge]):e.length?(typeof e=="string"&&!(t===this[kt]&&!this[ti]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[kt]&&(e=this[ti].write(e)),this[ge]&&this[ye]!==0&&this[ea](!0),this[ge]?this.emit("data",e):this[E0](e),this[ye]!==0&&this.emit("readable"),s&&i(s),this[ge]):(this[ye]!==0&&this.emit("readable"),s&&i(s),this[ge])}read(e){if(this[he])return null;if(this[Je]=!1,this[ye]===0||e===0||e&&e>this[ye])return this[sr](),null;this[Ae]&&(e=null),this[be].length>1&&!this[Ae]&&(this[be]=[this[kt]?this[be].join(""):Buffer.concat(this[be],this[ye])]);let t=this[qx](e||null,this[be][0]);return this[sr](),t}[qx](e,t){if(this[Ae])this[ta]();else{let s=t;e===s.length||e===null?this[ta]():typeof s=="string"?(this[be][0]=s.slice(e),t=s.slice(0,e),this[ye]-=e):(this[be][0]=s.subarray(e),t=s.subarray(0,e),this[ye]-=e)}return this.emit("data",t),!this[be].length&&!this[rr]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t="utf8"),e!==void 0&&this.write(e,t),s&&this.once("end",s),this[rr]=!0,this.writable=!1,(this[ge]||!this[wn])&&this[sr](),this}[ri](){this[he]||(!this[os]&&!this[Me].length&&(this[Je]=!0),this[wn]=!1,this[ge]=!0,this.emit("resume"),this[be].length?this[ea]():this[rr]?this[sr]():this.emit("drain"))}resume(){return this[ri]()}pause(){this[ge]=!1,this[wn]=!0,this[Je]=!1}get destroyed(){return this[he]}get flowing(){return this[ge]}get paused(){return this[wn]}[E0](e){this[Ae]?this[ye]+=1:this[ye]+=e.length,this[be].push(e)}[ta](){return this[Ae]?this[ye]-=1:this[ye]-=this[be][0].length,this[be].shift()}[ea](e=!1){do;while(this[Vx](this[ta]())&&this[be].length);!e&&!this[be].length&&!this[rr]&&this.emit("drain")}[Vx](e){return this.emit("data",e),this[ge]}pipe(e,t){if(this[he])return e;this[Je]=!1;let s=this[Dr];return t=t||{},e===Wx.stdout||e===Wx.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[Me].push(t.proxyErrors?new T0(this,e,t):new sa(this,e,t)),this[$t]?vn(()=>this[ri]()):this[ri]()),e}unpipe(e){let t=this[Me].find(s=>s.dest===e);t&&(this[Me].length===1?(this[ge]&&this[os]===0&&(this[ge]=!1),this[Me]=[]):this[Me].splice(this[Me].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);if(e==="data")this[Je]=!1,this[os]++,!this[Me].length&&!this[ge]&&this[ri]();else if(e==="readable"&&this[ye]!==0)super.emit("readable");else if(d8(e)&&this[Dr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[yn]){let i=t;this[$t]?vn(()=>i.call(this,this[yn])):i.call(this,this[yn])}return s}removeListener(e,t){return this.off(e,t)}off(e,t){let s=super.off(e,t);return e==="data"&&(this[os]=this.listeners("data").length,this[os]===0&&!this[Je]&&!this[Me].length&&(this[ge]=!1)),s}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[os]=0,!this[Je]&&!this[Me].length&&(this[ge]=!1)),t}get emittedEnd(){return this[Dr]}[sr](){!this[Xo]&&!this[Dr]&&!this[he]&&this[be].length===0&&this[rr]&&(this[Xo]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Qo]&&this.emit("close"),this[Xo]=!1)}emit(e,...t){let s=t[0];if(e!=="error"&&e!=="close"&&e!==he&&this[he])return!1;if(e==="data")return!this[Ae]&&!s?!1:this[$t]?(vn(()=>this[S0](s)),!0):this[S0](s);if(e==="end")return this[Hx]();if(e==="close"){if(this[Qo]=!0,!this[Dr]&&!this[he])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[yn]=s,super.emit(k0,s);let n=!this[Dn]||this.listeners("error").length?super.emit("error",s):!1;return this[sr](),n}else if(e==="resume"){let n=super.emit("resume");return this[sr](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...t);return this[sr](),i}[S0](e){for(let s of this[Me])s.dest.write(e)===!1&&this.pause();let t=this[Je]?!1:super.emit("data",e);return this[sr](),t}[Hx](){return this[Dr]?!1:(this[Dr]=!0,this.readable=!1,this[$t]?(vn(()=>this[_0]()),!0):this[_0]())}[_0](){if(this[ti]){let t=this[ti].end();if(t){for(let s of this[Me])s.dest.write(t);this[Je]||super.emit("data",t)}}for(let t of this[Me])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ae]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[Ae]||(e.dataLength+=s.length)}),await t,e}async concat(){if(this[Ae])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[kt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(he,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Je]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[rr])return t();let n,o,a=h=>{this.off("data",c),this.off("end",l),this.off(he,u),t(),o(h)},c=h=>{this.off("error",a),this.off("end",l),this.off(he,u),this.pause(),n({value:h,done:!!this[rr]})},l=()=>{this.off("error",a),this.off("data",c),this.off(he,u),t(),n({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((h,d)=>{o=d,n=h,this.once(he,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Je]=!1;let e=!1,t=()=>(this.pause(),this.off(k0,t),this.off(he,t),this.off("end",t),e=!0,{done:!0,value:void 0}),s=()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}};return this.once("end",t),this.once(k0,t),this.once(he,t),{next:s,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[he])return e?this.emit("error",e):this.emit(he),this;this[he]=!0,this[Je]=!0,this[be].length=0,this[ye]=0;let t=this;return typeof t.close=="function"&&!this[Qo]&&t.close(),e?this.emit("error",e):this.emit(he),this}static get isStream(){return l8}};var y8=Nt.realpathSync.native,En={lstatSync:Nt.lstatSync,readdir:Nt.readdir,readdirSync:Nt.readdirSync,readlinkSync:Nt.readlinkSync,realpathSync:y8,promises:{lstat:Cr.lstat,readdir:Cr.readdir,readlink:Cr.readlink,realpath:Cr.realpath}},Xx=r=>!r||r===En||r===b8?En:{...En,...r,promises:{...En.promises,...r.promises||{}}},Qx=/^\\\\\?\\([a-z]:)\\?$/i,w8=r=>r.replace(/\//g,"\\").replace(Qx,"$1\\"),D8=/[\\\/]/,dt=0,eg=1,tg=2,jt=4,rg=6,sg=8,as=10,ig=12,ft=15,Cn=~ft,O0=16,zx=32,kn=64,St=128,na=256,aa=512,Kx=kn|St|aa,v8=1023,I0=r=>r.isFile()?sg:r.isDirectory()?jt:r.isSymbolicLink()?as:r.isCharacterDevice()?tg:r.isBlockDevice()?rg:r.isSocket()?ig:r.isFIFO()?eg:dt,Zx=new ns({max:2**12}),Sn=r=>{let e=Zx.get(r);if(e)return e;let t=r.normalize("NFKD");return Zx.set(r,t),t},Yx=new ns({max:2**12}),oa=r=>{let e=Yx.get(r);if(e)return e;let t=Sn(r.toLowerCase());return Yx.set(r,t),t},ca=class extends ns{constructor(){super({max:256})}},B0=class extends ns{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},ng=Symbol("PathScurry setAsCwd"),Te=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#d;get gid(){return this.#d}#h;get rdev(){return this.#h}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#p;get size(){return this.#p}#f;get blocks(){return this.#f}#c;get atimeMs(){return this.#c}#n;get mtimeMs(){return this.#n}#m;get ctimeMs(){return this.#m}#D;get birthtimeMs(){return this.#D}#w;get atime(){return this.#w}#x;get mtime(){return this.#x}#A;get ctime(){return this.#A}#g;get birthtime(){return this.#g}#E;#k;#b;#y;#v;#S;#s;#P;#I;#_;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=dt,s,i,n,o,a){this.name=e,this.#E=n?oa(e):Sn(e),this.#s=t&v8,this.nocase=n,this.roots=i,this.root=s||this,this.#P=o,this.#b=a.fullpath,this.#v=a.relative,this.#S=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=Xx(a.fs)}depth(){return this.#k!==void 0?this.#k:this.parent?this.#k=this.parent.depth()+1:this.#k=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#B(i):this.#B(i)}#B(e){let t=this;for(let s of e)t=t.child(s);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#s&=~O0,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let s=this.children(),i=this.nocase?oa(e):Sn(e);for(let c of s)if(c.#E===i)return c;let n=this.parent?this.sep:"",o=this.#b?this.#b+n+e:void 0,a=this.newChild(e,dt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=St),s.push(a),a}relative(){if(this.isCWD)return"";if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let s=t.relative();return s+(!s||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.fullpathPosix();let s=t.relativePosix();return s+(!s||!t.parent?"":"/")+e}fullpath(){if(this.#b!==void 0)return this.#b;let e=this.name,t=this.parent;if(!t)return this.#b=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#b=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#y=`//?/${i}`:this.#y=i}let e=this.parent,t=e.fullpathPosix(),s=t+(!t||!e.parent?"":"/")+this.name;return this.#y=s}isUnknown(){return(this.#s&ft)===dt}isType(e){return this[`is${e}`]()}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&ft)===sg}isDirectory(){return(this.#s&ft)===jt}isCharacterDevice(){return(this.#s&ft)===tg}isBlockDevice(){return(this.#s&ft)===rg}isFIFO(){return(this.#s&ft)===eg}isSocket(){return(this.#s&ft)===ig}isSymbolicLink(){return(this.#s&as)===as}lstatCached(){return this.#s&zx?this:void 0}readlinkCached(){return this.#I}realpathCached(){return this.#_}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#I)return!0;if(!this.parent)return!1;let e=this.#s&ft;return!(e!==dt&&e!==as||this.#s&na||this.#s&St)}calledReaddir(){return!!(this.#s&O0)}isENOENT(){return!!(this.#s&St)}isNamed(e){return this.nocase?this.#E===oa(e):this.#E===Sn(e)}async readlink(){let e=this.#I;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(t);if(s)return this.#I=s}catch(t){this.#O(t.code);return}}readlinkSync(){let e=this.#I;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(t);if(s)return this.#I=s}catch(t){this.#O(t.code);return}}#j(e){this.#s|=O0;for(let t=e.provisional;t<e.length;t++){let s=e[t];s&&s.#C()}}#C(){this.#s&St||(this.#s=(this.#s|St)&Cn,this.#V())}#V(){let e=this.children();e.provisional=0;for(let t of e)t.#C()}#$(){this.#s|=aa,this.#R()}#R(){if(this.#s&kn)return;let e=this.#s;(e&ft)===jt&&(e&=Cn),this.#s=e|kn,this.#V()}#N(e=""){e==="ENOTDIR"||e==="EPERM"?this.#R():e==="ENOENT"?this.#C():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#R():e==="ENOENT"&&this.#C()}#O(e=""){let t=this.#s;t|=na,e==="ENOENT"&&(t|=St),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Cn),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#R()}#L(e,t){return this.#W(e,t)||this.#U(e,t)}#U(e,t){let s=I0(e),i=this.newChild(e.name,s,{parent:this}),n=i.#s&ft;return n!==jt&&n!==as&&n!==dt&&(i.#s|=kn),t.unshift(i),t.provisional++,i}#W(e,t){for(let s=t.provisional;s<t.length;s++){let i=t[s];if((this.nocase?oa(e.name):Sn(e.name))===i.#E)return this.#l(e,i,s,t)}}#l(e,t,s,i){let n=t.name;return t.#s=t.#s&Cn|I0(e),n!==e.name&&(t.name=e.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&St)===0)try{return this.#q(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#s&St)===0)try{return this.#q(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#q(e){let{atime:t,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:h,ino:d,mode:f,mtime:p,mtimeMs:m,nlink:g,rdev:x,size:b,uid:y}=e;this.#w=t,this.#c=s,this.#g=i,this.#D=n,this.#u=o,this.#f=a,this.#A=c,this.#m=l,this.#t=u,this.#d=h,this.#a=d,this.#r=f,this.#x=p,this.#n=m,this.#i=g,this.#h=x,this.#p=b,this.#o=y;let w=I0(e);this.#s=this.#s&Cn|w|zx,w!==dt&&w!==jt&&w!==as&&(this.#s|=kn)}#M=[];#T=!1;#H(e){this.#T=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(s=>s(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#M.push(e),this.#T)return;this.#T=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#N(n.code),s.provisional=0;else{for(let a of o)this.#L(a,s);this.#j(s)}this.#H(s.slice(0,s.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#G)await this.#G;else{let s=()=>{};this.#G=new Promise(i=>s=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#L(i,e);this.#j(e)}catch(i){this.#N(i.code),e.provisional=0}this.#G=void 0,s()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let s of this.#e.readdirSync(t,{withFileTypes:!0}))this.#L(s,e);this.#j(e)}catch(s){this.#N(s.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&Kx)return!1;let e=ft&this.#s;return e===dt||e===jt||e===as}shouldWalk(e,t){return(this.#s&jt)===jt&&!(this.#s&Kx)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#_)return this.#_;if(!((aa|na|St)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#_=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#_)return this.#_;if(!((aa|na|St)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#_=this.resolve(e)}catch{this.#$()}}[ng](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),s=[],i=this;for(;i&&i.parent;)t.add(i),i.#v=s.join(this.sep),i.#S=s.join("/"),i=i.parent,s.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#v=void 0,i.#S=void 0,i=i.parent}},la=class r extends Te{sep="\\";splitSep=D8;constructor(e,t=dt,s,i,n,o,a){super(e,t,s,i,n,o,a)}newChild(e,t=dt,s={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(e){return si.win32.parse(e).root}getRoot(e){if(e=w8(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,s]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=s;return this.roots[e]=new ii(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Qx,"$1\\"),e===t}},ua=class r extends Te{splitSep="/";sep="/";constructor(e,t=dt,s,i,n,o,a){super(e,t,s,i,n,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=dt,s={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ha=class{root;rootPath;roots;cwd;#e;#t;#r;nocase;#i;constructor(e=process.cwd(),t,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=En}={}){this.#i=Xx(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Jx.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new ca,this.#t=new ca,this.#r=new B0(n);let c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,h=t.sep,d=this.rootPath,f=!1;for(let p of c){let m=u--;l=l.child(p,{relative:new Array(m).fill("..").join(h),relativePosix:new Array(m).fill("..").join("/"),fullpath:d+=(f?"":h)+p}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let o=e[n];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let s=this.#e.get(t);if(s!==void 0)return s;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let o=e[n];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let s=this.#t.get(t);if(s!==void 0)return s;let i=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s}=t;if(e.canReaddir()){let i=await e.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0}=t;return e.canReaddir()?s?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=await e.readlink();return t?s:s?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=e.readlinkSync();return t?s:s?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=await e.realpath();return t?s:s?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=e.realpathSync();return t?s:s?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=[];(!n||n(e))&&a.push(s?e:e.fullpath());let c=new Set,l=(h,d)=>{c.add(h),h.readdirCB((f,p)=>{if(f)return d(f);let m=p.length;if(!m)return d();let g=()=>{--m===0&&d()};for(let x of p)(!n||n(x))&&a.push(s?x:x.fullpath()),i&&x.isSymbolicLink()?x.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(c,o)?l(b,g):g()):x.shouldWalk(c,o)?l(x,g):g()},!0)},u=e;return new Promise((h,d)=>{l(u,f=>{if(f)return d(f);h(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=[];(!n||n(e))&&a.push(s?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let h of u){(!n||n(h))&&a.push(s?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t;(!n||n(e))&&(yield s?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!n||n(u))&&(yield s?u:u.fullpath());let h=u;if(u.isSymbolicLink()){if(!(i&&(h=u.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=new vr({objectMode:!0});(!n||n(e))&&a.write(s?e:e.fullpath());let c=new Set,l=[e],u=0,h=()=>{let d=!1;for(;!d;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let p=(g,x,b=!1)=>{if(g)return a.emit("error",g);if(i&&!b){let y=[];for(let w of x)w.isSymbolicLink()&&y.push(w.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(y.length){Promise.all(y).then(()=>p(null,x,!0));return}}for(let y of x)y&&(!n||n(y))&&(a.write(s?y:y.fullpath())||(d=!0));u--;for(let y of x){let w=y.realpathCached()||y;w.shouldWalk(c,o)&&l.push(w)}d&&!a.flowing?a.once("drain",h):m||h()},m=!0;f.readdirCB(p,!0),m=!1}};return h(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=new vr({objectMode:!0}),c=new Set;(!n||n(e))&&a.write(s?e:e.fullpath());let l=[e],u=0,h=()=>{let d=!1;for(;!d;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let p=f.readdirSync();for(let m of p)(!n||n(m))&&(a.write(s?m:m.fullpath())||(d=!0));u--;for(let m of p){let g=m;if(m.isSymbolicLink()){if(!(i&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(c,o)&&l.push(g)}}d&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[ng](t)}},ii=class extends ha{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:s=!0}=t;super(e,si.win32,"\\",{...t,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return si.win32.parse(e).root.toUpperCase()}newRoot(e){return new la(this.rootPath,jt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ni=class extends ha{sep="/";constructor(e=process.cwd(),t={}){let{nocase:s=!1}=t;super(e,si.posix,"/",{...t,nocase:s}),this.nocase=s}parseRootPath(e){return"/"}newRoot(e){return new ua(this.rootPath,jt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},_n=class extends ni{constructor(e=process.cwd(),t={}){let{nocase:s=!0}=t;super(e,{...t,nocase:s})}},M_=process.platform==="win32"?la:ua,og=process.platform==="win32"?ii:process.platform==="darwin"?_n:ni;var C8=r=>r.length>=1,E8=r=>r.length>=1,oi=class r{#e;#t;#r;length;#i;#o;#d;#h;#u;#a;#p=!0;constructor(e,t,s,i){if(!C8(e))throw new TypeError("empty pattern list");if(!E8(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#r=s,this.#i=i,this.#r===0){if(this.isUNC()){let[n,o,a,c,...l]=this.#e,[u,h,d,f,...p]=this.#t;l[0]===""&&(l.shift(),p.shift());let m=[n,o,a,c,""].join("/"),g=[u,h,d,f,""].join("/");this.#e=[m,...l],this.#t=[g,...p],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=n+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Ee}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#d=this.#d||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new r(this.#e,this.#t,this.#r+1,this.#i),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#h=this.#h,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#i==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#p)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#p?!1:(this.#p=!1,!0)}};var k8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ai=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:s,noext:i,noglobstar:n,platform:o=k8}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Ye(e,this.mmopts);for(let s=0;s<t.set.length;s++){let i=t.set[s],n=t.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new oi(i,n,0,this.platform),a=new Ye(o.globString(),this.mmopts),c=n[n.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),s=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return!0;for(let o of this.absolute)if(o.match(t)||o.match(s))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",s=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var P0=class r{store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let s=e.fullpath(),i=this.store.get(s);i?i.add(t.globString()):this.store.set(s,new Set([t.globString()]))}},R0=class{store=new Map;add(e,t,s){let i=(t?2:0)|(s?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},M0=class{store=new Map;add(e,t){if(!e.canReaddir())return;let s=this.store.get(e);s?s.find(i=>i.globString()===t.globString())||s.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},An=class r{hasWalkedCache;matches=new R0;subwalks=new M0;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new P0}processPatterns(e,t){this.patterns=t;let s=t.map(i=>[e,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=n.rest();if(h)n=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(c),n=l,u=!0;if(c=n.pattern(),l=n.rest(),u){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof c=="string"){let h=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,h);continue}else if(c===Ee){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let h=l?.pattern(),d=l?.rest();if(!l||(h===""||h===".")&&!d)this.matches.add(i,a,h===""||h===".");else if(h===".."){let f=i.parent||i;d?this.hasWalkedCache.hasWalked(f,d)||this.subwalks.add(f,d):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let s=this.subwalks.get(e),i=this.child();for(let n of t)for(let o of s){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Ee?i.testGlobstar(n,o,l,a):c instanceof RegExp?i.testRegExp(n,c,l,a):i.testString(n,c,l,a)}return i}testGlobstar(e,t,s,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(s&&t.checkFollowGlobstar()?this.subwalks.add(e,s):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,s.rest(),i);else if(n===".."){let o=e.parent||e;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(e,n,s.rest(),i)}}testRegExp(e,t,s,i){t.test(e.name)&&(s?this.subwalks.add(e,s):this.matches.add(e,i,!1))}testString(e,t,s,i){e.isNamed(t)&&(s?this.subwalks.add(e,s):this.matches.add(e,i,!1))}};var S8=(r,e)=>typeof r=="string"?new ai([r],e):Array.isArray(r)?new ai(r,e):r,fa=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,t,s){if(this.patterns=e,this.path=t,this.opts=s,this.#r=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#t=S8(s.ignore??[],s),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||await e.realpath(),!s)return;e=s}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||e.realpathSync(),!s)return;e=s}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let s=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(s){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(n?o+n+i:"."+i)}}async match(e,t,s){let i=await this.matchCheck(e,s);i&&this.matchFinish(i,t)}matchSync(e,t,s){let i=this.matchCheckSync(e,s);i&&this.matchFinish(i,t)}walkCB(e,t,s){this.signal?.aborted&&s(),this.walkCB2(e,t,new An(this.opts),s)}walkCB2(e,t,s,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,s,i));return}s.processPatterns(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,l).then(()=>o()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,s,o):a.readdirCB((l,u)=>this.walkCB3(a,u,s,o),!0)}o()}walkCB3(e,t,s,i){s=s.filterEntries(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,l).then(()=>o()));for(let[a,c]of s.subwalks.entries())n++,this.walkCB2(a,c,s.child(),o);o()}walkCBSync(e,t,s){this.signal?.aborted&&s(),this.walkCB2Sync(e,t,new An(this.opts),s)}walkCB2Sync(e,t,s,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,s,i));return}s.processPatterns(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirSync();this.walkCB3Sync(a,c,s,o)}o()}walkCB3Sync(e,t,s,i){s=s.filterEntries(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of s.subwalks.entries())n++,this.walkCB2Sync(a,c,s.child(),o);o()}},Tn=class extends fa{matches=new Set;constructor(e,t,s){super(e,t,s)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Fn=class extends fa{results;constructor(e,t,s){super(e,t,s),this.results=new vr({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,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 _8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",_t=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(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,ag.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||_8,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?ii:t.platform==="darwin"?_n:t.platform?ni:og;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...t,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(c=>new Ye(c,i)),[o,a]=n.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new oi(c,u,0,this.platform)})}async walk(){return[...await new Tn(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 Tn(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 Fn(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 Fn(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 $0=(r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Ye(t,e).hasMagic())return!0;return!1};function pa(r,e={}){return new _t(r,e).streamSync()}function lg(r,e={}){return new _t(r,e).stream()}function ma(r,e={}){return new _t(r,e).walkSync()}async function cg(r,e={}){return new _t(r,e).walk()}function xa(r,e={}){return new _t(r,e).iterateSync()}function ug(r,e={}){return new _t(r,e).iterate()}var A8=pa,T8=Object.assign(lg,{sync:pa}),F8=xa,O8=Object.assign(ug,{sync:xa}),I8=Object.assign(ma,{stream:pa,iterate:xa}),da=Object.assign(cg,{glob:cg,globSync:ma,sync:I8,globStream:lg,stream:T8,globStreamSync:pa,streamSync:A8,globIterate:ug,iterate:O8,globIterateSync:xa,iterateSync:F8,Glob:_t,hasMagic:$0,escape:Qs,unescape:Et});da.glob=da;var Er=(r,e)=>typeof r>"u"||typeof r===e,hg=r=>!!r&&typeof r=="object"&&Er(r.preserveRoot,"boolean")&&Er(r.tmp,"string")&&Er(r.maxRetries,"number")&&Er(r.retryDelay,"number")&&Er(r.backoff,"number")&&Er(r.maxBackoff,"number")&&(Er(r.glob,"boolean")||r.glob&&typeof r.glob=="object")&&Er(r.filter,"function"),fg=r=>{if(!hg(r))throw new Error("invalid rimraf options")},dg=r=>{fg(r);let{glob:e,...t}=r;if(!e)return t;let s=e===!0?r.signal?{signal:r.signal}:{}:r.signal?{signal:r.signal,...e}:e;return{...t,glob:{...s,absolute:!0,withFileTypes:!1}}},pg=(r={})=>dg(r),mg=(r={})=>dg(r);var On=require("path"),xg=require("util"),B8=(r,e={})=>{let t=typeof r;if(t!=="string"){let i=r&&t==="object"&&r.constructor,o=`The "path" argument must be of type string. Received ${i&&i.name?`an instance of ${i.name}`:t==="object"?(0,xg.inspect)(r):`type ${t} ${r}`}`;throw Object.assign(new TypeError(o),{path:r,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(r)){let i="path must be a string without null bytes";throw Object.assign(new TypeError(i),{path:r,code:"ERR_INVALID_ARG_VALUE"})}r=(0,On.resolve)(r);let{root:s}=(0,On.parse)(r);if(r===s&&e.preserveRoot!==!1){let i="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(i),{path:r,code:"ERR_PRESERVE_ROOT"})}if(process.platform==="win32"){let i=/[*|"<>?:]/,{root:n}=(0,On.parse)(r);if(i.test(r.substring(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r},In=B8;var gg=require("fs"),Lt=_(require("fs/promises"),1),K=require("fs"),bg=r=>(0,gg.readdirSync)(r,{withFileTypes:!0}),He={chmod:Lt.default.chmod,mkdir:Lt.default.mkdir,readdir:r=>Lt.default.readdir(r,{withFileTypes:!0}),rename:Lt.default.rename,rm:Lt.default.rm,rmdir:Lt.default.rmdir,stat:Lt.default.stat,lstat:Lt.default.lstat,unlink:Lt.default.unlink};var ui=require("path");var{readdir:P8}=He,ci=r=>P8(r).catch(e=>e),li=r=>{try{return bg(r)}catch(e){return e}};var yg=r=>!!r&&typeof r=="object",j0=(r,e)=>e in r&&typeof r[e]=="string",N0=r=>yg(r)&&j0(r,"code")&&j0(r,"path"),ne=r=>yg(r)&&j0(r,"code")?r.code:null;var $e=async(r,e)=>r.catch(t=>{if(ne(t)!=="ENOENT")throw e??t}),je=(r,e)=>{try{return r()}catch(t){if(ne(t)==="ENOENT")return;throw e??t}};var{lstat:R8,rmdir:M8,unlink:$8}=He,ga=async(r,e)=>(e?.signal?.throwIfAborted(),await $e(R8(r).then(t=>wg(r,e,t)))??!0),ba=(r,e)=>(e?.signal?.throwIfAborted(),je(()=>Dg(r,e,(0,K.lstatSync)(r)))??!0),wg=async(r,e,t)=>{e?.signal?.throwIfAborted();let s=t.isDirectory()?await ci(r):null;if(!Array.isArray(s)){if(s){if(ne(s)==="ENOENT")return!0;if(ne(s)!=="ENOTDIR")throw s}return e.filter&&!await e.filter(r,t)?!1:(await $e($8(r)),!0)}return!(await Promise.all(s.map(n=>wg((0,ui.resolve)(r,n.name),e,n)))).every(n=>n===!0)||e.preserveRoot===!1&&r===(0,ui.parse)(r).root||e.filter&&!await e.filter(r,t)?!1:(await $e(M8(r)),!0)},Dg=(r,e,t)=>{e?.signal?.throwIfAborted();let s=t.isDirectory()?li(r):null;if(!Array.isArray(s)){if(s){if(ne(s)==="ENOENT")return!0;if(ne(s)!=="ENOTDIR")throw s}return e.filter&&!e.filter(r,t)?!1:(je(()=>(0,K.unlinkSync)(r)),!0)}let i=!0;for(let n of s){let o=(0,ui.resolve)(r,n.name);i=Dg(o,e,n)&&i}return e.preserveRoot===!1&&r===(0,ui.parse)(r).root||!i||e.filter&&!e.filter(r,t)?!1:(je(()=>(0,K.rmdirSync)(r)),!0)};var hi=require("path");var{chmod:j8}=He,Bn=r=>async e=>{try{return void await $e(r(e))}catch(t){if(ne(t)==="EPERM")return await $e(j8(e,438).then(()=>!0),t)?void await r(e):void 0;throw t}},Pn=r=>e=>{try{return void je(()=>r(e))}catch(t){if(ne(t)==="EPERM")return je(()=>((0,K.chmodSync)(e,438),!0),t)?void r(e):void 0;throw t}};var vg=require("timers/promises");var N8=200,L8=1.2,Cg=10,Eg=new Set(["EMFILE","ENFILE","EBUSY"]),L0=r=>{let e=async(t,s,i=1,n=0)=>{let o=s.maxBackoff||N8,a=s.backoff||L8,c=s.maxRetries||Cg,l=0;for(;;)try{return await r(t)}catch(u){if(N0(u)&&u.path===t&&Eg.has(u.code)){if(i=Math.ceil(i*a),n=i+n,n<o)return await(0,vg.setTimeout)(i),e(t,s,i,n);if(l<c){l++;continue}}throw u}};return e},U0=r=>(t,s)=>{let i=s.maxRetries||Cg,n=0;for(;;)try{return r(t)}catch(o){if(N0(o)&&o.path===t&&Eg.has(o.code)&&n<i){n++;continue}throw o}};var pt=require("path");var Rn=require("os"),kr=require("path");var{stat:U8}=He,W8=r=>{try{return(0,K.statSync)(r).isDirectory()}catch{return!1}},q8=r=>U8(r).then(e=>e.isDirectory(),()=>!1),V8=async r=>{let{root:e}=(0,kr.parse)(r),t=(0,Rn.tmpdir)(),{root:s}=(0,kr.parse)(t);if(e.toLowerCase()===s.toLowerCase())return t;let i=(0,kr.resolve)(e,"/temp");return await q8(i)?i:e},H8=r=>{let{root:e}=(0,kr.parse)(r),t=(0,Rn.tmpdir)(),{root:s}=(0,kr.parse)(t);if(e.toLowerCase()===s.toLowerCase())return t;let i=(0,kr.resolve)(e,"/temp");return W8(i)?i:e},G8=async()=>(0,Rn.tmpdir)(),z8=()=>(0,Rn.tmpdir)(),kg=process.platform==="win32"?V8:G8,Sg=process.platform==="win32"?H8:z8;var{lstat:K8,rename:Z8,unlink:Y8,rmdir:J8}=He,Tg=r=>`.${(0,pt.basename)(r)}.${Math.random()}`,X8=Bn(Y8),Q8=Pn(K.unlinkSync),ya=async(r,e)=>(e?.signal?.throwIfAborted(),await $e(K8(r).then(t=>W0(r,e,t)))??!0),W0=async(r,e,t)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return W0(r,{...e,tmp:await kg(r)},t);if(r===e.tmp&&(0,pt.parse)(r).root!==r)throw new Error("cannot delete temp directory used for deletion");let s=t.isDirectory()?await ci(r):null;if(!Array.isArray(s)){if(s){if(ne(s)==="ENOENT")return!0;if(ne(s)!=="ENOTDIR")throw s}return e.filter&&!await e.filter(r,t)?!1:(await $e(_g(r,e.tmp,X8)),!0)}return!(await Promise.all(s.map(n=>W0((0,pt.resolve)(r,n.name),e,n)))).every(n=>n===!0)||e.preserveRoot===!1&&r===(0,pt.parse)(r).root||e.filter&&!await e.filter(r,t)?!1:(await $e(_g(r,e.tmp,J8)),!0)},_g=async(r,e,t)=>{let s=(0,pt.resolve)(e,Tg(r));return await Z8(r,s),await t(s)},wa=(r,e)=>(e?.signal?.throwIfAborted(),je(()=>q0(r,e,(0,K.lstatSync)(r)))??!0),q0=(r,e,t)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return q0(r,{...e,tmp:Sg(r)},t);let s=e.tmp;if(r===e.tmp&&(0,pt.parse)(r).root!==r)throw new Error("cannot delete temp directory used for deletion");let i=t.isDirectory()?li(r):null;if(!Array.isArray(i)){if(i){if(ne(i)==="ENOENT")return!0;if(ne(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(r,t)?!1:(je(()=>Ag(r,s,Q8)),!0)}let n=!0;for(let o of i){let a=(0,pt.resolve)(r,o.name);n=q0(a,e,o)&&n}return!n||e.preserveRoot===!1&&r===(0,pt.parse)(r).root||e.filter&&!e.filter(r,t)?!1:(je(()=>Ag(r,s,K.rmdirSync)),!0)},Ag=(r,e,t)=>{let s=(0,pt.resolve)(e,Tg(r));return(0,K.renameSync)(r,s),t(s)};var{unlink:e4,rmdir:t4,lstat:r4}=He,s4=L0(Bn(e4)),i4=U0(Pn(K.unlinkSync)),n4=L0(Bn(t4)),o4=U0(Pn(K.rmdirSync)),a4=async(r,{filter:e,...t})=>{t?.signal?.throwIfAborted();try{return await n4(r,t),!0}catch(s){if(ne(s)==="ENOTEMPTY")return ya(r,t);throw s}},c4=(r,{filter:e,...t})=>{t?.signal?.throwIfAborted();try{return o4(r,t),!0}catch(s){if(ne(s)==="ENOTEMPTY")return wa(r,t);throw s}},Sr=Symbol("start"),Fg=Symbol("child"),Da=Symbol("finish"),va=async(r,e)=>(e?.signal?.throwIfAborted(),await $e(r4(r).then(t=>V0(r,e,t,Sr)))??!0),Ca=(r,e)=>(e?.signal?.throwIfAborted(),je(()=>H0(r,e,(0,K.lstatSync)(r),Sr))??!0),V0=async(r,e,t,s=Sr)=>{e?.signal?.throwIfAborted();let i=t.isDirectory()?await ci(r):null;if(!Array.isArray(i)){if(i){if(ne(i)==="ENOENT")return!0;if(ne(i)!=="ENOTDIR")throw i}return e.filter&&!await e.filter(r,t)?!1:(await $e(s4(r,e)),!0)}let n=s===Sr?Fg:s,o=(await Promise.all(i.map(a=>V0((0,hi.resolve)(r,a.name),e,a,n)))).every(a=>a===!0);if(s===Sr)return V0(r,e,t,Da);if(s===Da){if(e.preserveRoot===!1&&r===(0,hi.parse)(r).root||!o||e.filter&&!await e.filter(r,t))return!1;await $e(a4(r,e))}return!0},H0=(r,e,t,s=Sr)=>{let i=t.isDirectory()?li(r):null;if(!Array.isArray(i)){if(i){if(ne(i)==="ENOENT")return!0;if(ne(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(r,t)?!1:(je(()=>i4(r,e)),!0)}let n=!0;for(let o of i){let a=s===Sr?Fg:s,c=(0,hi.resolve)(r,o.name);n=H0(c,e,o,a)&&n}if(s===Sr)return H0(r,e,t,Da);if(s===Da){if(e.preserveRoot===!1&&r===(0,hi.parse)(r).root||!n||e.filter&&!e.filter(r,t))return!1;je(()=>c4(r,e))}return!0};var G0=process.platform==="win32"?va:ga,z0=process.platform==="win32"?Ca:ba;var{rm:l4}=He,K0=async(r,e)=>(await l4(r,{...e,force:!0,recursive:!0}),!0),Z0=(r,e)=>((0,K.rmSync)(r,{...e,force:!0,recursive:!0}),!0);var[Og=0,u4=0]=process.version.replace(/^v/,"").split(".").map(r=>parseInt(r,10)),Ig=Og>14||Og===14&&u4>=14,Bg=!Ig||process.platform==="win32"?()=>!1:r=>!r?.signal&&!r?.filter,Pg=!Ig||process.platform==="win32"?()=>!1:r=>!r?.signal&&!r?.filter;var fi=r=>async(e,t)=>{let s=pg(t);return s.glob&&(e=await da(e,s.glob)),Array.isArray(e)?!!(await Promise.all(e.map(i=>r(In(i,s),s)))).reduce((i,n)=>i&&n,!0):!!await r(In(e,s),s)},di=r=>(e,t)=>{let s=mg(t);return s.glob&&(e=ma(e,s.glob)),Array.isArray(e)?!!e.map(i=>r(In(i,s),s)).reduce((i,n)=>i&&n,!0):!!r(In(e,s),s)},$g=di(Z0),h4=Object.assign(fi(K0),{sync:$g}),jg=di(z0),f4=Object.assign(fi(G0),{sync:jg}),Ng=di(Ca),d4=Object.assign(fi(va),{sync:Ng}),Lg=di(ba),p4=Object.assign(fi(ga),{sync:Lg}),Ug=di(wa),m4=Object.assign(fi(ya),{sync:Ug}),Rg=di((r,e)=>Pg(e)?Z0(r,e):z0(r,e));var Mg=fi((r,e)=>Bg(e)?K0(r,e):G0(r,e)),Ea=Object.assign(Mg,{rimraf:Mg,sync:Rg,rimrafSync:Rg,manual:f4,manualSync:jg,native:h4,nativeSync:$g,posix:p4,posixSync:Lg,windows:d4,windowsSync:Ng,moveRemove:m4,moveRemoveSync:Ug});Ea.rimraf=Ea;var de=r=>(0,_r.join)(process.cwd(),r),ka=r=>{try{return(0,Wg.readdirSync)(r).length===0}catch{return!0}},qg=()=>{try{return Mn()!==void 0}catch{return!1}};function Vg(){let r=g0({cwd:(0,_r.dirname)(__filename)});if(!r)throw new Error("Could not find package.json");return(0,_r.dirname)(r)}function Mn(){let r=g0();if(!r)throw new Error("You are not in a project directory");return(0,_r.dirname)(r)}var Hg=r=>Ea(r),Gg=(r,e)=>(0,_r.resolve)(require.resolve(r),`../${e}`);var zg=_(require("chalk"));async function Fe(r,e){let t=Date.now(),s=r.title,i=()=>Math.floor((Date.now()-t)/1e3),n=setInterval(()=>{i()>1&&(r.title=`${s} (${i()}s)`)},1e3);try{return await e(i)}finally{clearInterval(n)}}async function Sa(r,e,t){for(let s=0;s<e.length;s++){let i=e[s];r.output=zg.default.dim(`[${s+1}/${e.length}] ${i.title}`),await i.fn(t??{},r)}}var t2=require("node:child_process"),r2=require("node:fs"),X0=require("node:path"),s2=_(e2()),i2=require("execa");var B4={...process.env,NODE_NO_WARNINGS:"1"};async function Ar(r,e,{cwd:t=process.cwd(),task:s,shell:i,context:n=r,quiet:o=!1,nonInteractive:a=!1,env:c}={}){try{e.length===0&&(e=r.split(" ").slice(1));let l=o?"pipe":s||a?["ignore","pipe","pipe"]:"inherit",u={...B4};c?u={...u,...c}:(s||a)&&(u={...u,CI:"true"});let h=(0,i2.execa)(r,e,{cwd:t,stdio:l,all:s||a?!0:void 0,shell:i??!0,env:u});h.all&&h.all.on("data",d=>{let f=d.toString().trim();s?(s.output=f,f.length&&O.storeLog(f,n)):a&&f.length&&console.log(f)}),await h}catch(l){let u=l instanceof Error?l.message:String(l),h=P4(u);throw new Error(h)}}var P4=r=>{let e=r.match(/error: (.+)/);return e?e[1].trim():r},R4=(r,e)=>{let t=(0,X0.resolve)(e,r);return(0,r2.existsSync)(t)?(0,s2.config)({path:t,processEnv:{}}).parsed||{}:{}};function n2(r,e,t={}){let{cwd:s=process.cwd(),envFile:i,detached:n=!0,onStderr:o,onExit:a}=t,c=i?R4(i,s):{},l=(0,X0.resolve)(s,"node_modules",".bin"),u=process.env.PATH||"",h=`${l}:${u}`,d={...process.env,...c,PATH:h,FORCE_COLOR:"1"},f=(0,t2.spawn)(r,e,{cwd:s,env:d,stdio:["inherit","inherit","pipe"],detached:n});return o&&f.stderr?.on("data",o),a&&f.on("exit",a),f}var cs=require("node:fs"),Tr=require("node:path"),mi=require("fs-extra");var M4=["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml"],$4=r=>{if(M4.some(t=>(0,cs.existsSync)((0,Tr.join)(r,t)))||(0,cs.existsSync)((0,Tr.join)(r,"turbo.json")))return!0;let e=(0,Tr.join)(r,"package.json");if((0,cs.existsSync)(e))try{if(JSON.parse((0,cs.readFileSync)(e,"utf-8")).workspaces)return!0}catch{}return!1};function Ut(){let r=process.cwd();for(;!$4(r);){let e=r.slice(0,r.lastIndexOf("/"));if(e===r)throw new Error(`
102
+ >>> no match, partial?`,e,d,t,f),d===c))}let m;if(typeof u=="string"?(m=h===u,this.debug("string match",u,h,m)):(m=u.test(h),this.debug("pattern match",u,h,m)),!m)return!1}if(o===c&&a===l)return!0;if(o===c)return s;if(a===l)return o===c-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return $x(this.pattern,this.options)}parse(e){gn(e);let t=this.options;if(e==="**")return Ee;if(e==="")return"";let s,i=null;(s=e.match(qv))?i=t.dot?Hv:Vv:(s=e.match(Bv))?i=(t.nocase?t.dot?$v:Mv:t.dot?Rv:Pv)(s[1]):(s=e.match(Gv))?i=(t.nocase?t.dot?Kv:zv:t.dot?Zv:Yv)(s):(s=e.match(jv))?i=t.dot?Lv:Nv:(s=e.match(Uv))&&(i=Wv);let n=Xs.fromGlob(e,this.options).toMMPattern();return i&&typeof n=="object"&&Reflect.defineProperty(n,"test",{value:i}),n}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,s=t.noglobstar?Qv:t.dot?e8:t8,i=new Set(t.nocase?["i"]:[]),n=e.map(c=>{let l=c.map(h=>{if(h instanceof RegExp)for(let d of h.flags.split(""))i.add(d);return typeof h=="string"?o8(h):h===Ee?Ee:h._src});l.forEach((h,d)=>{let f=l[d+1],p=l[d-1];h!==Ee||p===Ee||(p===void 0?f!==void 0&&f!==Ee?l[d+1]="(?:\\/|"+s+"\\/)?"+f:l[d]=s:f===void 0?l[d-1]=p+"(?:\\/|\\/"+s+")?":f!==Ee&&(l[d-1]=p+"(?:\\/|\\/"+s+"\\/)"+f,l[d+1]=Ee))});let u=l.filter(h=>h!==Ee);if(this.partial&&u.length>=1){let h=[];for(let d=1;d<=u.length;d++)h.push(u.slice(0,d).join("/"));return"(?:"+h.join("|")+")"}return u.join("/")}).join("|"),[o,a]=e.length>1?["(?:",")"]:["",""];n="^"+o+n+a+"$",this.partial&&(n="^(?:\\/|"+o+n.slice(1,-1)+a+")$"),this.negate&&(n="^(?!"+n+").+$");try{this.regexp=new RegExp(n,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let s=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let n=this.set;this.debug(this.pattern,"set",n);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<n.length;a++){let c=n[a],l=i;if(s.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return s.flipNegate?!0:!this.negate}return s.flipNegate?!1:this.negate}static defaults(e){return Re.defaults(e).Minimatch}};Re.AST=Xs;Re.Minimatch=Ye;Re.escape=Qs;Re.unescape=Et;var ag=require("node:url");var a8=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Nx=new Set,v0=typeof process=="object"&&process?process:{},Lx=(r,e,t,s)=>{typeof v0.emitWarning=="function"?v0.emitWarning(r,e,t,s):console.error(`[${t}] ${e}: ${r}`)},Jo=globalThis.AbortController,jx=globalThis.AbortSignal;if(typeof Jo>"u"){jx=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(s,i){this._onabort.push(i)}},Jo=class{constructor(){e()}signal=new jx;abort(s){if(!this.signal.aborted){this.signal.reason=s,this.signal.aborted=!0;for(let i of this.signal._onabort)i(s);this.signal.onabort?.(s)}}};let r=v0.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{r&&(r=!1,Lx("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",e))}}var c8=r=>!Nx.has(r),O_=Symbol("type"),Dr=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),Ux=r=>Dr(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?ei:null:null,ei=class extends Array{constructor(e){super(e),this.fill(0)}},C0=class r{heap;length;static#e=!1;static create(e){let t=Ux(e);if(!t)return[];r.#e=!0;let s=new r(e,t);return r.#e=!1,s}constructor(e,t){if(!r.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},os=class r{#e;#t;#r;#i;#o;#d;#h;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#p;#f;#c;#n;#m;#D;#w;#x;#A;#g;#E;#k;#b;#y;#v;#S;#s;#P;static unsafeExposeInternals(e){return{starts:e.#k,ttls:e.#b,autopurgeTimers:e.#y,sizes:e.#E,keyMap:e.#f,keyList:e.#c,valList:e.#n,next:e.#m,prev:e.#D,get head(){return e.#w},get tail(){return e.#x},free:e.#A,isBackgroundFetch:t=>e.#l(t),backgroundFetch:(t,s,i,n)=>e.#W(t,s,i,n),moveToTail:t=>e.#M(t),indexes:t=>e.#F(t),rindexes:t=>e.#O(t),isStale:t=>e.#C(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#p}get size(){return this.#a}get fetchMethod(){return this.#d}get memoMethod(){return this.#h}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(e){let{max:t=0,ttl:s,ttlResolution:i=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:c,dispose:l,onInsert:u,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:f,maxSize:p=0,maxEntrySize:m=0,sizeCalculation:g,fetchMethod:x,memoMethod:b,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:I,ignoreFetchAbort:B,perf:H}=e;if(H!==void 0&&typeof H?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=H??a8,t!==0&&!Dr(t))throw new TypeError("max option must be a nonnegative integer");let A=t?Ux(t):Array;if(!A)throw new Error("invalid max value: "+t);if(this.#e=t,this.#t=p,this.maxEntrySize=m||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!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(b!==void 0&&typeof b!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#h=b,x!==void 0&&typeof x!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#d=x,this.#S=!!x,this.#f=new Map,this.#c=new Array(t).fill(void 0),this.#n=new Array(t).fill(void 0),this.#m=new A(t),this.#D=new A(t),this.#w=0,this.#x=0,this.#A=C0.create(t),this.#a=0,this.#p=0,typeof l=="function"&&(this.#r=l),typeof u=="function"&&(this.#i=u),typeof h=="function"?(this.#o=h,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#v=!!this.#r,this.#P=!!this.#i,this.#s=!!this.#o,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!B,this.maxEntrySize!==0){if(this.#t!==0&&!Dr(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!Dr(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=Dr(i)||i===0?i:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!Dr(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#I()}if(this.#e===0&&this.ttl===0&&this.#t===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let E="LRU_CACHE_UNBOUNDED";c8(E)&&(Nx.add(E),Lx("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",E,r))}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#I(){let e=new ei(this.#e),t=new ei(this.#e);this.#b=e,this.#k=t;let s=this.ttlAutopurge?new Array(this.#e):void 0;this.#y=s,this.#j=(o,a,c=this.#u.now())=>{if(t[o]=a!==0?c:0,e[o]=a,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),a!==0&&s){let l=setTimeout(()=>{this.#C(o)&&this.#T(this.#c[o],"expire")},a+1);l.unref&&l.unref(),s[o]=l}},this.#_=o=>{t[o]=e[o]!==0?this.#u.now():0},this.#B=(o,a)=>{if(e[a]){let c=e[a],l=t[a];if(!c||!l)return;o.ttl=c,o.start=l,o.now=i||n();let u=o.now-l;o.remainingTTL=c-u}};let i=0,n=()=>{let o=this.#u.now();if(this.ttlResolution>0){i=o;let a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{let a=this.#f.get(o);if(a===void 0)return 0;let c=e[a],l=t[a];if(!c||!l)return 1/0;let u=(i||n())-l;return c-u},this.#C=o=>{let a=t[o],c=e[o];return!!c&&!!a&&(i||n())-a>c}}#_=()=>{};#B=()=>{};#j=()=>{};#C=()=>!1;#V(){let e=new ei(this.#e);this.#p=0,this.#E=e,this.#$=t=>{this.#p-=e[t],e[t]=0},this.#N=(t,s,i,n)=>{if(this.#l(s))return 0;if(!Dr(i))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(i=n(s,t),!Dr(i))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 i},this.#R=(t,s,i)=>{if(e[t]=s,this.#t){let n=this.#t-e[t];for(;this.#p>n;)this.#U(!0)}this.#p+=e[t],i&&(i.entrySize=s,i.totalCalculatedSize=this.#p)}}#$=e=>{};#R=(e,t,s)=>{};#N=(e,t,s,i)=>{if(s||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#F({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#x;!(!this.#L(t)||((e||!this.#C(t))&&(yield t),t===this.#w));)t=this.#D[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#w;!(!this.#L(t)||((e||!this.#C(t))&&(yield t),t===this.#x));)t=this.#m[t]}#L(e){return e!==void 0&&this.#f.get(this.#c[e])===e}*entries(){for(let e of this.#F())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*rentries(){for(let e of this.#O())this.#n[e]!==void 0&&this.#c[e]!==void 0&&!this.#l(this.#n[e])&&(yield[this.#c[e],this.#n[e]])}*keys(){for(let e of this.#F()){let t=this.#c[e];t!==void 0&&!this.#l(this.#n[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#c[e];t!==void 0&&!this.#l(this.#n[e])&&(yield t)}}*values(){for(let e of this.#F())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}*rvalues(){for(let e of this.#O())this.#n[e]!==void 0&&!this.#l(this.#n[e])&&(yield this.#n[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let s of this.#F()){let i=this.#n[s],n=this.#l(i)?i.__staleWhileFetching:i;if(n!==void 0&&e(n,this.#c[s],this))return this.get(this.#c[s],t)}}forEach(e,t=this){for(let s of this.#F()){let i=this.#n[s],n=this.#l(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#c[s],this)}}rforEach(e,t=this){for(let s of this.#O()){let i=this.#n[s],n=this.#l(i)?i.__staleWhileFetching:i;n!==void 0&&e.call(t,n,this.#c[s],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#C(t)&&(this.#T(this.#c[t],"expire"),e=!0);return e}info(e){let t=this.#f.get(e);if(t===void 0)return;let s=this.#n[t],i=this.#l(s)?s.__staleWhileFetching:s;if(i===void 0)return;let n={value:i};if(this.#b&&this.#k){let o=this.#b[t],a=this.#k[t];if(o&&a){let c=o-(this.#u.now()-a);n.ttl=c,n.start=Date.now()}}return this.#E&&(n.size=this.#E[t]),n}dump(){let e=[];for(let t of this.#F({allowStale:!0})){let s=this.#c[t],i=this.#n[t],n=this.#l(i)?i.__staleWhileFetching:i;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#b&&this.#k){o.ttl=this.#b[t];let a=this.#u.now()-this.#k[t];o.start=Math.floor(Date.now()-a)}this.#E&&(o.size=this.#E[t]),e.unshift([s,o])}return e}load(e){this.clear();for(let[t,s]of e){if(s.start){let i=Date.now()-s.start;s.start=this.#u.now()-i}this.set(t,s.value,s)}}set(e,t,s={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:c}=s,{noUpdateTTL:l=this.noUpdateTTL}=s,u=this.#N(e,t,s.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.#T(e,"set"),this;let h=this.#a===0?void 0:this.#f.get(e);if(h===void 0)h=this.#a===0?this.#x:this.#A.length!==0?this.#A.pop():this.#a===this.#e?this.#U(!1):this.#a,this.#c[h]=e,this.#n[h]=t,this.#f.set(e,h),this.#m[this.#x]=h,this.#D[h]=this.#x,this.#x=h,this.#a++,this.#R(h,u,c),c&&(c.set="add"),l=!1,this.#P&&this.#i?.(t,e,"add");else{this.#M(h);let d=this.#n[h];if(t!==d){if(this.#S&&this.#l(d)){d.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:f}=d;f!==void 0&&!o&&(this.#v&&this.#r?.(f,e,"set"),this.#s&&this.#g?.push([f,e,"set"]))}else o||(this.#v&&this.#r?.(d,e,"set"),this.#s&&this.#g?.push([d,e,"set"]));if(this.#$(h),this.#R(h,u,c),this.#n[h]=t,c){c.set="replace";let f=d&&this.#l(d)?d.__staleWhileFetching:d;f!==void 0&&(c.oldValue=f)}}else c&&(c.set="update");this.#P&&this.onInsert?.(t,e,t===d?"update":"replace")}if(i!==0&&!this.#b&&this.#I(),this.#b&&(l||this.#j(h,i,n),c&&this.#B(c,h)),!o&&this.#s&&this.#g){let d=this.#g,f;for(;f=d?.shift();)this.#o?.(...f)}return this}pop(){try{for(;this.#a;){let e=this.#n[this.#w];if(this.#U(!0),this.#l(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#g){let e=this.#g,t;for(;t=e?.shift();)this.#o?.(...t)}}}#U(e){let t=this.#w,s=this.#c[t],i=this.#n[t];return this.#S&&this.#l(i)?i.__abortController.abort(new Error("evicted")):(this.#v||this.#s)&&(this.#v&&this.#r?.(i,s,"evict"),this.#s&&this.#g?.push([i,s,"evict"])),this.#$(t),this.#y?.[t]&&(clearTimeout(this.#y[t]),this.#y[t]=void 0),e&&(this.#c[t]=void 0,this.#n[t]=void 0,this.#A.push(t)),this.#a===1?(this.#w=this.#x=0,this.#A.length=0):this.#w=this.#m[t],this.#f.delete(s),this.#a--,t}has(e,t={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:i}=t,n=this.#f.get(e);if(n!==void 0){let o=this.#n[n];if(this.#l(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#C(n))i&&(i.has="stale",this.#B(i,n));else return s&&this.#_(n),i&&(i.has="hit",this.#B(i,n)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:s=this.allowStale}=t,i=this.#f.get(e);if(i===void 0||!s&&this.#C(i))return;let n=this.#n[i];return this.#l(n)?n.__staleWhileFetching:n}#W(e,t,s,i){let n=t===void 0?void 0:this.#n[t];if(this.#l(n))return n;let o=new Jo,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let c={signal:o.signal,options:s,context:i},l=(m,g=!1)=>{let{aborted:x}=o.signal,b=s.ignoreFetchAbort&&m!==void 0;if(s.status&&(x&&!g?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,b&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),x&&!b&&!g)return h(o.signal.reason);let y=f,w=this.#n[t];return(w===f||b&&g&&w===void 0)&&(m===void 0?y.__staleWhileFetching!==void 0?this.#n[t]=y.__staleWhileFetching:this.#T(e,"fetch"):(s.status&&(s.status.fetchUpdated=!0),this.set(e,m,c.options))),m},u=m=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=m),h(m)),h=m=>{let{aborted:g}=o.signal,x=g&&s.allowStaleOnFetchAbort,b=x||s.allowStaleOnFetchRejection,y=b||s.noDeleteOnFetchRejection,w=f;if(this.#n[t]===f&&(!y||w.__staleWhileFetching===void 0?this.#T(e,"fetch"):x||(this.#n[t]=w.__staleWhileFetching)),b)return s.status&&w.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},d=(m,g)=>{let x=this.#d?.(e,n,c);x&&x instanceof Promise&&x.then(b=>m(b===void 0?void 0:b),g),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(m(void 0),s.allowStaleOnFetchAbort&&(m=b=>l(b,!0)))})};s.status&&(s.status.fetchDispatched=!0);let f=new Promise(d).then(l,u),p=Object.assign(f,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return t===void 0?(this.set(e,p,{...c.options,status:void 0}),t=this.#f.get(e)):this.#n[t]=p,p}#l(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Jo}async fetch(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:m,forceRefresh:g=!1,status:x,signal:b}=t;if(!this.#S)return x&&(x.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,status:x});let y={allowStale:s,updateAgeOnGet:i,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:x,signal:b},w=this.#f.get(e);if(w===void 0){x&&(x.fetch="miss");let v=this.#W(e,w,y,m);return v.__returned=v}else{let v=this.#n[w];if(this.#l(v)){let E=s&&v.__staleWhileFetching!==void 0;return x&&(x.fetch="inflight",E&&(x.returnedStale=!0)),E?v.__staleWhileFetching:v.__returned=v}let I=this.#C(w);if(!g&&!I)return x&&(x.fetch="hit"),this.#M(w),i&&this.#_(w),x&&this.#B(x,w),v;let B=this.#W(e,w,y,m),A=B.__staleWhileFetching!==void 0&&s;return x&&(x.fetch=I?"stale":"refresh",A&&I&&(x.returnedStale=!0)),A?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,t={}){let s=await this.fetch(e,t);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,t={}){let s=this.#h;if(!s)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:n,...o}=t,a=this.get(e,o);if(!n&&a!==void 0)return a;let c=s(e,a,{options:o,context:i});return this.set(e,c,o),c}get(e,t={}){let{allowStale:s=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=t,a=this.#f.get(e);if(a!==void 0){let c=this.#n[a],l=this.#l(c);return o&&this.#B(o,a),this.#C(a)?(o&&(o.get="stale"),l?(o&&s&&c.__staleWhileFetching!==void 0&&(o.returnedStale=!0),s?c.__staleWhileFetching:void 0):(n||this.#T(e,"expire"),o&&s&&(o.returnedStale=!0),s?c:void 0)):(o&&(o.get="hit"),l?c.__staleWhileFetching:(this.#M(a),i&&this.#_(a),c))}else o&&(o.get="miss")}#q(e,t){this.#D[t]=e,this.#m[e]=t}#M(e){e!==this.#x&&(e===this.#w?this.#w=this.#m[e]:this.#q(this.#D[e],this.#m[e]),this.#q(this.#x,e),this.#x=e)}delete(e){return this.#T(e,"delete")}#T(e,t){let s=!1;if(this.#a!==0){let i=this.#f.get(e);if(i!==void 0)if(this.#y?.[i]&&(clearTimeout(this.#y?.[i]),this.#y[i]=void 0),s=!0,this.#a===1)this.#H(t);else{this.#$(i);let n=this.#n[i];if(this.#l(n)?n.__abortController.abort(new Error("deleted")):(this.#v||this.#s)&&(this.#v&&this.#r?.(n,e,t),this.#s&&this.#g?.push([n,e,t])),this.#f.delete(e),this.#c[i]=void 0,this.#n[i]=void 0,i===this.#x)this.#x=this.#D[i];else if(i===this.#w)this.#w=this.#m[i];else{let o=this.#D[i];this.#m[o]=this.#m[i];let a=this.#m[i];this.#D[a]=this.#D[i]}this.#a--,this.#A.push(i)}}if(this.#s&&this.#g?.length){let i=this.#g,n;for(;n=i?.shift();)this.#o?.(...n)}return s}clear(){return this.#H("delete")}#H(e){for(let t of this.#O({allowStale:!0})){let s=this.#n[t];if(this.#l(s))s.__abortController.abort(new Error("deleted"));else{let i=this.#c[t];this.#v&&this.#r?.(s,i,e),this.#s&&this.#g?.push([s,i,e])}}if(this.#f.clear(),this.#n.fill(void 0),this.#c.fill(void 0),this.#b&&this.#k){this.#b.fill(0),this.#k.fill(0);for(let t of this.#y??[])t!==void 0&&clearTimeout(t);this.#y?.fill(void 0)}if(this.#E&&this.#E.fill(0),this.#w=0,this.#x=0,this.#A.length=0,this.#p=0,this.#a=0,this.#s&&this.#g){let t=this.#g,s;for(;s=t?.shift();)this.#o?.(...s)}}};var si=require("node:path"),Jx=require("node:url"),Nt=require("fs"),b8=_(require("node:fs"),1),Er=require("node:fs/promises");var ia=require("node:events"),F0=_(require("node:stream"),1),Gx=require("node:string_decoder"),Wx=typeof process=="object"&&process?process:{stdout:null,stderr:null},l8=r=>!!r&&typeof r=="object"&&(r instanceof Cr||r instanceof F0.default||u8(r)||h8(r)),u8=r=>!!r&&typeof r=="object"&&r instanceof ia.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==F0.default.Writable.prototype.pipe,h8=r=>!!r&&typeof r=="object"&&r instanceof ia.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function",rr=Symbol("EOF"),sr=Symbol("maybeEmitEnd"),vr=Symbol("emittedEnd"),Xo=Symbol("emittingEnd"),yn=Symbol("emittedError"),Qo=Symbol("closed"),qx=Symbol("read"),ea=Symbol("flush"),Vx=Symbol("flushChunk"),kt=Symbol("encoding"),ti=Symbol("decoder"),ge=Symbol("flowing"),wn=Symbol("paused"),ri=Symbol("resume"),be=Symbol("buffer"),Me=Symbol("pipes"),ye=Symbol("bufferLength"),E0=Symbol("bufferPush"),ta=Symbol("bufferShift"),Ae=Symbol("objectMode"),he=Symbol("destroyed"),k0=Symbol("error"),S0=Symbol("emitData"),Hx=Symbol("emitEnd"),_0=Symbol("emitEnd2"),$t=Symbol("async"),A0=Symbol("abort"),ra=Symbol("aborted"),Dn=Symbol("signal"),as=Symbol("dataListeners"),Je=Symbol("discarded"),vn=r=>Promise.resolve().then(r),f8=r=>r(),d8=r=>r==="end"||r==="finish"||r==="prefinish",p8=r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,m8=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),sa=class{src;dest;opts;ondrain;constructor(e,t,s){this.src=e,this.dest=t,this.opts=s,this.ondrain=()=>e[ri](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},T0=class extends sa{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,s){super(e,t,s),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},x8=r=>!!r.objectMode,g8=r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer",Cr=class extends ia.EventEmitter{[ge]=!1;[wn]=!1;[Me]=[];[be]=[];[Ae];[kt];[$t];[ti];[rr]=!1;[vr]=!1;[Xo]=!1;[Qo]=!1;[yn]=null;[ye]=0;[he]=!1;[Dn];[ra]=!1;[as]=0;[Je]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");x8(t)?(this[Ae]=!0,this[kt]=null):g8(t)?(this[kt]=t.encoding,this[Ae]=!1):(this[Ae]=!1,this[kt]=null),this[$t]=!!t.async,this[ti]=this[kt]?new Gx.StringDecoder(this[kt]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[be]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[Me]});let{signal:s}=t;s&&(this[Dn]=s,s.aborted?this[A0]():s.addEventListener("abort",()=>this[A0]()))}get bufferLength(){return this[ye]}get encoding(){return this[kt]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Ae]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[$t]}set async(e){this[$t]=this[$t]||!!e}[A0](){this[ra]=!0,this.emit("abort",this[Dn]?.reason),this.destroy(this[Dn]?.reason)}get aborted(){return this[ra]}set aborted(e){}write(e,t,s){if(this[ra])return!1;if(this[rr])throw new Error("write after end");if(this[he])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(s=t,t="utf8"),t||(t="utf8");let i=this[$t]?vn:f8;if(!this[Ae]&&!Buffer.isBuffer(e)){if(m8(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(p8(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Ae]?(this[ge]&&this[ye]!==0&&this[ea](!0),this[ge]?this.emit("data",e):this[E0](e),this[ye]!==0&&this.emit("readable"),s&&i(s),this[ge]):e.length?(typeof e=="string"&&!(t===this[kt]&&!this[ti]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[kt]&&(e=this[ti].write(e)),this[ge]&&this[ye]!==0&&this[ea](!0),this[ge]?this.emit("data",e):this[E0](e),this[ye]!==0&&this.emit("readable"),s&&i(s),this[ge]):(this[ye]!==0&&this.emit("readable"),s&&i(s),this[ge])}read(e){if(this[he])return null;if(this[Je]=!1,this[ye]===0||e===0||e&&e>this[ye])return this[sr](),null;this[Ae]&&(e=null),this[be].length>1&&!this[Ae]&&(this[be]=[this[kt]?this[be].join(""):Buffer.concat(this[be],this[ye])]);let t=this[qx](e||null,this[be][0]);return this[sr](),t}[qx](e,t){if(this[Ae])this[ta]();else{let s=t;e===s.length||e===null?this[ta]():typeof s=="string"?(this[be][0]=s.slice(e),t=s.slice(0,e),this[ye]-=e):(this[be][0]=s.subarray(e),t=s.subarray(0,e),this[ye]-=e)}return this.emit("data",t),!this[be].length&&!this[rr]&&this.emit("drain"),t}end(e,t,s){return typeof e=="function"&&(s=e,e=void 0),typeof t=="function"&&(s=t,t="utf8"),e!==void 0&&this.write(e,t),s&&this.once("end",s),this[rr]=!0,this.writable=!1,(this[ge]||!this[wn])&&this[sr](),this}[ri](){this[he]||(!this[as]&&!this[Me].length&&(this[Je]=!0),this[wn]=!1,this[ge]=!0,this.emit("resume"),this[be].length?this[ea]():this[rr]?this[sr]():this.emit("drain"))}resume(){return this[ri]()}pause(){this[ge]=!1,this[wn]=!0,this[Je]=!1}get destroyed(){return this[he]}get flowing(){return this[ge]}get paused(){return this[wn]}[E0](e){this[Ae]?this[ye]+=1:this[ye]+=e.length,this[be].push(e)}[ta](){return this[Ae]?this[ye]-=1:this[ye]-=this[be][0].length,this[be].shift()}[ea](e=!1){do;while(this[Vx](this[ta]())&&this[be].length);!e&&!this[be].length&&!this[rr]&&this.emit("drain")}[Vx](e){return this.emit("data",e),this[ge]}pipe(e,t){if(this[he])return e;this[Je]=!1;let s=this[vr];return t=t||{},e===Wx.stdout||e===Wx.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,s?t.end&&e.end():(this[Me].push(t.proxyErrors?new T0(this,e,t):new sa(this,e,t)),this[$t]?vn(()=>this[ri]()):this[ri]()),e}unpipe(e){let t=this[Me].find(s=>s.dest===e);t&&(this[Me].length===1?(this[ge]&&this[as]===0&&(this[ge]=!1),this[Me]=[]):this[Me].splice(this[Me].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let s=super.on(e,t);if(e==="data")this[Je]=!1,this[as]++,!this[Me].length&&!this[ge]&&this[ri]();else if(e==="readable"&&this[ye]!==0)super.emit("readable");else if(d8(e)&&this[vr])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[yn]){let i=t;this[$t]?vn(()=>i.call(this,this[yn])):i.call(this,this[yn])}return s}removeListener(e,t){return this.off(e,t)}off(e,t){let s=super.off(e,t);return e==="data"&&(this[as]=this.listeners("data").length,this[as]===0&&!this[Je]&&!this[Me].length&&(this[ge]=!1)),s}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[as]=0,!this[Je]&&!this[Me].length&&(this[ge]=!1)),t}get emittedEnd(){return this[vr]}[sr](){!this[Xo]&&!this[vr]&&!this[he]&&this[be].length===0&&this[rr]&&(this[Xo]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Qo]&&this.emit("close"),this[Xo]=!1)}emit(e,...t){let s=t[0];if(e!=="error"&&e!=="close"&&e!==he&&this[he])return!1;if(e==="data")return!this[Ae]&&!s?!1:this[$t]?(vn(()=>this[S0](s)),!0):this[S0](s);if(e==="end")return this[Hx]();if(e==="close"){if(this[Qo]=!0,!this[vr]&&!this[he])return!1;let n=super.emit("close");return this.removeAllListeners("close"),n}else if(e==="error"){this[yn]=s,super.emit(k0,s);let n=!this[Dn]||this.listeners("error").length?super.emit("error",s):!1;return this[sr](),n}else if(e==="resume"){let n=super.emit("resume");return this[sr](),n}else if(e==="finish"||e==="prefinish"){let n=super.emit(e);return this.removeAllListeners(e),n}let i=super.emit(e,...t);return this[sr](),i}[S0](e){for(let s of this[Me])s.dest.write(e)===!1&&this.pause();let t=this[Je]?!1:super.emit("data",e);return this[sr](),t}[Hx](){return this[vr]?!1:(this[vr]=!0,this.readable=!1,this[$t]?(vn(()=>this[_0]()),!0):this[_0]())}[_0](){if(this[ti]){let t=this[ti].end();if(t){for(let s of this[Me])s.dest.write(t);this[Je]||super.emit("data",t)}}for(let t of this[Me])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Ae]||(e.dataLength=0);let t=this.promise();return this.on("data",s=>{e.push(s),this[Ae]||(e.dataLength+=s.length)}),await t,e}async concat(){if(this[Ae])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[kt]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(he,()=>t(new Error("stream destroyed"))),this.on("error",s=>t(s)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Je]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[rr])return t();let n,o,a=h=>{this.off("data",c),this.off("end",l),this.off(he,u),t(),o(h)},c=h=>{this.off("error",a),this.off("end",l),this.off(he,u),this.pause(),n({value:h,done:!!this[rr]})},l=()=>{this.off("error",a),this.off("data",c),this.off(he,u),t(),n({done:!0,value:void 0})},u=()=>a(new Error("stream destroyed"));return new Promise((h,d)=>{o=d,n=h,this.once(he,u),this.once("error",a),this.once("end",l),this.once("data",c)})},throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Je]=!1;let e=!1,t=()=>(this.pause(),this.off(k0,t),this.off(he,t),this.off("end",t),e=!0,{done:!0,value:void 0}),s=()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}};return this.once("end",t),this.once(k0,t),this.once(he,t),{next:s,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[he])return e?this.emit("error",e):this.emit(he),this;this[he]=!0,this[Je]=!0,this[be].length=0,this[ye]=0;let t=this;return typeof t.close=="function"&&!this[Qo]&&t.close(),e?this.emit("error",e):this.emit(he),this}static get isStream(){return l8}};var y8=Nt.realpathSync.native,En={lstatSync:Nt.lstatSync,readdir:Nt.readdir,readdirSync:Nt.readdirSync,readlinkSync:Nt.readlinkSync,realpathSync:y8,promises:{lstat:Er.lstat,readdir:Er.readdir,readlink:Er.readlink,realpath:Er.realpath}},Xx=r=>!r||r===En||r===b8?En:{...En,...r,promises:{...En.promises,...r.promises||{}}},Qx=/^\\\\\?\\([a-z]:)\\?$/i,w8=r=>r.replace(/\//g,"\\").replace(Qx,"$1\\"),D8=/[\\\/]/,dt=0,eg=1,tg=2,jt=4,rg=6,sg=8,cs=10,ig=12,ft=15,Cn=~ft,O0=16,zx=32,kn=64,St=128,na=256,aa=512,Kx=kn|St|aa,v8=1023,I0=r=>r.isFile()?sg:r.isDirectory()?jt:r.isSymbolicLink()?cs:r.isCharacterDevice()?tg:r.isBlockDevice()?rg:r.isSocket()?ig:r.isFIFO()?eg:dt,Zx=new os({max:2**12}),Sn=r=>{let e=Zx.get(r);if(e)return e;let t=r.normalize("NFKD");return Zx.set(r,t),t},Yx=new os({max:2**12}),oa=r=>{let e=Yx.get(r);if(e)return e;let t=Sn(r.toLowerCase());return Yx.set(r,t),t},ca=class extends os{constructor(){super({max:256})}},B0=class extends os{constructor(e=16*1024){super({maxSize:e,sizeCalculation:t=>t.length+1})}},ng=Symbol("PathScurry setAsCwd"),Te=class{name;root;roots;parent;nocase;isCWD=!1;#e;#t;get dev(){return this.#t}#r;get mode(){return this.#r}#i;get nlink(){return this.#i}#o;get uid(){return this.#o}#d;get gid(){return this.#d}#h;get rdev(){return this.#h}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#p;get size(){return this.#p}#f;get blocks(){return this.#f}#c;get atimeMs(){return this.#c}#n;get mtimeMs(){return this.#n}#m;get ctimeMs(){return this.#m}#D;get birthtimeMs(){return this.#D}#w;get atime(){return this.#w}#x;get mtime(){return this.#x}#A;get ctime(){return this.#A}#g;get birthtime(){return this.#g}#E;#k;#b;#y;#v;#S;#s;#P;#I;#_;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=dt,s,i,n,o,a){this.name=e,this.#E=n?oa(e):Sn(e),this.#s=t&v8,this.nocase=n,this.roots=i,this.root=s||this,this.#P=o,this.#b=a.fullpath,this.#v=a.relative,this.#S=a.relativePosix,this.parent=a.parent,this.parent?this.#e=this.parent.#e:this.#e=Xx(a.fs)}depth(){return this.#k!==void 0?this.#k:this.parent?this.#k=this.parent.depth()+1:this.#k=0}childrenCache(){return this.#P}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#B(i):this.#B(i)}#B(e){let t=this;for(let s of e)t=t.child(s);return t}children(){let e=this.#P.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#P.set(this,t),this.#s&=~O0,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let s=this.children(),i=this.nocase?oa(e):Sn(e);for(let c of s)if(c.#E===i)return c;let n=this.parent?this.sep:"",o=this.#b?this.#b+n+e:void 0,a=this.newChild(e,dt,{...t,parent:this,fullpath:o});return this.canReaddir()||(a.#s|=St),s.push(a),a}relative(){if(this.isCWD)return"";if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let s=t.relative();return s+(!s||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#S!==void 0)return this.#S;let e=this.name,t=this.parent;if(!t)return this.#S=this.fullpathPosix();let s=t.relativePosix();return s+(!s||!t.parent?"":"/")+e}fullpath(){if(this.#b!==void 0)return this.#b;let e=this.name,t=this.parent;if(!t)return this.#b=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#b=i}fullpathPosix(){if(this.#y!==void 0)return this.#y;if(this.sep==="/")return this.#y=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#y=`//?/${i}`:this.#y=i}let e=this.parent,t=e.fullpathPosix(),s=t+(!t||!e.parent?"":"/")+this.name;return this.#y=s}isUnknown(){return(this.#s&ft)===dt}isType(e){return this[`is${e}`]()}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&ft)===sg}isDirectory(){return(this.#s&ft)===jt}isCharacterDevice(){return(this.#s&ft)===tg}isBlockDevice(){return(this.#s&ft)===rg}isFIFO(){return(this.#s&ft)===eg}isSocket(){return(this.#s&ft)===ig}isSymbolicLink(){return(this.#s&cs)===cs}lstatCached(){return this.#s&zx?this:void 0}readlinkCached(){return this.#I}realpathCached(){return this.#_}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#I)return!0;if(!this.parent)return!1;let e=this.#s&ft;return!(e!==dt&&e!==cs||this.#s&na||this.#s&St)}calledReaddir(){return!!(this.#s&O0)}isENOENT(){return!!(this.#s&St)}isNamed(e){return this.nocase?this.#E===oa(e):this.#E===Sn(e)}async readlink(){let e=this.#I;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),s=(await this.parent.realpath())?.resolve(t);if(s)return this.#I=s}catch(t){this.#O(t.code);return}}readlinkSync(){let e=this.#I;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),s=this.parent.realpathSync()?.resolve(t);if(s)return this.#I=s}catch(t){this.#O(t.code);return}}#j(e){this.#s|=O0;for(let t=e.provisional;t<e.length;t++){let s=e[t];s&&s.#C()}}#C(){this.#s&St||(this.#s=(this.#s|St)&Cn,this.#V())}#V(){let e=this.children();e.provisional=0;for(let t of e)t.#C()}#$(){this.#s|=aa,this.#R()}#R(){if(this.#s&kn)return;let e=this.#s;(e&ft)===jt&&(e&=Cn),this.#s=e|kn,this.#V()}#N(e=""){e==="ENOTDIR"||e==="EPERM"?this.#R():e==="ENOENT"?this.#C():this.children().provisional=0}#F(e=""){e==="ENOTDIR"?this.parent.#R():e==="ENOENT"&&this.#C()}#O(e=""){let t=this.#s;t|=na,e==="ENOENT"&&(t|=St),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Cn),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#R()}#L(e,t){return this.#W(e,t)||this.#U(e,t)}#U(e,t){let s=I0(e),i=this.newChild(e.name,s,{parent:this}),n=i.#s&ft;return n!==jt&&n!==cs&&n!==dt&&(i.#s|=kn),t.unshift(i),t.provisional++,i}#W(e,t){for(let s=t.provisional;s<t.length;s++){let i=t[s];if((this.nocase?oa(e.name):Sn(e.name))===i.#E)return this.#l(e,i,s,t)}}#l(e,t,s,i){let n=t.name;return t.#s=t.#s&Cn|I0(e),n!==e.name&&(t.name=e.name),s!==i.provisional&&(s===i.length-1?i.pop():i.splice(s,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&St)===0)try{return this.#q(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#F(e.code)}}lstatSync(){if((this.#s&St)===0)try{return this.#q(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#F(e.code)}}#q(e){let{atime:t,atimeMs:s,birthtime:i,birthtimeMs:n,blksize:o,blocks:a,ctime:c,ctimeMs:l,dev:u,gid:h,ino:d,mode:f,mtime:p,mtimeMs:m,nlink:g,rdev:x,size:b,uid:y}=e;this.#w=t,this.#c=s,this.#g=i,this.#D=n,this.#u=o,this.#f=a,this.#A=c,this.#m=l,this.#t=u,this.#d=h,this.#a=d,this.#r=f,this.#x=p,this.#n=m,this.#i=g,this.#h=x,this.#p=b,this.#o=y;let w=I0(e);this.#s=this.#s&Cn|w|zx,w!==dt&&w!==jt&&w!==cs&&(this.#s|=kn)}#M=[];#T=!1;#H(e){this.#T=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(s=>s(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let s=this.children();if(this.calledReaddir()){let n=s.slice(0,s.provisional);t?e(null,n):queueMicrotask(()=>e(null,n));return}if(this.#M.push(e),this.#T)return;this.#T=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(n,o)=>{if(n)this.#N(n.code),s.provisional=0;else{for(let a of o)this.#L(a,s);this.#j(s)}this.#H(s.slice(0,s.provisional))})}#G;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#G)await this.#G;else{let s=()=>{};this.#G=new Promise(i=>s=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#L(i,e);this.#j(e)}catch(i){this.#N(i.code),e.provisional=0}this.#G=void 0,s()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let s of this.#e.readdirSync(t,{withFileTypes:!0}))this.#L(s,e);this.#j(e)}catch(s){this.#N(s.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&Kx)return!1;let e=ft&this.#s;return e===dt||e===jt||e===cs}shouldWalk(e,t){return(this.#s&jt)===jt&&!(this.#s&Kx)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#_)return this.#_;if(!((aa|na|St)&this.#s))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#_=this.resolve(e)}catch{this.#$()}}realpathSync(){if(this.#_)return this.#_;if(!((aa|na|St)&this.#s))try{let e=this.#e.realpathSync(this.fullpath());return this.#_=this.resolve(e)}catch{this.#$()}}[ng](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),s=[],i=this;for(;i&&i.parent;)t.add(i),i.#v=s.join(this.sep),i.#S=s.join("/"),i=i.parent,s.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#v=void 0,i.#S=void 0,i=i.parent}},la=class r extends Te{sep="\\";splitSep=D8;constructor(e,t=dt,s,i,n,o,a){super(e,t,s,i,n,o,a)}newChild(e,t=dt,s={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(e){return si.win32.parse(e).root}getRoot(e){if(e=w8(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,s]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=s;return this.roots[e]=new ii(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(Qx,"$1\\"),e===t}},ua=class r extends Te{splitSep="/";sep="/";constructor(e,t=dt,s,i,n,o,a){super(e,t,s,i,n,o,a)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=dt,s={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),s)}},ha=class{root;rootPath;roots;cwd;#e;#t;#r;nocase;#i;constructor(e=process.cwd(),t,s,{nocase:i,childrenCacheSize:n=16*1024,fs:o=En}={}){this.#i=Xx(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,Jx.fileURLToPath)(e));let a=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(a),this.#e=new ca,this.#t=new ca,this.#r=new B0(n);let c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]&&c.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#i),this.roots[this.rootPath]=this.root;let l=this.root,u=c.length-1,h=t.sep,d=this.rootPath,f=!1;for(let p of c){let m=u--;l=l.child(p,{relative:new Array(m).fill("..").join(h),relativePosix:new Array(m).fill("..").join("/"),fullpath:d+=(f?"":h)+p}),f=!0}this.cwd=l}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let n=e.length-1;n>=0;n--){let o=e[n];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let s=this.#e.get(t);if(s!==void 0)return s;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let n=e.length-1;n>=0;n--){let o=e[n];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let s=this.#t.get(t);if(s!==void 0)return s;let i=this.cwd.resolve(t).fullpathPosix();return this.#t.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s}=t;if(e.canReaddir()){let i=await e.readdir();return s?i:i.map(n=>n.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0}=t;return e.canReaddir()?s?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=await e.readlink();return t?s:s?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=e.readlinkSync();return t?s:s?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=await e.realpath();return t?s:s?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e.withFileTypes,e=this.cwd);let s=e.realpathSync();return t?s:s?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=[];(!n||n(e))&&a.push(s?e:e.fullpath());let c=new Set,l=(h,d)=>{c.add(h),h.readdirCB((f,p)=>{if(f)return d(f);let m=p.length;if(!m)return d();let g=()=>{--m===0&&d()};for(let x of p)(!n||n(x))&&a.push(s?x:x.fullpath()),i&&x.isSymbolicLink()?x.realpath().then(b=>b?.isUnknown()?b.lstat():b).then(b=>b?.shouldWalk(c,o)?l(b,g):g()):x.shouldWalk(c,o)?l(x,g):g()},!0)},u=e;return new Promise((h,d)=>{l(u,f=>{if(f)return d(f);h(a)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=[];(!n||n(e))&&a.push(s?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let h of u){(!n||n(h))&&a.push(s?h:h.fullpath());let d=h;if(h.isSymbolicLink()){if(!(i&&(d=h.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}return a}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t;(!n||n(e))&&(yield s?e:e.fullpath());let a=new Set([e]);for(let c of a){let l=c.readdirSync();for(let u of l){(!n||n(u))&&(yield s?u:u.fullpath());let h=u;if(u.isSymbolicLink()){if(!(i&&(h=u.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(a,o)&&a.add(h)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=new Cr({objectMode:!0});(!n||n(e))&&a.write(s?e:e.fullpath());let c=new Set,l=[e],u=0,h=()=>{let d=!1;for(;!d;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let p=(g,x,b=!1)=>{if(g)return a.emit("error",g);if(i&&!b){let y=[];for(let w of x)w.isSymbolicLink()&&y.push(w.realpath().then(v=>v?.isUnknown()?v.lstat():v));if(y.length){Promise.all(y).then(()=>p(null,x,!0));return}}for(let y of x)y&&(!n||n(y))&&(a.write(s?y:y.fullpath())||(d=!0));u--;for(let y of x){let w=y.realpathCached()||y;w.shouldWalk(c,o)&&l.push(w)}d&&!a.flowing?a.once("drain",h):m||h()},m=!0;f.readdirCB(p,!0),m=!1}};return h(),a}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Te||(t=e,e=this.cwd);let{withFileTypes:s=!0,follow:i=!1,filter:n,walkFilter:o}=t,a=new Cr({objectMode:!0}),c=new Set;(!n||n(e))&&a.write(s?e:e.fullpath());let l=[e],u=0,h=()=>{let d=!1;for(;!d;){let f=l.shift();if(!f){u===0&&a.end();return}u++,c.add(f);let p=f.readdirSync();for(let m of p)(!n||n(m))&&(a.write(s?m:m.fullpath())||(d=!0));u--;for(let m of p){let g=m;if(m.isSymbolicLink()){if(!(i&&(g=m.realpathSync())))continue;g.isUnknown()&&g.lstatSync()}g.shouldWalk(c,o)&&l.push(g)}}d&&!a.flowing&&a.once("drain",h)};return h(),a}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[ng](t)}},ii=class extends ha{sep="\\";constructor(e=process.cwd(),t={}){let{nocase:s=!0}=t;super(e,si.win32,"\\",{...t,nocase:s}),this.nocase=s;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return si.win32.parse(e).root.toUpperCase()}newRoot(e){return new la(this.rootPath,jt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},ni=class extends ha{sep="/";constructor(e=process.cwd(),t={}){let{nocase:s=!1}=t;super(e,si.posix,"/",{...t,nocase:s}),this.nocase=s}parseRootPath(e){return"/"}newRoot(e){return new ua(this.rootPath,jt,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},_n=class extends ni{constructor(e=process.cwd(),t={}){let{nocase:s=!0}=t;super(e,{...t,nocase:s})}},M_=process.platform==="win32"?la:ua,og=process.platform==="win32"?ii:process.platform==="darwin"?_n:ni;var C8=r=>r.length>=1,E8=r=>r.length>=1,oi=class r{#e;#t;#r;length;#i;#o;#d;#h;#u;#a;#p=!0;constructor(e,t,s,i){if(!C8(e))throw new TypeError("empty pattern list");if(!E8(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#t=t,this.#r=s,this.#i=i,this.#r===0){if(this.isUNC()){let[n,o,a,c,...l]=this.#e,[u,h,d,f,...p]=this.#t;l[0]===""&&(l.shift(),p.shift());let m=[n,o,a,c,""].join("/"),g=[u,h,d,f,""].join("/");this.#e=[m,...l],this.#t=[g,...p],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#e,[a,...c]=this.#t;o[0]===""&&(o.shift(),c.shift());let l=n+"/",u=a+"/";this.#e=[l,...o],this.#t=[u,...c],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Ee}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#d=this.#d||(this.#r===0?this.isAbsolute()?this.#t[0]+this.#t.slice(1).join("/"):this.#t.join("/"):this.#t.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new r(this.#e,this.#t,this.#r+1,this.#i),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#h=this.#h,this.#o):this.#o=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#i==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#h!==void 0?this.#h:this.#h=this.#i==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#a!==void 0?this.#a:this.#a=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#p)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#p?!1:(this.#p=!1,!0)}};var k8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ai=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:s,noext:i,noglobstar:n,platform:o=k8}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:s,noext:i,noglobstar:n,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let a of e)this.add(a)}add(e){let t=new Ye(e,this.mmopts);for(let s=0;s<t.set.length;s++){let i=t.set[s],n=t.globParts[s];if(!i||!n)throw new Error("invalid pattern object");for(;i[0]==="."&&n[0]===".";)i.shift(),n.shift();let o=new oi(i,n,0,this.platform),a=new Ye(o.globString(),this.mmopts),c=n[n.length-1]==="**",l=o.isAbsolute();l?this.absolute.push(a):this.relative.push(a),c&&(l?this.absoluteChildren.push(a):this.relativeChildren.push(a))}}ignored(e){let t=e.fullpath(),s=`${t}/`,i=e.relative()||".",n=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(n))return!0;for(let o of this.absolute)if(o.match(t)||o.match(s))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",s=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(s))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var P0=class r{store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let s=e.fullpath(),i=this.store.get(s);i?i.add(t.globString()):this.store.set(s,new Set([t.globString()]))}},R0=class{store=new Map;add(e,t,s){let i=(t?2:0)|(s?1:0),n=this.store.get(e);this.store.set(e,n===void 0?i:i&n)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},M0=class{store=new Map;add(e,t){if(!e.canReaddir())return;let s=this.store.get(e);s?s.find(i=>i.globString()===t.globString())||s.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},An=class r{hasWalkedCache;matches=new R0;subwalks=new M0;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new P0}processPatterns(e,t){this.patterns=t;let s=t.map(i=>[e,i]);for(let[i,n]of s){this.hasWalkedCache.storeWalked(i,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let h=n.rest();if(h)n=h;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let c,l,u=!1;for(;typeof(c=n.pattern())=="string"&&(l=n.rest());)i=i.resolve(c),n=l,u=!0;if(c=n.pattern(),l=n.rest(),u){if(this.hasWalkedCache.hasWalked(i,n))continue;this.hasWalkedCache.storeWalked(i,n)}if(typeof c=="string"){let h=c===".."||c===""||c===".";this.matches.add(i.resolve(c),a,h);continue}else if(c===Ee){(!i.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(i,n);let h=l?.pattern(),d=l?.rest();if(!l||(h===""||h===".")&&!d)this.matches.add(i,a,h===""||h===".");else if(h===".."){let f=i.parent||i;d?this.hasWalkedCache.hasWalked(f,d)||this.subwalks.add(f,d):this.matches.add(f,a,!0)}}else c instanceof RegExp&&this.subwalks.add(i,n)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let s=this.subwalks.get(e),i=this.child();for(let n of t)for(let o of s){let a=o.isAbsolute(),c=o.pattern(),l=o.rest();c===Ee?i.testGlobstar(n,o,l,a):c instanceof RegExp?i.testRegExp(n,c,l,a):i.testString(n,c,l,a)}return i}testGlobstar(e,t,s,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(s&&t.checkFollowGlobstar()?this.subwalks.add(e,s):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,s.rest(),i);else if(n===".."){let o=e.parent||e;this.subwalks.add(o,s)}else n instanceof RegExp&&this.testRegExp(e,n,s.rest(),i)}}testRegExp(e,t,s,i){t.test(e.name)&&(s?this.subwalks.add(e,s):this.matches.add(e,i,!1))}testString(e,t,s,i){e.isNamed(t)&&(s?this.subwalks.add(e,s):this.matches.add(e,i,!1))}};var S8=(r,e)=>typeof r=="string"?new ai([r],e):Array.isArray(r)?new ai(r,e):r,fa=class{path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#t;#r;signal;maxDepth;includeChildMatches;constructor(e,t,s){if(this.patterns=e,this.path=t,this.opts=s,this.#r=!s.posix&&s.platform==="win32"?"\\":"/",this.includeChildMatches=s.includeChildMatches!==!1,(s.ignore||!this.includeChildMatches)&&(this.#t=S8(s.ignore??[],s),!this.includeChildMatches&&typeof this.#t.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=s.maxDepth||1/0,s.signal&&(this.signal=s.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#i(e){return this.seen.has(e)||!!this.#t?.ignored?.(e)}#o(e){return!!this.#t?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||await e.realpath(),!s)return;e=s}let n=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=await n.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(n,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#i(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let s;if(this.opts.realpath){if(s=e.realpathCached()||e.realpathSync(),!s)return;e=s}let n=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){let o=n.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(n,t)}matchFinish(e,t){if(this.#i(e))return;if(!this.includeChildMatches&&this.#t?.add){let n=`${e.relativePosix()}/**`;this.#t.add(n)}let s=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(s){let n=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(n+i)}else{let n=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!n.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(n?o+n+i:"."+i)}}async match(e,t,s){let i=await this.matchCheck(e,s);i&&this.matchFinish(i,t)}matchSync(e,t,s){let i=this.matchCheckSync(e,s);i&&this.matchFinish(i,t)}walkCB(e,t,s){this.signal?.aborted&&s(),this.walkCB2(e,t,new An(this.opts),s)}walkCB2(e,t,s,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,s,i));return}s.processPatterns(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,l).then(()=>o()));for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirCached();a.calledReaddir()?this.walkCB3(a,c,s,o):a.readdirCB((l,u)=>this.walkCB3(a,u,s,o),!0)}o()}walkCB3(e,t,s,i){s=s.filterEntries(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||(n++,this.match(a,c,l).then(()=>o()));for(let[a,c]of s.subwalks.entries())n++,this.walkCB2(a,c,s.child(),o);o()}walkCBSync(e,t,s){this.signal?.aborted&&s(),this.walkCB2Sync(e,t,new An(this.opts),s)}walkCB2Sync(e,t,s,i){if(this.#o(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,s,i));return}s.processPatterns(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let a of s.subwalkTargets()){if(this.maxDepth!==1/0&&a.depth()>=this.maxDepth)continue;n++;let c=a.readdirSync();this.walkCB3Sync(a,c,s,o)}o()}walkCB3Sync(e,t,s,i){s=s.filterEntries(e,t);let n=1,o=()=>{--n===0&&i()};for(let[a,c,l]of s.matches.entries())this.#i(a)||this.matchSync(a,c,l);for(let[a,c]of s.subwalks.entries())n++,this.walkCB2Sync(a,c,s.child(),o);o()}},Tn=class extends fa{matches=new Set;constructor(e,t,s){super(e,t,s)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},Fn=class extends fa{results;constructor(e,t,s){super(e,t,s),this.results=new Cr({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,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 _8=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",_t=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(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,ag.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(c=>c.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(c=>c.includes("/")?c:`./**/${c}`)}if(this.pattern=e,this.platform=t.platform||_8,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let c=t.platform==="win32"?ii:t.platform==="darwin"?_n:t.platform?ni:og;this.scurry=new c(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let s=this.platform==="darwin"||this.platform==="win32",i={...t,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(c=>new Ye(c,i)),[o,a]=n.reduce((c,l)=>(c[0].push(...l.set),c[1].push(...l.globParts),c),[[],[]]);this.patterns=o.map((c,l)=>{let u=a[l];if(!u)throw new Error("invalid pattern object");return new oi(c,u,0,this.platform)})}async walk(){return[...await new Tn(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 Tn(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 Fn(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 Fn(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 $0=(r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Ye(t,e).hasMagic())return!0;return!1};function pa(r,e={}){return new _t(r,e).streamSync()}function lg(r,e={}){return new _t(r,e).stream()}function ma(r,e={}){return new _t(r,e).walkSync()}async function cg(r,e={}){return new _t(r,e).walk()}function xa(r,e={}){return new _t(r,e).iterateSync()}function ug(r,e={}){return new _t(r,e).iterate()}var A8=pa,T8=Object.assign(lg,{sync:pa}),F8=xa,O8=Object.assign(ug,{sync:xa}),I8=Object.assign(ma,{stream:pa,iterate:xa}),da=Object.assign(cg,{glob:cg,globSync:ma,sync:I8,globStream:lg,stream:T8,globStreamSync:pa,streamSync:A8,globIterate:ug,iterate:O8,globIterateSync:xa,iterateSync:F8,Glob:_t,hasMagic:$0,escape:Qs,unescape:Et});da.glob=da;var kr=(r,e)=>typeof r>"u"||typeof r===e,hg=r=>!!r&&typeof r=="object"&&kr(r.preserveRoot,"boolean")&&kr(r.tmp,"string")&&kr(r.maxRetries,"number")&&kr(r.retryDelay,"number")&&kr(r.backoff,"number")&&kr(r.maxBackoff,"number")&&(kr(r.glob,"boolean")||r.glob&&typeof r.glob=="object")&&kr(r.filter,"function"),fg=r=>{if(!hg(r))throw new Error("invalid rimraf options")},dg=r=>{fg(r);let{glob:e,...t}=r;if(!e)return t;let s=e===!0?r.signal?{signal:r.signal}:{}:r.signal?{signal:r.signal,...e}:e;return{...t,glob:{...s,absolute:!0,withFileTypes:!1}}},pg=(r={})=>dg(r),mg=(r={})=>dg(r);var On=require("path"),xg=require("util"),B8=(r,e={})=>{let t=typeof r;if(t!=="string"){let i=r&&t==="object"&&r.constructor,o=`The "path" argument must be of type string. Received ${i&&i.name?`an instance of ${i.name}`:t==="object"?(0,xg.inspect)(r):`type ${t} ${r}`}`;throw Object.assign(new TypeError(o),{path:r,code:"ERR_INVALID_ARG_TYPE"})}if(/\0/.test(r)){let i="path must be a string without null bytes";throw Object.assign(new TypeError(i),{path:r,code:"ERR_INVALID_ARG_VALUE"})}r=(0,On.resolve)(r);let{root:s}=(0,On.parse)(r);if(r===s&&e.preserveRoot!==!1){let i="refusing to remove root directory without preserveRoot:false";throw Object.assign(new Error(i),{path:r,code:"ERR_PRESERVE_ROOT"})}if(process.platform==="win32"){let i=/[*|"<>?:]/,{root:n}=(0,On.parse)(r);if(i.test(r.substring(n.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r},In=B8;var gg=require("fs"),Lt=_(require("fs/promises"),1),K=require("fs"),bg=r=>(0,gg.readdirSync)(r,{withFileTypes:!0}),He={chmod:Lt.default.chmod,mkdir:Lt.default.mkdir,readdir:r=>Lt.default.readdir(r,{withFileTypes:!0}),rename:Lt.default.rename,rm:Lt.default.rm,rmdir:Lt.default.rmdir,stat:Lt.default.stat,lstat:Lt.default.lstat,unlink:Lt.default.unlink};var ui=require("path");var{readdir:P8}=He,ci=r=>P8(r).catch(e=>e),li=r=>{try{return bg(r)}catch(e){return e}};var yg=r=>!!r&&typeof r=="object",j0=(r,e)=>e in r&&typeof r[e]=="string",N0=r=>yg(r)&&j0(r,"code")&&j0(r,"path"),ne=r=>yg(r)&&j0(r,"code")?r.code:null;var $e=async(r,e)=>r.catch(t=>{if(ne(t)!=="ENOENT")throw e??t}),je=(r,e)=>{try{return r()}catch(t){if(ne(t)==="ENOENT")return;throw e??t}};var{lstat:R8,rmdir:M8,unlink:$8}=He,ga=async(r,e)=>(e?.signal?.throwIfAborted(),await $e(R8(r).then(t=>wg(r,e,t)))??!0),ba=(r,e)=>(e?.signal?.throwIfAborted(),je(()=>Dg(r,e,(0,K.lstatSync)(r)))??!0),wg=async(r,e,t)=>{e?.signal?.throwIfAborted();let s=t.isDirectory()?await ci(r):null;if(!Array.isArray(s)){if(s){if(ne(s)==="ENOENT")return!0;if(ne(s)!=="ENOTDIR")throw s}return e.filter&&!await e.filter(r,t)?!1:(await $e($8(r)),!0)}return!(await Promise.all(s.map(n=>wg((0,ui.resolve)(r,n.name),e,n)))).every(n=>n===!0)||e.preserveRoot===!1&&r===(0,ui.parse)(r).root||e.filter&&!await e.filter(r,t)?!1:(await $e(M8(r)),!0)},Dg=(r,e,t)=>{e?.signal?.throwIfAborted();let s=t.isDirectory()?li(r):null;if(!Array.isArray(s)){if(s){if(ne(s)==="ENOENT")return!0;if(ne(s)!=="ENOTDIR")throw s}return e.filter&&!e.filter(r,t)?!1:(je(()=>(0,K.unlinkSync)(r)),!0)}let i=!0;for(let n of s){let o=(0,ui.resolve)(r,n.name);i=Dg(o,e,n)&&i}return e.preserveRoot===!1&&r===(0,ui.parse)(r).root||!i||e.filter&&!e.filter(r,t)?!1:(je(()=>(0,K.rmdirSync)(r)),!0)};var hi=require("path");var{chmod:j8}=He,Bn=r=>async e=>{try{return void await $e(r(e))}catch(t){if(ne(t)==="EPERM")return await $e(j8(e,438).then(()=>!0),t)?void await r(e):void 0;throw t}},Pn=r=>e=>{try{return void je(()=>r(e))}catch(t){if(ne(t)==="EPERM")return je(()=>((0,K.chmodSync)(e,438),!0),t)?void r(e):void 0;throw t}};var vg=require("timers/promises");var N8=200,L8=1.2,Cg=10,Eg=new Set(["EMFILE","ENFILE","EBUSY"]),L0=r=>{let e=async(t,s,i=1,n=0)=>{let o=s.maxBackoff||N8,a=s.backoff||L8,c=s.maxRetries||Cg,l=0;for(;;)try{return await r(t)}catch(u){if(N0(u)&&u.path===t&&Eg.has(u.code)){if(i=Math.ceil(i*a),n=i+n,n<o)return await(0,vg.setTimeout)(i),e(t,s,i,n);if(l<c){l++;continue}}throw u}};return e},U0=r=>(t,s)=>{let i=s.maxRetries||Cg,n=0;for(;;)try{return r(t)}catch(o){if(N0(o)&&o.path===t&&Eg.has(o.code)&&n<i){n++;continue}throw o}};var pt=require("path");var Rn=require("os"),Sr=require("path");var{stat:U8}=He,W8=r=>{try{return(0,K.statSync)(r).isDirectory()}catch{return!1}},q8=r=>U8(r).then(e=>e.isDirectory(),()=>!1),V8=async r=>{let{root:e}=(0,Sr.parse)(r),t=(0,Rn.tmpdir)(),{root:s}=(0,Sr.parse)(t);if(e.toLowerCase()===s.toLowerCase())return t;let i=(0,Sr.resolve)(e,"/temp");return await q8(i)?i:e},H8=r=>{let{root:e}=(0,Sr.parse)(r),t=(0,Rn.tmpdir)(),{root:s}=(0,Sr.parse)(t);if(e.toLowerCase()===s.toLowerCase())return t;let i=(0,Sr.resolve)(e,"/temp");return W8(i)?i:e},G8=async()=>(0,Rn.tmpdir)(),z8=()=>(0,Rn.tmpdir)(),kg=process.platform==="win32"?V8:G8,Sg=process.platform==="win32"?H8:z8;var{lstat:K8,rename:Z8,unlink:Y8,rmdir:J8}=He,Tg=r=>`.${(0,pt.basename)(r)}.${Math.random()}`,X8=Bn(Y8),Q8=Pn(K.unlinkSync),ya=async(r,e)=>(e?.signal?.throwIfAborted(),await $e(K8(r).then(t=>W0(r,e,t)))??!0),W0=async(r,e,t)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return W0(r,{...e,tmp:await kg(r)},t);if(r===e.tmp&&(0,pt.parse)(r).root!==r)throw new Error("cannot delete temp directory used for deletion");let s=t.isDirectory()?await ci(r):null;if(!Array.isArray(s)){if(s){if(ne(s)==="ENOENT")return!0;if(ne(s)!=="ENOTDIR")throw s}return e.filter&&!await e.filter(r,t)?!1:(await $e(_g(r,e.tmp,X8)),!0)}return!(await Promise.all(s.map(n=>W0((0,pt.resolve)(r,n.name),e,n)))).every(n=>n===!0)||e.preserveRoot===!1&&r===(0,pt.parse)(r).root||e.filter&&!await e.filter(r,t)?!1:(await $e(_g(r,e.tmp,J8)),!0)},_g=async(r,e,t)=>{let s=(0,pt.resolve)(e,Tg(r));return await Z8(r,s),await t(s)},wa=(r,e)=>(e?.signal?.throwIfAborted(),je(()=>q0(r,e,(0,K.lstatSync)(r)))??!0),q0=(r,e,t)=>{if(e?.signal?.throwIfAborted(),!e.tmp)return q0(r,{...e,tmp:Sg(r)},t);let s=e.tmp;if(r===e.tmp&&(0,pt.parse)(r).root!==r)throw new Error("cannot delete temp directory used for deletion");let i=t.isDirectory()?li(r):null;if(!Array.isArray(i)){if(i){if(ne(i)==="ENOENT")return!0;if(ne(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(r,t)?!1:(je(()=>Ag(r,s,Q8)),!0)}let n=!0;for(let o of i){let a=(0,pt.resolve)(r,o.name);n=q0(a,e,o)&&n}return!n||e.preserveRoot===!1&&r===(0,pt.parse)(r).root||e.filter&&!e.filter(r,t)?!1:(je(()=>Ag(r,s,K.rmdirSync)),!0)},Ag=(r,e,t)=>{let s=(0,pt.resolve)(e,Tg(r));return(0,K.renameSync)(r,s),t(s)};var{unlink:e4,rmdir:t4,lstat:r4}=He,s4=L0(Bn(e4)),i4=U0(Pn(K.unlinkSync)),n4=L0(Bn(t4)),o4=U0(Pn(K.rmdirSync)),a4=async(r,{filter:e,...t})=>{t?.signal?.throwIfAborted();try{return await n4(r,t),!0}catch(s){if(ne(s)==="ENOTEMPTY")return ya(r,t);throw s}},c4=(r,{filter:e,...t})=>{t?.signal?.throwIfAborted();try{return o4(r,t),!0}catch(s){if(ne(s)==="ENOTEMPTY")return wa(r,t);throw s}},_r=Symbol("start"),Fg=Symbol("child"),Da=Symbol("finish"),va=async(r,e)=>(e?.signal?.throwIfAborted(),await $e(r4(r).then(t=>V0(r,e,t,_r)))??!0),Ca=(r,e)=>(e?.signal?.throwIfAborted(),je(()=>H0(r,e,(0,K.lstatSync)(r),_r))??!0),V0=async(r,e,t,s=_r)=>{e?.signal?.throwIfAborted();let i=t.isDirectory()?await ci(r):null;if(!Array.isArray(i)){if(i){if(ne(i)==="ENOENT")return!0;if(ne(i)!=="ENOTDIR")throw i}return e.filter&&!await e.filter(r,t)?!1:(await $e(s4(r,e)),!0)}let n=s===_r?Fg:s,o=(await Promise.all(i.map(a=>V0((0,hi.resolve)(r,a.name),e,a,n)))).every(a=>a===!0);if(s===_r)return V0(r,e,t,Da);if(s===Da){if(e.preserveRoot===!1&&r===(0,hi.parse)(r).root||!o||e.filter&&!await e.filter(r,t))return!1;await $e(a4(r,e))}return!0},H0=(r,e,t,s=_r)=>{let i=t.isDirectory()?li(r):null;if(!Array.isArray(i)){if(i){if(ne(i)==="ENOENT")return!0;if(ne(i)!=="ENOTDIR")throw i}return e.filter&&!e.filter(r,t)?!1:(je(()=>i4(r,e)),!0)}let n=!0;for(let o of i){let a=s===_r?Fg:s,c=(0,hi.resolve)(r,o.name);n=H0(c,e,o,a)&&n}if(s===_r)return H0(r,e,t,Da);if(s===Da){if(e.preserveRoot===!1&&r===(0,hi.parse)(r).root||!n||e.filter&&!e.filter(r,t))return!1;je(()=>c4(r,e))}return!0};var G0=process.platform==="win32"?va:ga,z0=process.platform==="win32"?Ca:ba;var{rm:l4}=He,K0=async(r,e)=>(await l4(r,{...e,force:!0,recursive:!0}),!0),Z0=(r,e)=>((0,K.rmSync)(r,{...e,force:!0,recursive:!0}),!0);var[Og=0,u4=0]=process.version.replace(/^v/,"").split(".").map(r=>parseInt(r,10)),Ig=Og>14||Og===14&&u4>=14,Bg=!Ig||process.platform==="win32"?()=>!1:r=>!r?.signal&&!r?.filter,Pg=!Ig||process.platform==="win32"?()=>!1:r=>!r?.signal&&!r?.filter;var fi=r=>async(e,t)=>{let s=pg(t);return s.glob&&(e=await da(e,s.glob)),Array.isArray(e)?!!(await Promise.all(e.map(i=>r(In(i,s),s)))).reduce((i,n)=>i&&n,!0):!!await r(In(e,s),s)},di=r=>(e,t)=>{let s=mg(t);return s.glob&&(e=ma(e,s.glob)),Array.isArray(e)?!!e.map(i=>r(In(i,s),s)).reduce((i,n)=>i&&n,!0):!!r(In(e,s),s)},$g=di(Z0),h4=Object.assign(fi(K0),{sync:$g}),jg=di(z0),f4=Object.assign(fi(G0),{sync:jg}),Ng=di(Ca),d4=Object.assign(fi(va),{sync:Ng}),Lg=di(ba),p4=Object.assign(fi(ga),{sync:Lg}),Ug=di(wa),m4=Object.assign(fi(ya),{sync:Ug}),Rg=di((r,e)=>Pg(e)?Z0(r,e):z0(r,e));var Mg=fi((r,e)=>Bg(e)?K0(r,e):G0(r,e)),Ea=Object.assign(Mg,{rimraf:Mg,sync:Rg,rimrafSync:Rg,manual:f4,manualSync:jg,native:h4,nativeSync:$g,posix:p4,posixSync:Lg,windows:d4,windowsSync:Ng,moveRemove:m4,moveRemoveSync:Ug});Ea.rimraf=Ea;var de=r=>(0,Ar.join)(process.cwd(),r),ka=r=>{try{return(0,Wg.readdirSync)(r).length===0}catch{return!0}},qg=()=>{try{return Mn()!==void 0}catch{return!1}};function Vg(){let r=g0({cwd:(0,Ar.dirname)(__filename)});if(!r)throw new Error("Could not find package.json");return(0,Ar.dirname)(r)}function Mn(){let r=g0();if(!r)throw new Error("You are not in a project directory");return(0,Ar.dirname)(r)}var Hg=r=>Ea(r),Gg=(r,e)=>(0,Ar.resolve)(require.resolve(r),`../${e}`);var zg=_(require("chalk"));async function Fe(r,e){let t=Date.now(),s=r.title,i=()=>Math.floor((Date.now()-t)/1e3),n=setInterval(()=>{i()>1&&(r.title=`${s} (${i()}s)`)},1e3);try{return await e(i)}finally{clearInterval(n)}}async function Sa(r,e,t){for(let s=0;s<e.length;s++){let i=e[s];r.output=zg.default.dim(`[${s+1}/${e.length}] ${i.title}`),await i.fn(t??{},r)}}var t2=require("node:child_process"),r2=require("node:fs"),X0=require("node:path"),s2=_(e2()),i2=require("execa");var B4={...process.env,NODE_NO_WARNINGS:"1"};async function Tr(r,e,{cwd:t=process.cwd(),task:s,shell:i,context:n=r,quiet:o=!1,nonInteractive:a=!1,env:c}={}){try{e.length===0&&(e=r.split(" ").slice(1));let l=o?"pipe":s||a?["ignore","pipe","pipe"]:"inherit",u={...B4};c?u={...u,...c}:(s||a)&&(u={...u,CI:"true"});let h=(0,i2.execa)(r,e,{cwd:t,stdio:l,all:s||a?!0:void 0,shell:i??!0,env:u});h.all&&h.all.on("data",d=>{let f=d.toString().trim();s?(s.output=f,f.length&&O.storeLog(f,n)):a&&f.length&&console.log(f)}),await h}catch(l){let u=l instanceof Error?l.message:String(l),h=P4(u);throw new Error(h)}}var P4=r=>{let e=r.match(/error: (.+)/);return e?e[1].trim():r},R4=(r,e)=>{let t=(0,X0.resolve)(e,r);return(0,r2.existsSync)(t)?(0,s2.config)({path:t,processEnv:{}}).parsed||{}:{}};function n2(r,e,t={}){let{cwd:s=process.cwd(),envFile:i,detached:n=!0,onStderr:o,onExit:a}=t,c=i?R4(i,s):{},l=(0,X0.resolve)(s,"node_modules",".bin"),u=process.env.PATH||"",h=`${l}:${u}`,d={...process.env,...c,PATH:h,FORCE_COLOR:"1"},f=(0,t2.spawn)(r,e,{cwd:s,env:d,stdio:["inherit","inherit","pipe"],detached:n});return o&&f.stderr?.on("data",o),a&&f.on("exit",a),f}var Fr=require("node:fs"),nr=require("node:path"),mi=require("fs-extra");var M4=["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml"],$4=r=>{let e=(0,nr.join)(r,"package.json");if(!(0,Fr.existsSync)(e))return!1;try{let t=JSON.parse((0,Fr.readFileSync)(e,"utf-8"));if(!t.workspaces)return!1;if(t.pf||(0,Fr.existsSync)((0,nr.join)(r,"turbo.json")))return!0;let s=M4.some(n=>(0,Fr.existsSync)((0,nr.join)(r,n))),i=(0,Fr.existsSync)((0,nr.join)(r,"infra"));return!!(s&&i)}catch{return!1}};function Ut(){let r=process.cwd();for(;!$4(r);){let e=r.slice(0,r.lastIndexOf("/"));if(e===r)throw new Error(`
103
103
  \x1B[31m\u2716\x1B[0m Not in a workspace directory
104
104
 
105
105
  Current directory: ${process.cwd()}
@@ -109,8 +109,8 @@ This command must be run from within a workspace created with \x1B[36mpf new wor
109
109
  To create a new workspace, run:
110
110
 
111
111
  \x1B[36mpf new workspace my-platform\x1B[0m
112
- `);r=e}return r}function Q0(){let r=Ut(),e=(0,Tr.join)(r,"package.json"),s=JSON.parse((0,cs.readFileSync)(e,"utf-8")).name;return s.startsWith("@")?s.split("/")[0]:`@${s}`}function ls(r,e,t=process.cwd()){let s=(0,Tr.join)(t,"package.json"),i=(0,mi.readJsonSync)(s);j4(i,r,e),(0,mi.writeJsonSync)(s,i,{spaces:2,EOL:`
113
- `,encoding:"utf-8"})}function j4(r,e,t){let s=e.split("."),i=r;for(let n=0;n<s.length-1;n++){let o=s[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[s[s.length-1]]=t}var xi=r=>{let e=Vg();return(0,mi.readJSONSync)((0,Tr.resolve)(e,r),{encoding:"utf-8"})},Fr=xi("package.json");var Aa=r=>mn(r);function c2(r){let e=(0,o2.join)(Mn(),"node_modules",r);return(0,us.existsSync)(e)}var l2=r=>Object.keys(Fr.scripts??{}).includes(r);function th(){if((0,us.existsSync)("bun.lock")||(0,us.existsSync)("bun.lockb"))return"bun";if((0,us.existsSync)("pnpm-lock.yaml"))return"pnpm";if((0,us.existsSync)("yarn.lock"))return"yarn";if((0,us.existsSync)("package-lock.json"))return"npm"}function Ge(){return th()??rh()}function rh(){return Aa("bun")?"bun":Aa("pnpm")?"pnpm":Aa("yarn")?"yarn":"npm"}function u2(){return["bun","pnpm","yarn","npm"].filter(Aa)}async function Or(r,e){let t=N4(r,e),{mergedOptions:s,packages:i}=t,{cwd:n=process.cwd(),flags:o=[],task:a}=s,c=s.packageManager??Ge(),l=[],u=Array.isArray(i)?i:[i];c==="bun"&&(u=u.map(d=>d.replace("git+ssh://",""))),c==="pnpm"&&(l.push("--config.engine-strict=false"),l.push("--no-frozen-lockfile")),["yarn","npm"].includes(c)&&l.push("--ignore-engines");let h=u.length?c==="npm"?["install",...o,...l,...u]:["add",...o,...l,...u]:["install",...l];await Ar(c,h,{cwd:n,task:a})}async function h2(r){let e=["-g"],t=[...r.flags??[],...e];await Or({...r,flags:t,packageManager:r.packageManager??Ge()})}function f2(r,e,t){let{args:s,mergedOptions:i}=p2(e??[],t),n=i.manager??Ge(),{command:o,args:a}=d2(n);(0,a2.execaSync)(o,[...a,r,...s],{cwd:i.cwd??(0,eh.cwd)(),stdio:"inherit",preferLocal:!0})}async function Wt(r,e,t){let{args:s,mergedOptions:i}=p2(e??[],t),n=i.manager??Ge(),{command:o,args:a}=d2(n);await Ar(o,[...a,r,...s],i)}async function Ta(r,e){let{script:t,mergedOptions:s}=L4(r,e),i=s.packageManager??Ge();await Ar(i,["run",t,...s.args??[]],{cwd:s.cwd??(0,eh.cwd)(),task:s.task})}function d2(r){let t={bun:"bunx",pnpm:"npx",yarn:"npx",npm:"npx"}[r];if(!t)throw new Error(`No executor found for the detected package manager: ${r}`);let[s,...i]=t.split(" ");return{command:s,args:i}}function N4(r,e){return Array.isArray(r)?{packages:r,mergedOptions:{...e,packages:r}}:{packages:r.packages??[],mergedOptions:r}}function p2(r,e){return Array.isArray(r)?{args:r,mergedOptions:e??{}}:{args:[],mergedOptions:r}}function L4(r,e){return typeof r=="string"?{script:r,mergedOptions:e??{}}:{script:r.script,mergedOptions:r}}function U4(r){let e=r.split(/\s+/),t=e[0],s=e.slice(1);if(t==="pf"){t=process.argv[1];let i=s.filter(o=>o.startsWith("-"));s=[...s.filter(o=>!o.startsWith("-")),...i]}return{executable:t,args:s}}async function W4(r,e){try{let{executable:t,args:s}=U4(r.command);return await Ar(t,s,{cwd:e,shell:!1}),{command:r.command,success:!0}}catch(t){return{command:r.command,success:!1,error:t instanceof Error?t.message:String(t)}}}async function m2(r,e){let t=[];for(let s of r){let i=await W4(s,e);if(t.push(i),!i.success)break}return t}function x2(r){let e=[/^pf\s+new\s+/,/^pf\s+add\s+/,/^bun\s+pf\s+new\s+/,/^bun\s+pf\s+add\s+/];return r.filter(t=>e.some(s=>s.test(t.command)))}function g2(r){for(let e of r){let t=e.command.match(/(?:bun\s+)?pf\s+new\s+\S+\s+(\S+)/);if(t)return t[1]}return null}var hs=require("node:fs"),Fa=require("node:path");function b2(r,e){let t={written:[],skipped:[],failed:[]};for(let s of r){let i=(0,Fa.join)(e.baseDir,s.path);try{if((0,hs.existsSync)(i)&&!e.overwrite){t.skipped.push(s.path);continue}if(e.dryRun){t.written.push(s.path);continue}let n=(0,Fa.dirname)(i);(0,hs.existsSync)(n)||(0,hs.mkdirSync)(n,{recursive:!0}),(0,hs.writeFileSync)(i,s.content,"utf-8"),t.written.push(s.path)}catch(n){t.failed.push({path:s.path,error:n.message})}}return t}var q4=[/####\s+`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/\*\*(?:File|Datei):?\*\*\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/(?:File|Datei):?\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/`([^\s`]+\.[a-z]+)`[:\s]*\n+```(\w+)?\n([\s\S]*?)```/gi],V4=/```(\w+)?\n([\s\S]*?)```/g;function H4(r,e,t){let s=[[/new Hono\(\)/i,"src/index.ts"],[/@Module\(/i,"src/app.module.ts"],[/@Controller\(/i,"src/app.controller.ts"],[/@Injectable\(/i,"src/app.service.ts"],[/NestFactory\.create/i,"src/main.ts"],[/"name":\s*"[^"]+"/i,"package.json"],[/^FROM\s+/im,"Dockerfile"],[/"compilerOptions"/i,"tsconfig.json"],[/^[A-Z_]+=.+$/m,".env"]];for(let[o,a]of s)if(o.test(r))return a;let n={typescript:"ts",ts:"ts",javascript:"js",js:"js",json:"json",toml:"toml",yaml:"yaml",yml:"yml",plaintext:"txt",env:"env",dockerfile:""}[e?.toLowerCase()||"ts"]??"ts";return n?`src/file-${t+1}.${n}`:null}function G4(r){let e=[],t=/```commands?\n([\s\S]*?)```/gi,s=[...r.matchAll(t)];for(let i of s){let o=i[1].trim().split(`
112
+ `);r=e}return r}function Q0(){let r=Ut(),e=(0,nr.join)(r,"package.json"),s=JSON.parse((0,Fr.readFileSync)(e,"utf-8")).name;return s.startsWith("@")?s.split("/")[0]:`@${s}`}function ls(r,e,t=process.cwd()){let s=(0,nr.join)(t,"package.json"),i=(0,mi.readJsonSync)(s);j4(i,r,e),(0,mi.writeJsonSync)(s,i,{spaces:2,EOL:`
113
+ `,encoding:"utf-8"})}function j4(r,e,t){let s=e.split("."),i=r;for(let n=0;n<s.length-1;n++){let o=s[n];(!(o in i)||typeof i[o]!="object"||i[o]===null)&&(i[o]={}),i=i[o]}i[s[s.length-1]]=t}var xi=r=>{let e=Vg();return(0,mi.readJSONSync)((0,nr.resolve)(e,r),{encoding:"utf-8"})},Or=xi("package.json");var Aa=r=>mn(r);function c2(r){let e=(0,o2.join)(Mn(),"node_modules",r);return(0,us.existsSync)(e)}var l2=r=>Object.keys(Or.scripts??{}).includes(r);function th(){if((0,us.existsSync)("bun.lock")||(0,us.existsSync)("bun.lockb"))return"bun";if((0,us.existsSync)("pnpm-lock.yaml"))return"pnpm";if((0,us.existsSync)("yarn.lock"))return"yarn";if((0,us.existsSync)("package-lock.json"))return"npm"}function Ge(){return th()??rh()}function rh(){return Aa("bun")?"bun":Aa("pnpm")?"pnpm":Aa("yarn")?"yarn":"npm"}function u2(){return["bun","pnpm","yarn","npm"].filter(Aa)}async function Ir(r,e){let t=N4(r,e),{mergedOptions:s,packages:i}=t,{cwd:n=process.cwd(),flags:o=[],task:a}=s,c=s.packageManager??Ge(),l=[],u=Array.isArray(i)?i:[i];c==="bun"&&(u=u.map(d=>d.replace("git+ssh://",""))),c==="pnpm"&&(l.push("--config.engine-strict=false"),l.push("--no-frozen-lockfile")),["yarn","npm"].includes(c)&&l.push("--ignore-engines");let h=u.length?c==="npm"?["install",...o,...l,...u]:["add",...o,...l,...u]:["install",...l];await Tr(c,h,{cwd:n,task:a})}async function h2(r){let e=["-g"],t=[...r.flags??[],...e];await Ir({...r,flags:t,packageManager:r.packageManager??Ge()})}function f2(r,e,t){let{args:s,mergedOptions:i}=p2(e??[],t),n=i.manager??Ge(),{command:o,args:a}=d2(n);(0,a2.execaSync)(o,[...a,r,...s],{cwd:i.cwd??(0,eh.cwd)(),stdio:"inherit",preferLocal:!0})}async function Wt(r,e,t){let{args:s,mergedOptions:i}=p2(e??[],t),n=i.manager??Ge(),{command:o,args:a}=d2(n);await Tr(o,[...a,r,...s],i)}async function Ta(r,e){let{script:t,mergedOptions:s}=L4(r,e),i=s.packageManager??Ge();await Tr(i,["run",t,...s.args??[]],{cwd:s.cwd??(0,eh.cwd)(),task:s.task})}function d2(r){let t={bun:"bunx",pnpm:"npx",yarn:"npx",npm:"npx"}[r];if(!t)throw new Error(`No executor found for the detected package manager: ${r}`);let[s,...i]=t.split(" ");return{command:s,args:i}}function N4(r,e){return Array.isArray(r)?{packages:r,mergedOptions:{...e,packages:r}}:{packages:r.packages??[],mergedOptions:r}}function p2(r,e){return Array.isArray(r)?{args:r,mergedOptions:e??{}}:{args:[],mergedOptions:r}}function L4(r,e){return typeof r=="string"?{script:r,mergedOptions:e??{}}:{script:r.script,mergedOptions:r}}function U4(r){let e=r.split(/\s+/),t=e[0],s=e.slice(1);if(t==="pf"){t=process.argv[1];let i=s.filter(o=>o.startsWith("-"));s=[...s.filter(o=>!o.startsWith("-")),...i]}return{executable:t,args:s}}async function W4(r,e){try{let{executable:t,args:s}=U4(r.command);return await Tr(t,s,{cwd:e,shell:!1}),{command:r.command,success:!0}}catch(t){return{command:r.command,success:!1,error:t instanceof Error?t.message:String(t)}}}async function m2(r,e){let t=[];for(let s of r){let i=await W4(s,e);if(t.push(i),!i.success)break}return t}function x2(r){let e=[/^pf\s+new\s+/,/^pf\s+add\s+/,/^bun\s+pf\s+new\s+/,/^bun\s+pf\s+add\s+/];return r.filter(t=>e.some(s=>s.test(t.command)))}function g2(r){for(let e of r){let t=e.command.match(/(?:bun\s+)?pf\s+new\s+\S+\s+(\S+)/);if(t)return t[1]}return null}var hs=require("node:fs"),Fa=require("node:path");function b2(r,e){let t={written:[],skipped:[],failed:[]};for(let s of r){let i=(0,Fa.join)(e.baseDir,s.path);try{if((0,hs.existsSync)(i)&&!e.overwrite){t.skipped.push(s.path);continue}if(e.dryRun){t.written.push(s.path);continue}let n=(0,Fa.dirname)(i);(0,hs.existsSync)(n)||(0,hs.mkdirSync)(n,{recursive:!0}),(0,hs.writeFileSync)(i,s.content,"utf-8"),t.written.push(s.path)}catch(n){t.failed.push({path:s.path,error:n.message})}}return t}var q4=[/####\s+`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/\*\*(?:File|Datei):?\*\*\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/(?:File|Datei):?\s*`?([^\s`\n]+\.[a-z]+)`?\s*\n+```(\w+)?\n([\s\S]*?)```/gi,/`([^\s`]+\.[a-z]+)`[:\s]*\n+```(\w+)?\n([\s\S]*?)```/gi],V4=/```(\w+)?\n([\s\S]*?)```/g;function H4(r,e,t){let s=[[/new Hono\(\)/i,"src/index.ts"],[/@Module\(/i,"src/app.module.ts"],[/@Controller\(/i,"src/app.controller.ts"],[/@Injectable\(/i,"src/app.service.ts"],[/NestFactory\.create/i,"src/main.ts"],[/"name":\s*"[^"]+"/i,"package.json"],[/^FROM\s+/im,"Dockerfile"],[/"compilerOptions"/i,"tsconfig.json"],[/^[A-Z_]+=.+$/m,".env"]];for(let[o,a]of s)if(o.test(r))return a;let n={typescript:"ts",ts:"ts",javascript:"js",js:"js",json:"json",toml:"toml",yaml:"yaml",yml:"yml",plaintext:"txt",env:"env",dockerfile:""}[e?.toLowerCase()||"ts"]??"ts";return n?`src/file-${t+1}.${n}`:null}function G4(r){let e=[],t=/```commands?\n([\s\S]*?)```/gi,s=[...r.matchAll(t)];for(let i of s){let o=i[1].trim().split(`
114
114
  `).filter(a=>a.trim());for(let a of o){let c=a.trim();c&&!c.startsWith("#")&&e.push({command:c,isPfCommand:c.startsWith("pf ")||c.includes(" pf ")})}}return e}function z4(r){let e=[],t=/```(?:bash|shell|sh)\n([\s\S]*?)```/gi,s=[...r.matchAll(t)];for(let i of s){let o=i[1].trim().split(`
115
115
  `).filter(a=>a.trim());for(let a of o){let c=a.trim();c&&(c.startsWith("pf ")||c.startsWith("bun pf "))&&e.push({command:c.replace(/^bun\s+/,""),isPfCommand:!0})}}return e}function K4(r){let e=G4(r);return e.length>0?e:z4(r)}function Z4(r){let t=/```dependencies?\n([\s\S]*?)```/gi.exec(r);return t?t[1].trim().split(`
116
116
  `).filter(n=>n.trim()).map(n=>n.trim()).filter(n=>n&&!n.startsWith("#")):[]}function Y4(r,e){let t=[`${e}/`,`services/${e}/`,"./"];for(let s of t)if(r.startsWith(s))return r.slice(s.length);return r}function J4(r,e,t){let s=[];for(let i of q4){let n=[...r.matchAll(i)];for(let o of n){let[,a,c="typescript",l]=o,u=Y4(a.trim(),e);t.has(u)||(t.add(u),s.push({path:u,content:l.trim(),language:c||"typescript"}))}}return s}function X4(r,e){let t=[],s=[...r.matchAll(V4)],i=0;for(let n of s){let[,o="typescript",a]=n,c=H4(a,o,i);c&&!e.has(c)&&(e.add(c),t.push({path:c,content:a.trim(),language:o||"typescript"})),i++}return t}function Q4(r,e){let t=new Set,s=J4(r,e,t);return s.length>0?s:X4(r,t)}function y2(r,e){return{commands:K4(r),files:Q4(r,e),dependencies:Z4(r)}}function w2(r){let e=[];r.length===0&&e.push("No code files could be extracted from the AI response");let t=r.some(s=>s.path==="src/index.ts"||s.path==="src/main.ts"||s.path==="index.ts");r.length>0&&!t&&e.push("No entry point file (src/index.ts or src/main.ts) found");for(let s of r)(!s.content||s.content.trim().length===0)&&e.push(`File ${s.path} is empty`);return{valid:e.length===0,errors:e}}var e5=[".github/copilot-instructions.md","docs/copilot-instructions.md","docs/ai-guidelines.md"],D2=r=>{try{return(0,Oa.existsSync)(r)?(0,Oa.readFileSync)(r,"utf-8"):null}catch{return null}},t5=r=>{let e=(0,gi.join)(__dirname,"instructions/ai-instructions.md"),t=D2(e),s=e5.map(n=>D2((0,gi.join)(r,n))).filter(Boolean),i=[t,...s].filter(Boolean);return i.length>0?i.join(`
@@ -177,7 +177,7 @@ FORMATTING RULES:
177
177
  \u2717 Scaffolding failed: ${t.command}`)),t.error&&console.log(J.default.red(` Error: ${t.error}`)),new Error(`Command failed: ${t.command}${t.error?` - ${t.error}`:""}`);console.log(J.default.green(`\u2713 Service scaffolding complete
178
178
  `))}async function c5(r,e,t){t.stop(),console.log(J.default.cyan(`
179
179
  \u25B6 Installing ${r.length} additional ${r.length===1?"package":"packages"}...
180
- `));try{await Or({packages:r,cwd:e,flags:["--silent"]}),console.log(J.default.green(`\u2713 Installed ${r.length} ${r.length===1?"package":"packages"}
180
+ `));try{await Ir({packages:r,cwd:e,flags:["--silent"]}),console.log(J.default.green(`\u2713 Installed ${r.length} ${r.length===1?"package":"packages"}
181
181
  `))}catch(s){throw console.log(J.default.red(`\u2717 Package installation failed
182
182
  `)),s}}async function l5(r,e,t){t.start("Writing generated files...");let s=b2(r,{baseDir:e,overwrite:!0});if(s.written.length>0){t.succeed(`Created ${s.written.length} files`),console.log();for(let i of s.written)console.log(J.default.dim(` ${i}`));console.log()}else t.succeed("No files to write");if(s.written.length>0){t.start("Applying code formatting...");try{await Wt("biome",["check","--fix","--unsafe",e],{cwd:process.cwd(),quiet:!0}),t.succeed("Code formatted!")}catch{t.warn("Code formatting completed with warnings")}}}function bi(){if(!Ji())return{valid:!1,error:J.default.red.bold(`\u274C AI configuration not found.
183
183
  `)+J.default.yellow("Please run ")+J.default.cyan.bold("pf setup --ai")+J.default.yellow(` first to configure your AI provider.
@@ -189,19 +189,19 @@ Warnings:`));for(let v of x.errors)console.log(J.default.yellow(` \u2022 ${v}`)
189
189
  `))}return m.length>0&&await c5(m,w,h),await l5(b,w,h),!0}function Pa(r,e,t){console.log(J.default.cyan.bold(`
190
190
  \u{1F916} AI-Powered Generation
191
191
  `)),console.log(J.default.dim(`Service: ${r.split("/").pop()}`)),console.log(J.default.dim(`Path: ${r}`)),console.log(J.default.dim(`Model: ${e.model}`)),console.log(J.default.dim(`Description: ${t}
192
- `))}var Ra=require("node:fs"),jn=_(require("node:path")),sh=_(require("chalk"));var E2=async r=>{await Ar("bash",["-c",`
192
+ `))}var Ra=require("node:fs"),jn=_(require("node:path")),sh=_(require("chalk"));var E2=async r=>{await Tr("bash",["-c",`
193
193
  curl -fsSL https://bun.sh/install | bash && if [ -f "$HOME/.bun/bin/bun" ]; then export PATH="$HOME/.bun/bin:$PATH"; fi
194
194
  `],{task:r,shell:!0}),await u5()},ih=()=>mn("bun"),k2=()=>m0([{label:"Bun",value:59026,color:"magenta",barColor:"magenta"},{label:"Deno",value:25335},{label:"Node.js",value:19039}],{title:'Express.js "hello world" HTTP requests per second (Linux x64)',barColor:"blackBright"}),S2=()=>m0([{label:"Bun",value:.36,color:"magenta",barColor:"magenta"},{label:"pnpm",value:6.44},{label:"npm",value:10.58},{label:"yarn",value:12.08}],{title:"Bun is an npm-compatible package manager.",unit:"s",footer:sh.default.blackBright("* Installing dependencies from cache for a Remix app."),barColor:"blackBright"}),u5=async()=>{let r='export PATH="$HOME/.bun/bin:$PATH"',e=process.env.HOME;if(!e){O.error("Could not detect $HOME environment variable. Cannot update shell config.");return}let t=[jn.default.join(e,".zshrc"),jn.default.join(e,".bashrc"),jn.default.join(e,".bash_profile")];for(let s of t)try{if(await Ra.promises.stat(s).then(()=>!0).catch(()=>!1)){(await Ra.promises.readFile(s,"utf8")).includes(r)||(await Ra.promises.appendFile(s,`
195
195
  # Added by platform installer
196
196
  ${r}
197
- `),O.log(`Added Bun path to ${jn.default.basename(s)}`));return}}catch(i){O.error(`Failed to update ${s}: ${i.message}`)}O.warn("No shell config file (.zshrc, .bashrc, .bash_profile) found. Please add the following manually:"),O.log(sh.default.cyan(r))};var Gt=_(require("chalk"));var Ma="integrations-run";var ee={};Bh(ee,{BRAND:()=>M5,DIRTY:()=>fs,EMPTY_PATH:()=>p5,INVALID:()=>P,NEVER:()=>wC,OK:()=>Oe,ParseStatus:()=>ke,Schema:()=>W,ZodAny:()=>Pr,ZodArray:()=>cr,ZodBigInt:()=>ps,ZodBoolean:()=>ms,ZodBranded:()=>Ln,ZodCatch:()=>Ss,ZodDate:()=>xs,ZodDefault:()=>ks,ZodDiscriminatedUnion:()=>Na,ZodEffects:()=>gt,ZodEnum:()=>Cs,ZodError:()=>ze,ZodFirstPartyTypeKind:()=>M,ZodFunction:()=>Ua,ZodIntersection:()=>ws,ZodIssueCode:()=>C,ZodLazy:()=>Ds,ZodLiteral:()=>vs,ZodMap:()=>Ei,ZodNaN:()=>Si,ZodNativeEnum:()=>Es,ZodNever:()=>At,ZodNull:()=>bs,ZodNullable:()=>Ht,ZodNumber:()=>ds,ZodObject:()=>Ke,ZodOptional:()=>mt,ZodParsedType:()=>S,ZodPipeline:()=>Un,ZodPromise:()=>Rr,ZodReadonly:()=>_s,ZodRecord:()=>La,ZodSchema:()=>W,ZodSet:()=>ki,ZodString:()=>Br,ZodSymbol:()=>vi,ZodTransformer:()=>gt,ZodTuple:()=>Vt,ZodType:()=>W,ZodUndefined:()=>gs,ZodUnion:()=>ys,ZodUnknown:()=>ar,ZodVoid:()=>Ci,addIssueToContext:()=>k,any:()=>H5,array:()=>Z5,bigint:()=>L5,boolean:()=>$2,coerce:()=>yC,custom:()=>P2,date:()=>U5,datetimeRegex:()=>I2,defaultErrorMap:()=>nr,discriminatedUnion:()=>Q5,effect:()=>hC,enum:()=>cC,function:()=>nC,getErrorMap:()=>yi,getParsedType:()=>qt,instanceof:()=>j5,intersection:()=>eC,isAborted:()=>$a,isAsync:()=>wi,isDirty:()=>ja,isValid:()=>Ir,late:()=>$5,lazy:()=>oC,literal:()=>aC,makeIssue:()=>Nn,map:()=>sC,nan:()=>N5,nativeEnum:()=>lC,never:()=>z5,null:()=>V5,nullable:()=>dC,number:()=>M2,object:()=>Y5,objectUtil:()=>nh,oboolean:()=>bC,onumber:()=>gC,optional:()=>fC,ostring:()=>xC,pipeline:()=>mC,preprocess:()=>pC,promise:()=>uC,quotelessJson:()=>h5,record:()=>rC,set:()=>iC,setErrorMap:()=>d5,strictObject:()=>J5,string:()=>R2,symbol:()=>W5,transformer:()=>hC,tuple:()=>tC,undefined:()=>q5,union:()=>X5,unknown:()=>G5,util:()=>q,void:()=>K5});var q;(function(r){r.assertEqual=i=>{};function e(i){}r.assertIs=e;function t(i){throw new Error}r.assertNever=t,r.arrayToEnum=i=>{let n={};for(let o of i)n[o]=o;return n},r.getValidEnumValues=i=>{let n=r.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of n)o[a]=i[a];return r.objectValues(o)},r.objectValues=i=>r.objectKeys(i).map(function(n){return i[n]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},r.find=(i,n)=>{for(let o of i)if(n(o))return o},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}r.joinValues=s,r.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(q||(q={}));var nh;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(nh||(nh={}));var S=q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qt=r=>{switch(typeof r){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(r)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(r)?S.array:r===null?S.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?S.promise:typeof Map<"u"&&r instanceof Map?S.map:typeof Set<"u"&&r instanceof Set?S.set:typeof Date<"u"&&r instanceof Date?S.date:S.object;default:return S.unknown}};var C=q.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),h5=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),ze=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},s={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let a=s,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),s}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,q.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};ze.create=r=>new ze(r);var f5=(r,e)=>{let t;switch(r.code){case C.invalid_type:r.received===S.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,q.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${q.joinValues(r.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${q.joinValues(r.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${q.joinValues(r.options)}, received '${r.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:q.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case C.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case C.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,q.assertNever(r)}return{message:t}},nr=f5;var _2=nr;function d5(r){_2=r}function yi(){return _2}var Nn=r=>{let{data:e,path:t,errorMaps:s,issueData:i}=r,n=[...t,...i.path||[]],o={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let a="",c=s.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:n,message:a}},p5=[];function k(r,e){let t=yi(),s=Nn({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===nr?void 0:nr].filter(i=>!!i)});r.common.issues.push(s)}var ke=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let i of t){if(i.status==="aborted")return P;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let i of t){let n=await i.key,o=await i.value;s.push({key:n,value:o})}return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let i of t){let{key:n,value:o}=i;if(n.status==="aborted"||o.status==="aborted")return P;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(s[n.value]=o.value)}return{status:e.value,value:s}}},P=Object.freeze({status:"aborted"}),fs=r=>({status:"dirty",value:r}),Oe=r=>({status:"valid",value:r}),$a=r=>r.status==="aborted",ja=r=>r.status==="dirty",Ir=r=>r.status==="valid",wi=r=>typeof Promise<"u"&&r instanceof Promise;var F;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(F||(F={}));var xt=class{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},A2=(r,e)=>{if(Ir(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ze(r.common.issues);return this._error=t,this._error}}};function L(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:i}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{let{message:c}=r;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??s??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:i}}var W=class{get description(){return this._def.description}_getType(e){return qt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ke,ctx:{common:e.parent.common,data:e.data,parsedType:qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(wi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qt(e)},i=this._parseSync({data:e,path:s.path,parent:s});return A2(s,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qt(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return Ir(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Ir(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qt(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(wi(i)?i:Promise.resolve(i));return A2(s,n)}refine(e,t){let s=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,n)=>{let o=e(i),a=()=>n.addIssue({code:C.custom,...s(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof t=="function"?t(s,i):t),!1))}_refinement(e){return new gt({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return mt.create(this,this._def)}nullable(){return Ht.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return cr.create(this)}promise(){return Rr.create(this,this._def)}or(e){return ys.create([this,e],this._def)}and(e){return ws.create(this,e,this._def)}transform(e){return new gt({...L(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ks({...L(this._def),innerType:this,defaultValue:t,typeName:M.ZodDefault})}brand(){return new Ln({typeName:M.ZodBranded,type:this,...L(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ss({...L(this._def),innerType:this,catchValue:t,typeName:M.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Un.create(this,e)}readonly(){return _s.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},m5=/^c[^\s-]{8,}$/i,x5=/^[0-9a-z]+$/,g5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,b5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y5=/^[a-z0-9_-]{21}$/i,w5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,v5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,C5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",oh,E5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,k5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,S5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,F2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F5=new RegExp(`^${F2}$`);function O2(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function O5(r){return new RegExp(`^${O2(r)}$`)}function I2(r){let e=`${F2}T${O2(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function I5(r,e){return!!((e==="v4"||!e)&&E5.test(r)||(e==="v6"||!e)&&S5.test(r))}function B5(r,e){if(!w5.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function P5(r,e){return!!((e==="v4"||!e)&&k5.test(r)||(e==="v6"||!e)&&_5.test(r))}var Br=class r extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_type,expected:S.string,received:n.parsedType}),P}let s=new ke,i;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?k(i,{code:C.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&k(i,{code:C.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")v5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"email",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")oh||(oh=new RegExp(C5,"u")),oh.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"emoji",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")b5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"uuid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")y5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"nanoid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")m5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cuid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")x5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cuid2",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")g5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"ulid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),k(i,{validation:"url",code:C.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"regex",code:C.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?I2(n).test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?F5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?O5(n).test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?D5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"duration",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?I5(e.data,n.version)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"ip",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?B5(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"jwt",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?P5(e.data,n.version)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cidr",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?A5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"base64",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?T5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"base64url",code:C.invalid_string,message:n.message}),s.dirty()):q.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(i=>e.test(i),{validation:t,code:C.invalid_string,...F.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...F.errToObj(e)})}url(e){return this._addCheck({kind:"url",...F.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...F.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...F.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...F.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...F.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...F.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...F.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...F.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...F.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...F.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...F.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...F.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...F.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...F.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...F.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...F.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...F.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...F.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...F.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...F.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...F.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...F.errToObj(t)})}nonempty(e){return this.min(1,F.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Br.create=r=>new Br({checks:[],typeName:M.ZodString,coerce:r?.coerce??!1,...L(r)});function R5(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=t>s?t:s,n=Number.parseInt(r.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return n%o/10**i}var ds=class r extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_type,expected:S.number,received:n.parsedType}),P}let s,i=new ke;for(let n of this._def.checks)n.kind==="int"?q.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),k(s,{code:C.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?R5(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),k(s,{code:C.not_finite,message:n.message}),i.dirty()):q.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,s,i){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:F.toString(i)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:F.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:F.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&q.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};ds.create=r=>new ds({checks:[],typeName:M.ZodNumber,coerce:r?.coerce||!1,...L(r)});var ps=class r extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let s,i=new ke;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):q.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return k(t,{code:C.invalid_type,expected:S.bigint,received:t.parsedType}),P}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,s,i){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:F.toString(i)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ps.create=r=>new ps({checks:[],typeName:M.ZodBigInt,coerce:r?.coerce??!1,...L(r)});var ms=class extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.boolean,received:s.parsedType}),P}return Oe(e.data)}};ms.create=r=>new ms({typeName:M.ZodBoolean,coerce:r?.coerce||!1,...L(r)});var xs=class r extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_type,expected:S.date,received:n.parsedType}),P}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_date}),P}let s=new ke,i;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):q.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:F.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:F.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};xs.create=r=>new xs({checks:[],coerce:r?.coerce||!1,typeName:M.ZodDate,...L(r)});var vi=class extends W{_parse(e){if(this._getType(e)!==S.symbol){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.symbol,received:s.parsedType}),P}return Oe(e.data)}};vi.create=r=>new vi({typeName:M.ZodSymbol,...L(r)});var gs=class extends W{_parse(e){if(this._getType(e)!==S.undefined){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.undefined,received:s.parsedType}),P}return Oe(e.data)}};gs.create=r=>new gs({typeName:M.ZodUndefined,...L(r)});var bs=class extends W{_parse(e){if(this._getType(e)!==S.null){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.null,received:s.parsedType}),P}return Oe(e.data)}};bs.create=r=>new bs({typeName:M.ZodNull,...L(r)});var Pr=class extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return Oe(e.data)}};Pr.create=r=>new Pr({typeName:M.ZodAny,...L(r)});var ar=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Oe(e.data)}};ar.create=r=>new ar({typeName:M.ZodUnknown,...L(r)});var At=class extends W{_parse(e){let t=this._getOrReturnCtx(e);return k(t,{code:C.invalid_type,expected:S.never,received:t.parsedType}),P}};At.create=r=>new At({typeName:M.ZodNever,...L(r)});var Ci=class extends W{_parse(e){if(this._getType(e)!==S.undefined){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.void,received:s.parsedType}),P}return Oe(e.data)}};Ci.create=r=>new Ci({typeName:M.ZodVoid,...L(r)});var cr=class r extends W{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==S.array)return k(t,{code:C.invalid_type,expected:S.array,received:t.parsedType}),P;if(i.exactLength!==null){let o=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(o||a)&&(k(t,{code:o?C.too_big:C.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(k(t,{code:C.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(k(t,{code:C.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>i.type._parseAsync(new xt(t,o,t.path,a)))).then(o=>ke.mergeArray(s,o));let n=[...t.data].map((o,a)=>i.type._parseSync(new xt(t,o,t.path,a)));return ke.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:F.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:F.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:F.toString(t)}})}nonempty(e){return this.min(1,e)}};cr.create=(r,e)=>new cr({type:r,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...L(e)});function Di(r){if(r instanceof Ke){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=mt.create(Di(s))}return new Ke({...r._def,shape:()=>e})}else return r instanceof cr?new cr({...r._def,type:Di(r.element)}):r instanceof mt?mt.create(Di(r.unwrap())):r instanceof Ht?Ht.create(Di(r.unwrap())):r instanceof Vt?Vt.create(r.items.map(e=>Di(e))):r}var Ke=class r extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=q.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==S.object){let l=this._getOrReturnCtx(e);return k(l,{code:C.invalid_type,expected:S.object,received:l.parsedType}),P}let{status:s,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof At&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let u=n[l],h=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new xt(i,h,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof At){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(k(i,{code:C.unrecognized_keys,keys:a}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let h=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new xt(i,h,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let h=await u.key,d=await u.value;l.push({key:h,value:d,alwaysSet:u.alwaysSet})}return l}).then(l=>ke.mergeObjectSync(s,l)):ke.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return F.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let i=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:F.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:M.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let s of q.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let s of q.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}deepPartial(){return Di(this)}partial(e){let t={};for(let s of q.objectKeys(this.shape)){let i=this.shape[s];e&&!e[s]?t[s]=i:t[s]=i.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let s of q.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof mt;)n=n._def.innerType;t[s]=n}return new r({...this._def,shape:()=>t})}keyof(){return B2(q.objectKeys(this.shape))}};Ke.create=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strip",catchall:At.create(),typeName:M.ZodObject,...L(e)});Ke.strictCreate=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strict",catchall:At.create(),typeName:M.ZodObject,...L(e)});Ke.lazycreate=(r,e)=>new Ke({shape:r,unknownKeys:"strip",catchall:At.create(),typeName:M.ZodObject,...L(e)});var ys=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function i(n){for(let a of n)if(a.result.status==="valid")return a.result;for(let a of n)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=n.map(a=>new ze(a.ctx.common.issues));return k(t,{code:C.invalid_union,unionErrors:o}),P}if(t.common.async)return Promise.all(s.map(async n=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let n,o=[];for(let c of s){let l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let a=o.map(c=>new ze(c));return k(t,{code:C.invalid_union,unionErrors:a}),P}}get options(){return this._def.options}};ys.create=(r,e)=>new ys({options:r,typeName:M.ZodUnion,...L(e)});var or=r=>r instanceof Ds?or(r.schema):r instanceof gt?or(r.innerType()):r instanceof vs?[r.value]:r instanceof Cs?r.options:r instanceof Es?q.objectValues(r.enum):r instanceof ks?or(r._def.innerType):r instanceof gs?[void 0]:r instanceof bs?[null]:r instanceof mt?[void 0,...or(r.unwrap())]:r instanceof Ht?[null,...or(r.unwrap())]:r instanceof Ln||r instanceof _s?or(r.unwrap()):r instanceof Ss?or(r._def.innerType):[],Na=class r extends W{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return k(t,{code:C.invalid_type,expected:S.object,received:t.parsedType}),P;let s=this.discriminator,i=t.data[s],n=this.optionsMap.get(i);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(k(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let i=new Map;for(let n of t){let o=or(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,n)}}return new r({typeName:M.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...L(s)})}};function ah(r,e){let t=qt(r),s=qt(e);if(r===e)return{valid:!0,data:r};if(t===S.object&&s===S.object){let i=q.objectKeys(e),n=q.objectKeys(r).filter(a=>i.indexOf(a)!==-1),o={...r,...e};for(let a of n){let c=ah(r[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(t===S.array&&s===S.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let n=0;n<r.length;n++){let o=r[n],a=e[n],c=ah(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return t===S.date&&s===S.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var ws=class extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),i=(n,o)=>{if($a(n)||$a(o))return P;let a=ah(n.value,o.value);return a.valid?((ja(n)||ja(o))&&t.dirty(),{status:t.value,value:a.data}):(k(s,{code:C.invalid_intersection_types}),P)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,o])=>i(n,o)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};ws.create=(r,e,t)=>new ws({left:r,right:e,typeName:M.ZodIntersection,...L(t)});var Vt=class r extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.array)return k(s,{code:C.invalid_type,expected:S.array,received:s.parsedType}),P;if(s.data.length<this._def.items.length)return k(s,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&s.data.length>this._def.items.length&&(k(s,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new xt(s,o,s.path,a)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>ke.mergeArray(t,o)):ke.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};Vt.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vt({items:r,typeName:M.ZodTuple,rest:null,...L(e)})};var La=class r extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.object)return k(s,{code:C.invalid_type,expected:S.object,received:s.parsedType}),P;let i=[],n=this._def.keyType,o=this._def.valueType;for(let a in s.data)i.push({key:n._parse(new xt(s,a,s.path,a)),value:o._parse(new xt(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?ke.mergeObjectAsync(t,i):ke.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof W?new r({keyType:e,valueType:t,typeName:M.ZodRecord,...L(s)}):new r({keyType:Br.create(),valueType:e,typeName:M.ZodRecord,...L(t)})}},Ei=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.map)return k(s,{code:C.invalid_type,expected:S.map,received:s.parsedType}),P;let i=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([a,c],l)=>({key:i._parse(new xt(s,a,s.path,[l,"key"])),value:n._parse(new xt(s,c,s.path,[l,"value"]))}));if(s.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return P;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return P;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}}}};Ei.create=(r,e,t)=>new Ei({valueType:e,keyType:r,typeName:M.ZodMap,...L(t)});var ki=class r extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.set)return k(s,{code:C.invalid_type,expected:S.set,received:s.parsedType}),P;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(k(s,{code:C.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(k(s,{code:C.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let n=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return P;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}let a=[...s.data.values()].map((c,l)=>n._parse(new xt(s,c,s.path,l)));return s.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,t){return new r({...this._def,minSize:{value:e,message:F.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:F.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ki.create=(r,e)=>new ki({valueType:r,minSize:null,maxSize:null,typeName:M.ZodSet,...L(e)});var Ua=class r extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return k(t,{code:C.invalid_type,expected:S.function,received:t.parsedType}),P;function s(a,c){return Nn({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yi(),nr].filter(l=>!!l),issueData:{code:C.invalid_arguments,argumentsError:c}})}function i(a,c){return Nn({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yi(),nr].filter(l=>!!l),issueData:{code:C.invalid_return_type,returnTypeError:c}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Rr){let a=this;return Oe(async function(...c){let l=new ze([]),u=await a._def.args.parseAsync(c,n).catch(f=>{throw l.addIssue(s(c,f)),l}),h=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(h,n).catch(f=>{throw l.addIssue(i(h,f)),l})})}else{let a=this;return Oe(function(...c){let l=a._def.args.safeParse(c,n);if(!l.success)throw new ze([s(c,l.error)]);let u=Reflect.apply(o,this,l.data),h=a._def.returns.safeParse(u,n);if(!h.success)throw new ze([i(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:Vt.create(e).rest(ar.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||Vt.create([]).rest(ar.create()),returns:t||ar.create(),typeName:M.ZodFunction,...L(s)})}},Ds=class extends W{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ds.create=(r,e)=>new Ds({getter:r,typeName:M.ZodLazy,...L(e)});var vs=class extends W{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}};vs.create=(r,e)=>new vs({value:r,typeName:M.ZodLiteral,...L(e)});function B2(r,e){return new Cs({values:r,typeName:M.ZodEnum,...L(e)})}var Cs=class r extends W{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return k(t,{expected:q.joinValues(s),received:t.parsedType,code:C.invalid_type}),P}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return k(t,{received:t.data,code:C.invalid_enum_value,options:s}),P}return Oe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};Cs.create=B2;var Es=class extends W{_parse(e){let t=q.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==S.string&&s.parsedType!==S.number){let i=q.objectValues(t);return k(s,{expected:q.joinValues(i),received:s.parsedType,code:C.invalid_type}),P}if(this._cache||(this._cache=new Set(q.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=q.objectValues(t);return k(s,{received:s.data,code:C.invalid_enum_value,options:i}),P}return Oe(e.data)}get enum(){return this._def.values}};Es.create=(r,e)=>new Es({values:r,typeName:M.ZodNativeEnum,...L(e)});var Rr=class extends W{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return k(t,{code:C.invalid_type,expected:S.promise,received:t.parsedType}),P;let s=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return Oe(s.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Rr.create=(r,e)=>new Rr({type:r,typeName:M.ZodPromise,...L(e)});var gt=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:o=>{k(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(s.data,n);if(s.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return P;let c=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return c.status==="aborted"?P:c.status==="dirty"?fs(c.value):t.value==="dirty"?fs(c.value):c});{if(t.value==="aborted")return P;let a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?P:a.status==="dirty"?fs(a.value):t.value==="dirty"?fs(a.value):a}}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){let a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?P:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?P:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ir(o))return P;let a=i.transform(o.value,n);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Ir(o)?Promise.resolve(i.transform(o.value,n)).then(a=>({status:t.value,value:a})):P);q.assertNever(i)}};gt.create=(r,e,t)=>new gt({schema:r,typeName:M.ZodEffects,effect:e,...L(t)});gt.createWithPreprocess=(r,e,t)=>new gt({schema:e,effect:{type:"preprocess",transform:r},typeName:M.ZodEffects,...L(t)});var mt=class extends W{_parse(e){return this._getType(e)===S.undefined?Oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mt.create=(r,e)=>new mt({innerType:r,typeName:M.ZodOptional,...L(e)});var Ht=class extends W{_parse(e){return this._getType(e)===S.null?Oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ht.create=(r,e)=>new Ht({innerType:r,typeName:M.ZodNullable,...L(e)});var ks=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===S.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ks.create=(r,e)=>new ks({innerType:r,typeName:M.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});var Ss=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return wi(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ze(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ze(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Ss.create=(r,e)=>new Ss({innerType:r,typeName:M.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});var Si=class extends W{_parse(e){if(this._getType(e)!==S.nan){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.nan,received:s.parsedType}),P}return{status:"valid",value:e.data}}};Si.create=r=>new Si({typeName:M.ZodNaN,...L(r)});var M5=Symbol("zod_brand"),Ln=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Un=class r extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?P:n.status==="dirty"?(t.dirty(),fs(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?P:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:M.ZodPipeline})}},_s=class extends W{_parse(e){let t=this._def.innerType._parse(e),s=i=>(Ir(i)&&(i.value=Object.freeze(i.value)),i);return wi(t)?t.then(i=>s(i)):s(t)}unwrap(){return this._def.innerType}};_s.create=(r,e)=>new _s({innerType:r,typeName:M.ZodReadonly,...L(e)});function T2(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function P2(r,e={},t){return r?Pr.create().superRefine((s,i)=>{let n=r(s);if(n instanceof Promise)return n.then(o=>{if(!o){let a=T2(e,s),c=a.fatal??t??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!n){let o=T2(e,s),a=o.fatal??t??!0;i.addIssue({code:"custom",...o,fatal:a})}}):Pr.create()}var $5={object:Ke.lazycreate},M;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(M||(M={}));var j5=(r,e={message:`Input not instance of ${r.name}`})=>P2(t=>t instanceof r,e),R2=Br.create,M2=ds.create,N5=Si.create,L5=ps.create,$2=ms.create,U5=xs.create,W5=vi.create,q5=gs.create,V5=bs.create,H5=Pr.create,G5=ar.create,z5=At.create,K5=Ci.create,Z5=cr.create,Y5=Ke.create,J5=Ke.strictCreate,X5=ys.create,Q5=Na.create,eC=ws.create,tC=Vt.create,rC=La.create,sC=Ei.create,iC=ki.create,nC=Ua.create,oC=Ds.create,aC=vs.create,cC=Cs.create,lC=Es.create,uC=Rr.create,hC=gt.create,fC=mt.create,dC=Ht.create,pC=gt.createWithPreprocess,mC=Un.create,xC=()=>R2().optional(),gC=()=>M2().optional(),bC=()=>$2().optional(),yC={string:(r=>Br.create({...r,coerce:!0})),number:(r=>ds.create({...r,coerce:!0})),boolean:(r=>ms.create({...r,coerce:!0})),bigint:(r=>ps.create({...r,coerce:!0})),date:(r=>xs.create({...r,coerce:!0}))};var wC=P;var DC=ee.object({name:ee.string(),description:ee.string(),link:ee.string().url().optional(),install:ee.union([ee.string(),ee.array(ee.string())]).transform(r=>Array.isArray(r)?r:[r]),installFlags:ee.array(ee.string()).optional(),run:ee.array(ee.string()).optional(),initial:ee.boolean().optional(),interactive:ee.boolean().optional()}),j2=ee.array(DC);var N2=r=>{try{return j2.parse(r)}catch(e){throw new Error(e.issues.map(t=>` - Path ${t.path.join(". ")} : ${t.message}`).join(`
197
+ `),O.log(`Added Bun path to ${jn.default.basename(s)}`));return}}catch(i){O.error(`Failed to update ${s}: ${i.message}`)}O.warn("No shell config file (.zshrc, .bashrc, .bash_profile) found. Please add the following manually:"),O.log(sh.default.cyan(r))};var Gt=_(require("chalk"));var Ma="integrations-run";var ee={};Bh(ee,{BRAND:()=>M5,DIRTY:()=>fs,EMPTY_PATH:()=>p5,INVALID:()=>P,NEVER:()=>wC,OK:()=>Oe,ParseStatus:()=>ke,Schema:()=>W,ZodAny:()=>Rr,ZodArray:()=>lr,ZodBigInt:()=>ps,ZodBoolean:()=>ms,ZodBranded:()=>Ln,ZodCatch:()=>Ss,ZodDate:()=>xs,ZodDefault:()=>ks,ZodDiscriminatedUnion:()=>Na,ZodEffects:()=>gt,ZodEnum:()=>Cs,ZodError:()=>ze,ZodFirstPartyTypeKind:()=>M,ZodFunction:()=>Ua,ZodIntersection:()=>ws,ZodIssueCode:()=>C,ZodLazy:()=>Ds,ZodLiteral:()=>vs,ZodMap:()=>Ei,ZodNaN:()=>Si,ZodNativeEnum:()=>Es,ZodNever:()=>At,ZodNull:()=>bs,ZodNullable:()=>Ht,ZodNumber:()=>ds,ZodObject:()=>Ke,ZodOptional:()=>mt,ZodParsedType:()=>S,ZodPipeline:()=>Un,ZodPromise:()=>Mr,ZodReadonly:()=>_s,ZodRecord:()=>La,ZodSchema:()=>W,ZodSet:()=>ki,ZodString:()=>Pr,ZodSymbol:()=>vi,ZodTransformer:()=>gt,ZodTuple:()=>Vt,ZodType:()=>W,ZodUndefined:()=>gs,ZodUnion:()=>ys,ZodUnknown:()=>cr,ZodVoid:()=>Ci,addIssueToContext:()=>k,any:()=>H5,array:()=>Z5,bigint:()=>L5,boolean:()=>$2,coerce:()=>yC,custom:()=>P2,date:()=>U5,datetimeRegex:()=>I2,defaultErrorMap:()=>or,discriminatedUnion:()=>Q5,effect:()=>hC,enum:()=>cC,function:()=>nC,getErrorMap:()=>yi,getParsedType:()=>qt,instanceof:()=>j5,intersection:()=>eC,isAborted:()=>$a,isAsync:()=>wi,isDirty:()=>ja,isValid:()=>Br,late:()=>$5,lazy:()=>oC,literal:()=>aC,makeIssue:()=>Nn,map:()=>sC,nan:()=>N5,nativeEnum:()=>lC,never:()=>z5,null:()=>V5,nullable:()=>dC,number:()=>M2,object:()=>Y5,objectUtil:()=>nh,oboolean:()=>bC,onumber:()=>gC,optional:()=>fC,ostring:()=>xC,pipeline:()=>mC,preprocess:()=>pC,promise:()=>uC,quotelessJson:()=>h5,record:()=>rC,set:()=>iC,setErrorMap:()=>d5,strictObject:()=>J5,string:()=>R2,symbol:()=>W5,transformer:()=>hC,tuple:()=>tC,undefined:()=>q5,union:()=>X5,unknown:()=>G5,util:()=>q,void:()=>K5});var q;(function(r){r.assertEqual=i=>{};function e(i){}r.assertIs=e;function t(i){throw new Error}r.assertNever=t,r.arrayToEnum=i=>{let n={};for(let o of i)n[o]=o;return n},r.getValidEnumValues=i=>{let n=r.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),o={};for(let a of n)o[a]=i[a];return r.objectValues(o)},r.objectValues=i=>r.objectKeys(i).map(function(n){return i[n]}),r.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let n=[];for(let o in i)Object.prototype.hasOwnProperty.call(i,o)&&n.push(o);return n},r.find=(i,n)=>{for(let o of i)if(n(o))return o},r.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,n=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}r.joinValues=s,r.jsonStringifyReplacer=(i,n)=>typeof n=="bigint"?n.toString():n})(q||(q={}));var nh;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(nh||(nh={}));var S=q.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),qt=r=>{switch(typeof r){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(r)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(r)?S.array:r===null?S.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?S.promise:typeof Map<"u"&&r instanceof Map?S.map:typeof Set<"u"&&r instanceof Set?S.set:typeof Date<"u"&&r instanceof Date?S.date:S.object;default:return S.unknown}};var C=q.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),h5=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),ze=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(n){return n.message},s={_errors:[]},i=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)s._errors.push(t(o));else{let a=s,c=0;for(;c<o.path.length;){let l=o.path[c];c===o.path.length-1?(a[l]=a[l]||{_errors:[]},a[l]._errors.push(t(o))):a[l]=a[l]||{_errors:[]},a=a[l],c++}}};return i(this),s}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,q.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];t[n]=t[n]||[],t[n].push(e(i))}else s.push(e(i));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};ze.create=r=>new ze(r);var f5=(r,e)=>{let t;switch(r.code){case C.invalid_type:r.received===S.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case C.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,q.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:t=`Unrecognized key(s) in object: ${q.joinValues(r.keys,", ")}`;break;case C.invalid_union:t="Invalid input";break;case C.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${q.joinValues(r.options)}`;break;case C.invalid_enum_value:t=`Invalid enum value. Expected ${q.joinValues(r.options)}, received '${r.received}'`;break;case C.invalid_arguments:t="Invalid function arguments";break;case C.invalid_return_type:t="Invalid function return type";break;case C.invalid_date:t="Invalid date";break;case C.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:q.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case C.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case C.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case C.custom:t="Invalid input";break;case C.invalid_intersection_types:t="Intersection results could not be merged";break;case C.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case C.not_finite:t="Number must be finite";break;default:t=e.defaultError,q.assertNever(r)}return{message:t}},or=f5;var _2=or;function d5(r){_2=r}function yi(){return _2}var Nn=r=>{let{data:e,path:t,errorMaps:s,issueData:i}=r,n=[...t,...i.path||[]],o={...i,path:n};if(i.message!==void 0)return{...i,path:n,message:i.message};let a="",c=s.filter(l=>!!l).slice().reverse();for(let l of c)a=l(o,{data:e,defaultError:a}).message;return{...i,path:n,message:a}},p5=[];function k(r,e){let t=yi(),s=Nn({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===or?void 0:or].filter(i=>!!i)});r.common.issues.push(s)}var ke=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let i of t){if(i.status==="aborted")return P;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let i of t){let n=await i.key,o=await i.value;s.push({key:n,value:o})}return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let i of t){let{key:n,value:o}=i;if(n.status==="aborted"||o.status==="aborted")return P;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(s[n.value]=o.value)}return{status:e.value,value:s}}},P=Object.freeze({status:"aborted"}),fs=r=>({status:"dirty",value:r}),Oe=r=>({status:"valid",value:r}),$a=r=>r.status==="aborted",ja=r=>r.status==="dirty",Br=r=>r.status==="valid",wi=r=>typeof Promise<"u"&&r instanceof Promise;var F;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(F||(F={}));var xt=class{constructor(e,t,s,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},A2=(r,e)=>{if(Br(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new ze(r.common.issues);return this._error=t,this._error}}};function L(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:i}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,a)=>{let{message:c}=r;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??s??a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:c??t??a.defaultError}},description:i}}var W=class{get description(){return this._def.description}_getType(e){return qt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ke,ctx:{common:e.parent.common,data:e.data,parsedType:qt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(wi(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){let s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qt(e)},i=this._parseSync({data:e,path:s.path,parent:s});return A2(s,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qt(e)};if(!this["~standard"].async)try{let s=this._parseSync({data:e,path:[],parent:t});return Br(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Br(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:qt(e)},i=this._parse({data:e,path:s.path,parent:s}),n=await(wi(i)?i:Promise.resolve(i));return A2(s,n)}refine(e,t){let s=i=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(i):t;return this._refinement((i,n)=>{let o=e(i),a=()=>n.addIssue({code:C.custom,...s(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(e,t){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof t=="function"?t(s,i):t),!1))}_refinement(e){return new gt({schema:this,typeName:M.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return mt.create(this,this._def)}nullable(){return Ht.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return lr.create(this)}promise(){return Mr.create(this,this._def)}or(e){return ys.create([this,e],this._def)}and(e){return ws.create(this,e,this._def)}transform(e){return new gt({...L(this._def),schema:this,typeName:M.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new ks({...L(this._def),innerType:this,defaultValue:t,typeName:M.ZodDefault})}brand(){return new Ln({typeName:M.ZodBranded,type:this,...L(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new Ss({...L(this._def),innerType:this,catchValue:t,typeName:M.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Un.create(this,e)}readonly(){return _s.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},m5=/^c[^\s-]{8,}$/i,x5=/^[0-9a-z]+$/,g5=/^[0-9A-HJKMNP-TV-Z]{26}$/i,b5=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,y5=/^[a-z0-9_-]{21}$/i,w5=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,D5=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,v5=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,C5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",oh,E5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,k5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,S5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A5=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,T5=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,F2="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",F5=new RegExp(`^${F2}$`);function O2(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function O5(r){return new RegExp(`^${O2(r)}$`)}function I2(r){let e=`${F2}T${O2(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function I5(r,e){return!!((e==="v4"||!e)&&E5.test(r)||(e==="v6"||!e)&&S5.test(r))}function B5(r,e){if(!w5.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function P5(r,e){return!!((e==="v4"||!e)&&k5.test(r)||(e==="v6"||!e)&&_5.test(r))}var Pr=class r extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_type,expected:S.string,received:n.parsedType}),P}let s=new ke,i;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="max")e.data.length>n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),s.dirty());else if(n.kind==="length"){let o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(i=this._getOrReturnCtx(e,i),o?k(i,{code:C.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&k(i,{code:C.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),s.dirty())}else if(n.kind==="email")v5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"email",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="emoji")oh||(oh=new RegExp(C5,"u")),oh.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"emoji",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="uuid")b5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"uuid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="nanoid")y5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"nanoid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid")m5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cuid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="cuid2")x5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cuid2",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="ulid")g5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"ulid",code:C.invalid_string,message:n.message}),s.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),k(i,{validation:"url",code:C.invalid_string,message:n.message}),s.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"regex",code:C.invalid_string,message:n.message}),s.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),s.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:{startsWith:n.value},message:n.message}),s.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:{endsWith:n.value},message:n.message}),s.dirty()):n.kind==="datetime"?I2(n).test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:"datetime",message:n.message}),s.dirty()):n.kind==="date"?F5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:"date",message:n.message}),s.dirty()):n.kind==="time"?O5(n).test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{code:C.invalid_string,validation:"time",message:n.message}),s.dirty()):n.kind==="duration"?D5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"duration",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="ip"?I5(e.data,n.version)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"ip",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="jwt"?B5(e.data,n.alg)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"jwt",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="cidr"?P5(e.data,n.version)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"cidr",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="base64"?A5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"base64",code:C.invalid_string,message:n.message}),s.dirty()):n.kind==="base64url"?T5.test(e.data)||(i=this._getOrReturnCtx(e,i),k(i,{validation:"base64url",code:C.invalid_string,message:n.message}),s.dirty()):q.assertNever(n);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(i=>e.test(i),{validation:t,code:C.invalid_string,...F.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...F.errToObj(e)})}url(e){return this._addCheck({kind:"url",...F.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...F.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...F.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...F.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...F.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...F.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...F.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...F.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...F.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...F.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...F.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...F.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...F.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...F.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...F.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...F.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...F.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...F.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...F.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...F.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...F.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...F.errToObj(t)})}nonempty(e){return this.min(1,F.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};Pr.create=r=>new Pr({checks:[],typeName:M.ZodString,coerce:r?.coerce??!1,...L(r)});function R5(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=t>s?t:s,n=Number.parseInt(r.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return n%o/10**i}var ds=class r extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==S.number){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_type,expected:S.number,received:n.parsedType}),P}let s,i=new ke;for(let n of this._def.checks)n.kind==="int"?q.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),k(s,{code:C.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()):n.kind==="multipleOf"?R5(e.data,n.value)!==0&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),k(s,{code:C.not_finite,message:n.message}),i.dirty()):q.assertNever(n);return{status:i.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,s,i){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:F.toString(i)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:F.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:F.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:F.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:F.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&q.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};ds.create=r=>new ds({checks:[],typeName:M.ZodNumber,coerce:r?.coerce||!1,...L(r)});var ps=class r extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==S.bigint)return this._getInvalidInput(e);let s,i=new ke;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),k(s,{code:C.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()):q.assertNever(n);return{status:i.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return k(t,{code:C.invalid_type,expected:S.bigint,received:t.parsedType}),P}gte(e,t){return this.setLimit("min",e,!0,F.toString(t))}gt(e,t){return this.setLimit("min",e,!1,F.toString(t))}lte(e,t){return this.setLimit("max",e,!0,F.toString(t))}lt(e,t){return this.setLimit("max",e,!1,F.toString(t))}setLimit(e,t,s,i){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:F.toString(i)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:F.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:F.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:F.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:F.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:F.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ps.create=r=>new ps({checks:[],typeName:M.ZodBigInt,coerce:r?.coerce??!1,...L(r)});var ms=class extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.boolean,received:s.parsedType}),P}return Oe(e.data)}};ms.create=r=>new ms({typeName:M.ZodBoolean,coerce:r?.coerce||!1,...L(r)});var xs=class r extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_type,expected:S.date,received:n.parsedType}),P}if(Number.isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return k(n,{code:C.invalid_date}),P}let s=new ke,i;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),s.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(i=this._getOrReturnCtx(e,i),k(i,{code:C.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),s.dirty()):q.assertNever(n);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:F.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:F.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};xs.create=r=>new xs({checks:[],coerce:r?.coerce||!1,typeName:M.ZodDate,...L(r)});var vi=class extends W{_parse(e){if(this._getType(e)!==S.symbol){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.symbol,received:s.parsedType}),P}return Oe(e.data)}};vi.create=r=>new vi({typeName:M.ZodSymbol,...L(r)});var gs=class extends W{_parse(e){if(this._getType(e)!==S.undefined){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.undefined,received:s.parsedType}),P}return Oe(e.data)}};gs.create=r=>new gs({typeName:M.ZodUndefined,...L(r)});var bs=class extends W{_parse(e){if(this._getType(e)!==S.null){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.null,received:s.parsedType}),P}return Oe(e.data)}};bs.create=r=>new bs({typeName:M.ZodNull,...L(r)});var Rr=class extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return Oe(e.data)}};Rr.create=r=>new Rr({typeName:M.ZodAny,...L(r)});var cr=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Oe(e.data)}};cr.create=r=>new cr({typeName:M.ZodUnknown,...L(r)});var At=class extends W{_parse(e){let t=this._getOrReturnCtx(e);return k(t,{code:C.invalid_type,expected:S.never,received:t.parsedType}),P}};At.create=r=>new At({typeName:M.ZodNever,...L(r)});var Ci=class extends W{_parse(e){if(this._getType(e)!==S.undefined){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.void,received:s.parsedType}),P}return Oe(e.data)}};Ci.create=r=>new Ci({typeName:M.ZodVoid,...L(r)});var lr=class r extends W{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),i=this._def;if(t.parsedType!==S.array)return k(t,{code:C.invalid_type,expected:S.array,received:t.parsedType}),P;if(i.exactLength!==null){let o=t.data.length>i.exactLength.value,a=t.data.length<i.exactLength.value;(o||a)&&(k(t,{code:o?C.too_big:C.too_small,minimum:a?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&t.data.length<i.minLength.value&&(k(t,{code:C.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&t.data.length>i.maxLength.value&&(k(t,{code:C.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((o,a)=>i.type._parseAsync(new xt(t,o,t.path,a)))).then(o=>ke.mergeArray(s,o));let n=[...t.data].map((o,a)=>i.type._parseSync(new xt(t,o,t.path,a)));return ke.mergeArray(s,n)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:F.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:F.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:F.toString(t)}})}nonempty(e){return this.min(1,e)}};lr.create=(r,e)=>new lr({type:r,minLength:null,maxLength:null,exactLength:null,typeName:M.ZodArray,...L(e)});function Di(r){if(r instanceof Ke){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=mt.create(Di(s))}return new Ke({...r._def,shape:()=>e})}else return r instanceof lr?new lr({...r._def,type:Di(r.element)}):r instanceof mt?mt.create(Di(r.unwrap())):r instanceof Ht?Ht.create(Di(r.unwrap())):r instanceof Vt?Vt.create(r.items.map(e=>Di(e))):r}var Ke=class r extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=q.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==S.object){let l=this._getOrReturnCtx(e);return k(l,{code:C.invalid_type,expected:S.object,received:l.parsedType}),P}let{status:s,ctx:i}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof At&&this._def.unknownKeys==="strip"))for(let l in i.data)o.includes(l)||a.push(l);let c=[];for(let l of o){let u=n[l],h=i.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new xt(i,h,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof At){let l=this._def.unknownKeys;if(l==="passthrough")for(let u of a)c.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(l==="strict")a.length>0&&(k(i,{code:C.unrecognized_keys,keys:a}),s.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let u of a){let h=i.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new xt(i,h,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let l=[];for(let u of c){let h=await u.key,d=await u.value;l.push({key:h,value:d,alwaysSet:u.alwaysSet})}return l}).then(l=>ke.mergeObjectSync(s,l)):ke.mergeObjectSync(s,c)}get shape(){return this._def.shape()}strict(e){return F.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{let i=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:F.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:M.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};for(let s of q.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}omit(e){let t={};for(let s of q.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new r({...this._def,shape:()=>t})}deepPartial(){return Di(this)}partial(e){let t={};for(let s of q.objectKeys(this.shape)){let i=this.shape[s];e&&!e[s]?t[s]=i:t[s]=i.optional()}return new r({...this._def,shape:()=>t})}required(e){let t={};for(let s of q.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let n=this.shape[s];for(;n instanceof mt;)n=n._def.innerType;t[s]=n}return new r({...this._def,shape:()=>t})}keyof(){return B2(q.objectKeys(this.shape))}};Ke.create=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strip",catchall:At.create(),typeName:M.ZodObject,...L(e)});Ke.strictCreate=(r,e)=>new Ke({shape:()=>r,unknownKeys:"strict",catchall:At.create(),typeName:M.ZodObject,...L(e)});Ke.lazycreate=(r,e)=>new Ke({shape:r,unknownKeys:"strip",catchall:At.create(),typeName:M.ZodObject,...L(e)});var ys=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function i(n){for(let a of n)if(a.result.status==="valid")return a.result;for(let a of n)if(a.result.status==="dirty")return t.common.issues.push(...a.ctx.common.issues),a.result;let o=n.map(a=>new ze(a.ctx.common.issues));return k(t,{code:C.invalid_union,unionErrors:o}),P}if(t.common.async)return Promise.all(s.map(async n=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await n._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(i);{let n,o=[];for(let c of s){let l={...t,common:{...t.common,issues:[]},parent:null},u=c._parseSync({data:t.data,path:t.path,parent:l});if(u.status==="valid")return u;u.status==="dirty"&&!n&&(n={result:u,ctx:l}),l.common.issues.length&&o.push(l.common.issues)}if(n)return t.common.issues.push(...n.ctx.common.issues),n.result;let a=o.map(c=>new ze(c));return k(t,{code:C.invalid_union,unionErrors:a}),P}}get options(){return this._def.options}};ys.create=(r,e)=>new ys({options:r,typeName:M.ZodUnion,...L(e)});var ar=r=>r instanceof Ds?ar(r.schema):r instanceof gt?ar(r.innerType()):r instanceof vs?[r.value]:r instanceof Cs?r.options:r instanceof Es?q.objectValues(r.enum):r instanceof ks?ar(r._def.innerType):r instanceof gs?[void 0]:r instanceof bs?[null]:r instanceof mt?[void 0,...ar(r.unwrap())]:r instanceof Ht?[null,...ar(r.unwrap())]:r instanceof Ln||r instanceof _s?ar(r.unwrap()):r instanceof Ss?ar(r._def.innerType):[],Na=class r extends W{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.object)return k(t,{code:C.invalid_type,expected:S.object,received:t.parsedType}),P;let s=this.discriminator,i=t.data[s],n=this.optionsMap.get(i);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(k(t,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),P)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let i=new Map;for(let n of t){let o=ar(n.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of o){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,n)}}return new r({typeName:M.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...L(s)})}};function ah(r,e){let t=qt(r),s=qt(e);if(r===e)return{valid:!0,data:r};if(t===S.object&&s===S.object){let i=q.objectKeys(e),n=q.objectKeys(r).filter(a=>i.indexOf(a)!==-1),o={...r,...e};for(let a of n){let c=ah(r[a],e[a]);if(!c.valid)return{valid:!1};o[a]=c.data}return{valid:!0,data:o}}else if(t===S.array&&s===S.array){if(r.length!==e.length)return{valid:!1};let i=[];for(let n=0;n<r.length;n++){let o=r[n],a=e[n],c=ah(o,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return t===S.date&&s===S.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var ws=class extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),i=(n,o)=>{if($a(n)||$a(o))return P;let a=ah(n.value,o.value);return a.valid?((ja(n)||ja(o))&&t.dirty(),{status:t.value,value:a.data}):(k(s,{code:C.invalid_intersection_types}),P)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([n,o])=>i(n,o)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};ws.create=(r,e,t)=>new ws({left:r,right:e,typeName:M.ZodIntersection,...L(t)});var Vt=class r extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.array)return k(s,{code:C.invalid_type,expected:S.array,received:s.parsedType}),P;if(s.data.length<this._def.items.length)return k(s,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),P;!this._def.rest&&s.data.length>this._def.items.length&&(k(s,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let n=[...s.data].map((o,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new xt(s,o,s.path,a)):null}).filter(o=>!!o);return s.common.async?Promise.all(n).then(o=>ke.mergeArray(t,o)):ke.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};Vt.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Vt({items:r,typeName:M.ZodTuple,rest:null,...L(e)})};var La=class r extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.object)return k(s,{code:C.invalid_type,expected:S.object,received:s.parsedType}),P;let i=[],n=this._def.keyType,o=this._def.valueType;for(let a in s.data)i.push({key:n._parse(new xt(s,a,s.path,a)),value:o._parse(new xt(s,s.data[a],s.path,a)),alwaysSet:a in s.data});return s.common.async?ke.mergeObjectAsync(t,i):ke.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof W?new r({keyType:e,valueType:t,typeName:M.ZodRecord,...L(s)}):new r({keyType:Pr.create(),valueType:e,typeName:M.ZodRecord,...L(t)})}},Ei=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.map)return k(s,{code:C.invalid_type,expected:S.map,received:s.parsedType}),P;let i=this._def.keyType,n=this._def.valueType,o=[...s.data.entries()].map(([a,c],l)=>({key:i._parse(new xt(s,a,s.path,[l,"key"])),value:n._parse(new xt(s,c,s.path,[l,"value"]))}));if(s.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of o){let l=await c.key,u=await c.value;if(l.status==="aborted"||u.status==="aborted")return P;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}})}else{let a=new Map;for(let c of o){let l=c.key,u=c.value;if(l.status==="aborted"||u.status==="aborted")return P;(l.status==="dirty"||u.status==="dirty")&&t.dirty(),a.set(l.value,u.value)}return{status:t.value,value:a}}}};Ei.create=(r,e,t)=>new Ei({valueType:e,keyType:r,typeName:M.ZodMap,...L(t)});var ki=class r extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==S.set)return k(s,{code:C.invalid_type,expected:S.set,received:s.parsedType}),P;let i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(k(s,{code:C.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),t.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(k(s,{code:C.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let n=this._def.valueType;function o(c){let l=new Set;for(let u of c){if(u.status==="aborted")return P;u.status==="dirty"&&t.dirty(),l.add(u.value)}return{status:t.value,value:l}}let a=[...s.data.values()].map((c,l)=>n._parse(new xt(s,c,s.path,l)));return s.common.async?Promise.all(a).then(c=>o(c)):o(a)}min(e,t){return new r({...this._def,minSize:{value:e,message:F.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:F.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ki.create=(r,e)=>new ki({valueType:r,minSize:null,maxSize:null,typeName:M.ZodSet,...L(e)});var Ua=class r extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.function)return k(t,{code:C.invalid_type,expected:S.function,received:t.parsedType}),P;function s(a,c){return Nn({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yi(),or].filter(l=>!!l),issueData:{code:C.invalid_arguments,argumentsError:c}})}function i(a,c){return Nn({data:a,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yi(),or].filter(l=>!!l),issueData:{code:C.invalid_return_type,returnTypeError:c}})}let n={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof Mr){let a=this;return Oe(async function(...c){let l=new ze([]),u=await a._def.args.parseAsync(c,n).catch(f=>{throw l.addIssue(s(c,f)),l}),h=await Reflect.apply(o,this,u);return await a._def.returns._def.type.parseAsync(h,n).catch(f=>{throw l.addIssue(i(h,f)),l})})}else{let a=this;return Oe(function(...c){let l=a._def.args.safeParse(c,n);if(!l.success)throw new ze([s(c,l.error)]);let u=Reflect.apply(o,this,l.data),h=a._def.returns.safeParse(u,n);if(!h.success)throw new ze([i(u,h.error)]);return h.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:Vt.create(e).rest(cr.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||Vt.create([]).rest(cr.create()),returns:t||cr.create(),typeName:M.ZodFunction,...L(s)})}},Ds=class extends W{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ds.create=(r,e)=>new Ds({getter:r,typeName:M.ZodLazy,...L(e)});var vs=class extends W{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:C.invalid_literal,expected:this._def.value}),P}return{status:"valid",value:e.data}}get value(){return this._def.value}};vs.create=(r,e)=>new vs({value:r,typeName:M.ZodLiteral,...L(e)});function B2(r,e){return new Cs({values:r,typeName:M.ZodEnum,...L(e)})}var Cs=class r extends W{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return k(t,{expected:q.joinValues(s),received:t.parsedType,code:C.invalid_type}),P}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),s=this._def.values;return k(t,{received:t.data,code:C.invalid_enum_value,options:s}),P}return Oe(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,{...this._def,...t})}exclude(e,t=this._def){return r.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}};Cs.create=B2;var Es=class extends W{_parse(e){let t=q.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==S.string&&s.parsedType!==S.number){let i=q.objectValues(t);return k(s,{expected:q.joinValues(i),received:s.parsedType,code:C.invalid_type}),P}if(this._cache||(this._cache=new Set(q.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=q.objectValues(t);return k(s,{received:s.data,code:C.invalid_enum_value,options:i}),P}return Oe(e.data)}get enum(){return this._def.values}};Es.create=(r,e)=>new Es({values:r,typeName:M.ZodNativeEnum,...L(e)});var Mr=class extends W{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return k(t,{code:C.invalid_type,expected:S.promise,received:t.parsedType}),P;let s=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return Oe(s.then(i=>this._def.type.parseAsync(i,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Mr.create=(r,e)=>new Mr({type:r,typeName:M.ZodPromise,...L(e)});var gt=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===M.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:o=>{k(s,o),o.fatal?t.abort():t.dirty()},get path(){return s.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let o=i.transform(s.data,n);if(s.common.async)return Promise.resolve(o).then(async a=>{if(t.value==="aborted")return P;let c=await this._def.schema._parseAsync({data:a,path:s.path,parent:s});return c.status==="aborted"?P:c.status==="dirty"?fs(c.value):t.value==="dirty"?fs(c.value):c});{if(t.value==="aborted")return P;let a=this._def.schema._parseSync({data:o,path:s.path,parent:s});return a.status==="aborted"?P:a.status==="dirty"?fs(a.value):t.value==="dirty"?fs(a.value):a}}if(i.type==="refinement"){let o=a=>{let c=i.refinement(a,n);if(s.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(s.common.async===!1){let a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?P:(a.status==="dirty"&&t.dirty(),o(a.value),{status:t.value,value:a.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(a=>a.status==="aborted"?P:(a.status==="dirty"&&t.dirty(),o(a.value).then(()=>({status:t.value,value:a.value}))))}if(i.type==="transform")if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Br(o))return P;let a=i.transform(o.value,n);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Br(o)?Promise.resolve(i.transform(o.value,n)).then(a=>({status:t.value,value:a})):P);q.assertNever(i)}};gt.create=(r,e,t)=>new gt({schema:r,typeName:M.ZodEffects,effect:e,...L(t)});gt.createWithPreprocess=(r,e,t)=>new gt({schema:e,effect:{type:"preprocess",transform:r},typeName:M.ZodEffects,...L(t)});var mt=class extends W{_parse(e){return this._getType(e)===S.undefined?Oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};mt.create=(r,e)=>new mt({innerType:r,typeName:M.ZodOptional,...L(e)});var Ht=class extends W{_parse(e){return this._getType(e)===S.null?Oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ht.create=(r,e)=>new Ht({innerType:r,typeName:M.ZodNullable,...L(e)});var ks=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===S.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ks.create=(r,e)=>new ks({innerType:r,typeName:M.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});var Ss=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return wi(i)?i.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ze(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ze(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};Ss.create=(r,e)=>new Ss({innerType:r,typeName:M.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});var Si=class extends W{_parse(e){if(this._getType(e)!==S.nan){let s=this._getOrReturnCtx(e);return k(s,{code:C.invalid_type,expected:S.nan,received:s.parsedType}),P}return{status:"valid",value:e.data}}};Si.create=r=>new Si({typeName:M.ZodNaN,...L(r)});var M5=Symbol("zod_brand"),Ln=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},Un=class r extends W{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?P:n.status==="dirty"?(t.dirty(),fs(n.value)):this._def.out._parseAsync({data:n.value,path:s.path,parent:s})})();{let i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?P:i.status==="dirty"?(t.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:M.ZodPipeline})}},_s=class extends W{_parse(e){let t=this._def.innerType._parse(e),s=i=>(Br(i)&&(i.value=Object.freeze(i.value)),i);return wi(t)?t.then(i=>s(i)):s(t)}unwrap(){return this._def.innerType}};_s.create=(r,e)=>new _s({innerType:r,typeName:M.ZodReadonly,...L(e)});function T2(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function P2(r,e={},t){return r?Rr.create().superRefine((s,i)=>{let n=r(s);if(n instanceof Promise)return n.then(o=>{if(!o){let a=T2(e,s),c=a.fatal??t??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!n){let o=T2(e,s),a=o.fatal??t??!0;i.addIssue({code:"custom",...o,fatal:a})}}):Rr.create()}var $5={object:Ke.lazycreate},M;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(M||(M={}));var j5=(r,e={message:`Input not instance of ${r.name}`})=>P2(t=>t instanceof r,e),R2=Pr.create,M2=ds.create,N5=Si.create,L5=ps.create,$2=ms.create,U5=xs.create,W5=vi.create,q5=gs.create,V5=bs.create,H5=Rr.create,G5=cr.create,z5=At.create,K5=Ci.create,Z5=lr.create,Y5=Ke.create,J5=Ke.strictCreate,X5=ys.create,Q5=Na.create,eC=ws.create,tC=Vt.create,rC=La.create,sC=Ei.create,iC=ki.create,nC=Ua.create,oC=Ds.create,aC=vs.create,cC=Cs.create,lC=Es.create,uC=Mr.create,hC=gt.create,fC=mt.create,dC=Ht.create,pC=gt.createWithPreprocess,mC=Un.create,xC=()=>R2().optional(),gC=()=>M2().optional(),bC=()=>$2().optional(),yC={string:(r=>Pr.create({...r,coerce:!0})),number:(r=>ds.create({...r,coerce:!0})),boolean:(r=>ms.create({...r,coerce:!0})),bigint:(r=>ps.create({...r,coerce:!0})),date:(r=>xs.create({...r,coerce:!0}))};var wC=P;var DC=ee.object({name:ee.string(),description:ee.string(),link:ee.string().url().optional(),install:ee.union([ee.string(),ee.array(ee.string())]).transform(r=>Array.isArray(r)?r:[r]),installFlags:ee.array(ee.string()).optional(),run:ee.array(ee.string()).optional(),initial:ee.boolean().optional(),interactive:ee.boolean().optional()}),j2=ee.array(DC);var N2=r=>{try{return j2.parse(r)}catch(e){throw new Error(e.issues.map(t=>` - Path ${t.path.join(". ")} : ${t.message}`).join(`
198
198
  `))}};var bt=()=>{try{let r=xi("bin/integration.collection.json");return N2(r)}catch(r){throw new Error(`Failed to load integrations!
199
199
  Check your integration.collection.json:
200
200
  ${r.message}`)}},_i=()=>bt().reduce((e,t)=>(t.initial&&e.push(t.name),e),[]),vC=r=>!!r?.name&&!!r?.link&&!!r?.description,Wa=r=>{let e=bt();if(!e?.length||!r?.length)return;let t=r.map(s=>e.find(i=>i.name===s)).filter(vC);t.length&&(O.breakLine().log("\u{1F50C} Installed Integrations:"),t.forEach(({name:s,link:i,description:n})=>{let o=O.getStoredLogs(`${Ma}:${s}`);i&&O.log(`${Yt(Gt.default.cyan(s),i)} - ${n}`),o.length&&O.log(o.map(a=>` \u203A ${Gt.default.dim(a.message)}`).join(`
201
- `))}))},CC=r=>r.toUpperCase().replace(/-/g,"_"),qa=(r,e)=>{let t=CC(r);O.breakLine().log(Gt.default.bold("Environment variables:")).log(Gt.default.dim(" Local:")).log(Gt.default.cyan(` ${t}_PORT=${e}`)).log(Gt.default.cyan(` ${t}_URL=http://localhost:${e}`)).breakLine().log(Gt.default.dim(" Production (auto-configured):")).log(Gt.default.cyan(` ${t}_PORT=${e}`)).log(Gt.default.cyan(` ${t}_URL=http://${r}:${e}`))};var ch=_(require("chalk"));var EC=r=>{let e=r.match(/^(@?[^@]+)@(.+)$/);return e?{name:e[1],version:e[2]}:{name:r,version:"latest"}},L2=async r=>{let{selectedIntegrations:e,cwd:t,packageManager:s=Ge(),task:i}=r;if(!e?.length||!i)return;let n=kC(e,t,s,i);await Sa(i,n)},kC=(r,e,t,s)=>{let n=bt()?.filter(a=>r.includes(a.name))?.flatMap(a=>a.install.map(c=>{let{name:l,version:u}=EC(c);return{title:ch.default.cyanBright(`Adding ${c} (${a.name})`),fn:async()=>{ls(`dependencies.${l}`,u,e)}}})),o={title:ch.default.cyanBright("Installing packages..."),fn:async()=>{await Or({cwd:e,packageManager:t,task:s})}};return[...n??[],o]};var U2=_(require("chalk"));var W2=async r=>{let{selectedIntegrations:e,cwd:t,task:s}=r;if(!e?.length||!s)return;let i=SC(e,t,s,r.packageManager);await Sa(s,i)},SC=(r,e,t,s)=>bt().filter(n=>r.includes(n.name)&&n.run?.length).flatMap(n=>(n.run||[]).map(o=>({title:U2.default.cyanBright(`Running "${o}" for ${n.name}
202
- `),fn:()=>_C(n,o,e,t,s)}))),_C=async(r,e,t,s,i)=>{let n=`${Ma}:${r.name}`;try{if(r.interactive)return f2(e,[],{cwd:t,context:n,task:s,manager:i});await Wt(e,[],{cwd:t,task:s,context:n})}catch(o){O.error(`Failed to run command "${e}" for ${r.name}: ${o.message}`)}};var lh=require("node:path"),q2=require("fs-extra");var AC=["nest-add","ng-add","angular-app","application","library","sub-app","add-module-import"],Va=()=>{try{let r=BC();return[...TC(),...r]}catch(r){return O.error("Error retrieving schematics:",r),[]}};function TC(){if(!qg())return[];try{let r=Mn(),e=bt(),t=FC(e);return OC(t,r)}catch(r){return O.breakLine().error("Error retrieving integration schematics:",r.message),[]}}function FC(r){return r.filter(({name:e})=>c2(e))}function OC(r,e){return r.map(({name:t})=>IC(t,e)).filter(Boolean).flat().filter(t=>t!==void 0)}function IC(r,e){try{let t=(0,lh.join)(e,"node_modules",r,"package.json"),s=xi(t)?.schematics;if(!s)return[];let i=(0,lh.join)(e,"node_modules",r,s),n=(0,q2.readJSONSync)(i).schematics;return V2(n,r)}catch(t){return O.error(`Error processing package ${r}:`,t),[]}}function BC(){try{let r="@nestjs/schematics",e=Gg(r,"collection.json"),t=xi(e);return V2(t.schematics,r)}catch(r){return O.error("Error retrieving NestJS schematics:",r),[]}}function V2(r,e){return r?Object.keys(r).filter(t=>!AC.includes(t)).map(t=>{let{description:s,aliases:i=[t]}=r[t];return{name:t,aliases:i,description:s,packageName:e}}):[]}async function H2(r,e,t=!1){let i=Va().find(({name:o,aliases:a})=>o===r||a.includes(r));if(!i)throw new Error(`Schematic "${r}" is not available.`);let n=i.packageName;if(!n)throw new Error(`Package for schematic "${r}" not found.`);await Wt("nest",["g","-c",n,i.name,e],{stdio:"inherit"}),t&&l2("lint")&&await Ta("lint")}var Mr=_(require("chalk")),M1=_(bh());var $1=()=>{let r=Va(),e=new M1.default({head:["name","alias","description","package"],style:{head:["dim","bold"],compact:!0}});return r.map(d7).forEach(t=>{e.push(t)}),Mr.default.bold(`
201
+ `))}))},CC=r=>r.toUpperCase().replace(/-/g,"_"),qa=(r,e)=>{let t=CC(r);O.breakLine().log(Gt.default.bold("Environment variables:")).log(Gt.default.dim(" Local:")).log(Gt.default.cyan(` ${t}_PORT=${e}`)).log(Gt.default.cyan(` ${t}_URL=http://localhost:${e}`)).breakLine().log(Gt.default.dim(" Production (auto-configured):")).log(Gt.default.cyan(` ${t}_PORT=${e}`)).log(Gt.default.cyan(` ${t}_URL=http://${r}:${e}`))};var ch=_(require("chalk"));var EC=r=>{let e=r.match(/^(@?[^@]+)@(.+)$/);return e?{name:e[1],version:e[2]}:{name:r,version:"latest"}},L2=async r=>{let{selectedIntegrations:e,cwd:t,packageManager:s=Ge(),task:i}=r;if(!e?.length||!i)return;let n=kC(e,t,s,i);await Sa(i,n)},kC=(r,e,t,s)=>{let n=bt()?.filter(a=>r.includes(a.name))?.flatMap(a=>a.install.map(c=>{let{name:l,version:u}=EC(c);return{title:ch.default.cyanBright(`Adding ${c} (${a.name})`),fn:async()=>{ls(`dependencies.${l}`,u,e)}}})),o={title:ch.default.cyanBright("Installing packages..."),fn:async()=>{await Ir({cwd:e,packageManager:t,task:s})}};return[...n??[],o]};var U2=_(require("chalk"));var W2=async r=>{let{selectedIntegrations:e,cwd:t,task:s}=r;if(!e?.length||!s)return;let i=SC(e,t,s,r.packageManager);await Sa(s,i)},SC=(r,e,t,s)=>bt().filter(n=>r.includes(n.name)&&n.run?.length).flatMap(n=>(n.run||[]).map(o=>({title:U2.default.cyanBright(`Running "${o}" for ${n.name}
202
+ `),fn:()=>_C(n,o,e,t,s)}))),_C=async(r,e,t,s,i)=>{let n=`${Ma}:${r.name}`;try{if(r.interactive)return f2(e,[],{cwd:t,context:n,task:s,manager:i});await Wt(e,[],{cwd:t,task:s,context:n})}catch(o){O.error(`Failed to run command "${e}" for ${r.name}: ${o.message}`)}};var lh=require("node:path"),q2=require("fs-extra");var AC=["nest-add","ng-add","angular-app","application","library","sub-app","add-module-import"],Va=()=>{try{let r=BC();return[...TC(),...r]}catch(r){return O.error("Error retrieving schematics:",r),[]}};function TC(){if(!qg())return[];try{let r=Mn(),e=bt(),t=FC(e);return OC(t,r)}catch(r){return O.breakLine().error("Error retrieving integration schematics:",r.message),[]}}function FC(r){return r.filter(({name:e})=>c2(e))}function OC(r,e){return r.map(({name:t})=>IC(t,e)).filter(Boolean).flat().filter(t=>t!==void 0)}function IC(r,e){try{let t=(0,lh.join)(e,"node_modules",r,"package.json"),s=xi(t)?.schematics;if(!s)return[];let i=(0,lh.join)(e,"node_modules",r,s),n=(0,q2.readJSONSync)(i).schematics;return V2(n,r)}catch(t){return O.error(`Error processing package ${r}:`,t),[]}}function BC(){try{let r="@nestjs/schematics",e=Gg(r,"collection.json"),t=xi(e);return V2(t.schematics,r)}catch(r){return O.error("Error retrieving NestJS schematics:",r),[]}}function V2(r,e){return r?Object.keys(r).filter(t=>!AC.includes(t)).map(t=>{let{description:s,aliases:i=[t]}=r[t];return{name:t,aliases:i,description:s,packageName:e}}):[]}async function H2(r,e,t=!1){let i=Va().find(({name:o,aliases:a})=>o===r||a.includes(r));if(!i)throw new Error(`Schematic "${r}" is not available.`);let n=i.packageName;if(!n)throw new Error(`Package for schematic "${r}" not found.`);await Wt("nest",["g","-c",n,i.name,e],{stdio:"inherit"}),t&&l2("lint")&&await Ta("lint")}var $r=_(require("chalk")),M1=_(bh());var $1=()=>{let r=Va(),e=new M1.default({head:["name","alias","description","package"],style:{head:["dim","bold"],compact:!0}});return r.map(d7).forEach(t=>{e.push(t)}),$r.default.bold(`
203
203
  Available schematics:
204
- `)+e.toString()},d7=({name:r,aliases:e,description:t,packageName:s})=>{let i=s==="@nestjs/schematics";return[i?Mr.default.green(r):Mr.default.greenBright(r),i?Mr.default.cyan(e.join(", ")):Mr.default.cyanBright(e.join(", ")),i?Mr.default.dim(t):t,i?Mr.default.dim(s):s]};function Za(r){return r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}async function j1(r,e,t={},s=[],i=[]){if(!r){console.error("Subcommand is not defined.");return}let n=s.map(l=>e[l]).filter(l=>l!==void 0),o=i.map(l=>{let u=e[l];if(!(u===!1||u===void 0))return u===!0?`--${Za(String(l))}`:`--${Za(String(l))}=${String(u)}`}).filter(l=>l!==void 0),a=Object.entries(t).map(([l,u])=>{if(!(u===!1||u===void 0))return u===!0?`--${Za(l)}`:`--${Za(l)}=${String(u)}`}).filter(l=>l!==void 0),c=[...n,...o,...a].map(String);await r.parseAsync(c,{from:"user"})}var eb=require("node:path"),Qe=_(require("chalk"));var Fi={title:"Confirm creation",enabled:r=>!r.userConfirmed,task:async(r,e)=>{if(r.userConfirmed=await e.prompt(Q).run({type:"Toggle",initial:!0,message:"\u{1F680} Ready to launch your project?"}),!r.userConfirmed)throw new Error("Project creation was canceled by the user.")}};var Kt=require("node:fs"),Oi=require("node:path");function N1(r,e){return`import type { K8sServiceConfig } from '@crossdelta/infrastructure'
204
+ `)+e.toString()},d7=({name:r,aliases:e,description:t,packageName:s})=>{let i=s==="@nestjs/schematics";return[i?$r.default.green(r):$r.default.greenBright(r),i?$r.default.cyan(e.join(", ")):$r.default.cyanBright(e.join(", ")),i?$r.default.dim(t):t,i?$r.default.dim(s):s]};function Za(r){return r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}async function j1(r,e,t={},s=[],i=[]){if(!r){console.error("Subcommand is not defined.");return}let n=s.map(l=>e[l]).filter(l=>l!==void 0),o=i.map(l=>{let u=e[l];if(!(u===!1||u===void 0))return u===!0?`--${Za(String(l))}`:`--${Za(String(l))}=${String(u)}`}).filter(l=>l!==void 0),a=Object.entries(t).map(([l,u])=>{if(!(u===!1||u===void 0))return u===!0?`--${Za(l)}`:`--${Za(l)}=${String(u)}`}).filter(l=>l!==void 0),c=[...n,...o,...a].map(String);await r.parseAsync(c,{from:"user"})}var eb=require("node:path"),Qe=_(require("chalk"));var Fi={title:"Confirm creation",enabled:r=>!r.userConfirmed,task:async(r,e)=>{if(r.userConfirmed=await e.prompt(Q).run({type:"Toggle",initial:!0,message:"\u{1F680} Ready to launch your project?"}),!r.userConfirmed)throw new Error("Project creation was canceled by the user.")}};var Kt=require("node:fs"),Oi=require("node:path");function N1(r,e){return`import type { K8sServiceConfig } from '@crossdelta/infrastructure'
205
205
  import { ports } from '@crossdelta/infrastructure'
206
206
 
207
207
  /**
@@ -246,39 +246,39 @@ export default config
246
246
  `}var p7=4001,m7=4e3;function x7(r){let e=[],t=r.matchAll(/ports\(\)\.(?:http|https|grpc|primary)\((\d+)\)/g);for(let c of t)e.push(Number(c[1]));let s=r.matchAll(/\.add(?:Http|Grpc)?\((\d+)/g);for(let c of s)e.push(Number(c[1]));let i=r.match(/containerPort\s*:\s*(\d+)/);i&&e.push(Number(i[1]));let n=r.match(/internalPorts\s*:\s*\[([^\]]+)\]/);if(n){let c=n[1].match(/\d+/g);c&&e.push(...c.map(Number))}let o=r.match(/httpPort\s*:\s*(\d+)/);o&&e.push(Number(o[1]));let a=r.matchAll(/const\s+\w*[pP]ort\w*\s*=\s*(\d+)/g);for(let c of a)e.push(Number(c[1]));return e}function g7(r,e){let t=e?p7:m7,s=new Set;if(!(0,Kt.existsSync)(r))return t;let i=(0,Kt.readdirSync)(r).filter(o=>o.endsWith(".ts"));for(let o of i){let a=(0,Oi.join)(r,o);try{let c=(0,Kt.readFileSync)(a,"utf-8"),l=x7(c);for(let u of l)s.add(u)}catch{}}let n=t;for(;s.has(n);)n++;return n}function b7(r){return(0,Oi.basename)(r)}var Ya={title:"Creating infrastructure service config",task:async(r,e)=>{let t=b7(r.projectName),s=Ut(),i=(0,Oi.join)(s,"infra","services");if(!(0,Kt.existsSync)(i)){e.title="Skipping infra config (no infra/services directory found)";return}let n=(0,Oi.join)(i,`${t}.ts`);if((0,Kt.existsSync)(n)){e.title=`Service config already exists: infra/services/${t}.ts`;return}let o=g7(i,!0);r.assignedPort=o;let a=r.serviceType==="hono"?N1(t,o):L1(t,o);(0,Kt.writeFileSync)(n,a),e.title=`Created infra/services/${t}.ts (port: ${o})`}};var Gn=require("node:child_process"),U1=require("node:fs"),W1=require("node:path"),y7=()=>{try{return(0,Gn.execSync)("git --version",{stdio:"ignore"}),!0}catch{return!1}},w7=r=>(0,U1.existsSync)((0,W1.join)(r,".git")),q1={title:"Initializing git repository",enabled:()=>y7(),skip:r=>w7(r.cwd)?"Already a git repository":!1,task:async(r,e)=>{try{(0,Gn.execSync)("git init",{cwd:r.cwd,stdio:"ignore"}),(0,Gn.execSync)("git add -A",{cwd:r.cwd,stdio:"ignore"}),(0,Gn.execSync)('git commit -m "chore: initial commit"',{cwd:r.cwd,stdio:"ignore",env:{...process.env,GIT_AUTHOR_NAME:process.env.GIT_AUTHOR_NAME||"Platform SDK",GIT_AUTHOR_EMAIL:process.env.GIT_AUTHOR_EMAIL||"platform-sdk@localhost",GIT_COMMITTER_NAME:process.env.GIT_COMMITTER_NAME||"Platform SDK",GIT_COMMITTER_EMAIL:process.env.GIT_COMMITTER_EMAIL||"platform-sdk@localhost"}}),e.title="Git repository initialized with initial commit"}catch{e.title="Git initialization skipped (git error)"}}};var yh=_(require("chalk"));var Ii={title:"Installing Bun",enabled:r=>!!r.shouldInstallBun&&!ih(),task:async(r,e)=>Fe(e,async t=>{await E2(e),r.elapsedTime+=t(),e.title=`Bun installed successfully. (${r.elapsedTime}s)`})},Bi={enabled:r=>!ih()&&!r.shouldInstallBun&&!r.packageManager,task:async(r,e)=>{r.shouldInstallBun=await e.prompt(Q).run({type:"Toggle",message:"Would you like to use Bun? (recommended)",initial:!0,footer:["",`${yh.default.magenta.bold("Bun")} is a fast JavaScript runtime, package manager, bundler, and test runner: ${yh.default.underline("https://bun.sh")}`,k2(),S2()].join(`
247
247
  `)}),r.shouldInstallBun&&(r.packageManager="bun")}};var wh=_(require("chalk"));var Ja={title:"Install integrations",enabled:r=>r.selectedIntegrations.length>0,task:async(r,e)=>Fe(e,async t=>{let{selectedIntegrations:s,cwd:i,packageManager:n}=r;await L2({selectedIntegrations:s,packageManager:n,cwd:i,task:e}),r.elapsedTime+=t()}),rendererOptions:{outputBar:1e3}},Xa={title:"Select integrations",enabled:r=>r.selectedIntegrations.length===0,task:async(r,e)=>{r.selectedIntegrations=await e.prompt(Q).run({type:"MultiSelect",hint:`
248
248
  Press <space> to select/deselect, <enter> to confirm, <i> to invert selection`,message:"Which integrations would you like to include?",initial:_i().map((t,s)=>s),choices:r.availableIntegrations.map(({name:t,description:s})=>({name:t,message:[wh.default.bold(t),s].join(" - "),value:t}))}),!r.selectedIntegrations||r.selectedIntegrations.length===0?e.title="No integrations selected.":e.title=["Selected integrations:",...r.selectedIntegrations.map(t=>wh.default.bold(`\u2022 ${t}`))].join(`
249
- `)}};var V1={title:"Install Nest CLI",task:async(r,e)=>Fe(e,async t=>{await h2({packages:["@nestjs/cli"],task:e,cwd:r.cwd}),r.elapsedTime+=t()}),rendererOptions:{outputBar:1e3}};var Qa={title:"Install dependencies",task:async(r,e)=>Fe(e,async t=>{await Or({cwd:r.cwd,task:e,packageManager:r.packageManager}),r.elapsedTime+=t()})};var H1=_(require("chalk"));var Pi={enabled:r=>!r.removeDir&&!ka(r.cwd),task:async(r,e)=>{if(r.removeDir=await e.prompt(Q).run({type:"Toggle",message:H1.default.bold("\u26A0\uFE0F Overwrite existing directory?"),initial:!1}),!r.removeDir)throw new Error("Project creation was canceled by the user.")}},Ri={enabled:r=>!!r.removeDir,task:async r=>Hg(r.cwd)};var ec={title:"Run integration commands",enabled:r=>r.selectedIntegrations.length>0,task:async(r,e)=>Fe(e,async t=>{let{selectedIntegrations:s,cwd:i}=r;await W2({selectedIntegrations:s,cwd:i,task:e,packageManager:r.packageManager}),r.elapsedTime+=t()}),rendererOptions:{outputBar:1}};var D7=["services/my-hono-service","services/my-nest-service","my-platform"],Mi={enabled:r=>r.skipInputPrompts||r.userConfirmed?!1:r.projectName?D7.includes(r.projectName):!0,task:async(r,e)=>{r.projectName=await e.prompt(Q).run({type:"Input",initial:r.projectName,message:"Enter project name",validate:t=>t?!0:"Project name is required."}),r.cwd&&(r.cwd=de(r.projectName))}};var Dh=_(require("chalk"));var $i={title:"Select Package manager",task:async(r,e)=>{if(r.packageManager??=th(),r.packageManager){e.title=`Using ${Dh.default.bold(r.packageManager)} as package manager.`;return}r.packageManager=await e.prompt(Q).run({type:"Select",message:"Which package manager would you like to use?",initial:rh(),choices:u2}),e.title=`Using ${Dh.default.bold(r.packageManager)} as package manager.`}};var zn=_(require("chalk")),G1={title:"GitHub repository owner",task:async(r,e)=>{if(r.githubOwner){e.title=`GitHub owner: ${zn.default.bold(r.githubOwner)}`;return}r.githubOwner=await e.prompt(Q).run({type:"Input",message:"Enter GitHub organization or username",initial:"my-org",validate:t=>t?.trim()?!0:"GitHub owner is required."}),e.title=`GitHub owner: ${zn.default.bold(r.githubOwner)}`}},z1={title:"Include GitHub CI/CD",task:async(r,e)=>{if(r.includeGitHubCI!==void 0){e.title=r.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD";return}r.includeGitHubCI=await e.prompt(Q).run({type:"Toggle",message:"Include GitHub Actions workflows and CI/CD?",initial:!0,enabled:"Yes",disabled:"No"}),e.title=r.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD"}};var K1={title:"Pulumi stack name",task:async(r,e)=>{if(r.pulumiStackBase){e.title=`Pulumi stack: ${zn.default.bold(r.pulumiStackBase)}`;return}let t=r.githubOwner||"myorg",s=r.projectName?.replace(/[^a-zA-Z0-9-]/g,"-")||"myproject",i=`${t}/${s}`;r.pulumiStackBase=await e.prompt(Q).run({type:"Input",message:"Enter Pulumi stack base name (org/project)",initial:i,validate:n=>n?.trim()?n.includes("/")?!0:"Format should be org/project (e.g., myorg/myproject)":"Pulumi stack name is required."}),e.title=`Pulumi stack: ${zn.default.bold(r.pulumiStackBase)}`}};var ji=require("node:fs"),Ts=require("node:path");var rc=require("node:fs"),tc=require("node:path"),Z1=_(require("handlebars")),v7=r=>r.toUpperCase().replace(/-/g,"_"),C7=()=>{let r=[(0,tc.join)(__dirname,"templates","hono-microservice"),(0,tc.join)(__dirname,"..","hono-microservice","templates")];for(let e of r)if((0,rc.existsSync)(e))return e;throw new Error(`Hono templates directory not found. Searched in: ${r.join(", ")}`)},Ch=(r,e)=>{let t=C7(),s=(0,tc.join)(t,r),i=(0,rc.readFileSync)(s,"utf-8");return Z1.default.compile(i)(e)};function Y1(r){return Ch("src/index.ts.hbs",{serviceName:r,envKey:v7(r)})}function J1(){return Ch("tsconfig.json.hbs",{})}function X1(r="1.2.23"){return Ch("Dockerfile.hbs",{bunVersion:r})}var Q1={title:"Create Hono app structure",rendererOptions:{outputBar:1e3},task:async(r,e)=>Fe(e,async t=>{try{await Wt("create-hono@latest",[r.projectName,"--pm",r.packageManager,"--template","bun","--install"],{task:e})}catch{let l=(0,Ts.join)(de(r.projectName),"src","index.ts");if(!(0,ji.existsSync)(l))throw new Error("Failed to scaffold Hono app structure")}let s=(0,Ts.basename)(r.projectName),i="bun run --hot src/index.ts",n=Q0();ls("scripts.dev",i,r.projectName),ls("scripts.start:dev",i,r.projectName),ls("name",`${n}/${s}`,r.projectName);let o=(0,Ts.join)(de(r.projectName),"src","index.ts");(0,ji.writeFileSync)(o,Y1(s));let a=(0,Ts.join)(de(r.projectName),"tsconfig.json");(0,ji.writeFileSync)(a,J1());let c=(0,Ts.join)(de(r.projectName),"Dockerfile");(0,ji.writeFileSync)(c,X1()),r.elapsedTime+=t()})};async function E7(r,e){let{valid:t,config:s,error:i}=bi();(!t||!s)&&(console.log(i),process.exit(1));let n=(r||"services/my-hono-service").trim(),o=await Ia(e.description);Pa(n,s,o);try{await Ba({servicePath:n,description:o,serviceType:"hono"},s)?(console.log(Qe.default.green.bold(`
249
+ `)}};var V1={title:"Install Nest CLI",task:async(r,e)=>Fe(e,async t=>{await h2({packages:["@nestjs/cli"],task:e,cwd:r.cwd}),r.elapsedTime+=t()}),rendererOptions:{outputBar:1e3}};var Qa={title:"Install dependencies",task:async(r,e)=>Fe(e,async t=>{await Ir({cwd:r.cwd,task:e,packageManager:r.packageManager}),r.elapsedTime+=t()})};var H1=_(require("chalk"));var Pi={enabled:r=>!r.removeDir&&!ka(r.cwd),task:async(r,e)=>{if(r.removeDir=await e.prompt(Q).run({type:"Toggle",message:H1.default.bold("\u26A0\uFE0F Overwrite existing directory?"),initial:!1}),!r.removeDir)throw new Error("Project creation was canceled by the user.")}},Ri={enabled:r=>!!r.removeDir,task:async r=>Hg(r.cwd)};var ec={title:"Run integration commands",enabled:r=>r.selectedIntegrations.length>0,task:async(r,e)=>Fe(e,async t=>{let{selectedIntegrations:s,cwd:i}=r;await W2({selectedIntegrations:s,cwd:i,task:e,packageManager:r.packageManager}),r.elapsedTime+=t()}),rendererOptions:{outputBar:1}};var D7=["services/my-hono-service","services/my-nest-service","my-platform"],Mi={enabled:r=>r.skipInputPrompts||r.userConfirmed?!1:r.projectName?D7.includes(r.projectName):!0,task:async(r,e)=>{r.projectName=await e.prompt(Q).run({type:"Input",initial:r.projectName,message:"Enter project name",validate:t=>t?!0:"Project name is required."}),r.cwd&&(r.cwd=de(r.projectName))}};var Dh=_(require("chalk"));var $i={title:"Select Package manager",task:async(r,e)=>{if(r.packageManager??=th(),r.packageManager){e.title=`Using ${Dh.default.bold(r.packageManager)} as package manager.`;return}r.packageManager=await e.prompt(Q).run({type:"Select",message:"Which package manager would you like to use?",initial:rh(),choices:u2}),e.title=`Using ${Dh.default.bold(r.packageManager)} as package manager.`}};var zn=_(require("chalk")),G1={title:"GitHub repository owner",task:async(r,e)=>{if(r.githubOwner){e.title=`GitHub owner: ${zn.default.bold(r.githubOwner)}`;return}r.githubOwner=await e.prompt(Q).run({type:"Input",message:"Enter GitHub organization or username",initial:"my-org",validate:t=>t?.trim()?!0:"GitHub owner is required."}),e.title=`GitHub owner: ${zn.default.bold(r.githubOwner)}`}},z1={title:"Include GitHub CI/CD",task:async(r,e)=>{if(r.includeGitHubCI!==void 0){e.title=r.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD";return}r.includeGitHubCI=await e.prompt(Q).run({type:"Toggle",message:"Include GitHub Actions workflows and CI/CD?",initial:!0,enabled:"Yes",disabled:"No"}),e.title=r.includeGitHubCI?"Including GitHub CI/CD workflows":"Skipping GitHub CI/CD"}};var K1={title:"Pulumi stack name",task:async(r,e)=>{if(r.pulumiStackBase){e.title=`Pulumi stack: ${zn.default.bold(r.pulumiStackBase)}`;return}let t=r.githubOwner||"myorg",s=r.projectName?.replace(/[^a-zA-Z0-9-]/g,"-")||"myproject",i=`${t}/${s}`;r.pulumiStackBase=await e.prompt(Q).run({type:"Input",message:"Enter Pulumi stack base name (org/project)",initial:i,validate:n=>n?.trim()?n.includes("/")?!0:"Format should be org/project (e.g., myorg/myproject)":"Pulumi stack name is required."}),e.title=`Pulumi stack: ${zn.default.bold(r.pulumiStackBase)}`}};var ji=require("node:fs"),Ts=require("node:path");var rc=require("node:fs"),tc=require("node:path"),Z1=_(require("handlebars")),v7=r=>r.toUpperCase().replace(/-/g,"_"),C7=()=>{let r=[(0,tc.join)(__dirname,"templates","hono-microservice"),(0,tc.join)(__dirname,"..","hono-microservice","templates")];for(let e of r)if((0,rc.existsSync)(e))return e;throw new Error(`Hono templates directory not found. Searched in: ${r.join(", ")}`)},Ch=(r,e)=>{let t=C7(),s=(0,tc.join)(t,r),i=(0,rc.readFileSync)(s,"utf-8");return Z1.default.compile(i)(e)};function Y1(r){return Ch("src/index.ts.hbs",{serviceName:r,envKey:v7(r)})}function J1(){return Ch("tsconfig.json.hbs",{})}function X1(r="1.2.23"){return Ch("Dockerfile.hbs",{bunVersion:r})}var Q1={title:"Create Hono app structure",rendererOptions:{outputBar:1e3},task:async(r,e)=>Fe(e,async t=>{try{await Wt("create-hono@latest",[r.projectName,"--pm",r.packageManager,"--template","bun","--install"],{task:e})}catch{let l=(0,Ts.join)(de(r.projectName),"src","index.ts");if(!(0,ji.existsSync)(l))throw new Error("Failed to scaffold Hono app structure")}let s=(0,Ts.basename)(r.projectName),i="bun run --hot src/index.ts",n=Q0();ls("scripts.dev",i,r.projectName),ls("scripts.start:dev",i,r.projectName),ls("name",`${n}/${s}`,r.projectName);let o=(0,Ts.join)(de(r.projectName),"src","index.ts");(0,ji.writeFileSync)(o,Y1(s));let a=(0,Ts.join)(de(r.projectName),"tsconfig.json");(0,ji.writeFileSync)(a,J1());let c=(0,Ts.join)(de(r.projectName),"Dockerfile");(0,ji.writeFileSync)(c,X1()),r.elapsedTime+=t()})};async function E7(r,e){let{valid:t,config:s,error:i}=bi();(!t||!s)&&(console.log(i),process.exit(1));let n=(r||"services/my-hono-service").trim(),o=await Ia(e.description);Pa(n,s,o);try{await Ba({servicePath:n,description:o,serviceType:"hono"},s)?(console.log(Qe.default.green.bold(`
250
250
  \u2705 Service generated successfully!
251
251
  `)),console.log(Qe.default.dim("Next steps:")),console.log(Qe.default.dim(` 1. ${Qe.default.cyan(`cd ${n}`)}`)),console.log(Qe.default.dim(` 2. ${Qe.default.cyan("bun install")}`)),console.log(Qe.default.dim(` 3. ${Qe.default.cyan("bun dev")}`)),console.log(),process.exit(0)):(console.log(Qe.default.red.bold(`
252
252
  \u274C Service generation failed
253
253
  `)),process.exit(1))}catch(a){console.log(Qe.default.red.bold(`
254
254
  \u274C Error: ${a.message}
255
- `)),process.exit(1)}}var tb=yr({name:"hono-micro",description:"Create a new Hono microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"],["--remove-dir","Remove existing directory before creating (used internally)"]],exampleUsage:'platform new hono-micro my-service --ai -d "Payment processing service"',buildContext:async(r,e)=>{if(e.ai)throw await E7(r.name,e),new Error("AI generation should have exited");let t=(r.name??"services/my-hono-service").trim(),s=de(t),i=e.packageManager??(e.yes&&Ge()),n=bt(),o=e.yes?_i():[],a=e.packageManager==="bun",c=!!e.yes||!!r.name&&r.name!=="services/my-hono-service";return{cwd:s,projectName:t,packageManager:i,shouldInstallBun:a,availableIntegrations:n,selectedIntegrations:o,serviceType:"hono",elapsedTime:0,userConfirmed:!!e.yes,skipInputPrompts:c,removeDir:!!e.removeDir||!!e.yes}},prompts:[Mi,Pi,Bi,$i,Xa,Fi],actions:[Ri,Ii,Q1,Ya,Ja,ec],onComplete:({projectName:r,packageManager:e,selectedIntegrations:t,assignedPort:s})=>{O.breakLine().log(Qe.default.bold.green("Hono Microservice created successfully!")),Wa(t),qa((0,eb.basename)(r),s??8080);let i=e??Ge();O.breakLine().log(`To start the project, run:
255
+ `)),process.exit(1)}}var tb=wr({name:"hono-micro",description:"Create a new Hono microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"],["--remove-dir","Remove existing directory before creating (used internally)"]],exampleUsage:'platform new hono-micro my-service --ai -d "Payment processing service"',buildContext:async(r,e)=>{if(e.ai)throw await E7(r.name,e),new Error("AI generation should have exited");let t=(r.name??"services/my-hono-service").trim(),s=de(t),i=e.packageManager??(e.yes&&Ge()),n=bt(),o=e.yes?_i():[],a=e.packageManager==="bun",c=!!e.yes||!!r.name&&r.name!=="services/my-hono-service";return{cwd:s,projectName:t,packageManager:i,shouldInstallBun:a,availableIntegrations:n,selectedIntegrations:o,serviceType:"hono",elapsedTime:0,userConfirmed:!!e.yes,skipInputPrompts:c,removeDir:!!e.removeDir||!!e.yes}},prompts:[Mi,Pi,Bi,$i,Xa,Fi],actions:[Ri,Ii,Q1,Ya,Ja,ec],onComplete:({projectName:r,packageManager:e,selectedIntegrations:t,assignedPort:s})=>{O.breakLine().log(Qe.default.bold.green("Hono Microservice created successfully!")),Wa(t),qa((0,eb.basename)(r),s??8080);let i=e??Ge();O.breakLine().log(`To start the project, run:
256
256
  ${Qe.default.bold(`cd ${r} && ${i} run dev`)}`).breakLine().log("Happy shipping with Hono! \u26A1\uFE0F").breakLine()}});var hb=require("node:path"),et=_(require("chalk"));var ob=require("node:fs"),ab=require("node:path");var ic=require("node:fs"),sc=require("node:path"),rb=_(require("handlebars")),k7=r=>r.toUpperCase().replace(/-/g,"_"),S7=r=>r.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),_7=()=>{let r=[(0,sc.join)(__dirname,"templates","nest-microservice"),(0,sc.join)(__dirname,"..","nest-microservice","templates")];for(let e of r)if((0,ic.existsSync)(e))return e;throw new Error(`NestJS templates directory not found. Searched in: ${r.join(", ")}`)},sb=(r,e)=>{let t=_7(),s=(0,sc.join)(t,r),i=(0,ic.readFileSync)(s,"utf-8");return rb.default.compile(i)(e)};function ib(r,e=3e3){return sb("src/main.ts.hbs",{serviceName:r,envKey:k7(r),displayName:S7(r),defaultPort:e})}function nb(r="24",e="1.2.23"){return sb("Dockerfile.hbs",{nodeVersion:r,bunVersion:e})}var cb={title:"Create NestJS app structure",rendererOptions:{outputBar:1e3},task:async(r,e)=>Fe(e,async t=>{await Wt("@nestjs/cli",["new",r.projectName,"--skip-install","--skip-git","--package-manager",r.packageManager],{task:e});let s=(0,ab.join)(de(r.projectName),"Dockerfile");(0,ob.writeFileSync)(s,nb()),r.elapsedTime+=t()})};var lb=require("node:fs"),nc=require("node:path");var ub={title:"Patch main.ts with PORT pattern",task:async(r,e)=>Fe(e,async t=>{let s=(0,nc.basename)(r.projectName),i=r.assignedPort??3e3,n=(0,nc.join)(de(r.projectName),"src","main.ts");(0,lb.writeFileSync)(n,ib(s,i)),e.title=`Patched main.ts with PORT || ${s.toUpperCase().replace(/-/g,"_")}_PORT`,r.elapsedTime+=t()})};async function A7(r,e){let{valid:t,config:s,error:i}=bi();(!t||!s)&&(console.log(i),process.exit(1));let n=(r||"services/my-nest-service").trim(),o=await Ia(e.description);Pa(n,s,o);try{await Ba({servicePath:n,description:o,serviceType:"nest"},s)?(console.log(et.default.green.bold(`
257
257
  \u2705 Service generated successfully!
258
258
  `)),console.log(et.default.dim("Next steps:")),console.log(et.default.dim(` 1. ${et.default.cyan(`cd ${n}`)}`)),console.log(et.default.dim(` 2. ${et.default.cyan("bun install")}`)),console.log(et.default.dim(` 3. ${et.default.cyan("bun run start:dev")}`)),console.log(),process.exit(0)):(console.log(et.default.red.bold(`
259
259
  \u274C Service generation failed
260
260
  `)),process.exit(1))}catch(a){console.log(et.default.red.bold(`
261
261
  \u274C Error: ${a.message}
262
- `)),process.exit(1)}}var fb=yr({name:"nest-micro",description:"Create a new NestJS microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"],["--remove-dir","Remove existing directory before creating (used internally)"]],exampleUsage:'platform new nest-micro my-service --ai -d "User authentication service"',buildContext:async(r,e)=>{if(e.ai)throw await A7(r.name,e),new Error("AI generation should have exited");let t=(r.name??"services/my-nest-service").trim(),s=de(t),i=e.packageManager??(e.yes&&Ge()),n=e.packageManager==="bun",o=bt(),a=e.yes?_i():[],c=!!e.yes||!!r.name;return{cwd:s,projectName:t,shouldInstallBun:n,packageManager:i,availableIntegrations:o,selectedIntegrations:a,serviceType:"nest",elapsedTime:0,userConfirmed:!!e.yes,skipInputPrompts:c,removeDir:!!e.removeDir||!!e.yes}},prompts:[Mi,Pi,Bi,$i,Xa,Fi],actions:[Ri,Ii,cb,Ya,ub,Qa,V1,Ja,ec],onComplete:({projectName:r,packageManager:e,selectedIntegrations:t,assignedPort:s})=>{O.breakLine().log(et.default.bold.green("NestJS Microservice created successfully!")),Wa(t),qa((0,hb.basename)(r),s??3e3),O.breakLine().log(`To start the project, run:
263
- ${et.default.bold(`cd ${r} && ${e} run start:dev`)}`).breakLine().log("Happy coding! \u{1F389}").breakLine()}});var yt=_(require("chalk"));var pb=require("node:child_process"),Be=require("node:fs"),$r=require("node:path"),mb=_(require("handlebars")),T7=()=>{let r=[(0,$r.join)(__dirname,"templates","workspace"),(0,$r.join)(__dirname,"..","workspace","templates")];for(let e of r)if((0,Be.existsSync)(e))return e;throw new Error(`Workspace templates directory not found. Searched in: ${r.join(", ")}`)},F7=(r,e)=>{let t=(0,Be.readFileSync)(r,"utf-8");return mb.default.compile(t)(e)},db=r=>{r.endsWith(".sh")&&(0,Be.chmodSync)(r,493)},O7=[{template:"package.json.hbs",output:"package.json"},{template:"pnpm-workspace.yaml.hbs",output:"pnpm-workspace.yaml",forPackageManager:"pnpm"},{template:"biome.json.hbs",output:"biome.json"},{template:"turbo.json.hbs",output:"turbo.json"},{template:"bunfig.toml.hbs",output:"bunfig.toml"},{template:"gitignore.hbs",output:".gitignore"},{template:"editorconfig.hbs",output:".editorconfig"},{template:"npmrc.hbs",output:".npmrc"},{template:"infra/package.json.hbs",output:"infra/package.json"},{template:"infra/index.ts.hbs",output:"infra/index.ts"},{template:"infra/tsconfig.json.hbs",output:"infra/tsconfig.json"},{template:"infra/Pulumi.yaml.hbs",output:"infra/Pulumi.yaml"},{template:"infra/Pulumi.dev.yaml.hbs",output:"infra/Pulumi.dev.yaml"},{template:"infra/services/nats.ts.hbs",output:"infra/services/nats.ts"},{template:"services/nats/package.json.hbs",output:"services/nats/package.json"},{template:"services/nats/nats.conf",output:"services/nats/nats.conf",isStatic:!0},{template:"services/nats/nats.prod.conf",output:"services/nats/nats.prod.conf",isStatic:!0},{template:"services/nats/README.md",output:"services/nats/README.md",isStatic:!0},{template:"services/nats/scripts/start-dev.sh.hbs",output:"services/nats/scripts/start-dev.sh"},{template:"apps/.gitkeep",output:"apps/.gitkeep",isStatic:!0},{template:"packages/.gitkeep",output:"packages/.gitkeep",isStatic:!0},{template:"docs/.gitkeep",output:"docs/.gitkeep",isStatic:!0},{template:".github/copilot-instructions.md.hbs",output:".github/copilot-instructions.md"},{template:".github/README.md",output:".github/README.md",isStatic:!0,isGitHubCI:!0},{template:".github/dependabot.yml",output:".github/dependabot.yml",isStatic:!0,isGitHubCI:!0},{template:".github/workflows/lint-and-tests.yml.hbs",output:".github/workflows/lint-and-tests.yml",isGitHubCI:!0},{template:".github/workflows/build-and-deploy.yml.hbs",output:".github/workflows/build-and-deploy.yml",isGitHubCI:!0},{template:".github/workflows/publish-packages.yml",output:".github/workflows/publish-packages.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/setup-bun-install/action.yml.hbs",output:".github/actions/setup-bun-install/action.yml",isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/action.yml",output:".github/actions/check-image-tag-exists/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/index.js",output:".github/actions/check-image-tag-exists/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/action.yml",output:".github/actions/check-path-changes/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/index.js",output:".github/actions/check-path-changes/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/detect-skipped-services/action.yml",output:".github/actions/detect-skipped-services/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/action.yml",output:".github/actions/generate-scope-matrix/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/index.js",output:".github/actions/generate-scope-matrix/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/prepare-build-context/action.yml",output:".github/actions/prepare-build-context/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/action.yml",output:".github/actions/resolve-scope-tags/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/index.js",output:".github/actions/resolve-scope-tags/index.js",isStatic:!0,isGitHubCI:!0}],xb={title:"Creating workspace structure",task:async(r,e)=>{if((0,Be.existsSync)(r.cwd)){e.title="Workspace directory already exists, skipping...";return}let t=T7(),s=r.includeGitHubCI??!0,i=r.packageManager||"bun",n=c=>{try{let h=(0,pb.spawnSync)(c,["--version"],{encoding:"utf-8",timeout:5e3}).stdout?.trim();if(h&&/^\d+\.\d+/.test(h))return`${c}@${h}`}catch{}return{bun:"bun@1.2.7",npm:"npm@10.9.2",yarn:"yarn@4.6.0",pnpm:"pnpm@9.15.2"}[c]||`${c}@latest`},o={projectName:r.projectName,githubOwner:r.githubOwner||"",pulumiStackBase:r.pulumiStackBase||r.projectName,packageManager:i,packageManagerVersion:n(i)},a=O7.filter(c=>!(c.isGitHubCI&&!s||c.forPackageManager&&c.forPackageManager!==i));for(let c of a){let l=(0,$r.join)(r.cwd,c.output),u=(0,$r.dirname)(l);if((0,Be.existsSync)(u)||(0,Be.mkdirSync)(u,{recursive:!0}),c.isStatic){let h=(0,$r.join)(t,c.template);(0,Be.existsSync)(h)?(0,Be.writeFileSync)(l,(0,Be.readFileSync)(h)):(0,Be.writeFileSync)(l,""),db(l)}else{let h=(0,$r.join)(t,c.template),d=F7(h,o);(0,Be.writeFileSync)(l,d),db(l)}}e.title="Workspace structure created"}};var gb=yr({name:"workspace",description:"Create a new workspace with infrastructure setup",arguments:[["[name]","Name or path of the workspace"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["-o, --github-owner <owner>","GitHub organization or username"],["-s, --pulumi-stack <name>","Pulumi stack base name (org/project)"],["--no-github","Skip GitHub CI/CD workflows"],["--remove-dir","Remove existing directory before creating (internal use)"]],exampleUsage:"pf new workspace my-platform -o my-org",buildContext:(r,e)=>{let t=(r.name??"my-platform").trim(),s=de(t),i=!!e.yes,n=e.packageManager??(i?Ge():void 0),o=e.packageManager==="bun",a=e.githubOwner??(i?"my-org":void 0),c=e.pulumiStack??(i?`${a}/${t}`:void 0),l=e.github===!1?!1:i?!0:void 0,u=!!r.name,h=e.removeDir||i;return{cwd:s,projectName:t,shouldInstallBun:o,packageManager:n,elapsedTime:0,userConfirmed:i,skipInputPrompts:u&&!i,removeDir:h,githubOwner:a,pulumiStackBase:c,includeGitHubCI:l}},prompts:[{enabled:r=>!r.userConfirmed,task:async(r,e)=>{try{let t=Ut();if(!await e.prompt(Q).run({type:"toggle",message:`\u26A0\uFE0F You are inside an existing workspace (${t}). Create a nested workspace anyway?`,enabled:"Yes",disabled:"No",initial:!1}))throw new Error("Workspace creation cancelled - already inside a workspace");e.title=yt.default.yellow("Warning: Creating nested workspace")}catch(t){if(t.message?.includes("cancelled"))throw t;e.title="No existing workspace detected"}}},Mi,Pi,G1,z1,K1,Bi,$i,Fi],actions:[Ri,Ii,xb,Qa,q1],onComplete:({projectName:r,includeGitHubCI:e})=>{O.breakLine().log(yt.default.bold.green("Workspace created successfully!")),O.breakLine().log(yt.default.bold("Next steps:")).log(` 1. ${yt.default.cyan(`cd ${r}`)}`).log(` 2. ${yt.default.cyan("bun pulumi login")}`).log(` 3. ${yt.default.cyan("bun pulumi up --stack dev")}`),e&&O.breakLine().log(yt.default.bold("GitHub Setup:")).log(" Configure these secrets in your GitHub repository:").log(` \u2022 ${yt.default.yellow("PULUMI_ACCESS_TOKEN")} - Pulumi Cloud access token`).log(` \u2022 ${yt.default.yellow("DIGITALOCEAN_TOKEN")} - DigitalOcean API token`).log(` \u2022 ${yt.default.yellow("NPM_TOKEN")} - (optional) NPM token for private packages`),O.breakLine().log(yt.default.bold("Structure created:")).log(" apps/ # Frontend applications").log(" services/ # Backend microservices").log(" packages/ # Shared libraries").log(" infra/").log(" \u251C\u2500\u2500 index.ts # Pulumi entry point").log(" \u251C\u2500\u2500 services/ # Service configs").log(" \u251C\u2500\u2500 Pulumi.yaml # Pulumi project config").log(" \u2514\u2500\u2500 Pulumi.dev.yaml # Dev stack config"),e&&O.log(" .github/").log(" \u251C\u2500\u2500 workflows/ # CI/CD workflows").log(" \u2514\u2500\u2500 actions/ # Custom actions"),O.breakLine().log("Happy coding! \u{1F389}").breakLine()}});var Kn=[{name:"Hono Microservice",value:"hono-micro",command:tb,supportsAi:!0},{name:"Nest Microservice",value:"nest-micro",command:fb,supportsAi:!0},{name:"Workspace (Infrastructure)",value:"workspace",command:gb,supportsAi:!1}],bb=()=>{let r=yr({name:"new",description:"Create a new project",arguments:[["[type]","Type of the project (e.g., nest-micro, shopware-plugin)"]],exampleUsage:"platform new nest-micro test-project",buildContext:e=>({projectType:e.type??"",useAi:!1,aiDescription:"",elapsedTime:0,cwd:process.cwd()}),prompts:[{enabled:e=>!e.projectType,task:async(e,t)=>{let s=await t.prompt(Q).run({type:"select",message:"Select Project type",choices:Kn});e.projectType=Kn.find(i=>i.name===s)?.value||"",t.title=`Using ${ur.default.bold(s)}`}},{enabled:e=>e.projectType!=="workspace"&&e.projectType!=="",task:async(e,t)=>{try{Ut(),t.title="Workspace detected"}catch{let s=["Not in a workspace directory","",`Current directory: ${process.cwd()}`,"","This command must be run from within a workspace created with pf new workspace","","To create a new workspace, run:",""," pf new workspace my-platform"].join(`
264
- `);throw new Error(s)}}},{enabled:e=>e.projectType==="workspace",task:async(e,t)=>{try{let s=Ut();if(!await t.prompt(Q).run({type:"toggle",message:`\u26A0\uFE0F You are inside an existing workspace (${s}). Create a nested workspace anyway?`,enabled:"Yes",disabled:"No",initial:!1}))throw new Error("Workspace creation cancelled - already inside a workspace");t.title=ur.default.yellow("Warning: Creating nested workspace")}catch(s){if(s.message?.includes("cancelled"))throw s;t.title="No existing workspace detected"}}},{enabled:e=>!!e.projectType,task:async(e,t)=>{let i={"hono-micro":"services/my-hono-service","nest-micro":"services/my-nest-service",workspace:"my-platform"}[e.projectType]||"my-project",n=e.projectType==="workspace"?"\u{1F4E6} Workspace name:":"\u{1F4E6} Service path (e.g., services/my-service):",o=await t.prompt(Q).run({type:"input",message:n,initial:i});e.servicePath=o.trim(),t.title=`Path: ${ur.default.dim(o)}`}},{enabled:e=>!!Kn.find(s=>s.value===e.projectType)?.supportsAi&&bi().valid,task:async(e,t)=>{let s=await t.prompt(Q).run({type:"toggle",message:"Use AI to generate service code?",enabled:"Yes",disabled:"No",initial:!1});e.useAi=s,t.title=s?ur.default.cyan("\u{1F916} AI-powered generation"):"Standard scaffolding"}},{enabled:e=>e.useAi,task:async(e,t)=>{let s=await t.prompt(Q).run({type:"input",message:"Describe what this service should do:"});e.aiDescription=s,t.title=`Description: ${ur.default.dim(s.slice(0,50))}${s.length>50?"...":""}`}},{enabled:e=>{if(!e.servicePath)return!1;let t=de(e.servicePath);return!ka(t)},task:async(e,t)=>{if(!await t.prompt(Q).run({type:"toggle",message:ur.default.bold("\u26A0\uFE0F Overwrite existing directory?"),enabled:"Yes",disabled:"No",initial:!1}))throw new Error("Project creation was canceled by the user.");e.shouldRemoveDir=!0,t.title=ur.default.yellow("Will overwrite existing directory")}},{title:"Confirm creation",enabled:e=>e.projectType!=="workspace",task:async(e,t)=>{if(!await t.prompt(Q).run({type:"Toggle",initial:!0,message:"\u{1F680} Ready to launch your project?"}))throw new Error("Project creation was canceled by the user.")}}],actions:[],onComplete:async e=>{Kn.find(n=>n.value===e.projectType)||r.error(ur.default.red(`Project type ${e.projectType} is not supported.`));let t=r.commands.find(n=>n.name()===e.projectType),s={};e.projectType!=="workspace"&&(s.yes=!0);let i=[];e.servicePath&&i.push("servicePath"),e.shouldRemoveDir&&(s.removeDir=!0),e.useAi&&(s.ai=!0,s.description=e.aiDescription),await j1(t,e,s,i)}});for(let e of Kn)r.addCommand(e.command);return r};var Le=require("node:fs"),Eh=require("node:fs/promises"),Ni=require("node:path"),Os=_(require("chalk"));var kh=300,yb=500,wb=30,I7=["infra/services"],B7=["services","apps"],Fs=null,Zn=!1,jr=r=>process.stdout.write(`${r}
265
- `),oc=r=>new Promise(e=>setTimeout(e,r)),P7=()=>{process.stdout.write("\x1B[?1049l\x1B[?25h\x1Bc")},Sh=(r,e)=>{let t=null;return(...s)=>{t&&clearTimeout(t),t=setTimeout(()=>r(...s),e)}},vb=async()=>{let r=Fs?.pid;if(!r)return;jr(Os.default.cyan("\u23F9 Stopping services...")),Fs?.stdout?.removeAllListeners(),Fs?.stderr?.removeAllListeners(),Fs?.removeAllListeners();let e=t=>{try{process.kill(-r,t)}catch{Fs?.kill(t)}};e("SIGTERM"),await oc(1e3);try{e("SIGKILL")}catch{}Fs=null,await oc(100)},Cb=r=>{jr(Os.default.cyan("\u{1F525} Starting services...")),Fs=n2("turbo",["run","start:dev","--continue"],{cwd:r,envFile:".env.local",onStderr:e=>{Zn||process.stderr.write(e)},onExit:e=>{Zn||(jr(`
266
- Turbo exited with code ${e}`),process.exit(e??0))}})},Eb=r=>Ta("generate-env",{cwd:r}),R7=async r=>{let t=["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml"].map(c=>(0,Ni.join)(r,c)).find(Le.existsSync),s=(0,Ni.join)(r,"node_modules"),i=async()=>({lock:t&&(0,Le.existsSync)(t)?(await(0,Eh.stat)(t)).mtimeMs:0,nm:(0,Le.existsSync)(s)?(await(0,Eh.stat)(s)).mtimeMs:0}),n=await i(),o=!1;for(let c=0;c<wb&&!o;c++){await oc(yb);let l=await i();o=l.lock!==n.lock||l.nm!==n.nm}if(!o)return;let a=await i();for(let c=0;c<wb;c++){await oc(yb);let l=await i();if(l.lock===a.lock&&l.nm===a.nm)return;a=l}},_h=async(r,e,t=!1,s)=>{if(!Zn){Zn=!0;try{t||await R7(e),await vb(),P7(),s&&jr(s),jr(Os.default.cyan(`\u{1F504} Detected change in ${Os.default.white(r)}, restarting...`)),await Eb(e),Cb(e)}catch(i){jr(`\u274C Failed to restart: ${i}`)}finally{Zn=!1}}},M7=(r,e)=>{let t=Sh(s=>_h(s,e,!0),kh);for(let s of r){let i=(0,Ni.join)(e,s);(0,Le.existsSync)(i)&&(0,Le.watch)(i,{recursive:!0},(n,o)=>o?.endsWith(".ts")&&t(o))}},Db=r=>{try{return(0,Le.existsSync)(r)?new Set((0,Le.readdirSync)(r,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)):new Set}catch{return new Set}},$7=(r,e)=>{for(let t of r){let s=(0,Ni.join)(e,t);if(!(0,Le.existsSync)(s))continue;let i=Db(s),n=Sh(async()=>{let a=Db(s),c=[...a].filter(d=>!i.has(d)),l=[...i].filter(d=>!a.has(d));if(!c.length&&!l.length)return;let u=[...c.map(d=>`+${d}`),...l.map(d=>`-${d}`)].join(", ");i=a;let h=c.length===0&&l.length>0;await _h(`${t}/`,e,h,`\u{1F4E6} Package changes: ${u}`)},kh);(0,Le.watch)(s,{recursive:!1},n);let o=Sh(async a=>{await _h(`${t}/${a}`,e,!1,`\u{1F4E6} Service updated: ${a}`)},kh);(0,Le.watch)(s,{recursive:!0},(a,c)=>{if(c?.endsWith("package.json")){let l=c.split("/")[0];l&&i.has(l)&&o(l)}})}},kb=new Se("dev").description("Start development mode with auto-reload").action(async()=>{let r=Ut(),e=I7,t=B7;try{let i=JSON.parse((0,Le.readFileSync)((0,Ni.join)(r,"package.json"),"utf-8"));e=i.pf?.dev?.watchDirs??e,t=i.pf?.dev?.watchPackages??t}catch{}await Eb(r),Cb(r),jr(`
267
- ${Os.default.cyan("\u{1F440} Watching:")} ${[...e,...t].join(", ")}`),M7(e,r),$7(t,r);let s=async()=>{jr(Os.default.cyan(`
268
- \u{1F44B} Shutting down...`)),await vb(),process.exit(0)};process.on("SIGINT",s),process.on("SIGTERM",s)});var Ab=_(bh());var Sb=require("fs-extra"),_b=require("globby");var j7=ee.record(ee.enum(["uuid","email","string","number","boolean","date","firstName","lastName","productName","productDescription","url","phoneNumber","address","companyName","streetAddress","city","state","country","zipCode","password"])),N7=ee.object({description:ee.string().optional(),eventName:ee.string(),faker:j7.optional(),data:ee.record(ee.any())});function ac(r=process.cwd()){let e=(0,_b.globbySync)("**/*.mock.json",{cwd:r,absolute:!0,gitignore:!0}),t=[];for(let s of e){let i=(0,Sb.readJSONSync)(s,{encoding:"utf8"}),n=N7.safeParse(i);if(!n.success){O.warn(`\u26A0\uFE0F Invalid schema in ${s}`),console.log(n.error.format());continue}t.push({eventName:n.data.eventName,path:s,schema:n.data})}return t}var Tb=new Se("event:list").description("List all available event mocks").action(()=>{let r=ac();if(r.length===0){O.error("No event schemas found.");return}let e=new Ab.default({head:["name","description"],style:{head:["dim","bold"],compact:!0}});for(let{eventName:t,schema:s}of r)e.push([t,s.description]);console.log(e.toString())});var Ah=null;async function Fb(){if(!Ah){let{faker:r}=await import("@faker-js/faker");Ah=r}return Ah}var Ob=new Se("event:send").description("Send a raw Pub/Sub event based on an event schema").argument("<eventName>","The name of the event").option("--endpoint <url>","Target HTTP endpoint","http://localhost:3000").option("--fake","Apply fake values to fakeable fields").option("--print","Print the generated Pub/Sub event without sending").action(async(r,e)=>{let t=await Fb(),i=ac().find(u=>u.eventName===r);if(!i){O.error(`Event "${r}" not found.`);return}let n=i.schema,o=e.fake?await L7(n):n.data,c={message:{data:Buffer.from(JSON.stringify({...o,type:n.eventName})).toString("base64"),messageId:t.string.uuid(),attributes:{source:"platform-sdk"}}};if(e.print){console.dir(c,{colors:!0});return}let l=await fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!l.ok){let u=await l.text();throw new Error(`Request failed: ${l.status} \u2013 ${u}`)}O.success("Event sent successfully.")});async function L7(r){let e=structuredClone(r.data);if(r.faker)for(let[t,s]of Object.entries(r.faker)){let i=await U7(s);fx(e,t,i)}return e}async function U7(r){let e=await Fb();switch(r){case"uuid":return e.string.uuid();case"email":return e.internet.email();case"string":return e.lorem.word();case"number":return e.number.int();case"boolean":return e.datatype.boolean();case"date":return new Date().toISOString();case"productName":return e.commerce.productName();case"productDescription":return e.commerce.productDescription();case"firstName":return e.person.firstName();case"lastName":return e.person.lastName();case"url":return e.internet.url();case"phoneNumber":return e.phone.number();case"streetAddress":return e.location.streetAddress();case"city":return e.location.city();case"state":return e.location.state();case"country":return e.location.country();case"companyName":return e.company.name();case"zipCode":return e.location.zipCode();case"password":return e.internet.password();default:return null}}var Ib=_(require("chalk"));var Bb=new Se("generate").alias("g").description(Ib.default.bold("Generate code (e.g. event-handlers, use-cases) using platform schematics")).argument("<schematic>","Name of schematic").argument("<name>","Name to generate").addHelpText("after",$1).showHelpAfterError().action(async(r,e)=>{try{await H2(r,e)}catch(t){O.error(t.message)}});var Li=require("node:fs"),Fh=_(require("node:path")),cc=_(require("chalk"));var Pb=_(require("os"));var{name:W7,publishConfig:q7}=Fr,V7=q7?.registry,H7=W7?.split("/")[0],Rb=new Se("token:set").description(cc.default.bold("Set a registry auth token in a .npmrc file")).argument("<token>","Authentication token (e.g. GitHub or npm token)").option("--scope <scope>","Package scope (e.g. @zooroyal)",H7).option("--registry <registry>","Registry URL",V7).option("--local","Write token to a local .npmrc in the current directory",!1).option("--force","Force overwrite existing token if already present",!1).action((r,e)=>Z7(r,e.scope||"",e.registry||"",e.local,e.force)).addHelpText("after",()=>`${cc.default.cyan(`
262
+ `)),process.exit(1)}}var fb=wr({name:"nest-micro",description:"Create a new NestJS microservice with the Crossdelta setup. Use --ai for AI-powered generation.",arguments:[["[name]","Name or path of the service"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["--ai","Use AI to generate service code based on a description"],["-d, --description <description>","Service description for AI generation (requires --ai)"],["--remove-dir","Remove existing directory before creating (used internally)"]],exampleUsage:'platform new nest-micro my-service --ai -d "User authentication service"',buildContext:async(r,e)=>{if(e.ai)throw await A7(r.name,e),new Error("AI generation should have exited");let t=(r.name??"services/my-nest-service").trim(),s=de(t),i=e.packageManager??(e.yes&&Ge()),n=e.packageManager==="bun",o=bt(),a=e.yes?_i():[],c=!!e.yes||!!r.name;return{cwd:s,projectName:t,shouldInstallBun:n,packageManager:i,availableIntegrations:o,selectedIntegrations:a,serviceType:"nest",elapsedTime:0,userConfirmed:!!e.yes,skipInputPrompts:c,removeDir:!!e.removeDir||!!e.yes}},prompts:[Mi,Pi,Bi,$i,Xa,Fi],actions:[Ri,Ii,cb,Ya,ub,Qa,V1,Ja,ec],onComplete:({projectName:r,packageManager:e,selectedIntegrations:t,assignedPort:s})=>{O.breakLine().log(et.default.bold.green("NestJS Microservice created successfully!")),Wa(t),qa((0,hb.basename)(r),s??3e3),O.breakLine().log(`To start the project, run:
263
+ ${et.default.bold(`cd ${r} && ${e} run start:dev`)}`).breakLine().log("Happy coding! \u{1F389}").breakLine()}});var yt=_(require("chalk"));var pb=require("node:child_process"),Be=require("node:fs"),jr=require("node:path"),mb=_(require("handlebars")),T7=()=>{let r=[(0,jr.join)(__dirname,"templates","workspace"),(0,jr.join)(__dirname,"..","workspace","templates")];for(let e of r)if((0,Be.existsSync)(e))return e;throw new Error(`Workspace templates directory not found. Searched in: ${r.join(", ")}`)},F7=(r,e)=>{let t=(0,Be.readFileSync)(r,"utf-8");return mb.default.compile(t)(e)},db=r=>{r.endsWith(".sh")&&(0,Be.chmodSync)(r,493)},O7=[{template:"package.json.hbs",output:"package.json"},{template:"pnpm-workspace.yaml.hbs",output:"pnpm-workspace.yaml",forPackageManager:"pnpm"},{template:"biome.json.hbs",output:"biome.json"},{template:"turbo.json.hbs",output:"turbo.json"},{template:"bunfig.toml.hbs",output:"bunfig.toml"},{template:"gitignore.hbs",output:".gitignore"},{template:"editorconfig.hbs",output:".editorconfig"},{template:"npmrc.hbs",output:".npmrc"},{template:"infra/package.json.hbs",output:"infra/package.json"},{template:"infra/index.ts.hbs",output:"infra/index.ts"},{template:"infra/tsconfig.json.hbs",output:"infra/tsconfig.json"},{template:"infra/Pulumi.yaml.hbs",output:"infra/Pulumi.yaml"},{template:"infra/Pulumi.dev.yaml.hbs",output:"infra/Pulumi.dev.yaml"},{template:"infra/services/nats.ts.hbs",output:"infra/services/nats.ts"},{template:"services/nats/package.json.hbs",output:"services/nats/package.json"},{template:"services/nats/nats.conf",output:"services/nats/nats.conf",isStatic:!0},{template:"services/nats/nats.prod.conf",output:"services/nats/nats.prod.conf",isStatic:!0},{template:"services/nats/README.md",output:"services/nats/README.md",isStatic:!0},{template:"services/nats/scripts/start-dev.sh.hbs",output:"services/nats/scripts/start-dev.sh"},{template:"apps/.gitkeep",output:"apps/.gitkeep",isStatic:!0},{template:"packages/.gitkeep",output:"packages/.gitkeep",isStatic:!0},{template:"docs/.gitkeep",output:"docs/.gitkeep",isStatic:!0},{template:".github/copilot-instructions.md.hbs",output:".github/copilot-instructions.md"},{template:".github/README.md",output:".github/README.md",isStatic:!0,isGitHubCI:!0},{template:".github/dependabot.yml",output:".github/dependabot.yml",isStatic:!0,isGitHubCI:!0},{template:".github/workflows/lint-and-tests.yml.hbs",output:".github/workflows/lint-and-tests.yml",isGitHubCI:!0},{template:".github/workflows/build-and-deploy.yml.hbs",output:".github/workflows/build-and-deploy.yml",isGitHubCI:!0},{template:".github/workflows/publish-packages.yml",output:".github/workflows/publish-packages.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/setup-bun-install/action.yml.hbs",output:".github/actions/setup-bun-install/action.yml",isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/action.yml",output:".github/actions/check-image-tag-exists/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-image-tag-exists/index.js",output:".github/actions/check-image-tag-exists/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/action.yml",output:".github/actions/check-path-changes/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/check-path-changes/index.js",output:".github/actions/check-path-changes/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/detect-skipped-services/action.yml",output:".github/actions/detect-skipped-services/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/action.yml",output:".github/actions/generate-scope-matrix/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/generate-scope-matrix/index.js",output:".github/actions/generate-scope-matrix/index.js",isStatic:!0,isGitHubCI:!0},{template:".github/actions/prepare-build-context/action.yml",output:".github/actions/prepare-build-context/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/action.yml",output:".github/actions/resolve-scope-tags/action.yml",isStatic:!0,isGitHubCI:!0},{template:".github/actions/resolve-scope-tags/index.js",output:".github/actions/resolve-scope-tags/index.js",isStatic:!0,isGitHubCI:!0}],xb={title:"Creating workspace structure",task:async(r,e)=>{if((0,Be.existsSync)(r.cwd)){e.title="Workspace directory already exists, skipping...";return}let t=T7(),s=r.includeGitHubCI??!0,i=r.packageManager||"bun",n=c=>{try{let h=(0,pb.spawnSync)(c,["--version"],{encoding:"utf-8",timeout:5e3}).stdout?.trim();if(h&&/^\d+\.\d+/.test(h))return`${c}@${h}`}catch{}return{bun:"bun@1.2.7",npm:"npm@10.9.2",yarn:"yarn@4.6.0",pnpm:"pnpm@9.15.2"}[c]||`${c}@latest`},o={projectName:r.projectName,githubOwner:r.githubOwner||"",pulumiStackBase:r.pulumiStackBase||r.projectName,packageManager:i,packageManagerVersion:n(i)},a=O7.filter(c=>!(c.isGitHubCI&&!s||c.forPackageManager&&c.forPackageManager!==i));for(let c of a){let l=(0,jr.join)(r.cwd,c.output),u=(0,jr.dirname)(l);if((0,Be.existsSync)(u)||(0,Be.mkdirSync)(u,{recursive:!0}),c.isStatic){let h=(0,jr.join)(t,c.template);(0,Be.existsSync)(h)?(0,Be.writeFileSync)(l,(0,Be.readFileSync)(h)):(0,Be.writeFileSync)(l,""),db(l)}else{let h=(0,jr.join)(t,c.template),d=F7(h,o);(0,Be.writeFileSync)(l,d),db(l)}}e.title="Workspace structure created"}};var gb=wr({name:"workspace",description:"Create a new workspace with infrastructure setup",arguments:[["[name]","Name or path of the workspace"]],options:[["-P, --package-manager <manager>","Specify the package manager (e.g., npm, yarn, pnpm, bun)"],["-y, --yes","Skip all prompts and use default values"],["-o, --github-owner <owner>","GitHub organization or username"],["-s, --pulumi-stack <name>","Pulumi stack base name (org/project)"],["--no-github","Skip GitHub CI/CD workflows"],["--remove-dir","Remove existing directory before creating (internal use)"]],exampleUsage:"pf new workspace my-platform -o my-org",buildContext:(r,e)=>{let t=(r.name??"my-platform").trim(),s=de(t),i=!!e.yes,n=e.packageManager??(i?Ge():void 0),o=e.packageManager==="bun",a=e.githubOwner??(i?"my-org":void 0),c=e.pulumiStack??(i?`${a}/${t}`:void 0),l=e.github===!1?!1:i?!0:void 0,u=!!r.name,h=e.removeDir||i;return{cwd:s,projectName:t,shouldInstallBun:o,packageManager:n,elapsedTime:0,userConfirmed:i,skipInputPrompts:u&&!i,removeDir:h,githubOwner:a,pulumiStackBase:c,includeGitHubCI:l}},prompts:[{enabled:r=>!r.userConfirmed,task:async(r,e)=>{try{let t=Ut();if(!await e.prompt(Q).run({type:"toggle",message:`\u26A0\uFE0F You are inside an existing workspace (${t}). Create a nested workspace anyway?`,enabled:"Yes",disabled:"No",initial:!1}))throw new Error("Workspace creation cancelled - already inside a workspace");e.title=yt.default.yellow("Warning: Creating nested workspace")}catch(t){if(t.message?.includes("cancelled"))throw t;e.title="No existing workspace detected"}}},Mi,Pi,G1,z1,K1,Bi,$i,Fi],actions:[Ri,Ii,xb,Qa,q1],onComplete:({projectName:r,includeGitHubCI:e})=>{O.breakLine().log(yt.default.bold.green("Workspace created successfully!")),O.breakLine().log(yt.default.bold("Next steps:")).log(` 1. ${yt.default.cyan(`cd ${r}`)}`).log(` 2. ${yt.default.cyan("bun pulumi login")}`).log(` 3. ${yt.default.cyan("bun pulumi up --stack dev")}`),e&&O.breakLine().log(yt.default.bold("GitHub Setup:")).log(" Configure these secrets in your GitHub repository:").log(` \u2022 ${yt.default.yellow("PULUMI_ACCESS_TOKEN")} - Pulumi Cloud access token`).log(` \u2022 ${yt.default.yellow("DIGITALOCEAN_TOKEN")} - DigitalOcean API token`).log(` \u2022 ${yt.default.yellow("NPM_TOKEN")} - (optional) NPM token for private packages`),O.breakLine().log(yt.default.bold("Structure created:")).log(" apps/ # Frontend applications").log(" services/ # Backend microservices").log(" packages/ # Shared libraries").log(" infra/").log(" \u251C\u2500\u2500 index.ts # Pulumi entry point").log(" \u251C\u2500\u2500 services/ # Service configs").log(" \u251C\u2500\u2500 Pulumi.yaml # Pulumi project config").log(" \u2514\u2500\u2500 Pulumi.dev.yaml # Dev stack config"),e&&O.log(" .github/").log(" \u251C\u2500\u2500 workflows/ # CI/CD workflows").log(" \u2514\u2500\u2500 actions/ # Custom actions"),O.breakLine().log("Happy coding! \u{1F389}").breakLine()}});var Kn=[{name:"Hono Microservice",value:"hono-micro",command:tb,supportsAi:!0},{name:"Nest Microservice",value:"nest-micro",command:fb,supportsAi:!0},{name:"Workspace (Infrastructure)",value:"workspace",command:gb,supportsAi:!1}],bb=()=>{let r=wr({name:"new",description:"Create a new project",arguments:[["[type]","Type of the project (e.g., nest-micro, shopware-plugin)"]],exampleUsage:"platform new nest-micro test-project",buildContext:e=>({projectType:e.type??"",useAi:!1,aiDescription:"",elapsedTime:0,cwd:process.cwd()}),prompts:[{enabled:e=>!e.projectType,task:async(e,t)=>{let s=await t.prompt(Q).run({type:"select",message:"Select Project type",choices:Kn});e.projectType=Kn.find(i=>i.name===s)?.value||"",t.title=`Using ${hr.default.bold(s)}`}},{enabled:e=>e.projectType!=="workspace"&&e.projectType!=="",task:async(e,t)=>{try{Ut(),t.title="Workspace detected"}catch{let s=["Not in a workspace directory","",`Current directory: ${process.cwd()}`,"","This command must be run from within a workspace created with pf new workspace","","To create a new workspace, run:",""," pf new workspace my-platform"].join(`
264
+ `);throw new Error(s)}}},{enabled:e=>e.projectType==="workspace",task:async(e,t)=>{try{let s=Ut();if(!await t.prompt(Q).run({type:"toggle",message:`\u26A0\uFE0F You are inside an existing workspace (${s}). Create a nested workspace anyway?`,enabled:"Yes",disabled:"No",initial:!1}))throw new Error("Workspace creation cancelled - already inside a workspace");t.title=hr.default.yellow("Warning: Creating nested workspace")}catch(s){if(s.message?.includes("cancelled"))throw s;t.title="No existing workspace detected"}}},{enabled:e=>!!e.projectType,task:async(e,t)=>{let i={"hono-micro":"services/my-hono-service","nest-micro":"services/my-nest-service",workspace:"my-platform"}[e.projectType]||"my-project",n=e.projectType==="workspace"?"\u{1F4E6} Workspace name:":"\u{1F4E6} Service path (e.g., services/my-service):",o=await t.prompt(Q).run({type:"input",message:n,initial:i});e.servicePath=o.trim(),t.title=`Path: ${hr.default.dim(o)}`}},{enabled:e=>!!Kn.find(s=>s.value===e.projectType)?.supportsAi&&bi().valid,task:async(e,t)=>{let s=await t.prompt(Q).run({type:"toggle",message:"Use AI to generate service code?",enabled:"Yes",disabled:"No",initial:!1});e.useAi=s,t.title=s?hr.default.cyan("\u{1F916} AI-powered generation"):"Standard scaffolding"}},{enabled:e=>e.useAi,task:async(e,t)=>{let s=await t.prompt(Q).run({type:"input",message:"Describe what this service should do:"});e.aiDescription=s,t.title=`Description: ${hr.default.dim(s.slice(0,50))}${s.length>50?"...":""}`}},{enabled:e=>{if(!e.servicePath)return!1;let t=de(e.servicePath);return!ka(t)},task:async(e,t)=>{if(!await t.prompt(Q).run({type:"toggle",message:hr.default.bold("\u26A0\uFE0F Overwrite existing directory?"),enabled:"Yes",disabled:"No",initial:!1}))throw new Error("Project creation was canceled by the user.");e.shouldRemoveDir=!0,t.title=hr.default.yellow("Will overwrite existing directory")}},{title:"Confirm creation",enabled:e=>e.projectType!=="workspace",task:async(e,t)=>{if(!await t.prompt(Q).run({type:"Toggle",initial:!0,message:"\u{1F680} Ready to launch your project?"}))throw new Error("Project creation was canceled by the user.")}}],actions:[],onComplete:async e=>{Kn.find(n=>n.value===e.projectType)||r.error(hr.default.red(`Project type ${e.projectType} is not supported.`));let t=r.commands.find(n=>n.name()===e.projectType),s={};e.projectType!=="workspace"&&(s.yes=!0);let i=[];e.servicePath&&i.push("servicePath"),e.shouldRemoveDir&&(s.removeDir=!0),e.useAi&&(s.ai=!0,s.description=e.aiDescription),await j1(t,e,s,i)}});for(let e of Kn)r.addCommand(e.command);return r};var Le=require("node:fs"),Eh=require("node:fs/promises"),Ni=require("node:path"),Os=_(require("chalk"));var kh=300,yb=500,wb=30,I7=["infra/services"],B7=["services","apps"],Fs=null,Zn=!1,Nr=r=>process.stdout.write(`${r}
265
+ `),oc=r=>new Promise(e=>setTimeout(e,r)),P7=()=>{process.stdout.write("\x1B[?1049l\x1B[?25h\x1Bc")},Sh=(r,e)=>{let t=null;return(...s)=>{t&&clearTimeout(t),t=setTimeout(()=>r(...s),e)}},vb=async()=>{let r=Fs?.pid;if(!r)return;Nr(Os.default.cyan("\u23F9 Stopping services...")),Fs?.stdout?.removeAllListeners(),Fs?.stderr?.removeAllListeners(),Fs?.removeAllListeners();let e=t=>{try{process.kill(-r,t)}catch{Fs?.kill(t)}};e("SIGTERM"),await oc(1e3);try{e("SIGKILL")}catch{}Fs=null,await oc(100)},Cb=r=>{Nr(Os.default.cyan("\u{1F525} Starting services...")),Fs=n2("turbo",["run","start:dev","--continue"],{cwd:r,envFile:".env.local",onStderr:e=>{Zn||process.stderr.write(e)},onExit:e=>{Zn||(Nr(`
266
+ Turbo exited with code ${e}`),process.exit(e??0))}})},Eb=r=>Ta("generate-env",{cwd:r}),R7=async r=>{let t=["bun.lock","bun.lockb","package-lock.json","yarn.lock","pnpm-lock.yaml"].map(c=>(0,Ni.join)(r,c)).find(Le.existsSync),s=(0,Ni.join)(r,"node_modules"),i=async()=>({lock:t&&(0,Le.existsSync)(t)?(await(0,Eh.stat)(t)).mtimeMs:0,nm:(0,Le.existsSync)(s)?(await(0,Eh.stat)(s)).mtimeMs:0}),n=await i(),o=!1;for(let c=0;c<wb&&!o;c++){await oc(yb);let l=await i();o=l.lock!==n.lock||l.nm!==n.nm}if(!o)return;let a=await i();for(let c=0;c<wb;c++){await oc(yb);let l=await i();if(l.lock===a.lock&&l.nm===a.nm)return;a=l}},_h=async(r,e,t=!1,s)=>{if(!Zn){Zn=!0;try{t||await R7(e),await vb(),P7(),s&&Nr(s),Nr(Os.default.cyan(`\u{1F504} Detected change in ${Os.default.white(r)}, restarting...`)),await Eb(e),Cb(e)}catch(i){Nr(`\u274C Failed to restart: ${i}`)}finally{Zn=!1}}},M7=(r,e)=>{let t=Sh(s=>_h(s,e,!0),kh);for(let s of r){let i=(0,Ni.join)(e,s);(0,Le.existsSync)(i)&&(0,Le.watch)(i,{recursive:!0},(n,o)=>o?.endsWith(".ts")&&t(o))}},Db=r=>{try{return(0,Le.existsSync)(r)?new Set((0,Le.readdirSync)(r,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name)):new Set}catch{return new Set}},$7=(r,e)=>{for(let t of r){let s=(0,Ni.join)(e,t);if(!(0,Le.existsSync)(s))continue;let i=Db(s),n=Sh(async()=>{let a=Db(s),c=[...a].filter(d=>!i.has(d)),l=[...i].filter(d=>!a.has(d));if(!c.length&&!l.length)return;let u=[...c.map(d=>`+${d}`),...l.map(d=>`-${d}`)].join(", ");i=a;let h=c.length===0&&l.length>0;await _h(`${t}/`,e,h,`\u{1F4E6} Package changes: ${u}`)},kh);(0,Le.watch)(s,{recursive:!1},n);let o=Sh(async a=>{await _h(`${t}/${a}`,e,!1,`\u{1F4E6} Service updated: ${a}`)},kh);(0,Le.watch)(s,{recursive:!0},(a,c)=>{if(c?.endsWith("package.json")){let l=c.split("/")[0];l&&i.has(l)&&o(l)}})}},kb=new Se("dev").description("Start development mode with auto-reload").action(async()=>{let r=Ut(),e=I7,t=B7;try{let i=JSON.parse((0,Le.readFileSync)((0,Ni.join)(r,"package.json"),"utf-8"));e=i.pf?.dev?.watchDirs??e,t=i.pf?.dev?.watchPackages??t}catch{}await Eb(r),Cb(r),Nr(`
267
+ ${Os.default.cyan("\u{1F440} Watching:")} ${[...e,...t].join(", ")}`),M7(e,r),$7(t,r);let s=async()=>{Nr(Os.default.cyan(`
268
+ \u{1F44B} Shutting down...`)),await vb(),process.exit(0)};process.on("SIGINT",s),process.on("SIGTERM",s)});var Ab=_(bh());var Sb=require("fs-extra"),_b=require("globby");var j7=ee.record(ee.enum(["uuid","email","string","number","boolean","date","firstName","lastName","productName","productDescription","url","phoneNumber","address","companyName","streetAddress","city","state","country","zipCode","password"])),N7=ee.object({description:ee.string().optional(),eventName:ee.string(),faker:j7.optional(),data:ee.record(ee.any())});function ac(r=process.cwd()){let e=(0,_b.globbySync)("**/*.mock.json",{cwd:r,absolute:!0,gitignore:!0}),t=[];for(let s of e){let i=(0,Sb.readJSONSync)(s,{encoding:"utf8"}),n=N7.safeParse(i);if(!n.success){O.warn(`\u26A0\uFE0F Invalid schema in ${s}`),console.log(n.error.format());continue}t.push({eventName:n.data.eventName,path:s,schema:n.data})}return t}var Tb=new Se("event:list").description("List all available event mocks").action(()=>{let r=ac();if(r.length===0){O.error("No event schemas found.");return}let e=new Ab.default({head:["name","description"],style:{head:["dim","bold"],compact:!0}});for(let{eventName:t,schema:s}of r)e.push([t,s.description]);console.log(e.toString())});var Ah=null;async function Fb(){if(!Ah){let{faker:r}=await import("@faker-js/faker");Ah=r}return Ah}var Ob=new Se("event:send").description("Send a raw Pub/Sub event based on an event schema").argument("<eventName>","The name of the event").option("--endpoint <url>","Target HTTP endpoint","http://localhost:3000").option("--fake","Apply fake values to fakeable fields").option("--print","Print the generated Pub/Sub event without sending").action(async(r,e)=>{let t=await Fb(),i=ac().find(u=>u.eventName===r);if(!i){O.error(`Event "${r}" not found.`);return}let n=i.schema,o=e.fake?await L7(n):n.data,c={message:{data:Buffer.from(JSON.stringify({...o,type:n.eventName})).toString("base64"),messageId:t.string.uuid(),attributes:{source:"platform-sdk"}}};if(e.print){console.dir(c,{colors:!0});return}let l=await fetch(e.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(!l.ok){let u=await l.text();throw new Error(`Request failed: ${l.status} \u2013 ${u}`)}O.success("Event sent successfully.")});async function L7(r){let e=structuredClone(r.data);if(r.faker)for(let[t,s]of Object.entries(r.faker)){let i=await U7(s);fx(e,t,i)}return e}async function U7(r){let e=await Fb();switch(r){case"uuid":return e.string.uuid();case"email":return e.internet.email();case"string":return e.lorem.word();case"number":return e.number.int();case"boolean":return e.datatype.boolean();case"date":return new Date().toISOString();case"productName":return e.commerce.productName();case"productDescription":return e.commerce.productDescription();case"firstName":return e.person.firstName();case"lastName":return e.person.lastName();case"url":return e.internet.url();case"phoneNumber":return e.phone.number();case"streetAddress":return e.location.streetAddress();case"city":return e.location.city();case"state":return e.location.state();case"country":return e.location.country();case"companyName":return e.company.name();case"zipCode":return e.location.zipCode();case"password":return e.internet.password();default:return null}}var Ib=_(require("chalk"));var Bb=new Se("generate").alias("g").description(Ib.default.bold("Generate code (e.g. event-handlers, use-cases) using platform schematics")).argument("<schematic>","Name of schematic").argument("<name>","Name to generate").addHelpText("after",$1).showHelpAfterError().action(async(r,e)=>{try{await H2(r,e)}catch(t){O.error(t.message)}});var Li=require("node:fs"),Fh=_(require("node:path")),cc=_(require("chalk"));var Pb=_(require("os"));var{name:W7,publishConfig:q7}=Or,V7=q7?.registry,H7=W7?.split("/")[0],Rb=new Se("token:set").description(cc.default.bold("Set a registry auth token in a .npmrc file")).argument("<token>","Authentication token (e.g. GitHub or npm token)").option("--scope <scope>","Package scope (e.g. @zooroyal)",H7).option("--registry <registry>","Registry URL",V7).option("--local","Write token to a local .npmrc in the current directory",!1).option("--force","Force overwrite existing token if already present",!1).action((r,e)=>Z7(r,e.scope||"",e.registry||"",e.local,e.force)).addHelpText("after",()=>`${cc.default.cyan(`
269
269
  Example:`)}
270
270
  ${cc.default.bold("platform token:set <token> --scope @zooroyal --registry https://npm.pkg.github.com")}
271
271
  `),G7=r=>r?Fh.default.join(process.cwd(),".npmrc"):Fh.default.join(Pb.default.homedir(),".npmrc"),z7=(r,e,t)=>{let s=new URL(t).host;return e?`${e}:registry=https://${s}
272
272
  //${s}/:_authToken=${r}`:`//${s}/:_authToken=${r}`},K7=r=>(0,Li.existsSync)(r)?(0,Li.readFileSync)(r,"utf8"):"",Th=(r,e)=>(0,Li.writeFileSync)(r,e),Z7=(r,e,t,s=!1,i=!1)=>{let n=G7(s),o=z7(r,e,t),a=new URL(t).host,c=K7(n),l=new RegExp(`//${a}/:_authToken=\\S+`);if(!c){Th(n,`${o}
273
273
  `),O.success(`Created new .npmrc and set token for ${a}`);return}if(l.test(c)){if(!i){O.warn(`Token for ${a} already exists in ${n}. Use --force to overwrite.`);return}c=c.replace(l,o),Th(n,c),O.success(`Overwrote existing token for ${a} in ${n}`);return}c+=`
274
274
  ${o}
275
- `,Th(n,c),O.success(`Appended token for ${a} to ${n}`)};var oe=_(require("chalk"));var Y7=[/embed/i,/whisper/i,/tts/i,/dall-e/i,/davinci/i,/babbage/i,/curie/i,/ada(?!-)/i,/moderation/i,/realtime/i,/audio/i,/transcription/i,/search/i];async function J7(r,e,t=1e4){let s=new AbortController,i=setTimeout(()=>s.abort(),t);try{return await fetch(r,{...e,signal:s.signal})}finally{clearTimeout(i)}}function X7(r){return r.replace(/-(\d{8})$/," ($1)").replace(/^claude-/,"Claude ").replace(/^gpt-/,"GPT-").replace(/-/g," ").replace(/(\d)\.(\d)/g,"$1.$2").replace(/\s+/g," ").split(" ").map(e=>/^\d/.test(e)||/^\(\d+\)$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}async function Q7(r,e){let t=Yi(r),s=await J7(t.modelsApiUrl,{headers:t.buildHeaders(e)});if(!s.ok)throw new Error(`${t.name} API error: ${s.status}`);let i=await s.json(),n=t.parseModelsResponse(i);if(!Array.isArray(n)||n.length===0)throw new Error(`No models returned from ${t.name} API`);let o=n.filter(a=>{let c=t.modelFilters.some(u=>u.test(a.id)),l=Y7.some(u=>u.test(a.id));return c&&!l}).sort((a,c)=>{let l=typeof a.created=="number"?a.created:new Date(a.created).getTime();return(typeof c.created=="number"?c.created:new Date(c.created).getTime())-l}).map(a=>({name:X7(a.id),value:a.id}));if(o.length===0)throw new Error(`No chat models found from ${t.name} API`);return o}async function Mb(r,e){if(!e)throw new Error("API key is required to fetch available models");return{models:await Q7(r,e),fromApi:!0}}function eE(){if(!Ji())return null;try{let r=ho();return console.log(oe.default.dim(`Found existing configuration at ${Hr}
275
+ `,Th(n,c),O.success(`Appended token for ${a} to ${n}`)};var oe=_(require("chalk"));var Y7=[/embed/i,/whisper/i,/tts/i,/dall-e/i,/davinci/i,/babbage/i,/curie/i,/ada(?!-)/i,/moderation/i,/realtime/i,/audio/i,/transcription/i,/search/i];async function J7(r,e,t=1e4){let s=new AbortController,i=setTimeout(()=>s.abort(),t);try{return await fetch(r,{...e,signal:s.signal})}finally{clearTimeout(i)}}function X7(r){return r.replace(/-(\d{8})$/," ($1)").replace(/^claude-/,"Claude ").replace(/^gpt-/,"GPT-").replace(/-/g," ").replace(/(\d)\.(\d)/g,"$1.$2").replace(/\s+/g," ").split(" ").map(e=>/^\d/.test(e)||/^\(\d+\)$/.test(e)?e:e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()}async function Q7(r,e){let t=Yi(r),s=await J7(t.modelsApiUrl,{headers:t.buildHeaders(e)});if(!s.ok)throw new Error(`${t.name} API error: ${s.status}`);let i=await s.json(),n=t.parseModelsResponse(i);if(!Array.isArray(n)||n.length===0)throw new Error(`No models returned from ${t.name} API`);let o=n.filter(a=>{let c=t.modelFilters.some(u=>u.test(a.id)),l=Y7.some(u=>u.test(a.id));return c&&!l}).sort((a,c)=>{let l=typeof a.created=="number"?a.created:new Date(a.created).getTime();return(typeof c.created=="number"?c.created:new Date(c.created).getTime())-l}).map(a=>({name:X7(a.id),value:a.id}));if(o.length===0)throw new Error(`No chat models found from ${t.name} API`);return o}async function Mb(r,e){if(!e)throw new Error("API key is required to fetch available models");return{models:await Q7(r,e),fromApi:!0}}function eE(){if(!Ji())return null;try{let r=ho();return console.log(oe.default.dim(`Found existing configuration at ${Gr}
276
276
  `)),r}catch{return console.log(oe.default.yellow(`Found corrupted configuration, starting fresh.
277
277
  `)),null}}async function tE(r,e){return console.log(oe.default.dim(`
278
278
  \u{1F4CB} Get your ${r} API key here:`)),console.log(oe.default.cyan(` ${e}
279
279
  `)),d0({message:`Enter your ${r} API key:`,mask:"*",validate:t=>t.trim()?t.length<10?"API key seems too short":!0:"API key cannot be empty"})}async function rE(r,e,t){let s=await Ko({message:"Select model:",choices:r,default:e?.provider===t?e.model:void 0});return await zo({message:"Enter a custom model ID instead?",default:!1})?fn({message:"Enter custom model ID:",default:s,validate:n=>n.trim()?!0:"Model ID cannot be empty"}):s}function $b(r){return r.length<=12?"****":`${r.slice(0,4)}...${r.slice(-4)}`}function sE(r,e){console.log(oe.default.green.bold(`
280
280
  \u2705 AI configuration saved successfully!
281
- `)),console.log(oe.default.dim(`Configuration file: ${Hr}`)),console.log(oe.default.dim("API Key: Stored securely in system keychain")),console.log(oe.default.dim(`Provider: ${r.provider}`)),console.log(oe.default.dim(`Model: ${r.model}`)),console.log(oe.default.dim(`API Key: ${$b(e)}
281
+ `)),console.log(oe.default.dim(`Configuration file: ${Gr}`)),console.log(oe.default.dim("API Key: Stored securely in system keychain")),console.log(oe.default.dim(`Provider: ${r.provider}`)),console.log(oe.default.dim(`Model: ${r.model}`)),console.log(oe.default.dim(`API Key: ${$b(e)}
282
282
  `)),console.log(oe.default.cyan("You can now use AI-powered service generation:")),console.log(oe.default.dim(` pf new hono-micro services/my-service --ai
283
283
  `))}async function iE(r){let e=await uo(r);if(e)return e;let t=Yi(r);return process.env[t.defaultApiKeyEnvVar]??null}async function nE(){console.log(oe.default.cyan.bold(`
284
284
  \u{1F916} AI Configuration Setup
@@ -304,6 +304,6 @@ This command must be run from within a workspace created with`),wt.default.cyan(
304
304
  To create a new workspace, run:`)),console.error(wt.default.cyan(`
305
305
  pf new workspace my-platform
306
306
  `)),process.exit(1)),console.error(wt.default.red(`
307
- \u2716 An unexpected error occurred:`)),console.error(r),process.exit(1)});var lc=new Se,jb=Object.keys(Fr.bin||{}),[Ub="pf",Ih]=jb.length>0?jb:["pf"],{description:oE,version:aE,repository:Nb}=Fr,cE=Nb?.url?`https://${Nb.url.replace(/^(git\+|git@)/,"").replace(/\.git$/,"").replace(":","/")}`:"Repository URL not available",lE=[Oh,bb(),kb,Bb,Tb,Ob,Rb];lc.name(Ub).description([wt.default.bold(oE),`
307
+ \u2716 An unexpected error occurred:`)),console.error(r),process.exit(1)});var lc=new Se,jb=Object.keys(Or.bin||{}),[Ub="pf",Ih]=jb.length>0?jb:["pf"],{description:oE,version:aE,repository:Nb}=Or,cE=Nb?.url?`https://${Nb.url.replace(/^(git\+|git@)/,"").replace(/\.git$/,"").replace(":","/")}`:"Repository URL not available",lE=[Oh,bb(),kb,Bb,Tb,Ob,Rb];lc.name(Ub).description([wt.default.bold(oE),`
308
308
 
309
309
  `,wt.default.cyan("See more at: "),wt.default.bold(Yt("GitHub",cE))].join("")).version(aE||"0.0.1").helpCommand(!1);Ih&&Ih!==Ub&&lc.alias(Ih);lE.forEach(r=>{lc.addCommand(r)});lc.parse(Lb.argv);