Vt.exports;/*! * is-extglob * * Copyright (c) 2014-2016, Jon Schlinkert. * Licensed under the MIT License. */var TD=function(e){if(typeof e!="string"||e==="")return!1;for(var u;u=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(u[2])return!0;e=e.slice(u.index+u[0].length)}return!1};/*! * is-glob * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */var xD=TD,$s={"{":"}","(":")","[":"]"},OD=function(t){if(t[0]==="!")return!0;for(var e=0,u=-2,s=-2,n=-2,r=-2,i=-2;ee&&(i===-1||i>s||(i=t.indexOf("\\",e),i===-1||i>s)))||n!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(n=t.indexOf("}",e),n>e&&(i=t.indexOf("\\",e),i===-1||i>n))||r!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(r=t.indexOf(")",e),r>e&&(i=t.indexOf("\\",e),i===-1||i>r))||u!==-1&&t[e]==="("&&t[e+1]!=="|"&&(uu&&(i=t.indexOf("\\",u),i===-1||i>r))))return!0;if(t[e]==="\\"){var D=t[e+1];e+=2;var o=$s[D];if(o){var a=t.indexOf(o,e);a!==-1&&(e=a+1)}if(t[e]==="!")return!0}else e++}return!1},ND=function(t){if(t[0]==="!")return!0;for(var e=0;etypeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,u)=>e.nodes.find(s=>s.type===u),t.exceedsLimit=(e,u,s=1,n)=>n===!1||!t.isInteger(e)||!t.isInteger(u)?!1:(Number(u)-Number(e))/Number(s)>=n,t.escapeNode=(e,u=0,s)=>{let n=e.nodes[u];n&&(s&&n.type===s||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((u,s)=>(s.type==="text"&&u.push(s.value),s.type==="range"&&(s.type="text"),u),[]),t.flatten=(...e)=>{const u=[],s=n=>{for(let r=0;r{let u=(s,n={})=>{let r=e.escapeInvalid&&xs.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,D="";if(s.value)return(r||i)&&xs.isOpenOrClose(s)?"\\"+s.value:s.value;if(s.value)return s.value;if(s.nodes)for(let o of s.nodes)D+=u(o);return D};return u(t)};/*! * is-number * * Copyright (c) 2014-present, Jon Schlinkert. * Released under the MIT License. */var jD=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};/*! * to-regex-range * * Copyright (c) 2015-present, Jon Schlinkert. * Released under the MIT License. */const Os=jD,oe=(t,e,u)=>{if(Os(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Os(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let s={relaxZeros:!0,...u};typeof s.strictZeros=="boolean"&&(s.relaxZeros=s.strictZeros===!1);let n=String(s.relaxZeros),r=String(s.shorthand),i=String(s.capture),D=String(s.wrap),o=t+":"+e+"="+n+r+i+D;if(oe.cache.hasOwnProperty(o))return oe.cache[o].result;let a=Math.min(t,e),c=Math.max(t,e);if(Math.abs(a-c)===1){let F=t+"|"+e;return s.capture?`(${F})`:s.wrap===!1?F:`(?:${F})`}let f=ks(t)||ks(e),l={min:t,max:e,a,b:c},E=[],p=[];if(f&&(l.isPadded=f,l.maxLen=String(l.max).length),a<0){let F=c<0?Math.abs(c):1;p=Ns(F,Math.abs(a),l,s),a=l.a=0}return c>=0&&(E=Ns(a,c,l,s)),l.negatives=p,l.positives=E,l.result=UD(p,E),s.capture===!0?l.result=`(${l.result})`:s.wrap!==!1&&E.length+p.length>1&&(l.result=`(?:${l.result})`),oe.cache[o]=l,l.result};function UD(t,e,u){let s=Xt(t,e,"-",!1)||[],n=Xt(e,t,"",!1)||[],r=Xt(t,e,"-?",!0)||[];return s.concat(r).concat(n).join("|")}function KD(t,e){let u=1,s=1,n=Ls(t,u),r=new Set([e]);for(;t<=n&&n<=e;)r.add(n),u+=1,n=Ls(t,u);for(n=Is(e+1,s)-1;t1&&D.count.pop(),D.count.push(c.count[0]),D.string=D.pattern+Ps(D.count),i=a+1;continue}u.isPadded&&(f=XD(a,u,s)),c.string=f+c.pattern+Ps(c.count),r.push(c),i=a+1,D=c}return r}function Xt(t,e,u,s,n){let r=[];for(let i of t){let{string:D}=i;!s&&!Hs(e,"string",D)&&r.push(u+D),s&&Hs(e,"string",D)&&r.push(u+D)}return r}function zD(t,e){let u=[];for(let s=0;se?1:e>t?-1:0}function Hs(t,e,u){return t.some(s=>s[e]===u)}function Ls(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Is(t,e){return t-t%Math.pow(10,e)}function Ps(t){let[e=0,u=""]=t;return u||e>1?`{${e+(u?","+u:"")}}`:""}function qD(t,e,u){return`[${t}${e-t===1?"":"-"}${e}]`}function ks(t){return/^-?(0+)\d/.test(t)}function XD(t,e,u){if(!e.isPadded)return t;let s=Math.abs(e.maxLen-String(t).length),n=u.relaxZeros!==!1;switch(s){case 0:return"";case 1:return n?"0?":"0";case 2:return n?"0{0,2}":"00";default:return n?`0{0,${s}}`:`0{${s}}`}}oe.cache={},oe.clearCache=()=>oe.cache={};var QD=oe;/*! * fill-range * * Copyright (c) 2014-present, Jon Schlinkert. * Licensed under the MIT License. */const ZD=_e,Ms=QD,Ws=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),JD=t=>e=>t===!0?Number(e):String(e),Qt=t=>typeof t=="number"||typeof t=="string"&&t!=="",ve=t=>Number.isInteger(+t),Zt=t=>{let e=`${t}`,u=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++u]==="0";);return u>0},eo=(t,e,u)=>typeof t=="string"||typeof e=="string"?!0:u.stringify===!0,to=(t,e,u)=>{if(e>0){let s=t[0]==="-"?"-":"";s&&(t=t.slice(1)),t=s+t.padStart(s?e-1:e,"0")}return u===!1?String(t):t},Gs=(t,e)=>{let u=t[0]==="-"?"-":"";for(u&&(t=t.slice(1),e--);t.length{t.negatives.sort((i,D)=>iD?1:0),t.positives.sort((i,D)=>iD?1:0);let u=e.capture?"":"?:",s="",n="",r;return t.positives.length&&(s=t.positives.join("|")),t.negatives.length&&(n=`-(${u}${t.negatives.join("|")})`),s&&n?r=`${s}|${n}`:r=s||n,e.wrap?`(${u}${r})`:r},js=(t,e,u,s)=>{if(u)return Ms(t,e,{wrap:!1,...s});let n=String.fromCharCode(t);if(t===e)return n;let r=String.fromCharCode(e);return`[${n}-${r}]`},Us=(t,e,u)=>{if(Array.isArray(t)){let s=u.wrap===!0,n=u.capture?"":"?:";return s?`(${n}${t.join("|")})`:t.join("|")}return Ms(t,e,u)},Ks=(...t)=>new RangeError("Invalid range arguments: "+ZD.inspect(...t)),Vs=(t,e,u)=>{if(u.strictRanges===!0)throw Ks([t,e]);return[]},so=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},no=(t,e,u=1,s={})=>{let n=Number(t),r=Number(e);if(!Number.isInteger(n)||!Number.isInteger(r)){if(s.strictRanges===!0)throw Ks([t,e]);return[]}n===0&&(n=0),r===0&&(r=0);let i=n>r,D=String(t),o=String(e),a=String(u);u=Math.max(Math.abs(u),1);let c=Zt(D)||Zt(o)||Zt(a),f=c?Math.max(D.length,o.length,a.length):0,l=c===!1&&eo(t,e,s)===!1,E=s.transform||JD(l);if(s.toRegex&&u===1)return js(Gs(t,f),Gs(e,f),!0,s);let p={negatives:[],positives:[]},F=N=>p[N<0?"negatives":"positives"].push(Math.abs(N)),A=[],B=0;for(;i?n>=r:n<=r;)s.toRegex===!0&&u>1?F(n):A.push(to(E(n,B),f,l)),n=i?n-u:n+u,B++;return s.toRegex===!0?u>1?uo(p,s):Us(A,null,{wrap:!1,...s}):A},ro=(t,e,u=1,s={})=>{if(!ve(t)&&t.length>1||!ve(e)&&e.length>1)return Vs(t,e,s);let n=s.transform||(l=>String.fromCharCode(l)),r=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),D=r>i,o=Math.min(r,i),a=Math.max(r,i);if(s.toRegex&&u===1)return js(o,a,!1,s);let c=[],f=0;for(;D?r>=i:r<=i;)c.push(n(r,f)),r=D?r-u:r+u,f++;return s.toRegex===!0?Us(c,null,{wrap:!1,options:s}):c},st=(t,e,u,s={})=>{if(e==null&&Qt(t))return[t];if(!Qt(t)||!Qt(e))return Vs(t,e,s);if(typeof u=="function")return st(t,e,1,{transform:u});if(Ws(u))return st(t,e,0,u);let n={...s};return n.capture===!0&&(n.wrap=!0),u=u||n.step||1,ve(u)?ve(t)&&ve(e)?no(t,e,u,n):ro(t,e,Math.max(Math.abs(u),1),n):u!=null&&!Ws(u)?so(u,n):st(t,e,1,u)};var zs=st;const io=zs,Ys=ut,Do=(t,e={})=>{let u=(s,n={})=>{let r=Ys.isInvalidBrace(n),i=s.invalid===!0&&e.escapeInvalid===!0,D=r===!0||i===!0,o=e.escapeInvalid===!0?"\\":"",a="";if(s.isOpen===!0||s.isClose===!0)return o+s.value;if(s.type==="open")return D?o+s.value:"(";if(s.type==="close")return D?o+s.value:")";if(s.type==="comma")return s.prev.type==="comma"?"":D?s.value:"|";if(s.value)return s.value;if(s.nodes&&s.ranges>0){let c=Ys.reduce(s.nodes),f=io(...c,{...e,wrap:!1,toRegex:!0});if(f.length!==0)return c.length>1&&f.length>1?`(${f})`:f}if(s.nodes)for(let c of s.nodes)a+=u(c,s);return a};return u(t)};var oo=Do;const ao=zs,qs=qt,pe=ut,ae=(t="",e="",u=!1)=>{let s=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return u?pe.flatten(e).map(n=>`{${n}}`):e;for(let n of t)if(Array.isArray(n))for(let r of n)s.push(ae(r,e,u));else for(let r of e)u===!0&&typeof r=="string"&&(r=`{${r}}`),s.push(Array.isArray(r)?ae(n,r,u):n+r);return pe.flatten(s)},lo=(t,e={})=>{let u=e.rangeLimit===void 0?1e3:e.rangeLimit,s=(n,r={})=>{n.queue=[];let i=r,D=r.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,D=i.queue;if(n.invalid||n.dollar){D.push(ae(D.pop(),qs(n,e)));return}if(n.type==="brace"&&n.invalid!==!0&&n.nodes.length===2){D.push(ae(D.pop(),["{}"]));return}if(n.nodes&&n.ranges>0){let f=pe.reduce(n.nodes);if(pe.exceedsLimit(...f,e.step,u))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let l=ao(...f,e);l.length===0&&(l=qs(n,e)),D.push(ae(D.pop(),l)),n.nodes=[];return}let o=pe.encloseBrace(n),a=n.queue,c=n;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,a=c.queue;for(let f=0;f",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"};const ho=qt,{MAX_LENGTH:Xs,CHAR_BACKSLASH:Jt,CHAR_BACKTICK:Eo,CHAR_COMMA:po,CHAR_DOT:Co,CHAR_LEFT_PARENTHESES:Fo,CHAR_RIGHT_PARENTHESES:go,CHAR_LEFT_CURLY_BRACE:mo,CHAR_RIGHT_CURLY_BRACE:_o,CHAR_LEFT_SQUARE_BRACKET:Qs,CHAR_RIGHT_SQUARE_BRACKET:Zs,CHAR_DOUBLE_QUOTE:Ao,CHAR_SINGLE_QUOTE:yo,CHAR_NO_BREAK_SPACE:wo,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Ro}=fo,bo=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let u=e||{},s=typeof u.maxLength=="number"?Math.min(Xs,u.maxLength):Xs;if(t.length>s)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${s})`);let n={type:"root",input:t,nodes:[]},r=[n],i=n,D=n,o=0,a=t.length,c=0,f=0,l;const E=()=>t[c++],p=F=>{if(F.type==="text"&&D.type==="dot"&&(D.type="text"),D&&D.type==="text"&&F.type==="text"){D.value+=F.value;return}return i.nodes.push(F),F.parent=i,F.prev=D,D=F,F};for(p({type:"bos"});c0){if(i.ranges>0){i.ranges=0;let F=i.nodes.shift();i.nodes=[F,{type:"text",value:ho(i)}]}p({type:"comma",value:l}),i.commas++;continue}if(l===Co&&f>0&&i.commas===0){let F=i.nodes;if(f===0||F.length===0){p({type:"text",value:l});continue}if(D.type==="dot"){if(i.range=[],D.value+=l,D.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,D.type="text";continue}i.ranges++,i.args=[];continue}if(D.type==="range"){F.pop();let A=F[F.length-1];A.value+=D.value+l,D=A,i.ranges--;continue}p({type:"dot",value:l});continue}p({type:"text",value:l})}do if(i=r.pop(),i.type!=="root"){i.nodes.forEach(B=>{B.nodes||(B.type==="open"&&(B.isOpen=!0),B.type==="close"&&(B.isClose=!0),B.nodes||(B.type="text"),B.invalid=!0)});let F=r[r.length-1],A=F.nodes.indexOf(i);F.nodes.splice(A,1,...i.nodes)}while(r.length>0);return p({type:"eos"}),n};var vo=bo;const Js=qt,Bo=oo,So=co,$o=vo,Y=(t,e={})=>{let u=[];if(Array.isArray(t))for(let s of t){let n=Y.create(s,e);Array.isArray(n)?u.push(...n):u.push(n)}else u=[].concat(Y.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(u=[...new Set(u)]),u};Y.parse=(t,e={})=>$o(t,e),Y.stringify=(t,e={})=>Js(typeof t=="string"?Y.parse(t,e):t,e),Y.compile=(t,e={})=>(typeof t=="string"&&(t=Y.parse(t,e)),Bo(t,e)),Y.expand=(t,e={})=>{typeof t=="string"&&(t=Y.parse(t,e));let u=So(t,e);return e.noempty===!0&&(u=u.filter(Boolean)),e.nodupes===!0&&(u=[...new Set(u)]),u},Y.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Y.compile(t,e):Y.expand(t,e);var To=Y,xo=["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"],Oo=xo;const No=K,Ho=Oo,Lo=new Set(Ho);var Io=t=>Lo.has(No.extname(t).slice(1).toLowerCase()),nt={};(function(t){const{sep:e}=K,{platform:u}=process,s=me;t.EV_ALL="all",t.EV_READY="ready",t.EV_ADD="add",t.EV_CHANGE="change",t.EV_ADD_DIR="addDir",t.EV_UNLINK="unlink",t.EV_UNLINK_DIR="unlinkDir",t.EV_RAW="raw",t.EV_ERROR="error",t.STR_DATA="data",t.STR_END="end",t.STR_CLOSE="close",t.FSEVENT_CREATED="created",t.FSEVENT_MODIFIED="modified",t.FSEVENT_DELETED="deleted",t.FSEVENT_MOVED="moved",t.FSEVENT_CLONED="cloned",t.FSEVENT_UNKNOWN="unknown",t.FSEVENT_TYPE_FILE="file",t.FSEVENT_TYPE_DIRECTORY="directory",t.FSEVENT_TYPE_SYMLINK="symlink",t.KEY_LISTENERS="listeners",t.KEY_ERR="errHandlers",t.KEY_RAW="rawEmitters",t.HANDLER_KEYS=[t.KEY_LISTENERS,t.KEY_ERR,t.KEY_RAW],t.DOT_SLASH=`.${e}`,t.BACK_SLASH_RE=/\\/g,t.DOUBLE_SLASH_RE=/\/\//,t.SLASH_OR_BACK_SLASH_RE=/[/\\]/,t.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,t.REPLACER_RE=/^\.[/\\]/,t.SLASH="/",t.SLASH_SLASH="//",t.BRACE_START="{",t.BANG="!",t.ONE_DOT=".",t.TWO_DOTS="..",t.STAR="*",t.GLOBSTAR="**",t.ROOT_GLOBSTAR="/**/*",t.SLASH_GLOBSTAR="/**",t.DIR_SUFFIX="Dir",t.ANYMATCH_OPTS={dot:!0},t.STRING_TYPE="string",t.FUNCTION_TYPE="function",t.EMPTY_STR="",t.EMPTY_FN=()=>{},t.IDENTITY_FN=n=>n,t.isWindows=u==="win32",t.isMacos=u==="darwin",t.isLinux=u==="linux",t.isIBMi=s.type()==="OS400"})(nt);const se=J,I=K,{promisify:Be}=_e,Po=Io,{isWindows:ko,isLinux:Mo,EMPTY_FN:Wo,EMPTY_STR:Go,KEY_LISTENERS:Ce,KEY_ERR:eu,KEY_RAW:Se,HANDLER_KEYS:jo,EV_CHANGE:rt,EV_ADD:it,EV_ADD_DIR:Uo,EV_ERROR:en,STR_DATA:Ko,STR_END:Vo,BRACE_START:zo,STAR:Yo}=nt,qo="watch",Xo=Be(se.open),tn=Be(se.stat),Qo=Be(se.lstat),Zo=Be(se.close),tu=Be(se.realpath),Jo={lstat:Qo,stat:tn},uu=(t,e)=>{t instanceof Set?t.forEach(e):e(t)},$e=(t,e,u)=>{let s=t[e];s instanceof Set||(t[e]=s=new Set([s])),s.add(u)},ea=t=>e=>{const u=t[e];u instanceof Set?u.clear():delete t[e]},Te=(t,e,u)=>{const s=t[e];s instanceof Set?s.delete(u):s===u&&delete t[e]},un=t=>t instanceof Set?t.size===0:!t,Dt=new Map;function sn(t,e,u,s,n){const r=(i,D)=>{u(t),n(i,D,{watchedPath:t}),D&&t!==D&&ot(I.resolve(t,D),Ce,I.join(t,D))};try{return se.watch(t,e,r)}catch(i){s(i)}}const ot=(t,e,u,s,n)=>{const r=Dt.get(t);r&&uu(r[e],i=>{i(u,s,n)})},ta=(t,e,u,s)=>{const{listener:n,errHandler:r,rawEmitter:i}=s;let D=Dt.get(e),o;if(!u.persistent)return o=sn(t,u,n,r,i),o.close.bind(o);if(D)$e(D,Ce,n),$e(D,eu,r),$e(D,Se,i);else{if(o=sn(t,u,ot.bind(null,e,Ce),r,ot.bind(null,e,Se)),!o)return;o.on(en,async a=>{const c=ot.bind(null,e,eu);if(D.watcherUnusable=!0,ko&&a.code==="EPERM")try{const f=await Xo(t,"r");await Zo(f),c(a)}catch{}else c(a)}),D={listeners:n,errHandlers:r,rawEmitters:i,watcher:o},Dt.set(e,D)}return()=>{Te(D,Ce,n),Te(D,eu,r),Te(D,Se,i),un(D.listeners)&&(D.watcher.close(),Dt.delete(e),jo.forEach(ea(D)),D.watcher=void 0,Object.freeze(D))}},su=new Map,ua=(t,e,u,s)=>{const{listener:n,rawEmitter:r}=s;let i=su.get(e);const D=i&&i.options;return D&&(D.persistentu.interval)&&(i.listeners,i.rawEmitters,se.unwatchFile(e),i=void 0),i?($e(i,Ce,n),$e(i,Se,r)):(i={listeners:n,rawEmitters:r,options:u,watcher:se.watchFile(e,u,(o,a)=>{uu(i.rawEmitters,f=>{f(rt,e,{curr:o,prev:a})});const c=o.mtimeMs;(o.size!==a.size||c>a.mtimeMs||c===0)&&uu(i.listeners,f=>f(t,o))})},su.set(e,i)),()=>{Te(i,Ce,n),Te(i,Se,r),un(i.listeners)&&(su.delete(e),se.unwatchFile(e),i.options=i.watcher=void 0,Object.freeze(i))}};let sa=class{constructor(e){this.fsw=e,this._boundHandleError=u=>e._handleError(u)}_watchWithNodeFs(e,u){const s=this.fsw.options,n=I.dirname(e),r=I.basename(e);this.fsw._getWatchedDir(n).add(r);const D=I.resolve(e),o={persistent:s.persistent};u||(u=Wo);let a;return s.usePolling?(o.interval=s.enableBinaryInterval&&Po(r)?s.binaryInterval:s.interval,a=ua(e,D,o,{listener:u,rawEmitter:this.fsw._emitRaw})):a=ta(e,D,o,{listener:u,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_handleFile(e,u,s){if(this.fsw.closed)return;const n=I.dirname(e),r=I.basename(e),i=this.fsw._getWatchedDir(n);let D=u;if(i.has(r))return;const o=async(c,f)=>{if(this.fsw._throttle(qo,e,5)){if(!f||f.mtimeMs===0)try{const l=await tn(e);if(this.fsw.closed)return;const E=l.atimeMs,p=l.mtimeMs;(!E||E<=p||p!==D.mtimeMs)&&this.fsw._emit(rt,e,l),Mo&&D.ino!==l.ino?(this.fsw._closeFile(c),D=l,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,o))):D=l}catch{this.fsw._remove(n,r)}else if(i.has(r)){const l=f.atimeMs,E=f.mtimeMs;(!l||l<=E||E!==D.mtimeMs)&&this.fsw._emit(rt,e,f),D=f}}},a=this._watchWithNodeFs(e,o);if(!(s&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(it,e,0))return;this.fsw._emit(it,e,u)}return a}async _handleSymlink(e,u,s,n){if(this.fsw.closed)return;const r=e.fullPath,i=this.fsw._getWatchedDir(u);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let D;try{D=await tu(s)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(i.has(n)?this.fsw._symlinkPaths.get(r)!==D&&(this.fsw._symlinkPaths.set(r,D),this.fsw._emit(rt,s,e.stats)):(i.add(n),this.fsw._symlinkPaths.set(r,D),this.fsw._emit(it,s,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(r))return!0;this.fsw._symlinkPaths.set(r,!0)}_handleRead(e,u,s,n,r,i,D){if(e=I.join(e,Go),!s.hasGlob&&(D=this.fsw._throttle("readdir",e,1e3),!D))return;const o=this.fsw._getWatchedDir(s.path),a=new Set;let c=this.fsw._readdirp(e,{fileFilter:f=>s.filterPath(f),directoryFilter:f=>s.filterDir(f),depth:0}).on(Ko,async f=>{if(this.fsw.closed){c=void 0;return}const l=f.path;let E=I.join(e,l);if(a.add(l),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,E,l))){if(this.fsw.closed){c=void 0;return}(l===n||!n&&!o.has(l))&&(this.fsw._incrReadyCount(),E=I.join(r,I.relative(r,E)),this._addToNodeFs(E,u,s,i+1))}}).on(en,this._boundHandleError);return new Promise(f=>c.once(Vo,()=>{if(this.fsw.closed){c=void 0;return}const l=D?D.clear():!1;f(),o.getChildren().filter(E=>E!==e&&!a.has(E)&&(!s.hasGlob||s.filterPath({fullPath:I.resolve(e,E)}))).forEach(E=>{this.fsw._remove(e,E)}),c=void 0,l&&this._handleRead(e,!1,s,n,r,i,D)}))}async _handleDir(e,u,s,n,r,i,D){const o=this.fsw._getWatchedDir(I.dirname(e)),a=o.has(I.basename(e));!(s&&this.fsw.options.ignoreInitial)&&!r&&!a&&(!i.hasGlob||i.globFilter(e))&&this.fsw._emit(Uo,e,u),o.add(I.basename(e)),this.fsw._getWatchedDir(e);let c,f;const l=this.fsw.options.depth;if((l==null||n<=l)&&!this.fsw._symlinkPaths.has(D)){if(!r&&(await this._handleRead(e,s,i,r,e,n,c),this.fsw.closed))return;f=this._watchWithNodeFs(e,(E,p)=>{p&&p.mtimeMs===0||this._handleRead(E,!1,i,r,e,n,c)})}return f}async _addToNodeFs(e,u,s,n,r){const i=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return i(),!1;const D=this.fsw._getWatchHelpers(e,n);!D.hasGlob&&s&&(D.hasGlob=s.hasGlob,D.globFilter=s.globFilter,D.filterPath=o=>s.filterPath(o),D.filterDir=o=>s.filterDir(o));try{const o=await Jo[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))return i(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(Yo)&&!e.includes(zo);let c;if(o.isDirectory()){const f=I.resolve(e),l=a?await tu(e):e;if(this.fsw.closed||(c=await this._handleDir(D.watchPath,o,u,n,r,D,l),this.fsw.closed))return;f!==l&&l!==void 0&&this.fsw._symlinkPaths.set(f,l)}else if(o.isSymbolicLink()){const f=a?await tu(e):e;if(this.fsw.closed)return;const l=I.dirname(D.watchPath);if(this.fsw._getWatchedDir(l).add(D.watchPath),this.fsw._emit(it,D.watchPath,o),c=await this._handleDir(l,o,u,n,e,D,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(I.resolve(e),f)}else c=this._handleFile(D.watchPath,o,u);return i(),this.fsw._addPathCloser(e,c),!1}catch(o){if(this.fsw._handleError(o))return i(),e}}};var na=sa,nu={exports:{}};const ru=J,P=K,{promisify:iu}=_e;let Fe;try{Fe=dt.require("fsevents")}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t)}if(Fe){const t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){const e=Number.parseInt(t[1],10),u=Number.parseInt(t[2],10);e===8&&u<16&&(Fe=void 0)}}const{EV_ADD:Du,EV_CHANGE:ra,EV_ADD_DIR:nn,EV_UNLINK:at,EV_ERROR:ia,STR_DATA:Da,STR_END:oa,FSEVENT_CREATED:aa,FSEVENT_MODIFIED:la,FSEVENT_DELETED:ca,FSEVENT_MOVED:fa,FSEVENT_UNKNOWN:ha,FSEVENT_TYPE_FILE:da,FSEVENT_TYPE_DIRECTORY:xe,FSEVENT_TYPE_SYMLINK:rn,ROOT_GLOBSTAR:Dn,DIR_SUFFIX:Ea,DOT_SLASH:on,FUNCTION_TYPE:ou,EMPTY_FN:pa,IDENTITY_FN:Ca}=nt,Fa=t=>isNaN(t)?{}:{depth:t},au=iu(ru.stat),ga=iu(ru.lstat),an=iu(ru.realpath),ma={stat:au,lstat:ga},le=new Map,_a=10,Aa=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),ya=(t,e)=>({stop:Fe.watch(t,e)});function wa(t,e,u,s){let n=P.extname(e)?P.dirname(e):e;const r=P.dirname(n);let i=le.get(n);Ra(r)&&(n=r);const D=P.resolve(t),o=D!==e,a=(f,l,E)=>{o&&(f=f.replace(e,D)),(f===D||!f.indexOf(D+P.sep))&&u(f,l,E)};let c=!1;for(const f of le.keys())if(e.indexOf(P.resolve(f)+P.sep)===0){n=f,i=le.get(n),c=!0;break}return i||c?i.listeners.add(a):(i={listeners:new Set([a]),rawEmitter:s,watcher:ya(n,(f,l)=>{if(!i.listeners.size)return;const E=Fe.getInfo(f,l);i.listeners.forEach(p=>{p(f,l,E)}),i.rawEmitter(E.event,f,E)})},le.set(n,i)),()=>{const f=i.listeners;if(f.delete(a),!f.size&&(le.delete(n),i.watcher))return i.watcher.stop().then(()=>{i.rawEmitter=i.watcher=void 0,Object.freeze(i)})}}const Ra=t=>{let e=0;for(const u of le.keys())if(u.indexOf(t)===0&&(e++,e>=_a))return!0;return!1},ba=()=>Fe&&le.size<128,lu=(t,e)=>{let u=0;for(;!t.indexOf(e)&&(t=P.dirname(t))!==e;)u++;return u},ln=(t,e)=>t.type===xe&&e.isDirectory()||t.type===rn&&e.isSymbolicLink()||t.type===da&&e.isFile();let va=class{constructor(e){this.fsw=e}checkIgnored(e,u){const s=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,u))return s.add(e),u&&u.isDirectory()&&s.add(e+Dn),!0;s.delete(e),s.delete(e+Dn)}addOrChange(e,u,s,n,r,i,D,o){const a=r.has(i)?ra:Du;this.handleEvent(a,e,u,s,n,r,i,D,o)}async checkExists(e,u,s,n,r,i,D,o){try{const a=await au(e);if(this.fsw.closed)return;ln(D,a)?this.addOrChange(e,u,s,n,r,i,D,o):this.handleEvent(at,e,u,s,n,r,i,D,o)}catch(a){a.code==="EACCES"?this.addOrChange(e,u,s,n,r,i,D,o):this.handleEvent(at,e,u,s,n,r,i,D,o)}}handleEvent(e,u,s,n,r,i,D,o,a){if(!(this.fsw.closed||this.checkIgnored(u)))if(e===at){const c=o.type===xe;(c||i.has(D))&&this.fsw._remove(r,D,c)}else{if(e===Du){if(o.type===xe&&this.fsw._getWatchedDir(u),o.type===rn&&a.followSymlinks){const f=a.depth===void 0?void 0:lu(s,n)+1;return this._addToFsEvents(u,!1,!0,f)}this.fsw._getWatchedDir(r).add(D)}const c=o.type===xe?e+Ea:e;this.fsw._emit(c,u),c===nn&&this._addToFsEvents(u,!1,!0)}}_watchWithFsEvents(e,u,s,n){if(this.fsw.closed||this.fsw._isIgnored(e))return;const r=this.fsw.options,D=wa(e,u,async(o,a,c)=>{if(this.fsw.closed||r.depth!==void 0&&lu(o,u)>r.depth)return;const f=s(P.join(e,P.relative(e,o)));if(n&&!n(f))return;const l=P.dirname(f),E=P.basename(f),p=this.fsw._getWatchedDir(c.type===xe?f:l);if(Aa.has(a)||c.event===ha)if(typeof r.ignored===ou){let F;try{F=await au(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,F))return;ln(c,F)?this.addOrChange(f,o,u,l,p,E,c,r):this.handleEvent(at,f,o,u,l,p,E,c,r)}else this.checkExists(f,o,u,l,p,E,c,r);else switch(c.event){case aa:case la:return this.addOrChange(f,o,u,l,p,E,c,r);case ca:case fa:return this.checkExists(f,o,u,l,p,E,c,r)}},this.fsw._emitRaw);return this.fsw._emitReady(),D}async _handleFsEventsSymlink(e,u,s,n){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(u))){this.fsw._symlinkPaths.set(u,!0),this.fsw._incrReadyCount();try{const r=await an(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(r))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(r||e,i=>{let D=e;return r&&r!==on?D=i.replace(r,e):i!==on&&(D=P.join(e,i)),s(D)},!1,n)}catch(r){if(this.fsw._handleError(r))return this.fsw._emitReady()}}}emitAdd(e,u,s,n,r){const i=s(e),D=u.isDirectory(),o=this.fsw._getWatchedDir(P.dirname(i)),a=P.basename(i);D&&this.fsw._getWatchedDir(i),!o.has(a)&&(o.add(a),(!n.ignoreInitial||r===!0)&&this.fsw._emit(D?nn:Du,i,u))}initWatch(e,u,s,n){if(this.fsw.closed)return;const r=this._watchWithFsEvents(s.watchPath,P.resolve(e||s.watchPath),n,s.globFilter);this.fsw._addPathCloser(u,r)}async _addToFsEvents(e,u,s,n){if(this.fsw.closed)return;const r=this.fsw.options,i=typeof u===ou?u:Ca,D=this.fsw._getWatchHelpers(e);try{const o=await ma[D.statMethod](D.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(D.watchPath,o))throw null;if(o.isDirectory()){if(D.globFilter||this.emitAdd(i(e),o,i,r,s),n&&n>r.depth)return;this.fsw._readdirp(D.watchPath,{fileFilter:a=>D.filterPath(a),directoryFilter:a=>D.filterDir(a),...Fa(r.depth-(n||0))}).on(Da,a=>{if(this.fsw.closed||a.stats.isDirectory()&&!D.filterPath(a))return;const c=P.join(D.watchPath,a.path),{fullPath:f}=a;if(D.followSymlinks&&a.stats.isSymbolicLink()){const l=r.depth===void 0?void 0:lu(c,P.resolve(D.watchPath))+1;this._handleFsEventsSymlink(c,f,i,l)}else this.emitAdd(c,a.stats,i,r,s)}).on(ia,pa).on(oa,()=>{this.fsw._emitReady()})}else this.emitAdd(D.watchPath,o,i,r,s),this.fsw._emitReady()}catch(o){(!o||this.fsw._handleError(o))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(r.persistent&&s!==!0)if(typeof u===ou)this.initWatch(void 0,e,D,i);else{let o;try{o=await an(D.watchPath)}catch{}this.initWatch(o,e,D,i)}}};nu.exports=va,nu.exports.canUse=ba;var Ba=nu.exports;const{EventEmitter:Sa}=xn,cu=J,v=K,{promisify:cn}=_e,$a=wD,fu=$D.default,Ta=GD,hu=Ts,xa=To,Oa=bs,Na=na,fn=Ba,{EV_ALL:du,EV_READY:Ha,EV_ADD:lt,EV_CHANGE:Oe,EV_UNLINK:hn,EV_ADD_DIR:La,EV_UNLINK_DIR:Ia,EV_RAW:Pa,EV_ERROR:Eu,STR_CLOSE:ka,STR_END:Ma,BACK_SLASH_RE:Wa,DOUBLE_SLASH_RE:dn,SLASH_OR_BACK_SLASH_RE:Ga,DOT_RE:ja,REPLACER_RE:Ua,SLASH:pu,SLASH_SLASH:Ka,BRACE_START:Va,BANG:Cu,ONE_DOT:En,TWO_DOTS:za,GLOBSTAR:Ya,SLASH_GLOBSTAR:Fu,ANYMATCH_OPTS:gu,STRING_TYPE:mu,FUNCTION_TYPE:qa,EMPTY_STR:_u,EMPTY_FN:Xa,isWindows:Qa,isMacos:Za,isIBMi:Ja}=nt,el=cn(cu.stat),tl=cn(cu.readdir),Au=(t=[])=>Array.isArray(t)?t:[t],pn=(t,e=[])=>(t.forEach(u=>{Array.isArray(u)?pn(u,e):e.push(u)}),e),Cn=t=>{const e=pn(Au(t));if(!e.every(u=>typeof u===mu))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(gn)},Fn=t=>{let e=t.replace(Wa,pu),u=!1;for(e.startsWith(Ka)&&(u=!0);e.match(dn);)e=e.replace(dn,pu);return u&&(e=pu+e),e},gn=t=>Fn(v.normalize(Fn(t))),mn=(t=_u)=>e=>typeof e!==mu?e:gn(v.isAbsolute(e)?e:v.join(t,e)),ul=(t,e)=>v.isAbsolute(t)?t:t.startsWith(Cu)?Cu+v.join(e,t.slice(1)):v.join(e,t),q=(t,e)=>t[e]===void 0;class sl{constructor(e,u){this.path=e,this._removeWatcher=u,this.items=new Set}add(e){const{items:u}=this;u&&e!==En&&e!==za&&u.add(e)}async remove(e){const{items:u}=this;if(!u||(u.delete(e),u.size>0))return;const s=this.path;try{await tl(s)}catch{this._removeWatcher&&this._removeWatcher(v.dirname(s),v.basename(s))}}has(e){const{items:u}=this;if(u)return u.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}const nl="stat",rl="lstat";class il{constructor(e,u,s,n){this.fsw=n,this.path=e=e.replace(Ua,_u),this.watchPath=u,this.fullWatchPath=v.resolve(u),this.hasGlob=u!==e,e===_u&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&s?void 0:!1,this.globFilter=this.hasGlob?fu(e,void 0,gu):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(r=>{r.length>1&&r.pop()}),this.followSymlinks=s,this.statMethod=s?nl:rl}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 v.join(this.watchPath,v.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:u}=e;if(u&&u.isSymbolicLink())return this.filterDir(e);const s=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===qa?this.globFilter(s):!0)&&this.fsw._isntIgnored(s,u)&&this.fsw._hasReadPermissions(u)}getDirParts(e){if(!this.hasGlob)return[];const u=[];return(e.includes(Va)?xa.expand(e):[e]).forEach(n=>{u.push(v.relative(this.watchPath,n).split(Ga))}),u}filterDir(e){if(this.hasGlob){const u=this.getDirParts(this.checkGlobSymlink(e));let s=!1;this.unmatchedGlob=!this.dirParts.some(n=>n.every((r,i)=>(r===Ya&&(s=!0),s||!u[0][i]||fu(r,u[0][i],gu))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class Dl extends Sa{constructor(e){super();const u={};e&&Object.assign(u,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,q(u,"persistent")&&(u.persistent=!0),q(u,"ignoreInitial")&&(u.ignoreInitial=!1),q(u,"ignorePermissionErrors")&&(u.ignorePermissionErrors=!1),q(u,"interval")&&(u.interval=100),q(u,"binaryInterval")&&(u.binaryInterval=300),q(u,"disableGlobbing")&&(u.disableGlobbing=!1),u.enableBinaryInterval=u.binaryInterval!==u.interval,q(u,"useFsEvents")&&(u.useFsEvents=!u.usePolling),fn.canUse()||(u.useFsEvents=!1),q(u,"usePolling")&&!u.useFsEvents&&(u.usePolling=Za),Ja&&(u.usePolling=!0);const n=process.env.CHOKIDAR_USEPOLLING;if(n!==void 0){const o=n.toLowerCase();o==="false"||o==="0"?u.usePolling=!1:o==="true"||o==="1"?u.usePolling=!0:u.usePolling=!!o}const r=process.env.CHOKIDAR_INTERVAL;r&&(u.interval=Number.parseInt(r,10)),q(u,"atomic")&&(u.atomic=!u.usePolling&&!u.useFsEvents),u.atomic&&(this._pendingUnlinks=new Map),q(u,"followSymlinks")&&(u.followSymlinks=!0),q(u,"awaitWriteFinish")&&(u.awaitWriteFinish=!1),u.awaitWriteFinish===!0&&(u.awaitWriteFinish={});const i=u.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),u.ignored&&(u.ignored=Au(u.ignored));let D=0;this._emitReady=()=>{D++,D>=this._readyCount&&(this._emitReady=Xa,this._readyEmitted=!0,process.nextTick(()=>this.emit(Ha)))},this._emitRaw=(...o)=>this.emit(Pa,...o),this._readyEmitted=!1,this.options=u,u.useFsEvents?this._fsEventsHandler=new fn(this):this._nodeFsHandler=new Na(this),Object.freeze(u)}add(e,u,s){const{cwd:n,disableGlobbing:r}=this.options;this.closed=!1;let i=Cn(e);return n&&(i=i.map(D=>{const o=ul(D,n);return r||!hu(D)?o:Oa(o)})),i=i.filter(D=>D.startsWith(Cu)?(this._ignoredPaths.add(D.slice(1)),!1):(this._ignoredPaths.delete(D),this._ignoredPaths.delete(D+Fu),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=i.length),this.options.persistent&&(this._readyCount*=2),i.forEach(D=>this._fsEventsHandler._addToFsEvents(D))):(this._readyCount||(this._readyCount=0),this._readyCount+=i.length,Promise.all(i.map(async D=>{const o=await this._nodeFsHandler._addToNodeFs(D,!s,0,0,u);return o&&this._emitReady(),o})).then(D=>{this.closed||D.filter(o=>o).forEach(o=>{this.add(v.dirname(o),v.basename(u||o))})})),this}unwatch(e){if(this.closed)return this;const u=Cn(e),{cwd:s}=this.options;return u.forEach(n=>{!v.isAbsolute(n)&&!this._closers.has(n)&&(s&&(n=v.join(s,n)),n=v.resolve(n)),this._closePath(n),this._ignoredPaths.add(n),this._watched.has(n)&&this._ignoredPaths.add(n+Fu),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach(u=>u.forEach(s=>{const n=s();n instanceof Promise&&e.push(n)})),this._streams.forEach(u=>u.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(u=>u.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(u=>{this[`_${u}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach((u,s)=>{const n=this.options.cwd?v.relative(this.options.cwd,s):s;e[n||En]=u.getChildren().sort()}),e}emitWithAll(e,u){this.emit(...u),e!==Eu&&this.emit(du,...u)}async _emit(e,u,s,n,r){if(this.closed)return;const i=this.options;Qa&&(u=v.normalize(u)),i.cwd&&(u=v.relative(i.cwd,u));const D=[e,u];r!==void 0?D.push(s,n,r):n!==void 0?D.push(s,n):s!==void 0&&D.push(s);const o=i.awaitWriteFinish;let a;if(o&&(a=this._pendingWrites.get(u)))return a.lastChange=new Date,this;if(i.atomic){if(e===hn)return this._pendingUnlinks.set(u,D),setTimeout(()=>{this._pendingUnlinks.forEach((c,f)=>{this.emit(...c),this.emit(du,...c),this._pendingUnlinks.delete(f)})},typeof i.atomic=="number"?i.atomic:100),this;e===lt&&this._pendingUnlinks.has(u)&&(e=D[0]=Oe,this._pendingUnlinks.delete(u))}if(o&&(e===lt||e===Oe)&&this._readyEmitted){const c=(f,l)=>{f?(e=D[0]=Eu,D[1]=f,this.emitWithAll(e,D)):l&&(D.length>2?D[2]=l:D.push(l),this.emitWithAll(e,D))};return this._awaitWriteFinish(u,o.stabilityThreshold,e,c),this}if(e===Oe&&!this._throttle(Oe,u,50))return this;if(i.alwaysStat&&s===void 0&&(e===lt||e===La||e===Oe)){const c=i.cwd?v.join(i.cwd,u):u;let f;try{f=await el(c)}catch{}if(!f||this.closed)return;D.push(f)}return this.emitWithAll(e,D),this}_handleError(e){const u=e&&e.code;return e&&u!=="ENOENT"&&u!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||u!=="EPERM"&&u!=="EACCES")&&this.emit(Eu,e),e||this.closed}_throttle(e,u,s){this._throttled.has(e)||this._throttled.set(e,new Map);const n=this._throttled.get(e),r=n.get(u);if(r)return r.count++,!1;let i;const D=()=>{const a=n.get(u),c=a?a.count:0;return n.delete(u),clearTimeout(i),a&&clearTimeout(a.timeoutObject),c};i=setTimeout(D,s);const o={timeoutObject:i,clear:D,count:0};return n.set(u,o),o}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,u,s,n){let r,i=e;this.options.cwd&&!v.isAbsolute(e)&&(i=v.join(this.options.cwd,e));const D=new Date,o=a=>{cu.stat(i,(c,f)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&n(c);return}const l=Number(new Date);a&&f.size!==a.size&&(this._pendingWrites.get(e).lastChange=l);const E=this._pendingWrites.get(e);l-E.lastChange>=u?(this._pendingWrites.delete(e),n(void 0,f)):r=setTimeout(o,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:D,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(r),s)}),r=setTimeout(o,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,u){if(this.options.atomic&&ja.test(e))return!0;if(!this._userIgnored){const{cwd:s}=this.options,n=this.options.ignored,r=n&&n.map(mn(s)),i=Au(r).filter(o=>typeof o===mu&&!hu(o)).map(o=>o+Fu),D=this._getGlobIgnored().map(mn(s)).concat(r,i);this._userIgnored=fu(D,void 0,gu)}return this._userIgnored([e,u])}_isntIgnored(e,u){return!this._isIgnored(e,u)}_getWatchHelpers(e,u){const s=u||this.options.disableGlobbing||!hu(e)?e:Ta(e),n=this.options.followSymlinks;return new il(e,s,n,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const u=v.resolve(e);return this._watched.has(u)||this._watched.set(u,new sl(u,this._boundRemove)),this._watched.get(u)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const s=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(s.toString(8)[0],10))}_remove(e,u,s){const n=v.join(e,u),r=v.resolve(n);if(s=s!=null?s:this._watched.has(n)||this._watched.has(r),!this._throttle("remove",n,100))return;!s&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,u,!0),this._getWatchedDir(n).getChildren().forEach(l=>this._remove(n,l));const o=this._getWatchedDir(e),a=o.has(u);o.remove(u),this._symlinkPaths.has(r)&&this._symlinkPaths.delete(r);let c=n;if(this.options.cwd&&(c=v.relative(this.options.cwd,n)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===lt)return;this._watched.delete(n),this._watched.delete(r);const f=s?Ia:hn;a&&!this._isIgnored(n)&&this._emit(f,n),this.options.useFsEvents||this._closePath(n)}_closePath(e){this._closeFile(e);const u=v.dirname(e);this._getWatchedDir(u).remove(v.basename(e))}_closeFile(e){const u=this._closers.get(e);u&&(u.forEach(s=>s()),this._closers.delete(e))}_addPathCloser(e,u){if(!u)return;let s=this._closers.get(e);s||(s=[],this._closers.set(e,s)),s.push(u)}_readdirp(e,u){if(this.closed)return;const s={type:du,alwaysStat:!0,lstat:!0,...u};let n=$a(e,s);return this._streams.add(n),n.once(ka,()=>{n=void 0}),n.once(Ma,()=>{n&&(this._streams.delete(n),n=void 0)}),n}}const ol=(t,e)=>{const u=new Dl(e);return u.add(t),u};var al=ol;let ce=!0;const ge=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Ne=0;if(ge.process&&ge.process.env&&ge.process.stdout){const{FORCE_COLOR:t,NODE_DISABLE_COLORS:e,NO_COLOR:u,TERM:s,COLORTERM:n}=ge.process.env;e||u||t==="0"?ce=!1:t==="1"||t==="2"||t==="3"?ce=!0:s==="dumb"?ce=!1:"CI"in ge.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(r=>r in ge.process.env)?ce=!0:ce=process.stdout.isTTY,ce&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Ne=3:s&&(s.endsWith("-256color")||s.endsWith("256"))?Ne=2:Ne=1)}let _n={enabled:ce,supportLevel:Ne};function He(t,e,u=1){const s=`\x1B[${t}m`,n=`\x1B[${e}m`,r=new RegExp(`\\x1b\\[${e}m`,"g");return i=>_n.enabled&&_n.supportLevel>=u?s+(""+i).replace(r,s)+n:""+i}const Le=He(33,39),ll=He(90,39),cl=He(92,39),fl=He(95,39),hl=He(96,39),ct=(t=!0)=>{let e=!1;return u=>{if(e||u==="unknown-flag")return!0;if(u==="argument")return e=!0,t}},An=(t,e=process.argv.slice(2))=>(Ru(t,e,{ignore:ct()}),e),dl=t=>{let e=Buffer.alloc(0);return u=>{for(e=Buffer.concat([e,u]);e.length>4;){const s=e.readInt32BE(0);if(e.length>=4+s){const n=e.slice(4,4+s);t(n),e=e.slice(4+s)}else break}}},yn=async()=>{const t=Nn.createServer(u=>{u.on("data",dl(s=>{const n=JSON.parse(s.toString());t.emit("data",n)}))}),e=Ln.getPipePath(process.pid);return await J.promises.mkdir(Hn.tmpdir,{recursive:!0}),await J.promises.rm(e,{force:!0}),await new Promise((u,s)=>{t.listen(e,u),t.on("error",s)}),t.unref(),process.on("exit",()=>{if(t.close(),process.platform!=="win32")try{J.rmSync(e)}catch{}}),t},El=()=>new Date().toLocaleTimeString(),Ie=(...t)=>console.log(ll(El()),hl("[tsx]"),...t),pl="\x1Bc",Cl=(t,e)=>{let u;return function(){u&&clearTimeout(u),u=setTimeout(()=>Reflect.apply(t,this,arguments),e)}},wn={noCache:{type:Boolean,description:"Disable caching",default:!1},tsconfig:{type:String,description:"Custom tsconfig.json path"},clearScreen:{type:Boolean,description:"Clearing the screen on rerun",default:!0},ignore:{type:[String],description:"Paths & globs to exclude from being watched"}},Fl=ei({name:"watch",parameters:["