t+="Invalid input",this.state.error=`
`+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(et.cursor.down(e.rest.length)),this.write(`
`.repeat(t))}catch{}this.emit("close")}start(){!this.stop&&this.options.show!==!1&&(this.stop=mi.listen(this,this.keypress.bind(this)),this.once("close",this.stop))}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:i}=this;if(this.format=()=>e.call(this,this.value),this.result=()=>i.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 s=t.onSubmit.bind(this),n=this.submit.bind(this);delete this.options.onSubmit,this.submit=async()=>(await s(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,i){let{options:s,state:n,symbols:u,timers:o}=this,a=o&&o[e];n.timer=a;let l=s[e]||n[e]||u[e],c=t&&t[e]!=null?t[e]:await l;if(c==="")return c;let h=await this.resolve(c,n,t,i);return!h&&t&&t[e]?this.resolve(l,n,t,i):h}async prefix(){let e=await this.element("prefix")||this.symbols,t=this.timers&&this.timers.prefix,i=this.state;return i.timer=t,de.isObject(e)&&(e=e[i.status]||e.pending),de.hasColor(e)?e:(this.styles[i.status]||this.styles.pending)(e)}async message(){let e=await this.element("message");return de.hasColor(e)?e:this.styles.strong(e)}async separator(){let e=await this.element("separator")||this.symbols,t=this.timers&&this.timers.separator,i=this.state;i.timer=t;let s=e[i.status]||e.pending||i.separator,n=await this.resolve(s,i);return de.isObject(n)&&(n=n[i.status]||n.pending),de.hasColor(n)?n:this.styles.muted(n)}async pointer(e,t){let i=await this.element("pointer",e,t);if(typeof i=="string"&&de.hasColor(i))return i;if(i){let s=this.styles,n=this.index===t,u=n?s.primary:l=>l,o=await this.resolve(i[n?"on":"off"]||i,this.state),a=de.hasColor(o)?o:u(o);return n?a:" ".repeat(o.length)}}async indicator(e,t){let i=await this.element("indicator",e,t);if(typeof i=="string"&&de.hasColor(i))return i;if(i){let s=this.styles,n=e.enabled===!0,u=n?s.success:s.dark,o=i[n?"on":"off"]||i;return de.hasColor(o)?o:u(o)}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 de.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 de.resolve(this,e,...t)}get base(){return r.prototype}get style(){return this.styles[this.state.status]}get height(){return this.options.rows||de.height(this.stdout,25)}get width(){return this.options.columns||de.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,i=[t,e].find(this.isValue.bind(this));return this.isValue(i)?i:this.initial}static get prompt(){return e=>new this(e).run()}};function lh(r){let e=s=>r[s]===void 0||typeof r[s]=="function",t=["actions","choices","initial","margin","roles","styles","symbols","theme","timers","value"],i=["body","footer","error","header","hint","indicator","message","prefix","separator","skip"];for(let s of Object.keys(r.options)){if(t.includes(s)||/^on[A-Z]/.test(s))continue;let n=r.options[s];typeof n=="function"&&e(s)?i.includes(s)||(r[s]=n.bind(r)):typeof r[s]!="function"&&(r[s]=n)}}function ch(r){typeof r=="number"&&(r=[r,r,r,r]);let e=[].concat(r||[]),t=s=>s%2===0?`
`:" ",i=[];for(let s=0;s<4;s++){let n=t(s);e[s]?i.push(n.repeat(e[s])):i.push("")}return i}Cu.exports=Ei});var wu=y((Q0,yu)=>{"use strict";var hh=le(),Au={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 Au.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}};yu.exports=(r,e={})=>{let t=hh.merge({},Au,e.roles);return t[r]||t.default}});var St=y((X0,vu)=>{"use strict";var fh=be(),dh=dt(),ph=wu(),sr=le(),{reorder:Ci,scrollUp:Dh,scrollDown:gh,isObject:_u,swap:mh}=sr,Ai=class extends dh{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:i,suggest:s}=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 s!="function"&&this.selectable.length===0)throw new Error("At least one choice must be selectable");_u(t)&&(t=Object.keys(t)),Array.isArray(t)?(i!=null&&(this.index=this.findIndex(i)),t.forEach(n=>this.enable(this.find(n))),await this.render()):(i!=null&&(t=i),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 i=[],s=0,n=async(u,o)=>{typeof u=="function"&&(u=await u.call(this)),u instanceof Promise&&(u=await u);for(let a=0;a<u.length;a++){let l=u[a]=await this.toChoice(u[a],s++,o);i.push(l),l.choices&&await n(l.choices,l)}return i};return n(e,t).then(u=>(this.state.loadingChoices=!1,u))}async toChoice(e,t,i){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 s=e.value;if(e=ph(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,sr.define(e,"parent",i),e.level=i?i.level+1:1,e.indent==null&&(e.indent=i?i.indent+"  ":e.indent||""),e.path=i?i.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,fh.unstyle(e.message).length));let u={...e};return e.reset=(o=u.input,a=u.value)=>{for(let l of Object.keys(u))e[l]=u[l];e.input=o,e.value=a},s==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,i){let s=await this.toChoice(e,t,i);return this.choices.push(s),this.index=this.choices.length-1,this.limit=this.choices.length,s}async newItem(e,t,i){let s={name:"New choice name?",editable:!0,newChoice:!0,...e},n=await this.addChoice(s,t,i);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(){return this.multiple?(this.toggle(this.focused),this.render()):this.alert()}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(e=this.focused){return this.choices.some(t=>!!t.parent)?(this.toggle(e.parent&&!e.choices?e.parent:e),this.render()):this.a()}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(s=>this.toggle(s,t));let i=e.parent;for(;i;){let s=i.choices.filter(n=>this.isDisabled(n));i.enabled=s.every(n=>n.enabled===!0),i=i.parent}return bu(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=i=>{let s=Number(i);if(s>this.choices.length-1)return this.alert();let n=this.focused,u=this.choices.find(o=>s===o.index);if(!u.enabled&&this.selected.length>=this.maxSelected)return this.alert();if(this.visible.indexOf(u)===-1){let o=Ci(this.choices),a=o.indexOf(u);if(n.index>a){let l=o.slice(a,a+this.limit),c=o.filter(h=>!l.includes(h));this.choices=l.concat(c)}else{let l=a-this.limit+1;this.choices=o.slice(l).concat(o.slice(0,l))}}return this.index=this.choices.indexOf(u),this.toggle(this.focused),this.render()};return clearTimeout(this.numberTimeout),new Promise(i=>{let s=this.choices.length,n=this.num,u=(o=!1,a)=>{clearTimeout(this.numberTimeout),o&&(a=t(n)),this.num="",i(a)};if(n==="0"||n.length===1&&+(n+"0")>s)return u(!0);if(Number(n)>s)return u(!1,this.alert());this.numberTimeout=setTimeout(()=>u(!0),this.delay)})}home(){return this.choices=Ci(this.choices),this.index=0,this.render()}end(){let e=this.choices.length-this.limit,t=Ci(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,i=this.index;return this.options.scroll===!1&&i===0?this.alert():e>t&&i===0?this.scrollUp():(this.index=(i-1%e+e)%e,this.isDisabled()?this.up():this.render())}down(){let e=this.choices.length,t=this.visible.length,i=this.index;return this.options.scroll===!1&&i===t-1?this.alert():e>t&&i===t-1?this.scrollDown():(this.index=(i+1)%e,this.isDisabled()?this.down():this.render())}scrollUp(e=0){return this.choices=Dh(this.choices),this.index=e,this.isDisabled()?this.up():this.render()}scrollDown(e=this.visible.length-1){return this.choices=gh(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){mh(this.choices,this.index,e)}isDisabled(e=this.focused){return e&&["disabled","collapsed","hidden","completing","readonly"].some(i=>e[i]===!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(i=>!this.isDisabled(i));return e.enabled&&t.every(i=>this.isEnabled(i))}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((i,s)=>(i[s]=this.find(s,t),i),{})}filter(e,t){let s=typeof e=="function"?e:(o,a)=>[o.name,a].includes(e),u=(this.options.multiple?this.state._choices:this.choices).filter(s);return t?u.map(o=>o[t]):u}find(e,t){if(_u(e))return t?e[t]:e;let s=typeof e=="function"?e:(u,o)=>[u.name,o].includes(e),n=this.choices.find(s);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(u=>u.newChoice))return this.alert();let{reorder:t,sort:i}=this.options,s=this.multiple===!0,n=this.selected;return n===void 0?this.alert():(Array.isArray(n)&&t!==!1&&i!==!0&&(n=sr.reorder(n)),this.value=s?n.map(u=>u.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(i=>i.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 i=this.find(t);i&&(this.initial=i.index,this.focus(i,!0))}}}get choices(){return bu(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:i}=this,s=e.limit||this._limit||t.limit||i.length;return Math.min(s,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 bu(r,e){if(e instanceof Promise)return e;if(typeof e=="function"){if(sr.isAsyncFn(e))return e;e=e.call(r,r)}for(let t of e){if(Array.isArray(t.choices)){let i=t.choices.filter(s=>!r.isDisabled(s));t.enabled=i.every(s=>s.enabled===!0)}r.isDisabled(t)===!0&&delete t.enabled}return e}vu.exports=Ai});var We=y((Z0,Fu)=>{"use strict";var Eh=St(),yi=le(),wi=class extends Eh{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 i=this.resolve(e.message,this.state,e,t);return e.role==="heading"&&!yi.hasColor(i)&&(i=this.styles.strong(i)),this.resolve(i,this.state,e,t)}choiceSeparator(){return":"}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,s=await this.pointer(e,t),n=await this.indicator(e,t)+(e.pad||""),u=await this.resolve(e.hint,this.state,e,t);u&&!yi.hasColor(u)&&(u=this.styles.muted(u));let o=this.indent(e),a=await this.choiceMessage(e,t),l=()=>[this.margin[3],o+s+n,a,this.margin[1],u].filter(Boolean).join(" ");return e.role==="heading"?l():e.disabled?(yi.hasColor(a)||(a=this.styles.disabled(a)),l()):(i&&(a=this.styles.em(a)),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,u)=>await this.renderChoice(n,u)),t=await Promise.all(e);t.length||t.push(this.styles.danger("No matching choices"));let i=this.margin[0]+t.join(`
`),s;return this.options.choicesHeader&&(s=await this.resolve(this.options.choicesHeader,this.state)),[s,i].filter(Boolean).join(`
`)}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,i="",s=await this.header(),n=await this.prefix(),u=await this.separator(),o=await this.message();this.options.promptLine!==!1&&(i=[n,o,u,""].join(" "),this.state.prompt=i);let a=await this.format(),l=await this.error()||await this.hint(),c=await this.renderChoices(),h=await this.footer();a&&(i+=a),l&&!i.includes(l)&&(i+=" "+l),e&&!a&&!c.trim()&&this.multiple&&this.emptyError!=null&&(i+=this.styles.danger(this.emptyError)),this.clear(t),this.write([s,i,c,h].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Fu.exports=wi});var Su=y((J0,xu)=>{"use strict";var Ch=We(),Ah=(r,e)=>{let t=r.toLowerCase();return i=>{let n=i.toLowerCase().indexOf(t),u=e(i.slice(n,n+t.length));return n>=0?i.slice(0,n)+u+i.slice(n+t.length):i}},_i=class extends Ch{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:i}=this.state;return this.input=i.slice(0,t)+e+i.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 i=e.toLowerCase();return t.filter(s=>s.message.toLowerCase().includes(i))}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.options.highlight.bind(this):this.styles.placeholder,t=Ah(this.input,e),i=this.choices;this.choices=i.map(s=>({...s,message:t(s.message)})),await super.render(),this.choices=i}submit(){return this.options.multiple&&(this.value=this.selected.map(e=>e.name)),super.submit()}};xu.exports=_i});var vi=y((eD,Ru)=>{"use strict";var bi=le();Ru.exports=(r,e={})=>{r.cursorHide();let{input:t="",initial:i="",pos:s,showCursor:n=!0,color:u}=e,o=u||r.styles.placeholder,a=bi.inverse(r.styles.primary),l=D=>a(r.styles.black(D)),c=t,h=" ",f=l(h);if(r.blink&&r.blink.off===!0&&(l=D=>D,f=""),n&&s===0&&i===""&&t==="")return l(h);if(n&&s===0&&(t===i||t===""))return l(i[0])+o(i.slice(1));i=bi.isPrimitive(i)?`${i}`:"",t=bi.isPrimitive(t)?`${t}`:"";let p=i&&i.startsWith(t)&&i!==t,m=p?l(i[t.length]):f;if(s!==t.length&&n===!0&&(c=t.slice(0,s)+l(t[s])+t.slice(s+1),m=""),n===!1&&(m=""),p){let D=r.styles.unstyle(c+m);return c+m+o(i.slice(D.length))}return c+m}});var nr=y((tD,Bu)=>{"use strict";var yh=be(),wh=We(),_h=vi(),Fi=class extends wh{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:i,input:s}=t;return t.value=t.input=s.slice(0,i)+e+s.slice(i),t.cursor++,this.render()}delete(){let e=this.focused;if(!e||e.cursor<=0)return this.alert();let{cursor:t,input:i}=e;return e.value=e.input=i.slice(0,t-1)+i.slice(t),e.cursor--,this.render()}deleteForward(){let e=this.focused;if(!e)return this.alert();let{cursor:t,input:i}=e;if(i[t]===void 0)return this.alert();let s=`${i}`.slice(0,t)+`${i}`.slice(t+1);return e.value=e.input=s,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:i}=e;return t&&t.startsWith(i)&&i!==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 i=await this.resolve(e.separator,this.state,e,t)||":";return i?" "+this.styles.disabled(i):""}async renderChoice(e,t){await this.onChoice(e,t);let{state:i,styles:s}=this,{cursor:n,initial:u="",name:o,hint:a,input:l=""}=e,{muted:c,submitted:h,primary:f,danger:p}=s,m=a,D=this.index===t,b=e.validate||(()=>!0),d=await this.choiceSeparator(e,t),w=e.message;this.align==="right"&&(w=w.padStart(this.longest+1," ")),this.align==="left"&&(w=w.padEnd(this.longest+1," "));let _=this.values[o]=l||u,R=l?"success":"dark";await b.call(e,_,this.state)!==!0&&(R="danger");let O=s[R],q=O(await this.indicator(e,t))+(e.pad||""),te=this.indent(e),B=()=>[te,q,w+d,l,m].filter(Boolean).join(" ");if(i.submitted)return w=yh.unstyle(w),l=h(l),m="",B();if(e.format)l=await e.format.call(this,l,e,t);else{let M=this.styles.muted;l=_h(this,{input:l,initial:u,pos:n,showCursor:D,color:M})}return this.isValue(l)||(l=this.styles.muted(this.symbols.ellipsis)),e.result&&(this.values[o]=await e.result.call(this,_,e,t)),D&&(w=f(w)),e.error?l+=(l?" ":"")+p(e.error.trim()):e.hint&&(l+=(l?" ":"")+c(e.hint.trim())),B()}async submit(){return this.value=this.values,super.base.submit.call(this)}};Bu.exports=Fi});var xi=y((rD,Lu)=>{"use strict";var bh=nr(),vh=()=>{throw new Error("expected prompt to have a custom authenticate method")},Ou=(r=vh)=>{class e extends bh{constructor(i){super(i)}async submit(){this.value=await r.call(this,this.values,this.state),super.base.submit.call(this)}static create(i){return Ou(i)}}return e};Lu.exports=Ou()});var Nu=y((iD,Pu)=>{"use strict";var Fh=xi();function xh(r,e){return r.username===this.options.username&&r.password===this.options.password}var Tu=(r=xh)=>{let e=[{name:"username",message:"username"},{name:"password",message:"password",format(i){return this.options.showPassword?i:(this.state.submitted?this.styles.primary:this.styles.muted)(this.symbols.asterisk.repeat(i.length))}}];class t extends Fh.create(r){constructor(s){super({...s,choices:e})}static create(s){return Tu(s)}}return t};Pu.exports=Tu()});var ur=y((sD,Iu)=>{"use strict";var Sh=dt(),{isPrimitive:Rh,hasColor:Bh}=le(),Si=class extends Sh{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:i}=this;return i.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 Rh(e)&&(this.isTrue(e)||this.isFalse(e))}async hint(){if(this.state.status==="pending"){let e=await this.element("hint");return Bh(e)?e:this.styles.muted(e)}}async render(){let{input:e,size:t}=this.state,i=await this.prefix(),s=await this.separator(),n=await this.message(),u=this.styles.muted(this.default),o=[i,n,u,s].filter(Boolean).join(" ");this.state.prompt=o;let a=await this.header(),l=this.value=this.cast(e),c=await this.format(l),h=await this.error()||await this.hint(),f=await this.footer();h&&!o.includes(h)&&(c+=" "+h),o+=" "+c,this.clear(t),this.write([a,o,f].filter(Boolean).join(`
`)),this.restore()}set value(e){super.value=e}get value(){return this.cast(super.value)}};Iu.exports=Si});var Mu=y((nD,ku)=>{"use strict";var Oh=ur(),Ri=class extends Oh{constructor(e){super(e),this.default=this.options.default||(this.initial?"(Y/n)":"(y/N)")}};ku.exports=Ri});var Hu=y((uD,$u)=>{"use strict";var Lh=We(),Th=nr(),pt=Th.prototype,Bi=class extends Lh{constructor(e){super({...e,multiple:!0}),this.align=[this.options.align,"left"].find(t=>t!=null),this.emptyError="",this.values={}}dispatch(e,t){let i=this.focused,s=i.parent||{};return!i.editable&&!s.editable&&(e==="a"||e==="i")?super[e]():pt.dispatch.call(this,e,t)}append(e,t){return pt.append.call(this,e,t)}delete(e,t){return pt.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?pt.next.call(this):super.next()}prev(){return this.focused.editable?pt.prev.call(this):super.prev()}async indicator(e,t){let i=e.indicator||"",s=e.editable?i:super.indicator(e,t);return await this.resolve(s,this.state,e,t)||""}indent(e){return e.role==="heading"?"":e.editable?" ":"  "}async renderChoice(e,t){return e.indent="",e.editable?pt.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 i=t.parent?this.value[t.parent.name]:this.value;if(t.editable?i=t.value===t.name?t.initial||"":t.value:this.isDisabled(t)||(i=t.enabled===!0),e=await t.validate(i,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)}};$u.exports=Bi});var tt=y((oD,qu)=>{"use strict";var Ph=dt(),Nh=vi(),{isPrimitive:Ih}=le(),Oi=class extends Ph{constructor(e){super(e),this.initial=Ih(this.initial)?String(this.initial):"",this.initial&&this.cursorHide(),this.state.prevCursor=0,this.state.clipboard=[]}async keypress(e,t={}){let i=this.state.prevKeypress;return this.state.prevKeypress=t,this.options.multiline===!0&&t.name==="return"&&(!i||i.name!=="return")?this.append(`
`,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:i}=this.state;this.input=`${i}`.slice(0,t)+e+`${i}`.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),i=this.input.slice(e),s=t.split(" ");this.state.clipboard.push(s.pop()),this.input=s.join(" "),this.cursor=this.input.length,this.input+=i,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):Nh(this,{input:e,initial:t,pos:this.cursor})}async render(){let e=this.state.size,t=await this.prefix(),i=await this.separator(),s=await this.message(),n=[t,s,i].filter(Boolean).join(" ");this.state.prompt=n;let u=await this.header(),o=await this.format(),a=await this.error()||await this.hint(),l=await this.footer();a&&!o.includes(a)&&(o+=" "+a),n+=" "+o,this.clear(e),this.write([u,n,l].filter(Boolean).join(`
`)),this.restore()}};qu.exports=Oi});var Gu=y((aD,ju)=>{"use strict";var kh=r=>r.filter((e,t)=>r.lastIndexOf(e)===t),or=r=>kh(r).filter(Boolean);ju.exports=(r,e={},t="")=>{let{past:i=[],present:s=""}=e,n,u;switch(r){case"prev":case"undo":return n=i.slice(0,i.length-1),u=i[i.length-1]||"",{past:or([t,...n]),present:u};case"next":case"redo":return n=i.slice(1),u=i[0]||"",{past:or([...n,t]),present:u};case"save":return{past:or([...i,t]),present:""};case"remove":return u=or(i.filter(o=>o!==t)),s="",u.length&&(s=u.pop()),{past:u,present:s};default:throw new Error(`Invalid action: "${r}"`)}}});var Ti=y((lD,Uu)=>{"use strict";var Mh=tt(),Wu=Gu(),Li=class extends Mh{constructor(e){super(e);let t=this.options.history;if(t&&t.store){let i=t.values||this.initial;this.autosave=!!t.autosave,this.store=t.store,this.data=this.store.get("values")||{past:[],present:i},this.initial=this.data.present||this.data.past[this.data.past.length-1]}}completion(e){return this.store?(this.data=Wu(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=Wu("save",this.data,this.input),this.store.set("values",this.data))}submit(){return this.store&&this.autosave===!0&&this.save(),super.submit()}};Uu.exports=Li});var Vu=y((cD,zu)=>{"use strict";var $h=tt(),Pi=class extends $h{format(){return""}};zu.exports=Pi});var Yu=y((hD,Ku)=>{"use strict";var Hh=tt(),Ni=class extends Hh{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()}};Ku.exports=Ni});var Xu=y((fD,Qu)=>{"use strict";var qh=We(),Ii=class extends qh{constructor(e){super({...e,multiple:!0})}};Qu.exports=Ii});var Mi=y((dD,Zu)=>{"use strict";var jh=tt(),ki=class extends jh{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,i=this.toNumber(this.input);return i>this.max+t?this.alert():(this.input=`${i+t}`,this.render())}down(e){let t=e||this.minor,i=this.toNumber(this.input);return i<this.min-t?this.alert():(this.input=`${i-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()}};Zu.exports=ki});var eo=y((pD,Ju)=>{Ju.exports=Mi()});var ro=y((DD,to)=>{"use strict";var Gh=tt(),$i=class extends Gh{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)):""}};to.exports=$i});var no=y((gD,so)=>{"use strict";var Wh=be(),Uh=St(),io=le(),Hi=class extends Uh{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||`
   `;let t=e.startNumber||1;typeof this.scale=="number"&&(this.scaleKey=!1,this.scale=Array(this.scale).fill(0).map((i,s)=>({name:s+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 i=0;i<this.scale.length;i++)t.scale.push({index:i})}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,i){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(i=>`   ${i.name} - ${i.message}`)].map(i=>this.styles.muted(i)).join(`
`)}renderScaleHeading(e){let t=this.scale.map(a=>a.name);typeof this.options.renderScaleHeading=="function"&&(t=this.options.renderScaleHeading.call(this,e));let i=this.scaleLength-t.join("").length,s=Math.round(i/(t.length-1)),u=t.map(a=>this.styles.strong(a)).join(" ".repeat(s)),o=" ".repeat(this.widths[0]);return this.margin[3]+o+this.margin[1]+u}scaleIndicator(e,t,i){if(typeof this.options.scaleIndicator=="function")return this.options.scaleIndicator.call(this,e,t,i);let s=e.scaleIndex===t.index;return t.disabled?this.styles.hint(this.symbols.radio.disabled):s?this.styles.success(this.symbols.radio.on):this.symbols.radio.off}renderScale(e,t){let i=e.scale.map(n=>this.scaleIndicator(e,n,t)),s=this.term==="Hyper"?"":" ";return i.join(s+this.symbols.line.repeat(this.edgeLength))}async renderChoice(e,t){await this.onChoice(e,t);let i=this.index===t,s=await this.pointer(e,t),n=await e.hint;n&&!io.hasColor(n)&&(n=this.styles.muted(n));let u=m=>this.margin[3]+m.replace(/\s+$/,"").padEnd(this.widths[0]," "),o=this.newline,a=this.indent(e),l=await this.resolve(e.message,this.state,e,t),c=await this.renderScale(e,t),h=this.margin[1]+this.margin[3];this.scaleLength=Wh.unstyle(c).length,this.widths[0]=Math.min(this.widths[0],this.width-this.scaleLength-h.length);let p=io.wordWrap(l,{width:this.widths[0],newline:o}).split(`
`).map(m=>u(m)+this.margin[1]);return i&&(c=this.styles.info(c),p=p.map(m=>this.styles.info(m))),p[0]+=c,this.linebreak&&p.push(""),[a+s,p.join(`
`)].filter(Boolean)}async renderChoices(){if(this.state.submitted)return"";this.tableize();let e=this.visible.map(async(s,n)=>await this.renderChoice(s,n)),t=await Promise.all(e),i=await this.renderScaleHeading();return this.margin[0]+[i,...t.map(s=>s.join(" "))].join(`
`)}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),s=await this.separator(),n=await this.message(),u="";this.options.promptLine!==!1&&(u=[i,n,s,""].join(" "),this.state.prompt=u);let o=await this.header(),a=await this.format(),l=await this.renderScaleKey(),c=await this.error()||await this.hint(),h=await this.renderChoices(),f=await this.footer(),p=this.emptyError;a&&(u+=a),c&&!u.includes(c)&&(u+=" "+c),e&&!a&&!h.trim()&&this.multiple&&p!=null&&(u+=this.styles.danger(p)),this.clear(t),this.write([o,u,l,h,f].filter(Boolean).join(`
`)),this.state.submitted||this.write(this.margin[2]),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIndex;return this.base.submit.call(this)}};so.exports=Hi});var ao=y((mD,oo)=>{"use strict";var uo=be(),zh=(r="")=>typeof r=="string"?r.replace(/^['"]|['"]$/g,""):"",ji=class{constructor(e){this.name=e.key,this.field=e.field||{},this.value=zh(e.initial||this.field.initial||""),this.message=e.message||this.name,this.cursor=0,this.input="",this.lines=[]}},Vh=async(r={},e={},t=i=>i)=>{let i=new Set,s=r.fields||[],n=r.template,u=[],o=[],a=[],l=1;typeof n=="function"&&(n=await n());let c=-1,h=()=>n[++c],f=()=>n[c+1],p=m=>{m.line=l,u.push(m)};for(p({type:"bos",value:""});c<n.length-1;){let m=h();if(/^[^\S\n ]$/.test(m)){p({type:"text",value:m});continue}if(m===`
`){p({type:"newline",value:m}),l++;continue}if(m==="\\"){m+=h(),p({type:"text",value:m});continue}if((m==="$"||m==="#"||m==="{")&&f()==="{"){let b=h();m+=b;let d={type:"template",open:m,inner:"",close:"",value:m},w;for(;w=h();){if(w==="}"){f()==="}"&&(w+=h()),d.value+=w,d.close=w;break}w===":"?(d.initial="",d.key=d.inner):d.initial!==void 0&&(d.initial+=w),d.value+=w,d.inner+=w}d.template=d.open+(d.initial||d.inner)+d.close,d.key=d.key||d.inner,e.hasOwnProperty(d.key)&&(d.initial=e[d.key]),d=t(d),p(d),a.push(d.key),i.add(d.key);let _=o.find(R=>R.name===d.key);d.field=s.find(R=>R.name===d.key),_||(_=new ji(d),o.push(_)),_.lines.push(d.line-1);continue}let D=u[u.length-1];D.type==="text"&&D.line===l?D.value+=m:p({type:"text",value:m})}return p({type:"eos",value:""}),{input:n,tabstops:u,unique:i,keys:a,items:o}};oo.exports=async r=>{let e=r.options,t=new Set(e.required===!0?[]:e.required||[]),i={...e.values,...e.initial},{tabstops:s,items:n,keys:u}=await Vh(e,i),o=qi("result",r,e),a=qi("format",r,e),l=qi("validate",r,e,!0),c=r.isValue.bind(r);return async(h={},f=!1)=>{let p=0;h.required=t,h.items=n,h.keys=u,h.output="";let m=async(w,_,R,O)=>{let q=await l(w,_,R,O);return q===!1?"Invalid field "+R.name:q};for(let w of s){let _=w.value,R=w.key;if(w.type!=="template"){_&&(h.output+=_);continue}if(w.type==="template"){let O=n.find(j=>j.name===R);e.required===!0&&h.required.add(O.name);let q=[O.input,h.values[O.value],O.value,_].find(c),B=(O.field||{}).message||w.inner;if(f){let j=await m(h.values[R],h,O,p);if(j&&typeof j=="string"||j===!1){h.invalid.set(R,j);continue}h.invalid.delete(R);let A=await o(h.values[R],h,O,p);h.output+=uo.unstyle(A);continue}O.placeholder=!1;let M=_;_=await a(_,h,O,p),q!==_?(h.values[R]=q,_=r.styles.typing(q),h.missing.delete(B)):(h.values[R]=void 0,q=`<${B}>`,_=r.styles.primary(q),O.placeholder=!0,h.required.has(R)&&h.missing.add(B)),h.missing.has(B)&&h.validating&&(_=r.styles.warning(q)),h.invalid.has(R)&&h.validating&&(_=r.styles.danger(q)),p===h.index&&(M!==_?_=r.styles.underline(_):_=r.styles.heading(uo.unstyle(_))),p++}_&&(h.output+=_)}let D=h.output.split(`
`).map(w=>" "+w),b=n.length,d=0;for(let w of n)h.invalid.has(w.name)&&w.lines.forEach(_=>{D[_][0]===" "&&(D[_]=h.styles.danger(h.symbols.bullet)+D[_].slice(1))}),r.isValue(h.values[w.name])&&d++;return h.completed=(d/b*100).toFixed(0),h.output=D.join(`
`),h.output}};function qi(r,e,t,i){return(s,n,u,o)=>typeof u.field[r]=="function"?u.field[r].call(e,s,n,u,o):[i,s].find(a=>e.isValue(a))}});var co=y((ED,lo)=>{"use strict";var Kh=be(),Yh=ao(),Qh=dt(),Gi=class extends Qh{constructor(e){super(e),this.cursorHide(),this.reset(!0)}async initialize(){this.interpolate=await Yh(this),await super.initialize()}async reset(e){this.state.keys=[],this.state.invalid=new Map,this.state.missing=new Set,this.state.completed=0,this.state.values={},e!==!0&&(await this.initialize(),await this.render())}moveCursor(e){let t=this.getItem();this.cursor+=e,t.cursor+=e}dispatch(e,t){if(!t.code&&!t.ctrl&&e!=null&&this.getItem()){this.append(e,t);return}this.alert()}append(e,t){let i=this.getItem(),s=i.input.slice(0,this.cursor),n=i.input.slice(this.cursor);this.input=i.input=`${s}${e}${n}`,this.moveCursor(1),this.render()}delete(){let e=this.getItem();if(this.cursor<=0||!e.input)return this.alert();let t=e.input.slice(this.cursor),i=e.input.slice(0,this.cursor-1);this.input=e.input=`${i}${t}`,this.moveCursor(-1),this.render()}increment(e){return e>=this.state.keys.length-1?0:e+1}decrement(e){return e<=0?this.state.keys.length-1:e-1}first(){this.state.index=0,this.render()}last(){this.state.index=this.state.keys.length-1,this.render()}right(){if(this.cursor>=this.input.length)return this.alert();this.moveCursor(1),this.render()}left(){if(this.cursor<=0)return this.alert();this.moveCursor(-1),this.render()}prev(){this.state.index=this.decrement(this.state.index),this.getItem(),this.render()}next(){this.state.index=this.increment(this.state.index),this.getItem(),this.render()}up(){this.prev()}down(){this.next()}format(e){let t=this.state.completed<100?this.styles.warning:this.styles.success;return this.state.submitted===!0&&this.state.completed!==100&&(t=this.styles.danger),t(`${this.state.completed}% completed`)}async render(){let{index:e,keys:t=[],submitted:i,size:s}=this.state,n=[this.options.newline,`
`].find(w=>w!=null),u=await this.prefix(),o=await this.separator(),a=await this.message(),l=[u,a,o].filter(Boolean).join(" ");this.state.prompt=l;let c=await this.header(),h=await this.error()||"",f=await this.hint()||"",p=i?"":await this.interpolate(this.state),m=this.state.key=t[e]||"",D=await this.format(m),b=await this.footer();D&&(l+=" "+D),f&&!D&&this.state.completed===0&&(l+=" "+f),this.clear(s);let d=[c,l,p,b,h.trim()];this.write(d.filter(Boolean).join(n)),this.restore()}getItem(e){let{items:t,keys:i,index:s}=this.state,n=t.find(u=>u.name===i[s]);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:i,values:s}=this.state;if(e.size){let o="";for(let[a,l]of e)o+=`Invalid ${a}: ${l}
`;return this.state.error=o,super.submit()}if(t.size)return this.state.error="Required: "+[...t.keys()].join(", "),super.submit();let u=Kh.unstyle(i).split(`
`).map(o=>o.slice(1)).join(`
`);return this.value={values:s,result:u},super.submit()}};lo.exports=Gi});var fo=y((CD,ho)=>{"use strict";var Xh="(Use <shift>+<up/down> to sort)",Zh=We(),Wi=class extends Zh{constructor(e){super({...e,reorder:!1,sort:!0,multiple:!0}),this.state.hint=[this.options.hint,Xh].find(this.isValue.bind(this))}indicator(){return""}async renderChoice(e,t){let i=await super.renderChoice(e,t),s=this.symbols.identicalTo+" ",n=this.index===t&&this.sorting?this.styles.muted(s):"  ";return this.options.drag===!1&&(n=""),this.options.numbered===!0?n+`${t+1} - `+i:n+i}get selected(){return this.choices}submit(){return this.value=this.choices.map(e=>e.value),super.submit()}};ho.exports=Wi});var Do=y((AD,po)=>{"use strict";var Jh=St(),Ui=class extends Jh{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(i=>this.styles.muted(i)),this.state.header=t.join(`
   `)}}async toChoices(...e){if(this.createdScales)return!1;this.createdScales=!0;let t=await super.toChoices(...e);for(let i of t)i.scale=ef(5,this.options),i.scaleIdx=2;return t}dispatch(){this.alert()}space(){let e=this.focused,t=e.scale[e.scaleIdx],i=t.selected;return e.scale.forEach(s=>s.selected=!1),t.selected=!i,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 i=this.index===t,s=this.term==="Hyper",n=s?9:8,u=s?"":" ",o=this.symbols.line.repeat(n),a=" ".repeat(n+(s?0:1)),l=_=>(_?this.styles.success("\u25C9"):"\u25EF")+u,c=t+1+".",h=i?this.styles.heading:this.styles.noop,f=await this.resolve(e.message,this.state,e,t),p=this.indent(e),m=p+e.scale.map((_,R)=>l(R===e.scaleIdx)).join(o),D=_=>_===e.scaleIdx?h(_):_,b=p+e.scale.map((_,R)=>D(R)).join(a),d=()=>[c,f].filter(Boolean).join(" "),w=()=>[d(),m,b," "].filter(Boolean).join(`
`);return i&&(m=this.styles.cyan(m),b=this.styles.cyan(b)),w()}async renderChoices(){if(this.state.submitted)return"";let e=this.visible.map(async(i,s)=>await this.renderChoice(i,s)),t=await Promise.all(e);return t.length||t.push(this.styles.danger("No matching choices")),t.join(`
`)}format(){return this.state.submitted?this.choices.map(t=>this.styles.info(t.scaleIdx)).join(", "):""}async render(){let{submitted:e,size:t}=this.state,i=await this.prefix(),s=await this.separator(),n=await this.message(),u=[i,n,s].filter(Boolean).join(" ");this.state.prompt=u;let o=await this.header(),a=await this.format(),l=await this.error()||await this.hint(),c=await this.renderChoices(),h=await this.footer();(a||!l)&&(u+=" "+a),l&&!u.includes(l)&&(u+=" "+l),e&&!a&&!c&&this.multiple&&this.type!=="form"&&(u+=this.styles.danger(this.emptyError)),this.clear(t),this.write([u,o,c,h].filter(Boolean).join(`
`)),this.restore()}submit(){this.value={};for(let e of this.choices)this.value[e.name]=e.scaleIdx;return this.base.submit.call(this)}};function ef(r,e={}){if(Array.isArray(e.scale))return e.scale.map(i=>({...i}));let t=[];for(let i=1;i<r+1;i++)t.push({i,selected:!1});return t}po.exports=Ui});var mo=y((yD,go)=>{go.exports=Ti()});var Co=y((wD,Eo)=>{"use strict";var tf=ur(),zi=class extends tf{async initialize(){await super.initialize(),this.value=this.initial=!!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=i=>this.styles.primary.underline(i);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(),i=await this.prefix(),s=await this.separator(),n=await this.message(),u=await this.format(),o=await this.error()||await this.hint(),a=await this.footer(),l=[i,n,s,u].join(" ");this.state.prompt=l,o&&!l.includes(o)&&(l+=" "+o),this.clear(e),this.write([t,l,a].filter(Boolean).join(`
`)),this.write(this.margin[2]),this.restore()}};Eo.exports=zi});var yo=y((_D,Ao)=>{"use strict";var rf=We(),Vi=class extends rf{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 i=await super.toChoices(e,t);if(i.length<2)throw new Error("Please give at least two choices to the user");if(this.options.correctChoice>i.length)throw new Error("Please specify the index of the correct answer from the list of choices");return i}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)}}};Ao.exports=Vi});var _o=y(Ki=>{"use strict";var wo=le(),ee=(r,e)=>{wo.defineExport(Ki,r,e),wo.defineExport(Ki,r.toLowerCase(),e)};ee("AutoComplete",()=>Su());ee("BasicAuth",()=>Nu());ee("Confirm",()=>Mu());ee("Editable",()=>Hu());ee("Form",()=>nr());ee("Input",()=>Ti());ee("Invisible",()=>Vu());ee("List",()=>Yu());ee("MultiSelect",()=>Xu());ee("Numeral",()=>eo());ee("Password",()=>ro());ee("Scale",()=>no());ee("Select",()=>We());ee("Snippet",()=>co());ee("Sort",()=>fo());ee("Survey",()=>Do());ee("Text",()=>mo());ee("Toggle",()=>Co());ee("Quiz",()=>yo())});var vo=y((vD,bo)=>{bo.exports={ArrayPrompt:St(),AuthPrompt:xi(),BooleanPrompt:ur(),NumberPrompt:Mi(),StringPrompt:tt()}});var So=y((FD,xo)=>{"use strict";var Fo=require("assert"),Qi=require("events"),Ue=le(),Fe=class extends Qi{constructor(e,t){super(),this.options=Ue.merge({},e),this.answers={...t}}register(e,t){if(Ue.isObject(e)){for(let s of Object.keys(e))this.register(s,e[s]);return this}Fo.equal(typeof t,"function","expected a function");let i=e.toLowerCase();return t.prototype instanceof this.Prompt?this.prompts[i]=t:this.prompts[i]=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(Ue.merge({},this.options,t))}catch(i){return Promise.reject(i)}return this.answers}async ask(e){typeof e=="function"&&(e=await e.call(this));let t=Ue.merge({},this.options,e),{type:i,name:s}=e,{set:n,get:u}=Ue;if(typeof i=="function"&&(i=await i.call(this,e,this.answers)),!i)return this.answers[s];Fo(this.prompts[i],`Prompt "${i}" is not registered`);let o=new this.prompts[i](t),a=u(this.answers,s);o.state.answers=this.answers,o.enquirer=this,s&&o.on("submit",c=>{this.emit("answer",s,c,o),n(this.answers,s,c)});let l=o.emit.bind(o);return o.emit=(...c)=>(this.emit.call(this,...c),l(...c)),this.emit("prompt",o,this),t.autofill&&a!=null?(o.value=o.input=a,t.autofill==="show"&&await o.submit()):a=o.value=await o.run(),a}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||dt()}static get prompts(){return _o()}static get types(){return vo()}static get prompt(){let e=(t,...i)=>{let s=new this(...i),n=s.emit.bind(s);return s.emit=(...u)=>(e.emit(...u),n(...u)),s.prompt(t)};return Ue.mixinEmitter(e,new Qi),e}};Ue.mixinEmitter(Fe,new Qi);var Yi=Fe.prompts;for(let r of Object.keys(Yi)){let e=r.toLowerCase(),t=i=>new Yi[r](i).run();Fe.prompt[e]=t,Fe[e]=t,Fe[r]||Reflect.defineProperty(Fe,r,{get:()=>Yi[r]})}var Rt=r=>{Ue.defineExport(Fe,r,()=>Fe.types[r])};Rt("ArrayPrompt");Rt("AuthPrompt");Rt("BooleanPrompt");Rt("NumberPrompt");Rt("StringPrompt");xo.exports=Fe});var Bt=y((xD,To)=>{"use strict";var sf=require("path"),Oe="\\\\/",Ro=`[^${Oe}]`,ke="\\.",nf="\\+",uf="\\?",ar="\\/",of="(?=.)",Bo="[^/]",Xi=`(?:${ar}|$)`,Oo=`(?:^|${ar})`,Zi=`${ke}{1,2}${Xi}`,af=`(?!${ke})`,lf=`(?!${Oo}${Zi})`,cf=`(?!${ke}{0,1}${Xi})`,hf=`(?!${Zi})`,ff=`[^.${ar}]`,df=`${Bo}*?`,Lo={DOT_LITERAL:ke,PLUS_LITERAL:nf,QMARK_LITERAL:uf,SLASH_LITERAL:ar,ONE_CHAR:of,QMARK:Bo,END_ANCHOR:Xi,DOTS_SLASH:Zi,NO_DOT:af,NO_DOTS:lf,NO_DOT_SLASH:cf,NO_DOTS_SLASH:hf,QMARK_NO_DOT:ff,STAR:df,START_ANCHOR:Oo},pf={...Lo,SLASH_LITERAL:`[${Oe}]`,QMARK:Ro,STAR:`${Ro}*?`,DOTS_SLASH:`${ke}{1,2}(?:[${Oe}]|$)`,NO_DOT:`(?!${ke})`,NO_DOTS:`(?!(?:^|[${Oe}])${ke}{1,2}(?:[${Oe}]|$))`,NO_DOT_SLASH:`(?!${ke}{0,1}(?:[${Oe}]|$))`,NO_DOTS_SLASH:`(?!${ke}{1,2}(?:[${Oe}]|$))`,QMARK_NO_DOT:`[^.${Oe}]`,START_ANCHOR:`(?:^|[${Oe}])`,END_ANCHOR:`(?:[${Oe}]|$)`},Df={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};To.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Df,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:sf.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?pf:Lo}}});var lr=y(pe=>{"use strict";var gf=require("path"),mf=process.platform==="win32",{REGEX_BACKSLASH:Ef,REGEX_REMOVE_BACKSLASH:Cf,REGEX_SPECIAL_CHARS:Af,REGEX_SPECIAL_CHARS_GLOBAL:yf}=Bt();pe.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);pe.hasRegexChars=r=>Af.test(r);pe.isRegexChar=r=>r.length===1&&pe.hasRegexChars(r);pe.escapeRegex=r=>r.replace(yf,"\\$1");pe.toPosixSlashes=r=>r.replace(Ef,"/");pe.removeBackslashes=r=>r.replace(Cf,e=>e==="\\"?"":e);pe.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};pe.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:mf===!0||gf.sep==="\\";pe.escapeLast=(r,e,t)=>{let i=r.lastIndexOf(e,t);return i===-1?r:r[i-1]==="\\"?pe.escapeLast(r,e,i-1):`${r.slice(0,i)}\\${r.slice(i)}`};pe.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};pe.wrapOutput=(r,e={},t={})=>{let i=t.contains?"":"^",s=t.contains?"":"$",n=`${i}(?:${r})${s}`;return e.negated===!0&&(n=`(?:^(?!${n}).*$)`),n}});var qo=y((RD,Ho)=>{"use strict";var Po=lr(),{CHAR_ASTERISK:Ji,CHAR_AT:wf,CHAR_BACKWARD_SLASH:Ot,CHAR_COMMA:_f,CHAR_DOT:es,CHAR_EXCLAMATION_MARK:ts,CHAR_FORWARD_SLASH:$o,CHAR_LEFT_CURLY_BRACE:rs,CHAR_LEFT_PARENTHESES:is,CHAR_LEFT_SQUARE_BRACKET:bf,CHAR_PLUS:vf,CHAR_QUESTION_MARK:No,CHAR_RIGHT_CURLY_BRACE:Ff,CHAR_RIGHT_PARENTHESES:Io,CHAR_RIGHT_SQUARE_BRACKET:xf}=Bt(),ko=r=>r===$o||r===Ot,Mo=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},Sf=(r,e)=>{let t=e||{},i=r.length-1,s=t.parts===!0||t.scanToEnd===!0,n=[],u=[],o=[],a=r,l=-1,c=0,h=0,f=!1,p=!1,m=!1,D=!1,b=!1,d=!1,w=!1,_=!1,R=!1,O=!1,q=0,te,B,M={value:"",depth:0,isGlob:!1},j=()=>l>=i,A=()=>a.charCodeAt(l+1),K=()=>(te=B,a.charCodeAt(++l));for(;l<i;){B=K();let ce;if(B===Ot){w=M.backslashes=!0,B=K(),B===rs&&(d=!0);continue}if(d===!0||B===rs){for(q++;j()!==!0&&(B=K());){if(B===Ot){w=M.backslashes=!0,K();continue}if(B===rs){q++;continue}if(d!==!0&&B===es&&(B=K())===es){if(f=M.isBrace=!0,m=M.isGlob=!0,O=!0,s===!0)continue;break}if(d!==!0&&B===_f){if(f=M.isBrace=!0,m=M.isGlob=!0,O=!0,s===!0)continue;break}if(B===Ff&&(q--,q===0)){d=!1,f=M.isBrace=!0,O=!0;break}}if(s===!0)continue;break}if(B===$o){if(n.push(l),u.push(M),M={value:"",depth:0,isGlob:!1},O===!0)continue;if(te===es&&l===c+1){c+=2;continue}h=l+1;continue}if(t.noext!==!0&&(B===vf||B===wf||B===Ji||B===No||B===ts)===!0&&A()===is){if(m=M.isGlob=!0,D=M.isExtglob=!0,O=!0,B===ts&&l===c&&(R=!0),s===!0){for(;j()!==!0&&(B=K());){if(B===Ot){w=M.backslashes=!0,B=K();continue}if(B===Io){m=M.isGlob=!0,O=!0;break}}continue}break}if(B===Ji){if(te===Ji&&(b=M.isGlobstar=!0),m=M.isGlob=!0,O=!0,s===!0)continue;break}if(B===No){if(m=M.isGlob=!0,O=!0,s===!0)continue;break}if(B===bf){for(;j()!==!0&&(ce=K());){if(ce===Ot){w=M.backslashes=!0,K();continue}if(ce===xf){p=M.isBracket=!0,m=M.isGlob=!0,O=!0;break}}if(s===!0)continue;break}if(t.nonegate!==!0&&B===ts&&l===c){_=M.negated=!0,c++;continue}if(t.noparen!==!0&&B===is){if(m=M.isGlob=!0,s===!0){for(;j()!==!0&&(B=K());){if(B===is){w=M.backslashes=!0,B=K();continue}if(B===Io){O=!0;break}}continue}break}if(m===!0){if(O=!0,s===!0)continue;break}}t.noext===!0&&(D=!1,m=!1);let G=a,$e="",g="";c>0&&($e=a.slice(0,c),a=a.slice(c),h-=c),G&&m===!0&&h>0?(G=a.slice(0,h),g=a.slice(h)):m===!0?(G="",g=a):G=a,G&&G!==""&&G!=="/"&&G!==a&&ko(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),t.unescape===!0&&(g&&(g=Po.removeBackslashes(g)),G&&w===!0&&(G=Po.removeBackslashes(G)));let E={prefix:$e,input:r,start:c,base:G,glob:g,isBrace:f,isBracket:p,isGlob:m,isExtglob:D,isGlobstar:b,negated:_,negatedExtglob:R};if(t.tokens===!0&&(E.maxDepth=0,ko(B)||u.push(M),E.tokens=u),t.parts===!0||t.tokens===!0){let ce;for(let $=0;$<n.length;$++){let Se=ce?ce+1:c,Re=n[$],De=r.slice(Se,Re);t.tokens&&($===0&&c!==0?(u[$].isPrefix=!0,u[$].value=$e):u[$].value=De,Mo(u[$]),E.maxDepth+=u[$].depth),($!==0||De!=="")&&o.push(De),ce=Re}if(ce&&ce+1<r.length){let $=r.slice(ce+1);o.push($),t.tokens&&(u[u.length-1].value=$,Mo(u[u.length-1]),E.maxDepth+=u[u.length-1].depth)}E.slashes=n,E.parts=o}return E};Ho.exports=Sf});var Wo=y((BD,Go)=>{"use strict";var cr=Bt(),me=lr(),{MAX_LENGTH:hr,POSIX_REGEX_SOURCE:Rf,REGEX_NON_SPECIAL_CHARS:Bf,REGEX_SPECIAL_CHARS_BACKREF:Of,REPLACEMENTS:jo}=cr,Lf=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(s=>me.escapeRegex(s)).join("..")}return t},Dt=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,ss=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=jo[r]||r;let t={...e},i=typeof t.maxLength=="number"?Math.min(hr,t.maxLength):hr,s=r.length;if(s>i)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${i}`);let n={type:"bos",value:"",output:t.prepend||""},u=[n],o=t.capture?"":"?:",a=me.isWindows(e),l=cr.globChars(a),c=cr.extglobChars(l),{DOT_LITERAL:h,PLUS_LITERAL:f,SLASH_LITERAL:p,ONE_CHAR:m,DOTS_SLASH:D,NO_DOT:b,NO_DOT_SLASH:d,NO_DOTS_SLASH:w,QMARK:_,QMARK_NO_DOT:R,STAR:O,START_ANCHOR:q}=l,te=F=>`(${o}(?:(?!${q}${F.dot?D:h}).)*?)`,B=t.dot?"":b,M=t.dot?_:R,j=t.bash===!0?te(t):O;t.capture&&(j=`(${j})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let A={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:u};r=me.removePrefix(r,A),s=r.length;let K=[],G=[],$e=[],g=n,E,ce=()=>A.index===s-1,$=A.peek=(F=1)=>r[A.index+F],Se=A.advance=()=>r[++A.index]||"",Re=()=>r.slice(A.index+1),De=(F="",W=0)=>{A.consumed+=F,A.index+=W},qt=F=>{A.output+=F.output!=null?F.output:F.value,De(F.value)},Ll=()=>{let F=1;for(;$()==="!"&&($(2)!=="("||$(3)==="?");)Se(),A.start++,F++;return F%2===0?!1:(A.negated=!0,A.start++,!0)},jt=F=>{A[F]++,$e.push(F)},ze=F=>{A[F]--,$e.pop()},N=F=>{if(g.type==="globstar"){let W=A.braces>0&&(F.type==="comma"||F.type==="brace"),v=F.extglob===!0||K.length&&(F.type==="pipe"||F.type==="paren");F.type!=="slash"&&F.type!=="paren"&&!W&&!v&&(A.output=A.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=j,A.output+=g.output)}if(K.length&&F.type!=="paren"&&(K[K.length-1].inner+=F.value),(F.value||F.output)&&qt(F),g&&g.type==="text"&&F.type==="text"){g.value+=F.value,g.output=(g.output||"")+F.value;return}F.prev=g,u.push(F),g=F},Gt=(F,W)=>{let v={...c[W],conditions:1,inner:""};v.prev=g,v.parens=A.parens,v.output=A.output;let P=(t.capture?"(":"")+v.open;jt("parens"),N({type:F,value:W,output:A.output?"":m}),N({type:"paren",extglob:!0,value:Se(),output:P}),K.push(v)},Tl=F=>{let W=F.close+(t.capture?")":""),v;if(F.type==="negate"){let P=j;if(F.inner&&F.inner.length>1&&F.inner.includes("/")&&(P=te(t)),(P!==j||ce()||/^\)+$/.test(Re()))&&(W=F.close=`)$))${P}`),F.inner.includes("*")&&(v=Re())&&/^\.[^\\/.]+$/.test(v)){let Y=ss(v,{...e,fastpaths:!1}).output;W=F.close=`)${Y})${P})`}F.prev.type==="bos"&&(A.negatedExtglob=!0)}N({type:"paren",extglob:!0,value:E,output:W}),ze("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let F=!1,W=r.replace(Of,(v,P,Y,he,J,xr)=>he==="\\"?(F=!0,v):he==="?"?P?P+he+(J?_.repeat(J.length):""):xr===0?M+(J?_.repeat(J.length):""):_.repeat(Y.length):he==="."?h.repeat(Y.length):he==="*"?P?P+he+(J?j:""):j:P?v:`\\${v}`);return F===!0&&(t.unescape===!0?W=W.replace(/\\/g,""):W=W.replace(/\\+/g,v=>v.length%2===0?"\\\\":v?"\\":"")),W===r&&t.contains===!0?(A.output=r,A):(A.output=me.wrapOutput(W,A,e),A)}for(;!ce();){if(E=Se(),E==="\0")continue;if(E==="\\"){let v=$();if(v==="/"&&t.bash!==!0||v==="."||v===";")continue;if(!v){E+="\\",N({type:"text",value:E});continue}let P=/^\\+/.exec(Re()),Y=0;if(P&&P[0].length>2&&(Y=P[0].length,A.index+=Y,Y%2!==0&&(E+="\\")),t.unescape===!0?E=Se():E+=Se(),A.brackets===0){N({type:"text",value:E});continue}}if(A.brackets>0&&(E!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&E===":"){let v=g.value.slice(1);if(v.includes("[")&&(g.posix=!0,v.includes(":"))){let P=g.value.lastIndexOf("["),Y=g.value.slice(0,P),he=g.value.slice(P+2),J=Rf[he];if(J){g.value=Y+J,A.backtrack=!0,Se(),!n.output&&u.indexOf(g)===1&&(n.output=m);continue}}}(E==="["&&$()!==":"||E==="-"&&$()==="]")&&(E=`\\${E}`),E==="]"&&(g.value==="["||g.value==="[^")&&(E=`\\${E}`),t.posix===!0&&E==="!"&&g.value==="["&&(E="^"),g.value+=E,qt({value:E});continue}if(A.quotes===1&&E!=='"'){E=me.escapeRegex(E),g.value+=E,qt({value:E});continue}if(E==='"'){A.quotes=A.quotes===1?0:1,t.keepQuotes===!0&&N({type:"text",value:E});continue}if(E==="("){jt("parens"),N({type:"paren",value:E});continue}if(E===")"){if(A.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Dt("opening","("));let v=K[K.length-1];if(v&&A.parens===v.parens+1){Tl(K.pop());continue}N({type:"paren",value:E,output:A.parens?")":"\\)"}),ze("parens");continue}if(E==="["){if(t.nobracket===!0||!Re().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Dt("closing","]"));E=`\\${E}`}else jt("brackets");N({type:"bracket",value:E});continue}if(E==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){N({type:"text",value:E,output:`\\${E}`});continue}if(A.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Dt("opening","["));N({type:"text",value:E,output:`\\${E}`});continue}ze("brackets");let v=g.value.slice(1);if(g.posix!==!0&&v[0]==="^"&&!v.includes("/")&&(E=`/${E}`),g.value+=E,qt({value:E}),t.literalBrackets===!1||me.hasRegexChars(v))continue;let P=me.escapeRegex(g.value);if(A.output=A.output.slice(0,-g.value.length),t.literalBrackets===!0){A.output+=P,g.value=P;continue}g.value=`(${o}${P}|${g.value})`,A.output+=g.value;continue}if(E==="{"&&t.nobrace!==!0){jt("braces");let v={type:"brace",value:E,output:"(",outputIndex:A.output.length,tokensIndex:A.tokens.length};G.push(v),N(v);continue}if(E==="}"){let v=G[G.length-1];if(t.nobrace===!0||!v){N({type:"text",value:E,output:E});continue}let P=")";if(v.dots===!0){let Y=u.slice(),he=[];for(let J=Y.length-1;J>=0&&(u.pop(),Y[J].type!=="brace");J--)Y[J].type!=="dots"&&he.unshift(Y[J].value);P=Lf(he,t),A.backtrack=!0}if(v.comma!==!0&&v.dots!==!0){let Y=A.output.slice(0,v.outputIndex),he=A.tokens.slice(v.tokensIndex);v.value=v.output="\\{",E=P="\\}",A.output=Y;for(let J of he)A.output+=J.output||J.value}N({type:"brace",value:E,output:P}),ze("braces"),G.pop();continue}if(E==="|"){K.length>0&&K[K.length-1].conditions++,N({type:"text",value:E});continue}if(E===","){let v=E,P=G[G.length-1];P&&$e[$e.length-1]==="braces"&&(P.comma=!0,v="|"),N({type:"comma",value:E,output:v});continue}if(E==="/"){if(g.type==="dot"&&A.index===A.start+1){A.start=A.index+1,A.consumed="",A.output="",u.pop(),g=n;continue}N({type:"slash",value:E,output:p});continue}if(E==="."){if(A.braces>0&&g.type==="dot"){g.value==="."&&(g.output=h);let v=G[G.length-1];g.type="dots",g.output+=E,g.value+=E,v.dots=!0;continue}if(A.braces+A.parens===0&&g.type!=="bos"&&g.type!=="slash"){N({type:"text",value:E,output:h});continue}N({type:"dot",value:E,output:h});continue}if(E==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&$()==="("&&$(2)!=="?"){Gt("qmark",E);continue}if(g&&g.type==="paren"){let P=$(),Y=E;if(P==="<"&&!me.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(P)||P==="<"&&!/<([!=]|\w+>)/.test(Re()))&&(Y=`\\${E}`),N({type:"text",value:E,output:Y});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){N({type:"qmark",value:E,output:R});continue}N({type:"qmark",value:E,output:_});continue}if(E==="!"){if(t.noextglob!==!0&&$()==="("&&($(2)!=="?"||!/[!=<:]/.test($(3)))){Gt("negate",E);continue}if(t.nonegate!==!0&&A.index===0){Ll();continue}}if(E==="+"){if(t.noextglob!==!0&&$()==="("&&$(2)!=="?"){Gt("plus",E);continue}if(g&&g.value==="("||t.regex===!1){N({type:"plus",value:E,output:f});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||A.parens>0){N({type:"plus",value:E});continue}N({type:"plus",value:f});continue}if(E==="@"){if(t.noextglob!==!0&&$()==="("&&$(2)!=="?"){N({type:"at",extglob:!0,value:E,output:""});continue}N({type:"text",value:E});continue}if(E!=="*"){(E==="$"||E==="^")&&(E=`\\${E}`);let v=Bf.exec(Re());v&&(E+=v[0],A.index+=v[0].length),N({type:"text",value:E});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=E,g.output=j,A.backtrack=!0,A.globstar=!0,De(E);continue}let F=Re();if(t.noextglob!==!0&&/^\([^?]/.test(F)){Gt("star",E);continue}if(g.type==="star"){if(t.noglobstar===!0){De(E);continue}let v=g.prev,P=v.prev,Y=v.type==="slash"||v.type==="bos",he=P&&(P.type==="star"||P.type==="globstar");if(t.bash===!0&&(!Y||F[0]&&F[0]!=="/")){N({type:"star",value:E,output:""});continue}let J=A.braces>0&&(v.type==="comma"||v.type==="brace"),xr=K.length&&(v.type==="pipe"||v.type==="paren");if(!Y&&v.type!=="paren"&&!J&&!xr){N({type:"star",value:E,output:""});continue}for(;F.slice(0,3)==="/**";){let Wt=r[A.index+4];if(Wt&&Wt!=="/")break;F=F.slice(3),De("/**",3)}if(v.type==="bos"&&ce()){g.type="globstar",g.value+=E,g.output=te(t),A.output=g.output,A.globstar=!0,De(E);continue}if(v.type==="slash"&&v.prev.type!=="bos"&&!he&&ce()){A.output=A.output.slice(0,-(v.output+g.output).length),v.output=`(?:${v.output}`,g.type="globstar",g.output=te(t)+(t.strictSlashes?")":"|$)"),g.value+=E,A.globstar=!0,A.output+=v.output+g.output,De(E);continue}if(v.type==="slash"&&v.prev.type!=="bos"&&F[0]==="/"){let Wt=F[1]!==void 0?"|$":"";A.output=A.output.slice(0,-(v.output+g.output).length),v.output=`(?:${v.output}`,g.type="globstar",g.output=`${te(t)}${p}|${p}${Wt})`,g.value+=E,A.output+=v.output+g.output,A.globstar=!0,De(E+Se()),N({type:"slash",value:"/",output:""});continue}if(v.type==="bos"&&F[0]==="/"){g.type="globstar",g.value+=E,g.output=`(?:^|${p}|${te(t)}${p})`,A.output=g.output,A.globstar=!0,De(E+Se()),N({type:"slash",value:"/",output:""});continue}A.output=A.output.slice(0,-g.output.length),g.type="globstar",g.output=te(t),g.value+=E,A.output+=g.output,A.globstar=!0,De(E);continue}let W={type:"star",value:E,output:j};if(t.bash===!0){W.output=".*?",(g.type==="bos"||g.type==="slash")&&(W.output=B+W.output),N(W);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){W.output=E,N(W);continue}(A.index===A.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(A.output+=d,g.output+=d):t.dot===!0?(A.output+=w,g.output+=w):(A.output+=B,g.output+=B),$()!=="*"&&(A.output+=m,g.output+=m)),N(W)}for(;A.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Dt("closing","]"));A.output=me.escapeLast(A.output,"["),ze("brackets")}for(;A.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Dt("closing",")"));A.output=me.escapeLast(A.output,"("),ze("parens")}for(;A.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Dt("closing","}"));A.output=me.escapeLast(A.output,"{"),ze("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&N({type:"maybe_slash",value:"",output:`${p}?`}),A.backtrack===!0){A.output="";for(let F of A.tokens)A.output+=F.output!=null?F.output:F.value,F.suffix&&(A.output+=F.suffix)}return A};ss.fastpaths=(r,e)=>{let t={...e},i=typeof t.maxLength=="number"?Math.min(hr,t.maxLength):hr,s=r.length;if(s>i)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${i}`);r=jo[r]||r;let n=me.isWindows(e),{DOT_LITERAL:u,SLASH_LITERAL:o,ONE_CHAR:a,DOTS_SLASH:l,NO_DOT:c,NO_DOTS:h,NO_DOTS_SLASH:f,STAR:p,START_ANCHOR:m}=cr.globChars(n),D=t.dot?h:c,b=t.dot?f:c,d=t.capture?"":"?:",w={negated:!1,prefix:""},_=t.bash===!0?".*?":p;t.capture&&(_=`(${_})`);let R=B=>B.noglobstar===!0?_:`(${d}(?:(?!${m}${B.dot?l:u}).)*?)`,O=B=>{switch(B){case"*":return`${D}${a}${_}`;case".*":return`${u}${a}${_}`;case"*.*":return`${D}${_}${u}${a}${_}`;case"*/*":return`${D}${_}${o}${a}${b}${_}`;case"**":return D+R(t);case"**/*":return`(?:${D}${R(t)}${o})?${b}${a}${_}`;case"**/*.*":return`(?:${D}${R(t)}${o})?${b}${_}${u}${a}${_}`;case"**/.*":return`(?:${D}${R(t)}${o})?${u}${a}${_}`;default:{let M=/^(.*?)\.(\w+)$/.exec(B);if(!M)return;let j=O(M[1]);return j?j+u+M[2]:void 0}}},q=me.removePrefix(r,w),te=O(q);return te&&t.strictSlashes!==!0&&(te+=`${o}?`),te};Go.exports=ss});var zo=y((OD,Uo)=>{"use strict";var Tf=require("path"),Pf=qo(),ns=Wo(),us=lr(),Nf=Bt(),If=r=>r&&typeof r=="object"&&!Array.isArray(r),X=(r,e,t=!1)=>{if(Array.isArray(r)){let c=r.map(f=>X(f,e,t));return f=>{for(let p of c){let m=p(f);if(m)return m}return!1}}let i=If(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!i)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},n=us.isWindows(e),u=i?X.compileRe(r,e):X.makeRe(r,e,!1,!0),o=u.state;delete u.state;let a=()=>!1;if(s.ignore){let c={...e,ignore:null,onMatch:null,onResult:null};a=X(s.ignore,c,t)}let l=(c,h=!1)=>{let{isMatch:f,match:p,output:m}=X.test(c,u,e,{glob:r,posix:n}),D={glob:r,state:o,regex:u,posix:n,input:c,output:m,match:p,isMatch:f};return typeof s.onResult=="function"&&s.onResult(D),f===!1?(D.isMatch=!1,h?D:!1):a(c)?(typeof s.onIgnore=="function"&&s.onIgnore(D),D.isMatch=!1,h?D:!1):(typeof s.onMatch=="function"&&s.onMatch(D),h?D:!0)};return t&&(l.state=o),l};X.test=(r,e,t,{glob:i,posix:s}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let n=t||{},u=n.format||(s?us.toPosixSlashes:null),o=r===i,a=o&&u?u(r):r;return o===!1&&(a=u?u(r):r,o=a===i),(o===!1||n.capture===!0)&&(n.matchBase===!0||n.basename===!0?o=X.matchBase(r,e,t,s):o=e.exec(a)),{isMatch:!!o,match:o,output:a}};X.matchBase=(r,e,t,i=us.isWindows(t))=>(e instanceof RegExp?e:X.makeRe(e,t)).test(Tf.basename(r));X.isMatch=(r,e,t)=>X(e,t)(r);X.parse=(r,e)=>Array.isArray(r)?r.map(t=>X.parse(t,e)):ns(r,{...e,fastpaths:!1});X.scan=(r,e)=>Pf(r,e);X.compileRe=(r,e,t=!1,i=!1)=>{if(t===!0)return r.output;let s=e||{},n=s.contains?"":"^",u=s.contains?"":"$",o=`${n}(?:${r.output})${u}`;r&&r.negated===!0&&(o=`^(?!${o}).*$`);let a=X.toRegex(o,e);return i===!0&&(a.state=r),a};X.makeRe=(r,e={},t=!1,i=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(s.output=ns.fastpaths(r,e)),s.output||(s=ns(r,e)),X.compileRe(s,e,t,i)};X.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};X.constants=Nf;Uo.exports=X});var os=y((LD,Vo)=>{"use strict";Vo.exports=zo()});var ta=y((TD,ea)=>{"use strict";var Tt=require("fs"),{Readable:kf}=require("stream"),Lt=require("path"),{promisify:Dr}=require("util"),as=os(),Mf=Dr(Tt.readdir),$f=Dr(Tt.stat),Ko=Dr(Tt.lstat),Hf=Dr(Tt.realpath),qf="!",Zo="READDIRP_RECURSIVE_ERROR",jf=new Set(["ENOENT","EPERM","EACCES","ELOOP",Zo]),ls="files",Jo="directories",dr="files_directories",fr="all",Yo=[ls,Jo,dr,fr],Gf=r=>jf.has(r.code),[Qo,Wf]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),Uf=process.platform==="win32"&&(Qo>10||Qo===10&&Wf>=5),Xo=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=as(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let i of r){let s=i.trim();s.charAt(0)===qf?t.push(as(s.slice(1))):e.push(as(s))}return t.length>0?e.length>0?i=>e.some(s=>s(i.basename))&&!t.some(s=>s(i.basename)):i=>!t.some(s=>s(i.basename)):i=>e.some(s=>s(i.basename))}}},pr=class r extends kf{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:ls,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:i,type:s}=t;this._fileFilter=Xo(t.fileFilter),this._directoryFilter=Xo(t.directoryFilter);let n=t.lstat?Ko:$f;Uf?this._stat=u=>n(u,{bigint:!0}):this._stat=n,this._maxDepth=t.depth,this._wantsDir=[Jo,dr,fr].includes(s),this._wantsFile=[ls,dr,fr].includes(s),this._wantsEverything=s===fr,this._root=Lt.resolve(i),this._isDirent="Dirent"in Tt&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(i,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:t,depth:i,files:s=[]}=this.parent||{};if(s.length>0){let n=s.splice(0,e).map(u=>this._formatEntry(u,t));for(let u of await Promise.all(n)){if(this.destroyed)return;let o=await this._getEntryType(u);o==="directory"&&this._directoryFilter(u)?(i<=this._maxDepth&&this.parents.push(this._exploreDir(u.fullPath,i+1)),this._wantsDir&&(this.push(u),e--)):(o==="file"||this._includeAsFile(u))&&this._fileFilter(u)&&this._wantsFile&&(this.push(u),e--)}}else{let n=this.parents.pop();if(!n){this.push(null);break}if(this.parent=await n,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let i;try{i=await Mf(e,this._rdOptions)}catch(s){this._onError(s)}return{files:i,depth:t,path:e}}async _formatEntry(e,t){let i;try{let s=this._isDirent?e.name:e,n=Lt.resolve(Lt.join(t,s));i={path:Lt.relative(this._root,n),fullPath:n,basename:s},i[this._statsProp]=this._isDirent?e:await this._stat(n)}catch(s){this._onError(s)}return i}_onError(e){Gf(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let i=e.fullPath;try{let s=await Hf(i),n=await Ko(s);if(n.isFile())return"file";if(n.isDirectory()){let u=s.length;if(i.startsWith(s)&&i.substr(u,1)===Lt.sep){let o=new Error(`Circular symlink detected: "${i}" points to "${s}"`);return o.code=Zo,this._onError(o)}return"directory"}}catch(s){this._onError(s)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},gt=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=dr),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!Yo.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${Yo.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new pr(e)},zf=(r,e={})=>new Promise((t,i)=>{let s=[];gt(r,e).on("data",n=>s.push(n)).on("end",()=>t(s)).on("error",n=>i(n))});gt.promise=zf;gt.ReaddirpStream=pr;gt.default=gt;ea.exports=gt});var cs=y((PD,ra)=>{ra.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var i="";if(t>4&&r[3]==="\\"){var s=r[2];(s==="?"||s===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),i="//")}var n=r.split(/[/\\]+/);return e!==!1&&n[n.length-1]===""&&n.pop(),i+n.join("/")}});var aa=y((ua,oa)=>{"use strict";Object.defineProperty(ua,"__esModule",{value:!0});var na=os(),Vf=cs(),ia="!",Kf={returnIndex:!1},Yf=r=>Array.isArray(r)?r:[r],Qf=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=na(r,e);return i=>r===i||t(i)}return r instanceof RegExp?t=>r.test(t):t=>!1},sa=(r,e,t,i)=>{let s=Array.isArray(t),n=s?t[0]:t;if(!s&&typeof n!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(n));let u=Vf(n,!1);for(let a=0;a<e.length;a++){let l=e[a];if(l(u))return i?-1:!1}let o=s&&[u].concat(t.slice(1));for(let a=0;a<r.length;a++){let l=r[a];if(s?l(...o):l(u))return i?a:!0}return i?-1:!1},hs=(r,e,t=Kf)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let i=typeof t=="boolean"?{returnIndex:t}:t,s=i.returnIndex||!1,n=Yf(r),u=n.filter(a=>typeof a=="string"&&a.charAt(0)===ia).map(a=>a.slice(1)).map(a=>na(a,i)),o=n.filter(a=>typeof a!="string"||typeof a=="string"&&a.charAt(0)!==ia).map(a=>Qf(a,i));return e==null?(a,l=!1)=>sa(o,u,a,typeof l=="boolean"?l:!1):sa(o,u,e,s)};hs.default=hs;oa.exports=hs});var ca=y((ND,la)=>{la.exports=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1}});var fs=y((ID,fa)=>{var Xf=ca(),ha={"{":"}","(":")","[":"]"},Zf=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,i=-2,s=-2,n=-2,u=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||i!==-1&&r[e]==="["&&r[e+1]!=="]"&&(i<e&&(i=r.indexOf("]",e)),i>e&&(u===-1||u>i||(u=r.indexOf("\\",e),u===-1||u>i)))||s!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(s=r.indexOf("}",e),s>e&&(u=r.indexOf("\\",e),u===-1||u>s))||n!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(n=r.indexOf(")",e),n>e&&(u=r.indexOf("\\",e),u===-1||u>n))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(n=r.indexOf(")",t),n>t&&(u=r.indexOf("\\",t),u===-1||u>n))))return!0;if(r[e]==="\\"){var o=r[e+1];e+=2;var a=ha[o];if(a){var l=r.indexOf(a,e);l!==-1&&(e=l+1)}if(r[e]==="!")return!0}else e++}return!1},Jf=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var i=ha[t];if(i){var s=r.indexOf(i,e);s!==-1&&(e=s+1)}if(r[e]==="!")return!0}else e++}return!1};fa.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(Xf(e))return!0;var i=Zf;return t&&t.strict===!1&&(i=Jf),i(e)}});var pa=y((kD,da)=>{"use strict";var ed=fs(),td=require("path").posix.dirname,rd=require("os").platform()==="win32",ds="/",id=/\\/g,sd=/[\{\[].*[\}\]]$/,nd=/(^|[^\\])([\{\[]|\([^\)]+$)/,ud=/\\([\!\*\?\|\[\]\(\)\{\}])/g;da.exports=function(e,t){var i=Object.assign({flipBackslashes:!0},t);i.flipBackslashes&&rd&&e.indexOf(ds)<0&&(e=e.replace(id,ds)),sd.test(e)&&(e+=ds),e+="a";do e=td(e);while(ed(e)||nd.test(e));return e.replace(ud,"$1")}});var gr=y(ye=>{"use strict";ye.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;ye.find=(r,e)=>r.nodes.find(t=>t.type===e);ye.exceedsLimit=(r,e,t=1,i)=>i===!1||!ye.isInteger(r)||!ye.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=i;ye.escapeNode=(r,e=0,t)=>{let i=r.nodes[e];i&&(t&&i.type===t||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)};ye.encloseBrace=r=>r.type!=="brace"||r.commas>>0+r.ranges>>0?!1:(r.invalid=!0,!0);ye.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:!(r.commas>>0+r.ranges>>0)||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;ye.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;ye.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);ye.flatten=(...r)=>{let e=[],t=i=>{for(let s=0;s<i.length;s++){let n=i[s];Array.isArray(n)?t(n,e):n!==void 0&&e.push(n)}return e};return t(r),e}});var mr=y(($D,ga)=>{"use strict";var Da=gr();ga.exports=(r,e={})=>{let t=(i,s={})=>{let n=e.escapeInvalid&&Da.isInvalidBrace(s),u=i.invalid===!0&&e.escapeInvalid===!0,o="";if(i.value)return(n||u)&&Da.isOpenOrClose(i)?"\\"+i.value:i.value;if(i.value)return i.value;if(i.nodes)for(let a of i.nodes)o+=t(a);return o};return t(r)}});var Ea=y((HD,ma)=>{"use strict";ma.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var xa=y((qD,Fa)=>{"use strict";var Ca=Ea(),rt=(r,e,t)=>{if(Ca(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(Ca(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let i={relaxZeros:!0,...t};typeof i.strictZeros=="boolean"&&(i.relaxZeros=i.strictZeros===!1);let s=String(i.relaxZeros),n=String(i.shorthand),u=String(i.capture),o=String(i.wrap),a=r+":"+e+"="+s+n+u+o;if(rt.cache.hasOwnProperty(a))return rt.cache[a].result;let l=Math.min(r,e),c=Math.max(r,e);if(Math.abs(l-c)===1){let D=r+"|"+e;return i.capture?`(${D})`:i.wrap===!1?D:`(?:${D})`}let h=va(r)||va(e),f={min:r,max:e,a:l,b:c},p=[],m=[];if(h&&(f.isPadded=h,f.maxLen=String(f.max).length),l<0){let D=c<0?Math.abs(c):1;m=Aa(D,Math.abs(l),f,i),l=f.a=0}return c>=0&&(p=Aa(l,c,f,i)),f.negatives=m,f.positives=p,f.result=od(m,p,i),i.capture===!0?f.result=`(${f.result})`:i.wrap!==!1&&p.length+m.length>1&&(f.result=`(?:${f.result})`),rt.cache[a]=f,f.result};function od(r,e,t){let i=ps(r,e,"-",!1,t)||[],s=ps(e,r,"",!1,t)||[],n=ps(r,e,"-?",!0,t)||[];return i.concat(n).concat(s).join("|")}function ad(r,e){let t=1,i=1,s=wa(r,t),n=new Set([e]);for(;r<=s&&s<=e;)n.add(s),t+=1,s=wa(r,t);for(s=_a(e+1,i)-1;r<s&&s<=e;)n.add(s),i+=1,s=_a(e+1,i)-1;return n=[...n],n.sort(hd),n}function ld(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let i=cd(r,e),s=i.length,n="",u=0;for(let o=0;o<s;o++){let[a,l]=i[o];a===l?n+=a:a!=="0"||l!=="9"?n+=fd(a,l,t):u++}return u&&(n+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:n,count:[u],digits:s}}function Aa(r,e,t,i){let s=ad(r,e),n=[],u=r,o;for(let a=0;a<s.length;a++){let l=s[a],c=ld(String(u),String(l),i),h="";if(!t.isPadded&&o&&o.pattern===c.pattern){o.count.length>1&&o.count.pop(),o.count.push(c.count[0]),o.string=o.pattern+ba(o.count),u=l+1;continue}t.isPadded&&(h=dd(l,t,i)),c.string=h+c.pattern+ba(c.count),n.push(c),u=l+1,o=c}return n}function ps(r,e,t,i,s){let n=[];for(let u of r){let{string:o}=u;!i&&!ya(e,"string",o)&&n.push(t+o),i&&ya(e,"string",o)&&n.push(t+o)}return n}function cd(r,e){let t=[];for(let i=0;i<r.length;i++)t.push([r[i],e[i]]);return t}function hd(r,e){return r>e?1:e>r?-1:0}function ya(r,e,t){return r.some(i=>i[e]===t)}function wa(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function _a(r,e){return r-r%Math.pow(10,e)}function ba(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function fd(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function va(r){return/^-?(0+)\d/.test(r)}function dd(r,e,t){if(!e.isPadded)return r;let i=Math.abs(e.maxLen-String(r).length),s=t.relaxZeros!==!1;switch(i){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${i}}`:`0{${i}}`}}rt.cache={};rt.clearCache=()=>rt.cache={};Fa.exports=rt});var ms=y((jD,Na)=>{"use strict";var pd=require("util"),Ba=xa(),Sa=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),Dd=r=>e=>r===!0?Number(e):String(e),Ds=r=>typeof r=="number"||typeof r=="string"&&r!=="",Pt=r=>Number.isInteger(+r),gs=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},gd=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,md=(r,e,t)=>{if(e>0){let i=r[0]==="-"?"-":"";i&&(r=r.slice(1)),r=i+r.padStart(i?e-1:e,"0")}return t===!1?String(r):r},Ra=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},Ed=(r,e)=>{r.negatives.sort((u,o)=>u<o?-1:u>o?1:0),r.positives.sort((u,o)=>u<o?-1:u>o?1:0);let t=e.capture?"":"?:",i="",s="",n;return r.positives.length&&(i=r.positives.join("|")),r.negatives.length&&(s=`-(${t}${r.negatives.join("|")})`),i&&s?n=`${i}|${s}`:n=i||s,e.wrap?`(${t}${n})`:n},Oa=(r,e,t,i)=>{if(t)return Ba(r,e,{wrap:!1,...i});let s=String.fromCharCode(r);if(r===e)return s;let n=String.fromCharCode(e);return`[${s}-${n}]`},La=(r,e,t)=>{if(Array.isArray(r)){let i=t.wrap===!0,s=t.capture?"":"?:";return i?`(${s}${r.join("|")})`:r.join("|")}return Ba(r,e,t)},Ta=(...r)=>new RangeError("Invalid range arguments: "+pd.inspect(...r)),Pa=(r,e,t)=>{if(t.strictRanges===!0)throw Ta([r,e]);return[]},Cd=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},Ad=(r,e,t=1,i={})=>{let s=Number(r),n=Number(e);if(!Number.isInteger(s)||!Number.isInteger(n)){if(i.strictRanges===!0)throw Ta([r,e]);return[]}s===0&&(s=0),n===0&&(n=0);let u=s>n,o=String(r),a=String(e),l=String(t);t=Math.max(Math.abs(t),1);let c=gs(o)||gs(a)||gs(l),h=c?Math.max(o.length,a.length,l.length):0,f=c===!1&&gd(r,e,i)===!1,p=i.transform||Dd(f);if(i.toRegex&&t===1)return Oa(Ra(r,h),Ra(e,h),!0,i);let m={negatives:[],positives:[]},D=w=>m[w<0?"negatives":"positives"].push(Math.abs(w)),b=[],d=0;for(;u?s>=n:s<=n;)i.toRegex===!0&&t>1?D(s):b.push(md(p(s,d),h,f)),s=u?s-t:s+t,d++;return i.toRegex===!0?t>1?Ed(m,i):La(b,null,{wrap:!1,...i}):b},yd=(r,e,t=1,i={})=>{if(!Pt(r)&&r.length>1||!Pt(e)&&e.length>1)return Pa(r,e,i);let s=i.transform||(f=>String.fromCharCode(f)),n=`${r}`.charCodeAt(0),u=`${e}`.charCodeAt(0),o=n>u,a=Math.min(n,u),l=Math.max(n,u);if(i.toRegex&&t===1)return Oa(a,l,!1,i);let c=[],h=0;for(;o?n>=u:n<=u;)c.push(s(n,h)),n=o?n-t:n+t,h++;return i.toRegex===!0?La(c,null,{wrap:!1,options:i}):c},Er=(r,e,t,i={})=>{if(e==null&&Ds(r))return[r];if(!Ds(r)||!Ds(e))return Pa(r,e,i);if(typeof t=="function")return Er(r,e,1,{transform:t});if(Sa(t))return Er(r,e,0,t);let s={...i};return s.capture===!0&&(s.wrap=!0),t=t||s.step||1,Pt(t)?Pt(r)&&Pt(e)?Ad(r,e,t,s):yd(r,e,Math.max(Math.abs(t),1),s):t!=null&&!Sa(t)?Cd(t,s):Er(r,e,1,t)};Na.exports=Er});var Ma=y((GD,ka)=>{"use strict";var wd=ms(),Ia=gr(),_d=(r,e={})=>{let t=(i,s={})=>{let n=Ia.isInvalidBrace(s),u=i.invalid===!0&&e.escapeInvalid===!0,o=n===!0||u===!0,a=e.escapeInvalid===!0?"\\":"",l="";if(i.isOpen===!0||i.isClose===!0)return a+i.value;if(i.type==="open")return o?a+i.value:"(";if(i.type==="close")return o?a+i.value:")";if(i.type==="comma")return i.prev.type==="comma"?"":o?i.value:"|";if(i.value)return i.value;if(i.nodes&&i.ranges>0){let c=Ia.reduce(i.nodes),h=wd(...c,{...e,wrap:!1,toRegex:!0});if(h.length!==0)return c.length>1&&h.length>1?`(${h})`:h}if(i.nodes)for(let c of i.nodes)l+=t(c,i);return l};return t(r)};ka.exports=_d});var qa=y((WD,Ha)=>{"use strict";var bd=ms(),$a=mr(),mt=gr(),it=(r="",e="",t=!1)=>{let i=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?mt.flatten(e).map(s=>`{${s}}`):e;for(let s of r)if(Array.isArray(s))for(let n of s)i.push(it(n,e,t));else for(let n of e)t===!0&&typeof n=="string"&&(n=`{${n}}`),i.push(Array.isArray(n)?it(s,n,t):s+n);return mt.flatten(i)},vd=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,i=(s,n={})=>{s.queue=[];let u=n,o=n.queue;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,o=u.queue;if(s.invalid||s.dollar){o.push(it(o.pop(),$a(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){o.push(it(o.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let h=mt.reduce(s.nodes);if(mt.exceedsLimit(...h,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=bd(...h,e);f.length===0&&(f=$a(s,e)),o.push(it(o.pop(),f)),s.nodes=[];return}let a=mt.encloseBrace(s),l=s.queue,c=s;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,l=c.queue;for(let h=0;h<s.nodes.length;h++){let f=s.nodes[h];if(f.type==="comma"&&s.type==="brace"){h===1&&l.push(""),l.push("");continue}if(f.type==="close"){o.push(it(o.pop(),l,a));continue}if(f.value&&f.type!=="open"){l.push(it(l.pop(),f.value));continue}f.nodes&&i(f,s)}return l};return mt.flatten(i(r))};Ha.exports=vd});var Ga=y((UD,ja)=>{"use strict";ja.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"	",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ka=y((zD,Va)=>{"use strict";var Fd=mr(),{MAX_LENGTH:Wa,CHAR_BACKSLASH:Es,CHAR_BACKTICK:xd,CHAR_COMMA:Sd,CHAR_DOT:Rd,CHAR_LEFT_PARENTHESES:Bd,CHAR_RIGHT_PARENTHESES:Od,CHAR_LEFT_CURLY_BRACE:Ld,CHAR_RIGHT_CURLY_BRACE:Td,CHAR_LEFT_SQUARE_BRACKET:Ua,CHAR_RIGHT_SQUARE_BRACKET:za,CHAR_DOUBLE_QUOTE:Pd,CHAR_SINGLE_QUOTE:Nd,CHAR_NO_BREAK_SPACE:Id,CHAR_ZERO_WIDTH_NOBREAK_SPACE:kd}=Ga(),Md=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},i=typeof t.maxLength=="number"?Math.min(Wa,t.maxLength):Wa;if(r.length>i)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${i})`);let s={type:"root",input:r,nodes:[]},n=[s],u=s,o=s,a=0,l=r.length,c=0,h=0,f,p={},m=()=>r[c++],D=b=>{if(b.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&b.type==="text"){o.value+=b.value;return}return u.nodes.push(b),b.parent=u,b.prev=o,o=b,b};for(D({type:"bos"});c<l;)if(u=n[n.length-1],f=m(),!(f===kd||f===Id)){if(f===Es){D({type:"text",value:(e.keepEscaping?f:"")+m()});continue}if(f===za){D({type:"text",value:"\\"+f});continue}if(f===Ua){a++;let b=!0,d;for(;c<l&&(d=m());){if(f+=d,d===Ua){a++;continue}if(d===Es){f+=m();continue}if(d===za&&(a--,a===0))break}D({type:"text",value:f});continue}if(f===Bd){u=D({type:"paren",nodes:[]}),n.push(u),D({type:"text",value:f});continue}if(f===Od){if(u.type!=="paren"){D({type:"text",value:f});continue}u=n.pop(),D({type:"text",value:f}),u=n[n.length-1];continue}if(f===Pd||f===Nd||f===xd){let b=f,d;for(e.keepQuotes!==!0&&(f="");c<l&&(d=m());){if(d===Es){f+=d+m();continue}if(d===b){e.keepQuotes===!0&&(f+=d);break}f+=d}D({type:"text",value:f});continue}if(f===Ld){h++;let d={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||u.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};u=D(d),n.push(u),D({type:"open",value:f});continue}if(f===Td){if(u.type!=="brace"){D({type:"text",value:f});continue}let b="close";u=n.pop(),u.close=!0,D({type:b,value:f}),h--,u=n[n.length-1];continue}if(f===Sd&&h>0){if(u.ranges>0){u.ranges=0;let b=u.nodes.shift();u.nodes=[b,{type:"text",value:Fd(u)}]}D({type:"comma",value:f}),u.commas++;continue}if(f===Rd&&h>0&&u.commas===0){let b=u.nodes;if(h===0||b.length===0){D({type:"text",value:f});continue}if(o.type==="dot"){if(u.range=[],o.value+=f,o.type="range",u.nodes.length!==3&&u.nodes.length!==5){u.invalid=!0,u.ranges=0,o.type="text";continue}u.ranges++,u.args=[];continue}if(o.type==="range"){b.pop();let d=b[b.length-1];d.value+=o.value+f,o=d,u.ranges--;continue}D({type:"dot",value:f});continue}D({type:"text",value:f})}do if(u=n.pop(),u.type!=="root"){u.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});let b=n[n.length-1],d=b.nodes.indexOf(u);b.nodes.splice(d,1,...u.nodes)}while(n.length>0);return D({type:"eos"}),s};Va.exports=Md});var Xa=y((VD,Qa)=>{"use strict";var Ya=mr(),$d=Ma(),Hd=qa(),qd=Ka(),Ee=(r,e={})=>{let t=[];if(Array.isArray(r))for(let i of r){let s=Ee.create(i,e);Array.isArray(s)?t.push(...s):t.push(s)}else t=[].concat(Ee.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};Ee.parse=(r,e={})=>qd(r,e);Ee.stringify=(r,e={})=>Ya(typeof r=="string"?Ee.parse(r,e):r,e);Ee.compile=(r,e={})=>(typeof r=="string"&&(r=Ee.parse(r,e)),$d(r,e));Ee.expand=(r,e={})=>{typeof r=="string"&&(r=Ee.parse(r,e));let t=Hd(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};Ee.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?Ee.compile(r,e):Ee.expand(r,e);Qa.exports=Ee});var Za=y((KD,jd)=>{jd.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]});var el=y((YD,Ja)=>{Ja.exports=Za()});var rl=y((QD,tl)=>{"use strict";var Gd=require("path"),Wd=el(),Ud=new Set(Wd);tl.exports=r=>Ud.has(Gd.extname(r).slice(1).toLowerCase())});var Cr=y(S=>{"use strict";var{sep:zd}=require("path"),{platform:Cs}=process,Vd=require("os");S.EV_ALL="all";S.EV_READY="ready";S.EV_ADD="add";S.EV_CHANGE="change";S.EV_ADD_DIR="addDir";S.EV_UNLINK="unlink";S.EV_UNLINK_DIR="unlinkDir";S.EV_RAW="raw";S.EV_ERROR="error";S.STR_DATA="data";S.STR_END="end";S.STR_CLOSE="close";S.FSEVENT_CREATED="created";S.FSEVENT_MODIFIED="modified";S.FSEVENT_DELETED="deleted";S.FSEVENT_MOVED="moved";S.FSEVENT_CLONED="cloned";S.FSEVENT_UNKNOWN="unknown";S.FSEVENT_TYPE_FILE="file";S.FSEVENT_TYPE_DIRECTORY="directory";S.FSEVENT_TYPE_SYMLINK="symlink";S.KEY_LISTENERS="listeners";S.KEY_ERR="errHandlers";S.KEY_RAW="rawEmitters";S.HANDLER_KEYS=[S.KEY_LISTENERS,S.KEY_ERR,S.KEY_RAW];S.DOT_SLASH=`.${zd}`;S.BACK_SLASH_RE=/\\/g;S.DOUBLE_SLASH_RE=/\/\//;S.SLASH_OR_BACK_SLASH_RE=/[/\\]/;S.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;S.REPLACER_RE=/^\.[/\\]/;S.SLASH="/";S.SLASH_SLASH="//";S.BRACE_START="{";S.BANG="!";S.ONE_DOT=".";S.TWO_DOTS="..";S.STAR="*";S.GLOBSTAR="**";S.ROOT_GLOBSTAR="/**/*";S.SLASH_GLOBSTAR="/**";S.DIR_SUFFIX="Dir";S.ANYMATCH_OPTS={dot:!0};S.STRING_TYPE="string";S.FUNCTION_TYPE="function";S.EMPTY_STR="";S.EMPTY_FN=()=>{};S.IDENTITY_FN=r=>r;S.isWindows=Cs==="win32";S.isMacos=Cs==="darwin";S.isLinux=Cs==="linux";S.isIBMi=Vd.type()==="OS400"});var al=y((ZD,ol)=>{"use strict";var Me=require("fs"),se=require("path"),{promisify:Mt}=require("util"),Kd=rl(),{isWindows:Yd,isLinux:Qd,EMPTY_FN:Xd,EMPTY_STR:Zd,KEY_LISTENERS:Et,KEY_ERR:As,KEY_RAW:Nt,HANDLER_KEYS:Jd,EV_CHANGE:yr,EV_ADD:Ar,EV_ADD_DIR:ep,EV_ERROR:sl,STR_DATA:tp,STR_END:rp,BRACE_START:ip,STAR:sp}=Cr(),np="watch",up=Mt(Me.open),nl=Mt(Me.stat),op=Mt(Me.lstat),ap=Mt(Me.close),ys=Mt(Me.realpath),lp={lstat:op,stat:nl},_s=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},It=(r,e,t)=>{let i=r[e];i instanceof Set||(r[e]=i=new Set([i])),i.add(t)},cp=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},kt=(r,e,t)=>{let i=r[e];i instanceof Set?i.delete(t):i===t&&delete r[e]},ul=r=>r instanceof Set?r.size===0:!r,wr=new Map;function il(r,e,t,i,s){let n=(u,o)=>{t(r),s(u,o,{watchedPath:r}),o&&r!==o&&_r(se.resolve(r,o),Et,se.join(r,o))};try{return Me.watch(r,e,n)}catch(u){i(u)}}var _r=(r,e,t,i,s)=>{let n=wr.get(r);n&&_s(n[e],u=>{u(t,i,s)})},hp=(r,e,t,i)=>{let{listener:s,errHandler:n,rawEmitter:u}=i,o=wr.get(e),a;if(!t.persistent)return a=il(r,t,s,n,u),a.close.bind(a);if(o)It(o,Et,s),It(o,As,n),It(o,Nt,u);else{if(a=il(r,t,_r.bind(null,e,Et),n,_r.bind(null,e,Nt)),!a)return;a.on(sl,async l=>{let c=_r.bind(null,e,As);if(o.watcherUnusable=!0,Yd&&l.code==="EPERM")try{let h=await up(r,"r");await ap(h),c(l)}catch{}else c(l)}),o={listeners:s,errHandlers:n,rawEmitters:u,watcher:a},wr.set(e,o)}return()=>{kt(o,Et,s),kt(o,As,n),kt(o,Nt,u),ul(o.listeners)&&(o.watcher.close(),wr.delete(e),Jd.forEach(cp(o)),o.watcher=void 0,Object.freeze(o))}},ws=new Map,fp=(r,e,t,i)=>{let{listener:s,rawEmitter:n}=i,u=ws.get(e),o=new Set,a=new Set,l=u&&u.options;return l&&(l.persistent<t.persistent||l.interval>t.interval)&&(o=u.listeners,a=u.rawEmitters,Me.unwatchFile(e),u=void 0),u?(It(u,Et,s),It(u,Nt,n)):(u={listeners:s,rawEmitters:n,options:t,watcher:Me.watchFile(e,t,(c,h)=>{_s(u.rawEmitters,p=>{p(yr,e,{curr:c,prev:h})});let f=c.mtimeMs;(c.size!==h.size||f>h.mtimeMs||f===0)&&_s(u.listeners,p=>p(r,c))})},ws.set(e,u)),()=>{kt(u,Et,s),kt(u,Nt,n),ul(u.listeners)&&(ws.delete(e),Me.unwatchFile(e),u.options=u.watcher=void 0,Object.freeze(u))}},bs=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let i=this.fsw.options,s=se.dirname(e),n=se.basename(e);this.fsw._getWatchedDir(s).add(n);let o=se.resolve(e),a={persistent:i.persistent};t||(t=Xd);let l;return i.usePolling?(a.interval=i.enableBinaryInterval&&Kd(n)?i.binaryInterval:i.interval,l=fp(e,o,a,{listener:t,rawEmitter:this.fsw._emitRaw})):l=hp(e,o,a,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,t,i){if(this.fsw.closed)return;let s=se.dirname(e),n=se.basename(e),u=this.fsw._getWatchedDir(s),o=t;if(u.has(n))return;let a=async(c,h)=>{if(this.fsw._throttle(np,e,5)){if(!h||h.mtimeMs===0)try{let f=await nl(e);if(this.fsw.closed)return;let p=f.atimeMs,m=f.mtimeMs;(!p||p<=m||m!==o.mtimeMs)&&this.fsw._emit(yr,e,f),Qd&&o.ino!==f.ino?(this.fsw._closeFile(c),o=f,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,a))):o=f}catch{this.fsw._remove(s,n)}else if(u.has(n)){let f=h.atimeMs,p=h.mtimeMs;(!f||f<=p||p!==o.mtimeMs)&&this.fsw._emit(yr,e,h),o=h}}},l=this._watchWithNodeFs(e,a);if(!(i&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Ar,e,0))return;this.fsw._emit(Ar,e,t)}return l}async _handleSymlink(e,t,i,s){if(this.fsw.closed)return;let n=e.fullPath,u=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let o;try{o=await ys(i)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(u.has(s)?this.fsw._symlinkPaths.get(n)!==o&&(this.fsw._symlinkPaths.set(n,o),this.fsw._emit(yr,i,e.stats)):(u.add(s),this.fsw._symlinkPaths.set(n,o),this.fsw._emit(Ar,i,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(n))return!0;this.fsw._symlinkPaths.set(n,!0)}_handleRead(e,t,i,s,n,u,o){if(e=se.join(e,Zd),!i.hasGlob&&(o=this.fsw._throttle("readdir",e,1e3),!o))return;let a=this.fsw._getWatchedDir(i.path),l=new Set,c=this.fsw._readdirp(e,{fileFilter:h=>i.filterPath(h),directoryFilter:h=>i.filterDir(h),depth:0}).on(tp,async h=>{if(this.fsw.closed){c=void 0;return}let f=h.path,p=se.join(e,f);if(l.add(f),!(h.stats.isSymbolicLink()&&await this._handleSymlink(h,e,p,f))){if(this.fsw.closed){c=void 0;return}(f===s||!s&&!a.has(f))&&(this.fsw._incrReadyCount(),p=se.join(n,se.relative(n,p)),this._addToNodeFs(p,t,i,u+1))}}).on(sl,this._boundHandleError);return new Promise(h=>c.once(rp,()=>{if(this.fsw.closed){c=void 0;return}let f=o?o.clear():!1;h(),a.getChildren().filter(p=>p!==e&&!l.has(p)&&(!i.hasGlob||i.filterPath({fullPath:se.resolve(e,p)}))).forEach(p=>{this.fsw._remove(e,p)}),c=void 0,f&&this._handleRead(e,!1,i,s,n,u,o)}))}async _handleDir(e,t,i,s,n,u,o){let a=this.fsw._getWatchedDir(se.dirname(e)),l=a.has(se.basename(e));!(i&&this.fsw.options.ignoreInitial)&&!n&&!l&&(!u.hasGlob||u.globFilter(e))&&this.fsw._emit(ep,e,t),a.add(se.basename(e)),this.fsw._getWatchedDir(e);let c,h,f=this.fsw.options.depth;if((f==null||s<=f)&&!this.fsw._symlinkPaths.has(o)){if(!n&&(await this._handleRead(e,i,u,n,e,s,c),this.fsw.closed))return;h=this._watchWithNodeFs(e,(p,m)=>{m&&m.mtimeMs===0||this._handleRead(p,!1,u,n,e,s,c)})}return h}async _addToNodeFs(e,t,i,s,n){let u=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return u(),!1;let o=this.fsw._getWatchHelpers(e,s);!o.hasGlob&&i&&(o.hasGlob=i.hasGlob,o.globFilter=i.globFilter,o.filterPath=a=>i.filterPath(a),o.filterDir=a=>i.filterDir(a));try{let a=await lp[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,a))return u(),!1;let l=this.fsw.options.followSymlinks&&!e.includes(sp)&&!e.includes(ip),c;if(a.isDirectory()){let h=se.resolve(e),f=l?await ys(e):e;if(this.fsw.closed||(c=await this._handleDir(o.watchPath,a,t,s,n,o,f),this.fsw.closed))return;h!==f&&f!==void 0&&this.fsw._symlinkPaths.set(h,f)}else if(a.isSymbolicLink()){let h=l?await ys(e):e;if(this.fsw.closed)return;let f=se.dirname(o.watchPath);if(this.fsw._getWatchedDir(f).add(o.watchPath),this.fsw._emit(Ar,o.watchPath,a),c=await this._handleDir(f,a,t,s,e,o,h),this.fsw.closed)return;h!==void 0&&this.fsw._symlinkPaths.set(se.resolve(e),h)}else c=this._handleFile(o.watchPath,a,t);return u(),this.fsw._addPathCloser(e,c),!1}catch(a){if(this.fsw._handleError(a))return u(),e}}};ol.exports=bs});var Dl=y((JD,Ls)=>{"use strict";var Bs=require("fs"),ne=require("path"),{promisify:Os}=require("util"),Ct;try{Ct=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Ct){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&(Ct=void 0)}}var{EV_ADD:vs,EV_CHANGE:dp,EV_ADD_DIR:ll,EV_UNLINK:br,EV_ERROR:pp,STR_DATA:Dp,STR_END:gp,FSEVENT_CREATED:mp,FSEVENT_MODIFIED:Ep,FSEVENT_DELETED:Cp,FSEVENT_MOVED:Ap,FSEVENT_UNKNOWN:yp,FSEVENT_TYPE_FILE:wp,FSEVENT_TYPE_DIRECTORY:$t,FSEVENT_TYPE_SYMLINK:pl,ROOT_GLOBSTAR:cl,DIR_SUFFIX:_p,DOT_SLASH:hl,FUNCTION_TYPE:Fs,EMPTY_FN:bp,IDENTITY_FN:vp}=Cr(),Fp=r=>isNaN(r)?{}:{depth:r},Ss=Os(Bs.stat),xp=Os(Bs.lstat),fl=Os(Bs.realpath),Sp={stat:Ss,lstat:xp},st=new Map,Rp=10,Bp=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Op=(r,e)=>({stop:Ct.watch(r,e)});function Lp(r,e,t,i){let s=ne.extname(e)?ne.dirname(e):e,n=ne.dirname(s),u=st.get(s);Tp(n)&&(s=n);let o=ne.resolve(r),a=o!==e,l=(h,f,p)=>{a&&(h=h.replace(e,o)),(h===o||!h.indexOf(o+ne.sep))&&t(h,f,p)},c=!1;for(let h of st.keys())if(e.indexOf(ne.resolve(h)+ne.sep)===0){s=h,u=st.get(s),c=!0;break}return u||c?u.listeners.add(l):(u={listeners:new Set([l]),rawEmitter:i,watcher:Op(s,(h,f)=>{if(!u.listeners.size)return;let p=Ct.getInfo(h,f);u.listeners.forEach(m=>{m(h,f,p)}),u.rawEmitter(p.event,h,p)})},st.set(s,u)),()=>{let h=u.listeners;if(h.delete(l),!h.size&&(st.delete(s),u.watcher))return u.watcher.stop().then(()=>{u.rawEmitter=u.watcher=void 0,Object.freeze(u)})}}var Tp=r=>{let e=0;for(let t of st.keys())if(t.indexOf(r)===0&&(e++,e>=Rp))return!0;return!1},Pp=()=>Ct&&st.size<128,xs=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=ne.dirname(r))!==e;)t++;return t},dl=(r,e)=>r.type===$t&&e.isDirectory()||r.type===pl&&e.isSymbolicLink()||r.type===wp&&e.isFile(),Rs=class{constructor(e){this.fsw=e}checkIgnored(e,t){let i=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return i.add(e),t&&t.isDirectory()&&i.add(e+cl),!0;i.delete(e),i.delete(e+cl)}addOrChange(e,t,i,s,n,u,o,a){let l=n.has(u)?dp:vs;this.handleEvent(l,e,t,i,s,n,u,o,a)}async checkExists(e,t,i,s,n,u,o,a){try{let l=await Ss(e);if(this.fsw.closed)return;dl(o,l)?this.addOrChange(e,t,i,s,n,u,o,a):this.handleEvent(br,e,t,i,s,n,u,o,a)}catch(l){l.code==="EACCES"?this.addOrChange(e,t,i,s,n,u,o,a):this.handleEvent(br,e,t,i,s,n,u,o,a)}}handleEvent(e,t,i,s,n,u,o,a,l){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===br){let c=a.type===$t;(c||u.has(o))&&this.fsw._remove(n,o,c)}else{if(e===vs){if(a.type===$t&&this.fsw._getWatchedDir(t),a.type===pl&&l.followSymlinks){let h=l.depth===void 0?void 0:xs(i,s)+1;return this._addToFsEvents(t,!1,!0,h)}this.fsw._getWatchedDir(n).add(o)}let c=a.type===$t?e+_p:e;this.fsw._emit(c,t),c===ll&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,i,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let n=this.fsw.options,o=Lp(e,t,async(a,l,c)=>{if(this.fsw.closed||n.depth!==void 0&&xs(a,t)>n.depth)return;let h=i(ne.join(e,ne.relative(e,a)));if(s&&!s(h))return;let f=ne.dirname(h),p=ne.basename(h),m=this.fsw._getWatchedDir(c.type===$t?h:f);if(Bp.has(l)||c.event===yp)if(typeof n.ignored===Fs){let D;try{D=await Ss(h)}catch{}if(this.fsw.closed||this.checkIgnored(h,D))return;dl(c,D)?this.addOrChange(h,a,t,f,m,p,c,n):this.handleEvent(br,h,a,t,f,m,p,c,n)}else this.checkExists(h,a,t,f,m,p,c,n);else switch(c.event){case mp:case Ep:return this.addOrChange(h,a,t,f,m,p,c,n);case Cp:case Ap:return this.checkExists(h,a,t,f,m,p,c,n)}},this.fsw._emitRaw);return this.fsw._emitReady(),o}async _handleFsEventsSymlink(e,t,i,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let n=await fl(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(n))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(n||e,u=>{let o=e;return n&&n!==hl?o=u.replace(n,e):u!==hl&&(o=ne.join(e,u)),i(o)},!1,s)}catch(n){if(this.fsw._handleError(n))return this.fsw._emitReady()}}}emitAdd(e,t,i,s,n){let u=i(e),o=t.isDirectory(),a=this.fsw._getWatchedDir(ne.dirname(u)),l=ne.basename(u);o&&this.fsw._getWatchedDir(u),!a.has(l)&&(a.add(l),(!s.ignoreInitial||n===!0)&&this.fsw._emit(o?ll:vs,u,t))}initWatch(e,t,i,s){if(this.fsw.closed)return;let n=this._watchWithFsEvents(i.watchPath,ne.resolve(e||i.watchPath),s,i.globFilter);this.fsw._addPathCloser(t,n)}async _addToFsEvents(e,t,i,s){if(this.fsw.closed)return;let n=this.fsw.options,u=typeof t===Fs?t:vp,o=this.fsw._getWatchHelpers(e);try{let a=await Sp[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,a))throw null;if(a.isDirectory()){if(o.globFilter||this.emitAdd(u(e),a,u,n,i),s&&s>n.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:l=>o.filterPath(l),directoryFilter:l=>o.filterDir(l),...Fp(n.depth-(s||0))}).on(Dp,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!o.filterPath(l))return;let c=ne.join(o.watchPath,l.path),{fullPath:h}=l;if(o.followSymlinks&&l.stats.isSymbolicLink()){let f=n.depth===void 0?void 0:xs(c,ne.resolve(o.watchPath))+1;this._handleFsEventsSymlink(c,h,u,f)}else this.emitAdd(c,l.stats,u,n,i)}).on(pp,bp).on(gp,()=>{this.fsw._emitReady()})}else this.emitAdd(o.watchPath,a,u,n,i),this.fsw._emitReady()}catch(a){(!a||this.fsw._handleError(a))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(n.persistent&&i!==!0)if(typeof t===Fs)this.initWatch(void 0,e,o,u);else{let a;try{a=await fl(o.watchPath)}catch{}this.initWatch(a,e,o,u)}}};Ls.exports=Rs;Ls.exports.canUse=Pp});var Fl=y(Vs=>{"use strict";var{EventEmitter:Np}=require("events"),Us=require("fs"),H=require("path"),{promisify:wl}=require("util"),Ip=ta(),Ms=aa().default,kp=pa(),Ts=fs(),Mp=Xa(),$p=cs(),Hp=al(),gl=Dl(),{EV_ALL:Ps,EV_READY:qp,EV_ADD:vr,EV_CHANGE:Ht,EV_UNLINK:ml,EV_ADD_DIR:jp,EV_UNLINK_DIR:Gp,EV_RAW:Wp,EV_ERROR:Ns,STR_CLOSE:Up,STR_END:zp,BACK_SLASH_RE:Vp,DOUBLE_SLASH_RE:El,SLASH_OR_BACK_SLASH_RE:Kp,DOT_RE:Yp,REPLACER_RE:Qp,SLASH:Is,SLASH_SLASH:Xp,BRACE_START:Zp,BANG:$s,ONE_DOT:_l,TWO_DOTS:Jp,GLOBSTAR:e0,SLASH_GLOBSTAR:ks,ANYMATCH_OPTS:Hs,STRING_TYPE:zs,FUNCTION_TYPE:t0,EMPTY_STR:qs,EMPTY_FN:r0,isWindows:i0,isMacos:s0,isIBMi:n0}=Cr(),u0=wl(Us.stat),o0=wl(Us.readdir),js=(r=[])=>Array.isArray(r)?r:[r],bl=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?bl(t,e):e.push(t)}),e),Cl=r=>{let e=bl(js(r));if(!e.every(t=>typeof t===zs))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(vl)},Al=r=>{let e=r.replace(Vp,Is),t=!1;for(e.startsWith(Xp)&&(t=!0);e.match(El);)e=e.replace(El,Is);return t&&(e=Is+e),e},vl=r=>Al(H.normalize(Al(r))),yl=(r=qs)=>e=>typeof e!==zs?e:vl(H.isAbsolute(e)?e:H.join(r,e)),a0=(r,e)=>H.isAbsolute(r)?r:r.startsWith($s)?$s+H.join(e,r.slice(1)):H.join(e,r),xe=(r,e)=>r[e]===void 0,Gs=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==_l&&e!==Jp&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let i=this.path;try{await o0(i)}catch{this._removeWatcher&&this._removeWatcher(H.dirname(i),H.basename(i))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},l0="stat",c0="lstat",Ws=class{constructor(e,t,i,s){this.fsw=s,this.path=e=e.replace(Qp,qs),this.watchPath=t,this.fullWatchPath=H.resolve(t),this.hasGlob=t!==e,e===qs&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&i?void 0:!1,this.globFilter=this.hasGlob?Ms(e,void 0,Hs):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(n=>{n.length>1&&n.pop()}),this.followSymlinks=i,this.statMethod=i?l0:c0}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return H.join(this.watchPath,H.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let i=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===t0?this.globFilter(i):!0)&&this.fsw._isntIgnored(i,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(Zp)?Mp.expand(e):[e]).forEach(s=>{t.push(H.relative(this.watchPath,s).split(Kp))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),i=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((n,u)=>(n===e0&&(i=!0),i||!t[0][u]||Ms(n,t[0][u],Hs))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Fr=class extends Np{constructor(e){super();let t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,xe(t,"persistent")&&(t.persistent=!0),xe(t,"ignoreInitial")&&(t.ignoreInitial=!1),xe(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),xe(t,"interval")&&(t.interval=100),xe(t,"binaryInterval")&&(t.binaryInterval=300),xe(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,xe(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),gl.canUse()||(t.useFsEvents=!1),xe(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=s0),n0&&(t.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let a=s.toLowerCase();a==="false"||a==="0"?t.usePolling=!1:a==="true"||a==="1"?t.usePolling=!0:t.usePolling=!!a}let n=process.env.CHOKIDAR_INTERVAL;n&&(t.interval=Number.parseInt(n,10)),xe(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),xe(t,"followSymlinks")&&(t.followSymlinks=!0),xe(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let u=t.awaitWriteFinish;u&&(u.stabilityThreshold||(u.stabilityThreshold=2e3),u.pollInterval||(u.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=js(t.ignored));let o=0;this._emitReady=()=>{o++,o>=this._readyCount&&(this._emitReady=r0,this._readyEmitted=!0,process.nextTick(()=>this.emit(qp)))},this._emitRaw=(...a)=>this.emit(Wp,...a),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new gl(this):this._nodeFsHandler=new Hp(this),Object.freeze(t)}add(e,t,i){let{cwd:s,disableGlobbing:n}=this.options;this.closed=!1;let u=Cl(e);return s&&(u=u.map(o=>{let a=a0(o,s);return n||!Ts(o)?a:$p(a)})),u=u.filter(o=>o.startsWith($s)?(this._ignoredPaths.add(o.slice(1)),!1):(this._ignoredPaths.delete(o),this._ignoredPaths.delete(o+ks),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=u.length),this.options.persistent&&(this._readyCount*=2),u.forEach(o=>this._fsEventsHandler._addToFsEvents(o))):(this._readyCount||(this._readyCount=0),this._readyCount+=u.length,Promise.all(u.map(async o=>{let a=await this._nodeFsHandler._addToNodeFs(o,!i,0,0,t);return a&&this._emitReady(),a})).then(o=>{this.closed||o.filter(a=>a).forEach(a=>{this.add(H.dirname(a),H.basename(t||a))})})),this}unwatch(e){if(this.closed)return this;let t=Cl(e),{cwd:i}=this.options;return t.forEach(s=>{!H.isAbsolute(s)&&!this._closers.has(s)&&(i&&(s=H.join(i,s)),s=H.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+ks),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(i=>{let s=i();s instanceof Promise&&e.push(s)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,i)=>{let s=this.options.cwd?H.relative(this.options.cwd,i):i;e[s||_l]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Ns&&this.emit(Ps,...t)}async _emit(e,t,i,s,n){if(this.closed)return;let u=this.options;i0&&(t=H.normalize(t)),u.cwd&&(t=H.relative(u.cwd,t));let o=[e,t];n!==void 0?o.push(i,s,n):s!==void 0?o.push(i,s):i!==void 0&&o.push(i);let a=u.awaitWriteFinish,l;if(a&&(l=this._pendingWrites.get(t)))return l.lastChange=new Date,this;if(u.atomic){if(e===ml)return this._pendingUnlinks.set(t,o),setTimeout(()=>{this._pendingUnlinks.forEach((c,h)=>{this.emit(...c),this.emit(Ps,...c),this._pendingUnlinks.delete(h)})},typeof u.atomic=="number"?u.atomic:100),this;e===vr&&this._pendingUnlinks.has(t)&&(e=o[0]=Ht,this._pendingUnlinks.delete(t))}if(a&&(e===vr||e===Ht)&&this._readyEmitted){let c=(h,f)=>{h?(e=o[0]=Ns,o[1]=h,this.emitWithAll(e,o)):f&&(o.length>2?o[2]=f:o.push(f),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,c),this}if(e===Ht&&!this._throttle(Ht,t,50))return this;if(u.alwaysStat&&i===void 0&&(e===vr||e===jp||e===Ht)){let c=u.cwd?H.join(u.cwd,t):t,h;try{h=await u0(c)}catch{}if(!h||this.closed)return;o.push(h)}return this.emitWithAll(e,o),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Ns,e),e||this.closed}_throttle(e,t,i){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),n=s.get(t);if(n)return n.count++,!1;let u,o=()=>{let l=s.get(t),c=l?l.count:0;return s.delete(t),clearTimeout(u),l&&clearTimeout(l.timeoutObject),c};u=setTimeout(o,i);let a={timeoutObject:u,clear:o,count:0};return s.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,i,s){let n,u=e;this.options.cwd&&!H.isAbsolute(e)&&(u=H.join(this.options.cwd,e));let o=new Date,a=l=>{Us.stat(u,(c,h)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&s(c);return}let f=Number(new Date);l&&h.size!==l.size&&(this._pendingWrites.get(e).lastChange=f);let p=this._pendingWrites.get(e);f-p.lastChange>=t?(this._pendingWrites.delete(e),s(void 0,h)):n=setTimeout(a,this.options.awaitWriteFinish.pollInterval,h)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(n),i)}),n=setTimeout(a,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&Yp.test(e))return!0;if(!this._userIgnored){let{cwd:i}=this.options,s=this.options.ignored,n=s&&s.map(yl(i)),u=js(n).filter(a=>typeof a===zs&&!Ts(a)).map(a=>a+ks),o=this._getGlobIgnored().map(yl(i)).concat(n,u);this._userIgnored=Ms(o,void 0,Hs)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let i=t||this.options.disableGlobbing||!Ts(e)?e:kp(e),s=this.options.followSymlinks;return new Ws(e,i,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=H.resolve(e);return this._watched.has(t)||this._watched.set(t,new Gs(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let i=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(i.toString(8)[0],10))}_remove(e,t,i){let s=H.join(e,t),n=H.resolve(s);if(i=i!=null?i:this._watched.has(s)||this._watched.has(n),!this._throttle("remove",s,100))return;!i&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(s).getChildren().forEach(f=>this._remove(s,f));let a=this._getWatchedDir(e),l=a.has(t);a.remove(t),this._symlinkPaths.has(n)&&this._symlinkPaths.delete(n);let c=s;if(this.options.cwd&&(c=H.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===vr)return;this._watched.delete(s),this._watched.delete(n);let h=i?Gp:ml;l&&!this._isIgnored(s)&&this._emit(h,s),this.options.useFsEvents||this._closePath(s)}_closePath(e){this._closeFile(e);let t=H.dirname(e);this._getWatchedDir(t).remove(H.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(i=>i()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let i=this._closers.get(e);i||(i=[],this._closers.set(e,i)),i.push(t)}_readdirp(e,t){if(this.closed)return;let i={type:Ps,alwaysStat:!0,lstat:!0,...t},s=Ip(e,i);return this._streams.add(s),s.once(Up,()=>{s=void 0}),s.once(zp,()=>{s&&(this._streams.delete(s),s=void 0)}),s}};Vs.FSWatcher=Fr;var h0=(r,e)=>{let t=new Fr(e);return t.add(r),t};Vs.watch=h0});var C0={};$l(C0,{chokidar:()=>E0,enquirer:()=>m0,json5:()=>f0,pirates:()=>p0,sourceMapSupport:()=>D0,stoppable:()=>g0});module.exports=Hl(C0);var xl=nt(un()),d0=nt(ln()),Sl=nt(Gn()),Rl=nt(Un()),Bl=nt(So()),Ol=nt(Fl()),f0=xl.default,p0=d0,D0=Sl.default,g0=Rl.default,m0=Bl.default,E0=Ol.default;0&&(module.exports={chokidar,enquirer,json5,pirates,sourceMapSupport,stoppable});
/*! Bundled license information:

normalize-path/index.js:
  (*!
   * normalize-path <https://github.com/jonschlinkert/normalize-path>
   *
   * Copyright (c) 2014-2018, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-extglob/index.js:
  (*!
   * is-extglob <https://github.com/jonschlinkert/is-extglob>
   *
   * Copyright (c) 2014-2016, Jon Schlinkert.
   * Licensed under the MIT License.
   *)

is-glob/index.js:
  (*!
   * is-glob <https://github.com/jonschlinkert/is-glob>
   *
   * Copyright (c) 2014-2017, Jon Schlinkert.
   * Released under the MIT License.
   *)

is-number/index.js:
  (*!
   * is-number <https://github.com/jonschlinkert/is-number>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

to-regex-range/index.js:
  (*!
   * to-regex-range <https://github.com/micromatch/to-regex-range>
   *
   * Copyright (c) 2015-present, Jon Schlinkert.
   * Released under the MIT License.
   *)

fill-range/index.js:
  (*!
   * fill-range <https://github.com/jonschlinkert/fill-range>
   *
   * Copyright (c) 2014-present, Jon Schlinkert.
   * Licensed under the MIT License.
   *)
*/
