diff --git a/Makefile.js b/Makefile.js index a039194f49e9..cd5402e6cccd 100644 --- a/Makefile.js +++ b/Makefile.js @@ -1,3 +1,3 @@ /* eslint-disable */ // prettier-ignore -"use strict";var e=require("os"),r=require("fs"),t=require("path"),n=require("events"),i=require("assert"),o=require("util"),s=require("child_process"),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u=function(e){return e&&e.Math==Math&&e},l=u("object"==typeof globalThis&&globalThis)||u("object"==typeof window&&window)||u("object"==typeof self&&self)||u("object"==typeof c&&c)||function(){return this}()||c||Function("return this")(),f={},p=function(e){try{return!!e()}catch(e){return!0}},h=!p((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d=!p((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),v=d,g=Function.prototype.call,y=v?g.bind(g):function(){return g.apply(g,arguments)},m={},E={}.propertyIsEnumerable,b=Object.getOwnPropertyDescriptor,w=b&&!E.call({1:2},1);m.f=w?function(e){var r=b(this,e);return!!r&&r.enumerable}:E;var O,S,R=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}},I=d,A=Function.prototype,j=A.call,x=I&&A.bind.bind(j,j),k=I?x:function(e){return function(){return j.apply(e,arguments)}},L=k,T=L({}.toString),_=L("".slice),N=function(e){return _(T(e),8,-1)},P=p,F=N,D=Object,C=k("".split),M=P((function(){return!D("z").propertyIsEnumerable(0)}))?function(e){return"String"==F(e)?C(e,""):D(e)}:D,G=function(e){return null==e},$=G,B=TypeError,U=function(e){if($(e))throw B("Can't call method on "+e);return e},X=M,q=U,W=function(e){return X(q(e))},V="object"==typeof document&&document.all,H={all:V,IS_HTMLDDA:void 0===V&&void 0!==V},z=H.all,Y=H.IS_HTMLDDA?function(e){return"function"==typeof e||e===z}:function(e){return"function"==typeof e},K=Y,J=H.all,Q=H.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:K(e)||e===J}:function(e){return"object"==typeof e?null!==e:K(e)},Z=l,ee=Y,re=function(e,r){return arguments.length<2?(t=Z[e],ee(t)?t:void 0):Z[e]&&Z[e][r];var t},te=k({}.isPrototypeOf),ne="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ie=l,oe=ne,se=ie.process,ce=ie.Deno,ae=se&&se.versions||ce&&ce.version,ue=ae&&ae.v8;ue&&(S=(O=ue.split("."))[0]>0&&O[0]<4?1:+(O[0]+O[1])),!S&&oe&&(!(O=oe.match(/Edge\/(\d+)/))||O[1]>=74)&&(O=oe.match(/Chrome\/(\d+)/))&&(S=+O[1]);var le=S,fe=le,pe=p,he=l.String,de=!!Object.getOwnPropertySymbols&&!pe((function(){var e=Symbol();return!he(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fe&&fe<41})),ve=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ge=re,ye=Y,me=te,Ee=Object,be=ve?function(e){return"symbol"==typeof e}:function(e){var r=ge("Symbol");return ye(r)&&me(r.prototype,Ee(e))},we=String,Oe=function(e){try{return we(e)}catch(e){return"Object"}},Se=Y,Re=Oe,Ie=TypeError,Ae=function(e){if(Se(e))return e;throw Ie(Re(e)+" is not a function")},je=Ae,xe=G,ke=function(e,r){var t=e[r];return xe(t)?void 0:je(t)},Le=y,Te=Y,_e=Q,Ne=TypeError,Pe={exports:{}},Fe=l,De=Object.defineProperty,Ce=function(e,r){try{De(Fe,e,{value:r,configurable:!0,writable:!0})}catch(t){Fe[e]=r}return r},Me=Ce,Ge="__core-js_shared__",$e=l[Ge]||Me(Ge,{}),Be=$e;(Pe.exports=function(e,r){return Be[e]||(Be[e]=void 0!==r?r:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ue=Pe.exports,Xe=U,qe=Object,We=function(e){return qe(Xe(e))},Ve=We,He=k({}.hasOwnProperty),ze=Object.hasOwn||function(e,r){return He(Ve(e),r)},Ye=k,Ke=0,Je=Math.random(),Qe=Ye(1..toString),Ze=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Qe(++Ke+Je,36)},er=Ue,rr=ze,tr=Ze,nr=de,ir=ve,or=l.Symbol,sr=er("wks"),cr=ir?or.for||or:or&&or.withoutSetter||tr,ar=function(e){return rr(sr,e)||(sr[e]=nr&&rr(or,e)?or[e]:cr("Symbol."+e)),sr[e]},ur=y,lr=Q,fr=be,pr=ke,hr=function(e,r){var t,n;if("string"===r&&Te(t=e.toString)&&!_e(n=Le(t,e)))return n;if(Te(t=e.valueOf)&&!_e(n=Le(t,e)))return n;if("string"!==r&&Te(t=e.toString)&&!_e(n=Le(t,e)))return n;throw Ne("Can't convert object to primitive value")},dr=TypeError,vr=ar("toPrimitive"),gr=function(e,r){if(!lr(e)||fr(e))return e;var t,n=pr(e,vr);if(n){if(void 0===r&&(r="default"),t=ur(n,e,r),!lr(t)||fr(t))return t;throw dr("Can't convert object to primitive value")}return void 0===r&&(r="number"),hr(e,r)},yr=be,mr=function(e){var r=gr(e,"string");return yr(r)?r:r+""},Er=Q,br=l.document,wr=Er(br)&&Er(br.createElement),Or=function(e){return wr?br.createElement(e):{}},Sr=Or,Rr=!h&&!p((function(){return 7!=Object.defineProperty(Sr("div"),"a",{get:function(){return 7}}).a})),Ir=h,Ar=y,jr=m,xr=R,kr=W,Lr=mr,Tr=ze,_r=Rr,Nr=Object.getOwnPropertyDescriptor;f.f=Ir?Nr:function(e,r){if(e=kr(e),r=Lr(r),_r)try{return Nr(e,r)}catch(e){}if(Tr(e,r))return xr(!Ar(jr.f,e,r),e[r])};var Pr={},Fr=h&&p((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Dr=Q,Cr=String,Mr=TypeError,Gr=function(e){if(Dr(e))return e;throw Mr(Cr(e)+" is not an object")},$r=h,Br=Rr,Ur=Fr,Xr=Gr,qr=mr,Wr=TypeError,Vr=Object.defineProperty,Hr=Object.getOwnPropertyDescriptor,zr="enumerable",Yr="configurable",Kr="writable";Pr.f=$r?Ur?function(e,r,t){if(Xr(e),r=qr(r),Xr(t),"function"==typeof e&&"prototype"===r&&"value"in t&&Kr in t&&!t[Kr]){var n=Hr(e,r);n&&n[Kr]&&(e[r]=t.value,t={configurable:Yr in t?t[Yr]:n[Yr],enumerable:zr in t?t[zr]:n[zr],writable:!1})}return Vr(e,r,t)}:Vr:function(e,r,t){if(Xr(e),r=qr(r),Xr(t),Br)try{return Vr(e,r,t)}catch(e){}if("get"in t||"set"in t)throw Wr("Accessors not supported");return"value"in t&&(e[r]=t.value),e};var Jr=Pr,Qr=R,Zr=h?function(e,r,t){return Jr.f(e,r,Qr(1,t))}:function(e,r,t){return e[r]=t,e},et={exports:{}},rt=h,tt=ze,nt=Function.prototype,it=rt&&Object.getOwnPropertyDescriptor,ot=tt(nt,"name"),st={EXISTS:ot,PROPER:ot&&"something"===function(){}.name,CONFIGURABLE:ot&&(!rt||rt&&it(nt,"name").configurable)},ct=Y,at=$e,ut=k(Function.toString);ct(at.inspectSource)||(at.inspectSource=function(e){return ut(e)});var lt,ft,pt,ht=at.inspectSource,dt=Y,vt=l.WeakMap,gt=dt(vt)&&/native code/.test(String(vt)),yt=Ze,mt=Ue("keys"),Et=function(e){return mt[e]||(mt[e]=yt(e))},bt={},wt=gt,Ot=l,St=Q,Rt=Zr,It=ze,At=$e,jt=Et,xt=bt,kt="Object already initialized",Lt=Ot.TypeError,Tt=Ot.WeakMap;if(wt||At.state){var _t=At.state||(At.state=new Tt);_t.get=_t.get,_t.has=_t.has,_t.set=_t.set,lt=function(e,r){if(_t.has(e))throw Lt(kt);return r.facade=e,_t.set(e,r),r},ft=function(e){return _t.get(e)||{}},pt=function(e){return _t.has(e)}}else{var Nt=jt("state");xt[Nt]=!0,lt=function(e,r){if(It(e,Nt))throw Lt(kt);return r.facade=e,Rt(e,Nt,r),r},ft=function(e){return It(e,Nt)?e[Nt]:{}},pt=function(e){return It(e,Nt)}}var Pt={set:lt,get:ft,has:pt,enforce:function(e){return pt(e)?ft(e):lt(e,{})},getterFor:function(e){return function(r){var t;if(!St(r)||(t=ft(r)).type!==e)throw Lt("Incompatible receiver, "+e+" required");return t}}},Ft=k,Dt=p,Ct=Y,Mt=ze,Gt=h,$t=st.CONFIGURABLE,Bt=ht,Ut=Pt.enforce,Xt=Pt.get,qt=String,Wt=Object.defineProperty,Vt=Ft("".slice),Ht=Ft("".replace),zt=Ft([].join),Yt=Gt&&!Dt((function(){return 8!==Wt((function(){}),"length",{value:8}).length})),Kt=String(String).split("String"),Jt=et.exports=function(e,r,t){"Symbol("===Vt(qt(r),0,7)&&(r="["+Ht(qt(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!Mt(e,"name")||$t&&e.name!==r)&&(Gt?Wt(e,"name",{value:r,configurable:!0}):e.name=r),Yt&&t&&Mt(t,"arity")&&e.length!==t.arity&&Wt(e,"length",{value:t.arity});try{t&&Mt(t,"constructor")&&t.constructor?Gt&&Wt(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=Ut(e);return Mt(n,"source")||(n.source=zt(Kt,"string"==typeof r?r:"")),e};Function.prototype.toString=Jt((function(){return Ct(this)&&Xt(this).source||Bt(this)}),"toString");var Qt=et.exports,Zt=Y,en=Pr,rn=Qt,tn=Ce,nn=function(e,r,t,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:r;if(Zt(t)&&rn(t,o,n),n.global)i?e[r]=t:tn(r,t);else{try{n.unsafe?e[r]&&(i=!0):delete e[r]}catch(e){}i?e[r]=t:en.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},on={},sn=Math.ceil,cn=Math.floor,an=Math.trunc||function(e){var r=+e;return(r>0?cn:sn)(r)},un=function(e){var r=+e;return r!=r||0===r?0:an(r)},ln=un,fn=Math.max,pn=Math.min,hn=function(e,r){var t=ln(e);return t<0?fn(t+r,0):pn(t,r)},dn=un,vn=Math.min,gn=function(e){return e>0?vn(dn(e),9007199254740991):0},yn=gn,mn=function(e){return yn(e.length)},En=W,bn=hn,wn=mn,On=function(e){return function(r,t,n){var i,o=En(r),s=wn(o),c=bn(n,s);if(e&&t!=t){for(;s>c;)if((i=o[c++])!=i)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===t)return e||c||0;return!e&&-1}},Sn={includes:On(!0),indexOf:On(!1)},Rn=ze,In=W,An=Sn.indexOf,jn=bt,xn=k([].push),kn=function(e,r){var t,n=In(e),i=0,o=[];for(t in n)!Rn(jn,t)&&Rn(n,t)&&xn(o,t);for(;r.length>i;)Rn(n,t=r[i++])&&(~An(o,t)||xn(o,t));return o},Ln=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Tn=kn,_n=Ln.concat("length","prototype");on.f=Object.getOwnPropertyNames||function(e){return Tn(e,_n)};var Nn={};Nn.f=Object.getOwnPropertySymbols;var Pn=re,Fn=on,Dn=Nn,Cn=Gr,Mn=k([].concat),Gn=Pn("Reflect","ownKeys")||function(e){var r=Fn.f(Cn(e)),t=Dn.f;return t?Mn(r,t(e)):r},$n=ze,Bn=Gn,Un=f,Xn=Pr,qn=function(e,r,t){for(var n=Bn(r),i=Xn.f,o=Un.f,s=0;ss;)bi.f(e,t=i[s++],n[t]);return e};var Ri,Ii=re("document","documentElement"),Ai=Gr,ji=di,xi=Ln,ki=bt,Li=Ii,Ti=Or,_i="prototype",Ni="script",Pi=Et("IE_PROTO"),Fi=function(){},Di=function(e){return"<"+Ni+">"+e+""},Ci=function(e){e.write(Di("")),e.close();var r=e.parentWindow.Object;return e=null,r},Mi=function(){try{Ri=new ActiveXObject("htmlfile")}catch(e){}var e,r,t;Mi="undefined"!=typeof document?document.domain&&Ri?Ci(Ri):(r=Ti("iframe"),t="java"+Ni+":",r.style.display="none",Li.appendChild(r),r.src=String(t),(e=r.contentWindow.document).open(),e.write(Di("document.F=Object")),e.close(),e.F):Ci(Ri);for(var n=xi.length;n--;)delete Mi[_i][xi[n]];return Mi()};ki[Pi]=!0;var Gi=Object.create||function(e,r){var t;return null!==e?(Fi[_i]=Ai(e),t=new Fi,Fi[_i]=null,t[Pi]=e):t=Mi(),void 0===r?t:ji.f(t,r)},$i=ar,Bi=Gi,Ui=Pr.f,Xi=$i("unscopables"),qi=Array.prototype;null==qi[Xi]&&Ui(qi,Xi,{configurable:!0,value:Bi(null)});var Wi,Vi,Hi,zi={},Yi=!p((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ki=ze,Ji=Y,Qi=We,Zi=Yi,eo=Et("IE_PROTO"),ro=Object,to=ro.prototype,no=Zi?ro.getPrototypeOf:function(e){var r=Qi(e);if(Ki(r,eo))return r[eo];var t=r.constructor;return Ji(t)&&r instanceof t?t.prototype:r instanceof ro?to:null},io=p,oo=Y,so=Q,co=no,ao=nn,uo=ar("iterator"),lo=!1;[].keys&&("next"in(Hi=[].keys())?(Vi=co(co(Hi)))!==Object.prototype&&(Wi=Vi):lo=!0);var fo=!so(Wi)||io((function(){var e={};return Wi[uo].call(e)!==e}));fo&&(Wi={}),oo(Wi[uo])||ao(Wi,uo,(function(){return this}));var po={IteratorPrototype:Wi,BUGGY_SAFARI_ITERATORS:lo},ho=po.IteratorPrototype,vo=Gi,go=R,yo=fi,mo=zi,Eo=function(){return this},bo=k,wo=Ae,Oo=Y,So=String,Ro=TypeError,Io=function(e,r,t){try{return bo(wo(Object.getOwnPropertyDescriptor(e,r)[t]))}catch(e){}},Ao=Gr,jo=function(e){if("object"==typeof e||Oo(e))return e;throw Ro("Can't set "+So(e)+" as a prototype")},xo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,r=!1,t={};try{(e=Io(Object.prototype,"__proto__","set"))(t,[]),r=t instanceof Array}catch(e){}return function(t,n){return Ao(t),jo(n),r?e(t,n):t.__proto__=n,t}}():void 0),ko=ci,Lo=y,To=Y,_o=function(e,r,t,n){var i=r+" Iterator";return e.prototype=vo(ho,{next:go(+!n,t)}),yo(e,i,!1),mo[i]=Eo,e},No=no,Po=xo,Fo=fi,Do=Zr,Co=nn,Mo=zi,Go=st.PROPER,$o=st.CONFIGURABLE,Bo=po.IteratorPrototype,Uo=po.BUGGY_SAFARI_ITERATORS,Xo=ar("iterator"),qo="keys",Wo="values",Vo="entries",Ho=function(){return this},zo=W,Yo=function(e){qi[Xi][e]=!0},Ko=zi,Jo=Pt,Qo=Pr.f,Zo=function(e,r,t,n,i,o,s){_o(t,r,n);var c,a,u,l=function(e){if(e===i&&v)return v;if(!Uo&&e in h)return h[e];switch(e){case qo:case Wo:case Vo:return function(){return new t(this,e)}}return function(){return new t(this)}},f=r+" Iterator",p=!1,h=e.prototype,d=h[Xo]||h["@@iterator"]||i&&h[i],v=!Uo&&d||l(i),g="Array"==r&&h.entries||d;if(g&&(c=No(g.call(new e)))!==Object.prototype&&c.next&&(No(c)!==Bo&&(Po?Po(c,Bo):To(c[Xo])||Co(c,Xo,Ho)),Fo(c,f,!0)),Go&&i==Wo&&d&&d.name!==Wo&&($o?Do(h,"name",Wo):(p=!0,v=function(){return Lo(d,this)})),i)if(a={values:l(Wo),keys:o?v:l(qo),entries:l(Vo)},s)for(u in a)(Uo||p||!(u in h))&&Co(h,u,a[u]);else ko({target:r,proto:!0,forced:Uo||p},a);return h[Xo]!==v&&Co(h,Xo,v,{name:i}),Mo[r]=v,a},es=function(e,r){return{value:e,done:r}},rs=h,ts="Array Iterator",ns=Jo.set,is=Jo.getterFor(ts);Zo(Array,"Array",(function(e,r){ns(this,{type:ts,target:zo(e),index:0,kind:r})}),(function(){var e=is(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,es(void 0,!0)):es("keys"==t?n:"values"==t?r[n]:[n,r[n]],!1)}),"values");var os=Ko.Arguments=Ko.Array;if(Yo("keys"),Yo("values"),Yo("entries"),rs&&"values"!==os.name)try{Qo(os,"name",{value:"values"})}catch(e){}var ss={};ss[ar("toStringTag")]="z";var cs="[object z]"===String(ss),as=Y,us=N,ls=ar("toStringTag"),fs=Object,ps="Arguments"==us(function(){return arguments}()),hs=cs?us:function(e){var r,t,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,r){try{return e[r]}catch(e){}}(r=fs(e),ls))?t:ps?us(r):"Object"==(n=us(r))&&as(r.callee)?"Arguments":n},ds=hs,vs=String,gs=function(e){if("Symbol"===ds(e))throw TypeError("Cannot convert a Symbol value to a string");return vs(e)},ys=Gr,ms=function(){var e=ys(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},Es=p,bs=l.RegExp,ws=Es((function(){var e=bs("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Os=ws||Es((function(){return!bs("a","y").sticky})),Ss=ws||Es((function(){var e=bs("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),Rs={BROKEN_CARET:Ss,MISSED_STICKY:Os,UNSUPPORTED_Y:ws},Is=p,As=l.RegExp,js=Is((function(){var e=As(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),xs=p,ks=l.RegExp,Ls=xs((function(){var e=ks("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),Ts=y,_s=k,Ns=gs,Ps=ms,Fs=Rs,Ds=Gi,Cs=Pt.get,Ms=js,Gs=Ls,$s=Ue("native-string-replace",String.prototype.replace),Bs=RegExp.prototype.exec,Us=Bs,Xs=_s("".charAt),qs=_s("".indexOf),Ws=_s("".replace),Vs=_s("".slice),Hs=function(){var e=/a/,r=/b*/g;return Ts(Bs,e,"a"),Ts(Bs,r,"a"),0!==e.lastIndex||0!==r.lastIndex}(),zs=Fs.BROKEN_CARET,Ys=void 0!==/()??/.exec("")[1];(Hs||Ys||zs||Ms||Gs)&&(Us=function(e){var r,t,n,i,o,s,c,a=this,u=Cs(a),l=Ns(e),f=u.raw;if(f)return f.lastIndex=a.lastIndex,r=Ts(Us,f,l),a.lastIndex=f.lastIndex,r;var p=u.groups,h=zs&&a.sticky,d=Ts(Ps,a),v=a.source,g=0,y=l;if(h&&(d=Ws(d,"y",""),-1===qs(d,"g")&&(d+="g"),y=Vs(l,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Xs(l,a.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),t=new RegExp("^(?:"+v+")",d)),Ys&&(t=new RegExp("^"+v+"$(?!\\s)",d)),Hs&&(n=a.lastIndex),i=Ts(Bs,h?t:a,y),h?i?(i.input=Vs(i.input,g),i[0]=Vs(i[0],g),i.index=a.lastIndex,a.lastIndex+=i[0].length):a.lastIndex=0:Hs&&i&&(a.lastIndex=a.global?i.index+i[0].length:n),Ys&&i&&i.length>1&&Ts($s,i[0],t,(function(){for(o=1;o=c?e?"":void 0:(n=Ec(o,s))<55296||n>56319||s+1===c||(i=Ec(o,s+1))<56320||i>57343?e?mc(o,s):n:e?bc(o,s,s+2):i-56320+(n-55296<<10)+65536}},Oc={codeAt:wc(!1),charAt:wc(!0)}.charAt,Sc=function(e,r,t){return r+(t?Oc(e,r).length:1)},Rc=k,Ic=We,Ac=Math.floor,jc=Rc("".charAt),xc=Rc("".replace),kc=Rc("".slice),Lc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Tc=/\$([$&'`]|\d{1,2})/g,_c=function(e,r,t,n,i,o){var s=t+e.length,c=n.length,a=Tc;return void 0!==i&&(i=Ic(i),a=Lc),xc(o,a,(function(o,a){var u;switch(jc(a,0)){case"$":return"$";case"&":return e;case"`":return kc(r,0,t);case"'":return kc(r,s);case"<":u=i[kc(a,1,-1)];break;default:var l=+a;if(0===l)return o;if(l>c){var f=Ac(l/10);return 0===f?o:f<=c?void 0===n[f-1]?jc(a,1):n[f-1]+jc(a,1):o}u=n[l-1]}return void 0===u?"":u}))},Nc=y,Pc=Gr,Fc=Y,Dc=N,Cc=Ks,Mc=TypeError,Gc=function(e,r){var t=e.exec;if(Fc(t)){var n=Nc(t,e,r);return null!==n&&Pc(n),n}if("RegExp"===Dc(e))return Nc(Cc,e,r);throw Mc("RegExp#exec called on incompatible receiver")},$c=rc,Bc=y,Uc=k,Xc=hc,qc=p,Wc=Gr,Vc=Y,Hc=G,zc=un,Yc=gn,Kc=gs,Jc=U,Qc=Sc,Zc=ke,ea=_c,ra=Gc,ta=ar("replace"),na=Math.max,ia=Math.min,oa=Uc([].concat),sa=Uc([].push),ca=Uc("".indexOf),aa=Uc("".slice),ua="$0"==="a".replace(/./,"$0"),la=!!/./[ta]&&""===/./[ta]("a","$0"),fa=!qc((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));Xc("replace",(function(e,r,t){var n=la?"$":"$0";return[function(e,t){var n=Jc(this),i=Hc(e)?void 0:Zc(e,ta);return i?Bc(i,e,n,t):Bc(r,Kc(n),e,t)},function(e,i){var o=Wc(this),s=Kc(e);if("string"==typeof i&&-1===ca(i,n)&&-1===ca(i,"$<")){var c=t(r,o,s,i);if(c.done)return c.value}var a=Vc(i);a||(i=Kc(i));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var p=ra(o,s);if(null===p)break;if(sa(f,p),!u)break;""===Kc(p[0])&&(o.lastIndex=Qc(s,Yc(o.lastIndex),l))}for(var h,d="",v=0,g=0;g=v&&(d+=aa(s,v,m)+S,v=m+y.length)}return d+aa(s,v)}]}),!fa||!ua||la);var pa=Q,ha=N,da=ar("match"),va=function(e){var r;return pa(e)&&(void 0!==(r=e[da])?!!r:"RegExp"==ha(e))},ga=y,ya=ze,ma=te,Ea=ms,ba=RegExp.prototype,wa=function(e){var r=e.flags;return void 0!==r||"flags"in ba||ya(e,"flags")||!ma(ba,e)?r:ga(Ea,e)},Oa=ci,Sa=y,Ra=k,Ia=U,Aa=Y,ja=G,xa=va,ka=gs,La=ke,Ta=wa,_a=_c,Na=ar("replace"),Pa=TypeError,Fa=Ra("".indexOf);Ra("".replace);var Da=Ra("".slice),Ca=Math.max,Ma=function(e,r,t){return t>e.length?-1:""===r?t:Fa(e,r,t)};Oa({target:"String",proto:!0},{replaceAll:function(e,r){var t,n,i,o,s,c,a,u,l=Ia(this),f=0,p=0,h="";if(!ja(e)){if(xa(e)&&(t=ka(Ia(Ta(e))),!~Fa(t,"g")))throw Pa("`.replaceAll` does not allow non-global regexes");if(n=La(e,Na))return Sa(n,e,l,r)}for(i=ka(l),o=ka(e),(s=Aa(r))||(r=ka(r)),c=o.length,a=Ca(1,c),f=Ma(i,o,0);-1!==f;)u=s?ka(r(o,f,i)):_a(o,i,f,[],void 0,r),h+=Da(i,p,f)+u,p=f+c,f=Ma(i,o,f+a);return po&&du(i,arguments[o]),i}));f.prototype=u,"Error"!==c?uu?uu(f,l):lu(f,l,{name:!0}):gu&&i in a&&(fu(f,a,i),fu(f,a,"prepareStackTrace")),lu(f,a);try{u.name!==c&&cu(u,"name",c),u.constructor=f}catch(e){}return f}},bu="WebAssembly",wu=l[bu],Ou=7!==Error("e",{cause:7}).cause,Su=function(e,r){var t={};t[e]=Eu(e,r,Ou),yu({global:!0,constructor:!0,arity:1,forced:Ou},t)},Ru=function(e,r){if(wu&&wu[e]){var t={};t[e]=Eu(bu+"."+e,r,Ou),yu({target:bu,stat:!0,constructor:!0,arity:1,forced:Ou},t)}};Su("Error",(function(e){return function(r){return mu(e,this,arguments)}})),Su("EvalError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("RangeError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("ReferenceError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("SyntaxError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("TypeError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("URIError",(function(e){return function(r){return mu(e,this,arguments)}})),Ru("CompileError",(function(e){return function(r){return mu(e,this,arguments)}})),Ru("LinkError",(function(e){return function(r){return mu(e,this,arguments)}})),Ru("RuntimeError",(function(e){return function(r){return mu(e,this,arguments)}}));var Iu=Ae,Au=d,ju=ic(ic.bind),xu=N,ku=Array.isArray||function(e){return"Array"==xu(e)},Lu=k,Tu=p,_u=Y,Nu=hs,Pu=ht,Fu=function(){},Du=[],Cu=re("Reflect","construct"),Mu=/^\s*(?:class|function)\b/,Gu=Lu(Mu.exec),$u=!Mu.exec(Fu),Bu=function(e){if(!_u(e))return!1;try{return Cu(Fu,Du,e),!0}catch(e){return!1}},Uu=function(e){if(!_u(e))return!1;switch(Nu(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return $u||!!Gu(Mu,Pu(e))}catch(e){return!0}};Uu.sham=!0;var Xu=!Cu||Tu((function(){var e;return Bu(Bu.call)||!Bu(Object)||!Bu((function(){e=!0}))||e}))?Uu:Bu,qu=ku,Wu=Xu,Vu=Q,Hu=ar("species"),zu=Array,Yu=function(e){var r;return qu(e)&&(r=e.constructor,(Wu(r)&&(r===zu||qu(r.prototype))||Vu(r)&&null===(r=r[Hu]))&&(r=void 0)),void 0===r?zu:r},Ku=function(e,r){return new(Yu(e))(0===r?0:r)},Ju=function(e,r){return Iu(e),void 0===r?e:Au?ju(e,r):function(){return e.apply(r,arguments)}},Qu=M,Zu=We,el=mn,rl=Ku,tl=k([].push),nl=function(e){var r=1==e,t=2==e,n=3==e,i=4==e,o=6==e,s=7==e,c=5==e||o;return function(a,u,l,f){for(var p,h,d=Zu(a),v=Qu(d),g=Ju(u,l),y=el(v),m=0,E=f||rl,b=r?E(a,y):t||s?E(a,0):void 0;y>m;m++)if((c||m in v)&&(h=g(p=v[m],m,d),e))if(r)b[m]=h;else if(h)switch(e){case 3:return!0;case 5:return p;case 6:return m;case 2:tl(b,p)}else switch(e){case 4:return!1;case 7:tl(b,p)}return o?-1:n||i?i:b}},il={forEach:nl(0),map:nl(1),filter:nl(2),some:nl(3),every:nl(4),find:nl(5),findIndex:nl(6),filterReject:nl(7)},ol=p,sl=le,cl=ar("species"),al=function(e){return sl>=51||!ol((function(){var r=[];return(r.constructor={})[cl]=function(){return{foo:1}},1!==r[e](Boolean).foo}))},ul=il.map;ci({target:"Array",proto:!0,forced:!al("map")},{map:function(e){return ul(this,e,arguments.length>1?arguments[1]:void 0)}});var ll,fl,pl=ci,hl=y,dl=Y,vl=Gr,gl=gs,yl=(ll=!1,(fl=/[ac]/).exec=function(){return ll=!0,/./.exec.apply(this,arguments)},!0===fl.test("abc")&&ll),ml=/./.test;pl({target:"RegExp",proto:!0,forced:!yl},{test:function(e){var r=vl(this),t=gl(e),n=r.exec;if(!dl(n))return hl(ml,r,t);var i=hl(n,r,t);return null!==i&&(vl(i),!0)}});var El=y,bl=Gr,wl=G,Ol=gn,Sl=gs,Rl=U,Il=ke,Al=Sc,jl=Gc;hc("match",(function(e,r,t){return[function(r){var t=Rl(this),n=wl(r)?void 0:Il(r,e);return n?El(n,r,t):new RegExp(r)[e](Sl(t))},function(e){var n=bl(this),i=Sl(e),o=t(r,n,i);if(o.done)return o.value;if(!n.global)return jl(n,i);var s=n.unicode;n.lastIndex=0;for(var c,a=[],u=0;null!==(c=jl(n,i));){var l=Sl(c[0]);a[u]=l,""===l&&(n.lastIndex=Al(i,Ol(n.lastIndex),s)),u++}return 0===u?null:a}]}));var xl=Qt,kl=Pr,Ll=function(e,r,t){return t.get&&xl(t.get,r,{getter:!0}),t.set&&xl(t.set,r,{setter:!0}),kl.f(e,r,t)},Tl=re,_l=Ll,Nl=h,Pl=ar("species"),Fl=h,Dl=l,Cl=k,Ml=Zn,Gl=qa,$l=Zr,Bl=on.f,Ul=te,Xl=va,ql=gs,Wl=wa,Vl=Rs,Hl=$a,zl=nn,Yl=p,Kl=ze,Jl=Pt.enforce,Ql=function(e){var r=Tl(e);Nl&&r&&!r[Pl]&&_l(r,Pl,{configurable:!0,get:function(){return this}})},Zl=js,ef=Ls,rf=ar("match"),tf=Dl.RegExp,nf=tf.prototype,of=Dl.SyntaxError,sf=Cl(nf.exec),cf=Cl("".charAt),af=Cl("".replace),uf=Cl("".indexOf),lf=Cl("".slice),ff=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,pf=/a/g,hf=/a/g,df=new tf(pf)!==pf,vf=Vl.MISSED_STICKY,gf=Vl.UNSUPPORTED_Y,yf=Fl&&(!df||vf||Zl||ef||Yl((function(){return hf[rf]=!1,tf(pf)!=pf||tf(hf)==hf||"/a/i"!=tf(pf,"i")})));if(Ml("RegExp",yf)){for(var mf=function(e,r){var t,n,i,o,s,c,a=Ul(nf,this),u=Xl(e),l=void 0===r,f=[],p=e;if(!a&&u&&l&&e.constructor===mf)return e;if((u||Ul(nf,e))&&(e=e.source,l&&(r=Wl(p))),e=void 0===e?"":ql(e),r=void 0===r?"":ql(r),p=e,Zl&&"dotAll"in pf&&(n=!!r&&uf(r,"s")>-1)&&(r=af(r,/s/g,"")),t=r,vf&&"sticky"in pf&&(i=!!r&&uf(r,"y")>-1)&&gf&&(r=af(r,/y/g,"")),ef&&(o=function(e){for(var r,t=e.length,n=0,i="",o=[],s={},c=!1,a=!1,u=0,l="";n<=t;n++){if("\\"===(r=cf(e,n)))r+=cf(e,++n);else if("]"===r)c=!1;else if(!c)switch(!0){case"["===r:c=!0;break;case"("===r:sf(ff,lf(e,n+1))&&(n+=2,a=!0),i+=r,u++;continue;case">"===r&&a:if(""===l||Kl(s,l))throw new of("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],a=!1,l="";continue}a?l+=r:i+=r}return[i,o]}(e),e=o[0],f=o[1]),s=Gl(tf(e,r),a?this:nf,mf),(n||i||f.length)&&(c=Jl(s),n&&(c.dotAll=!0,c.raw=mf(function(e){for(var r,t=e.length,n=0,i="",o=!1;n<=t;n++)"\\"!==(r=cf(e,n))?o||"."!==r?("["===r?o=!0:"]"===r&&(o=!1),i+=r):i+="[\\s\\S]":i+=r+cf(e,++n);return i}(e),t)),i&&(c.sticky=!0),f.length&&(c.groups=f)),e!==p)try{$l(s,"source",""===p?"(?:)":p)}catch(e){}return s},Ef=Bl(tf),bf=0;Ef.length>bf;)Hl(mf,tf,Ef[bf++]);nf.constructor=mf,mf.prototype=nf,zl(Dl,"RegExp",mf,{constructor:!0})}Ql("RegExp");var wf=h,Of=js,Sf=N,Rf=Ll,If=Pt.get,Af=RegExp.prototype,jf=TypeError;wf&&Of&&Rf(Af,"dotAll",{configurable:!0,get:function(){if(this!==Af){if("RegExp"===Sf(this))return!!If(this).dotAll;throw jf("Incompatible receiver, RegExp required")}}});var xf="\t\n\v\f\r                 \u2028\u2029\ufeff",kf=U,Lf=gs,Tf=xf,_f=k("".replace),Nf=RegExp("^["+Tf+"]+"),Pf=RegExp("(^|[^"+Tf+"])["+Tf+"]+$"),Ff=function(e){return function(r){var t=Lf(kf(r));return 1&e&&(t=_f(t,Nf,"")),2&e&&(t=_f(t,Pf,"$1")),t}},Df={start:Ff(1),end:Ff(2),trim:Ff(3)},Cf=st.PROPER,Mf=p,Gf=xf,$f=function(e){return Mf((function(){return!!Gf[e]()||"​…᠎"!=="​…᠎"[e]()||Cf&&Gf[e].name!==e}))},Bf=Df.trim;ci({target:"String",proto:!0,forced:$f("trim")},{trim:function(){return Bf(this)}});var Uf=k([].slice),Xf=ku,qf=Y,Wf=N,Vf=gs,Hf=k([].push),zf=ci,Yf=re,Kf=rc,Jf=y,Qf=k,Zf=p,ep=Y,rp=be,tp=Uf,np=function(e){if(qf(e))return e;if(Xf(e)){for(var r=e.length,t=[],n=0;n1?arguments[1]:void 0;return Xp?Up(this,e,r)||0:$p(this,e,r)}});var qp=h,Wp=ku,Vp=TypeError,Hp=Object.getOwnPropertyDescriptor,zp=qp&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,r){if(Wp(e)&&!Hp(e,"length").writable)throw Vp("Cannot set read only .length");return e.length=r}:function(e,r){return e.length=r},Yp=TypeError,Kp=function(e){if(e>9007199254740991)throw Yp("Maximum allowed index exceeded");return e},Jp=We,Qp=mn,Zp=zp,eh=Kp;ci({target:"Array",proto:!0,arity:1,forced:p((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var r=Jp(this),t=Qp(r),n=arguments.length;eh(t+n);for(var i=0;i=51||!th((function(){var e=[];return e[ph]=!1,e.concat()[0]!==e})),dh=function(e){if(!ih(e))return!1;var r=e[ph];return void 0!==r?!!r:nh(e)};rh({target:"Array",proto:!0,arity:1,forced:!hh||!lh("concat")},{concat:function(e){var r,t,n,i,o,s=oh(this),c=uh(s,0),a=0;for(r=-1,n=arguments.length;r=r.length)return t&&(t[h]=r),o(null,r);c.lastIndex=u;var e=c.exec(r);return p=l,l+=e[0],f=p+e[1],u=c.lastIndex,v[f]||t&&t[f]===f?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,f)?b(t[f]):i.lstat(f,m)}function m(e,r){if(e)return o(e);if(!r.isSymbolicLink())return v[f]=!0,t&&(t[f]=f),process.nextTick(y);if(!n){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(d.hasOwnProperty(s))return E(null,d[s],f)}i.stat(f,(function(e){if(e)return o(e);i.readlink(f,(function(e,r){n||(d[s]=r),E(e,r)}))}))}function E(r,n,i){if(r)return o(r);var s=e.resolve(p,n);t&&(t[i]=s),b(s)}function b(t){r=e.resolve(t,r.slice(u)),g()}g()},jh}function kh(){if(Ih)return Rh;Ih=1,Rh=a,a.realpath=a,a.sync=u,a.realpathSync=u,a.monkeypatch=function(){e.realpath=a,e.realpathSync=u},a.unmonkeypatch=function(){e.realpath=t,e.realpathSync=n};var e=r,t=e.realpath,n=e.realpathSync,i=process.version,o=/^v[0-5]\./.test(i),s=xh();function c(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function a(e,r,n){if(o)return t(e,r,n);"function"==typeof r&&(n=r,r=null),t(e,r,(function(t,i){c(t)?s.realpath(e,r,n):n(t,i)}))}function u(e,r){if(o)return n(e,r);try{return n(e,r)}catch(t){if(c(t))return s.realpathSync(e,r);throw t}}return Rh}var Lh=il.filter;ci({target:"Array",proto:!0,forced:!al("filter")},{filter:function(e){return Lh(this,e,arguments.length>1?arguments[1]:void 0)}});var Th,_h,Nh,Ph,Fh,Dh,Ch,Mh,Gh=Xu,$h=Oe,Bh=TypeError,Uh=Gr,Xh=function(e){if(Gh(e))return e;throw Bh($h(e)+" is not a constructor")},qh=G,Wh=ar("species"),Vh=hn,Hh=mn,zh=Op,Yh=Array,Kh=Math.max,Jh=function(e,r,t){for(var n=Hh(e),i=Vh(r,n),o=Vh(void 0===t?n:t,n),s=Yh(Kh(o-i,0)),c=0;i=0&&u>0){for(n=[],o=t.length;l>=0&&!c;)l==a?(n.push(l),a=t.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((i=n.pop())=0?a:u;n.length&&(c=[o,s])}return c}return Ph=1,Nh=e,e.range=t,Nh}();Fh=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return d(function(e){return e.split("\\\\").join(t).split("\\{").join(n).split("\\}").join(i).split("\\,").join(o).split("\\.").join(s)}(e),!0).map(a)};var t="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function a(e){return e.split(t).join("\\").split(n).join("{").split(i).join("}").split(o).join(",").split(s).join(".")}function u(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.pre,o=n.body,s=n.post,c=i.split(",");c[c.length-1]+="{"+o+"}";var a=u(s);return s.length&&(c[c.length-1]+=a.shift(),c.push.apply(c,a)),t.push.apply(t,c),t}function l(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function p(e,r){return e<=r}function h(e,r){return e>=r}function d(t,n){var o=[],s=r("{","}",t);if(!s||/\$$/.test(s.pre))return[t];var a,v=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=v||g,m=s.body.indexOf(",")>=0;if(!y&&!m)return s.post.match(/,.*\}/)?d(t=s.pre+"{"+s.body+i+s.post):[t];if(y)a=s.body.split(/\.\./);else if(1===(a=u(s.body)).length&&1===(a=d(a[0],!1).map(l)).length)return(w=s.post.length?d(s.post,!1):[""]).map((function(e){return s.pre+a[0]+e}));var E,b=s.pre,w=s.post.length?d(s.post,!1):[""];if(y){var O=c(a[0]),S=c(a[1]),R=Math.max(a[0].length,a[1].length),I=3==a.length?Math.abs(c(a[2])):1,A=p;S0){var T=new Array(L+1).join("0");k=x<0?"-"+T+k.slice(1):T+k}}E.push(k)}}else E=e(a,(function(e){return d(e,!1)}));for(var _=0;_65536)throw new TypeError("pattern is too long")};l.prototype.parse=function(e,t){p(e);var c=this.options;if("**"===e){if(!c.noglobstar)return r;e="*"}if(""===e)return"";var a,u="",l=!!c.nocase,f=!1,d=[],v=[],g=!1,y=-1,m=-1,E="."===e.charAt(0)?"":c.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function w(){if(a){switch(a){case"*":u+=o,l=!0;break;case"?":u+=i,l=!0;break;default:u+="\\"+a}b.debug("clearStateChar %j %j",a,u),a=!1}}for(var O,S=0,R=e.length;S-1;T--){var _=v[T],N=u.slice(0,_.reStart),P=u.slice(_.reStart,_.reEnd-8),F=u.slice(_.reEnd-8,_.reEnd),D=u.slice(_.reEnd);F+=D;var C=N.split("(").length-1,M=D;for(S=0;S=0&&!(i=r[o]);o--);for(o=0;o>> no match, partial?",e,p,t,h),p!==c))}if("string"==typeof l?(u=f===l,this.debug("string match",l,f,u)):(u=f.match(l),this.debug("pattern match",l,f,u)),!u)return!1}if(o===c&&s===a)return!0;if(o===c)return n;if(s===a)return o===c-1&&""===e[o];throw new Error("wtf?")},Ch}rd("split",(function(e,r,t){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var n=ud(od(this)),i=void 0===t?gd:t>>>0;if(0===i)return[];if(void 0===e)return[n];if(!id(e))return Zh(r,n,e,i);for(var o,s,c,a=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=Zh(hd,f,n))&&!((s=f.lastIndex)>l&&(bd(a,wd(n,l,o.index)),o.length>1&&o.index=i));)f.lastIndex===o.index&&f.lastIndex++;return l===n.length?!c&&Ed(f,"")||bd(a,""):bd(a,wd(n,l)),a.length>i?fd(a,0,i):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:Zh(r,this,e,t)}:r,[function(r,t){var i=od(this),o=nd(r)?void 0:ld(r,e);return o?Zh(o,r,i,t):Zh(n,ud(i),r,t)},function(e,i){var o=td(this),s=ud(e),c=t(n,o,s,i,n!==r);if(c.done)return c.value;var a=sd(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(vd?"g":"y"),f=new a(vd?"^(?:"+o.source+")":o,l),p=void 0===i?gd:i>>>0;if(0===p)return[];if(0===s.length)return null===pd(f,s)?[s]:[];for(var h=0,d=0,v=[];d0;)e[n]=e[--n];n!==o++&&(e[n]=t)}return e},Md=function(e,r,t,n){for(var i=r.length,o=t.length,s=0,c=0;s3)){if(tv)return!0;if(iv)return iv<603;var e,r,t,n,i="";for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)ov.push({k:r+n,v:t})}for(ov.sort((function(e,r){return r.v-e.v})),n=0;nJd(t)?1:-1}}(e)),t=Yd(i),n=0;nu-n+t;o--)xv(a,o-1)}else if(t>n)for(o=u-n;o>l;o--)c=o+t-1,(s=o+n-1)in a?a[c]=a[s]:xv(a,c);for(o=0;oi?(n.splice(0,i),process.nextTick((function(){t.apply(null,o)}))):delete r[e]}}))}(e))})),Pv}function Kv(){if(Cv)return Dv;Cv=1,Dv=m;var e=kh(),r=Id();r.Minimatch;var o=Ld(),s=n.EventEmitter,c=t,a=i,u=Nd(),l=function(){if(dv)return hv;dv=1,hv=p,p.GlobSync=h;var e=kh(),r=Id();r.Minimatch,Kv().Glob;var n=t,o=i,s=Nd(),c=gv(),a=c.setopts,u=c.ownProp,l=c.childrenIgnored,f=c.isIgnored;function p(e,r){if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new h(e,r).found}function h(e,r){if(!e)throw new Error("must provide pattern");if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof h))return new h(e,r);if(a(this,e,r),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&u(this.cache,r)){var n=this.cache[r];if(Array.isArray(n)&&(n="DIR"),!t||"DIR"===n)return n;if(t&&"FILE"===n)return!1}var i=this.statCache[r];if(!i){var o;try{o=this.fs.lstatSync(r)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[r]=!1,!1}if(o&&o.isSymbolicLink())try{i=this.fs.statSync(r)}catch(e){i=o}else i=o}return this.statCache[r]=i,n=!0,i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||n,(!t||"FILE"!==n)&&n},h.prototype._mark=function(e){return c.mark(this,e)},h.prototype._makeAbs=function(e){return c.makeAbs(this,e)},hv}(),f=gv(),p=f.setopts,h=f.ownProp,d=Yv(),v=f.childrenIgnored,g=f.isIgnored,y=zv();function m(e,r,t){if("function"==typeof r&&(t=r,r={}),r||(r={}),r.sync){if(t)throw new TypeError("callback provided to sync glob");return l(e,r)}return new b(e,r,t)}m.sync=l;var E=m.GlobSync=l.GlobSync;function b(e,r,t){if("function"==typeof r&&(t=r,r=null),r&&r.sync){if(t)throw new TypeError("callback provided to sync glob");return new E(e,r)}if(!(this instanceof b))return new b(e,r,t);p(this,e,r),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof t&&(t=y(t),this.on("error",t),this.on("end",(function(e){t(null,e)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return c();for(var o=!0,s=0;s1)return!0;for(var i=0;ithis.maxLength)return r();if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return r(null,i);if(n&&"FILE"===i)return r()}var o=this.statCache[t];if(void 0!==o){if(!1===o)return r(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&"FILE"===s?r():r(null,s,o)}var c=this,a=d("stat\0"+t,(function(n,i){if(i&&i.isSymbolicLink())return c.fs.stat(t,(function(n,o){n?c._stat2(e,t,null,i,r):c._stat2(e,t,n,o,r)}));c._stat2(e,t,n,i,r)}));a&&c.fs.lstat(t,a)},b.prototype._stat2=function(e,r,t,n,i){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[r]=!1,i();var o="/"===e.slice(-1);if(this.statCache[r]=n,"/"===r.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var s=!0;return n&&(s=n.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||s,o&&"FILE"===s?i():i(null,s,n)},Dv}function Jv(){if(Mv)return Ah;Mv=1;var t=e,n=r,i=Kv(),o=My(),s=Object.create(o);Ah.extend=Object.assign;var c=Boolean(process.versions.electron),a={fatal:!1,globOptions:{},maxdepth:255,noglob:!1,silent:!1,verbose:!1,execPath:null,bufLength:65536},u={reset:function(){Object.assign(this,a),c||(this.execPath=process.execPath)},resetForTesting:function(){this.reset(),this.silent=!0}};u.reset(),Ah.config=u;var l={error:null,errorCode:0,currentCmd:"shell.js"};function f(e){return"object"==typeof e&&null!==e}function p(){u.silent||console.error.apply(console,arguments)}function h(e){if("string"!=typeof e)throw new TypeError("input must be a string");return e.replace(/\\/g,"/")}function d(e,r,t){if("string"!=typeof e)throw new Error("msg must be a string");var n={continue:!1,code:1,prefix:l.currentCmd+": ",silent:!1};"number"==typeof r&&f(t)?t.code=r:f(r)?t=r:"number"==typeof r?t={code:r}:"number"!=typeof r&&(t={}),t=Object.assign({},n,t),l.errorCode||(l.errorCode=t.code);var i=h(t.prefix+e);if(l.error=l.error?l.error+"\n":"",l.error+=i,u.fatal)throw new Error(i);if(e.length>0&&!t.silent&&p(i),!t.continue)throw{msg:"earlyExit",retValue:new v("",l.error,l.errorCode)}}function v(e,r,t){var n;return e instanceof Array?((n=e).stdout=e.join("\n"),e.length>0&&(n.stdout+="\n")):(n=new String(e)).stdout=e,n.stderr=r,n.code=t,w.forEach((function(e){n[e]=s[e].bind(n)})),n}function g(e,r,t){if("string"!=typeof e&&!f(e))throw new Error("options must be strings or key-value pairs");if(!f(r))throw new Error("parseOptions() internal error: map must be an object");if(t&&!f(t))throw new Error("parseOptions() internal error: errorOptions must be object");if("--"===e)return{};var n={};if(Object.keys(r).forEach((function(e){var t=r[e];"!"!==t[0]&&(n[t]=!1)})),""===e)return n;if("string"==typeof e){if("-"!==e[0])throw new Error("Options string must start with a '-'");e.slice(1).split("").forEach((function(e){if(e in r){var i=r[e];"!"===i[0]?n[i.slice(1)]=!1:n[i]=!0}else d("option not recognized: "+e,t||{})}))}else Object.keys(e).forEach((function(i){var o=i[1];if(o in r){var s=r[o];n[s]=e[i]}else d("option not recognized: "+o,t||{})}));return n}function y(e){if(!Array.isArray(e))throw new TypeError("must be an array");var r=[];return e.forEach((function(e){if("string"!=typeof e)r.push(e);else{var t;try{t=(t=i.sync(e,u.globOptions)).length>0?t:[e]}catch(r){t=[e]}r=r.concat(t)}})),r}Ah.state=l,delete process.env.OLDPWD,Ah.isObject=f,Ah.log=p,Ah.convertErrorOutput=h,Ah.error=d,Ah.ShellString=v,Ah.parseOptions=g,Ah.expand=y;var m="function"==typeof Buffer.alloc?function(e){return Buffer.alloc(e||u.bufLength)}:function(e){return new Buffer(e||u.bufLength)};function E(e,r,n){return n=n||{},function(){var i=null;l.currentCmd=e,l.error=null,l.errorCode=0;try{var o=[].slice.call(arguments,0);if(u.verbose&&console.error.apply(console,[e].concat(o)),l.pipedValue=this&&"string"==typeof this.stdout?this.stdout:"",!1===n.unix)i=r.apply(this,o);else{f(o[0])&&"Object"===o[0].constructor.name||(0===o.length||"string"!=typeof o[0]||o[0].length<=1||"-"!==o[0][0])&&o.unshift(""),o=(o=o.reduce((function(e,r){return Array.isArray(r)?e.concat(r):(e.push(r),e)}),[])).map((function(e){return f(e)&&"String"===e.constructor.name?e.toString():e}));var s=t.homedir();o=o.map((function(e){return"string"==typeof e&&"~/"===e.slice(0,2)||"~"===e?e.replace(/^~/,s):e})),u.noglob||!0!==n.allowGlobbing||(o=o.slice(0,n.globStart).concat(y(o.slice(n.globStart))));try{f(n.cmdOptions)&&(o[0]=g(o[0],n.cmdOptions)),i=r.apply(this,o)}catch(e){if("earlyExit"!==e.msg)throw e;i=e.retValue}}}catch(e){if(!l.error)throw e.name="ShellJSInternalError",e;if(u.fatal)throw e}return n.wrapOutput&&("string"==typeof i||Array.isArray(i))&&(i=new v(i,l.error,l.errorCode)),l.currentCmd="shell.js",i}}Ah.buffer=m,Ah.unlinkSync=function(e){try{n.unlinkSync(e)}catch(r){if("EPERM"!==r.code)throw r;n.chmodSync(e,"0666"),n.unlinkSync(e)}},Ah.statFollowLinks=function(){return n.statSync.apply(n,arguments)},Ah.statNoFollowLinks=function(){return n.lstatSync.apply(n,arguments)},Ah.randomFileName=function(){return"shelljs_"+function e(r){if(1===r)return parseInt(16*Math.random(),10).toString(16);for(var t="",n=0;n0&&"-"===e.charAt(0)?[].unshift.call(arguments,""):n.error("You must specify a file.")),e=n.parseOptions(e,{R:"recursive",c:"changes",v:"verbose"}),t=[].slice.call(arguments,2),e.recursive?(c=[],t.forEach((function e(r){var t=n.statNoFollowLinks(r);t.isSymbolicLink()||(c.push(r),t.isDirectory()&&i.readdirSync(r).forEach((function(t){e(r+"/"+t)})))}))):c=t,c.forEach((function(t){if(t=o.resolve(t),i.existsSync(t)||n.error("File not found: "+t),!e.recursive||!n.statNoFollowLinks(t).isSymbolicLink()){var c=n.statFollowLinks(t),a=c.isDirectory(),u=c.mode,l=u&s.TYPE_MASK,f=u;isNaN(parseInt(r,8))?r.split(",").forEach((function(r){var o=/([ugoa]*)([=\+-])([rwxXst]*)/i.exec(r);if(o){var c=o[1],p=o[2],h=o[3],d=-1!==c.indexOf("u")||"a"===c||""===c,v=-1!==c.indexOf("g")||"a"===c||""===c,g=-1!==c.indexOf("o")||"a"===c||""===c,y=-1!==h.indexOf("r"),m=-1!==h.indexOf("w"),E=-1!==h.indexOf("x"),b=-1!==h.indexOf("X"),w=-1!==h.indexOf("t"),O=-1!==h.indexOf("s");b&&a&&(E=!0);var S=0;switch(d&&(S|=(y?s.OWNER_READ:0)+(m?s.OWNER_WRITE:0)+(E?s.OWNER_EXEC:0)+(O?s.SETUID:0)),v&&(S|=(y?s.GROUP_READ:0)+(m?s.GROUP_WRITE:0)+(E?s.GROUP_EXEC:0)+(O?s.SETGID:0)),g&&(S|=(y?s.OTHER_READ:0)+(m?s.OTHER_WRITE:0)+(E?s.OTHER_EXEC:0)),w&&(S|=s.STICKY),p){case"+":f|=S;break;case"-":f&=~S;break;case"=":f=l+S,n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u);break;default:n.error("Could not recognize operator: `"+p+"`")}e.verbose&&console.log(t+" -> "+f.toString(8)),u!==f&&(!e.verbose&&e.changes&&console.log(t+" -> "+f.toString(8)),i.chmodSync(t,f),u=f)}else n.error("Invalid symbolic mode change: "+r)})):(f=l+parseInt(r,8),n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u),i.chmodSync(t,f))}})),""}return n.register("chmod",c,{}),Xv=c}function rg(){if(Vv)return Wv;Vv=1;var e=r,n=t,i=Jv();function o(r,t,n){e.existsSync(r)||i.error("copyFileSync: no such file or directory: "+r);var o="win32"===process.platform;try{if(n.update&&i.statFollowLinks(r).mtime=i.config.maxdepth)){n++;var u="win32"===process.platform;try{e.mkdirSync(t)}catch(e){if("EEXIST"!==e.code)throw e}for(var l=e.readdirSync(r),f=0;f and/or "):(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]);var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force?new i.ShellString("","",0):(t.forEach((function(a,l){if(!e.existsSync(a))return""===a&&(a="''"),void i.error("no such file or directory: "+a,{continue:!0});var f=i.statFollowLinks(a);if(!r.noFollowsymlink&&f.isDirectory())if(r.recursive){var p=u&&u.isDirectory()?n.join(c,n.basename(a)):c;try{i.statFollowLinks(n.dirname(c)),s(a,p,0,{no_force:r.no_force,followsymlink:r.followsymlink})}catch(e){i.error("cannot create directory '"+c+"': No such file or directory")}}else i.error("omitting directory '"+a+"'",{continue:!0});else{var h=c;u&&u.isDirectory()&&(h=n.normalize(c+"/"+n.basename(a)));var d=e.existsSync(h);if(d&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,l))return void(r.no_force||i.error("will not overwrite just-created '"+h+"' with '"+a+"'",{continue:!0}));if(d&&r.no_force)return;if(""===n.relative(a,h))return void i.error("'"+h+"' and '"+a+"' are the same file",{continue:!0});o(a,h,r)}})),new i.ShellString("",i.state.error,i.state.errorCode))}return i.register("cp",a,{cmdOptions:{f:"!no_force",n:"no_force",u:"update",R:"recursive",r:"recursive",L:"followsymlink",P:"noFollowsymlink"},wrapOutput:!1}),Wv=a}var tg,ng,ig,og,sg,cg={};function ag(){if(tg)return cg;tg=1;var e=Jv(),r=Zv(),n=t;e.register("dirs",l,{wrapOutput:!1}),e.register("pushd",a,{wrapOutput:!1}),e.register("popd",u,{wrapOutput:!1});var i=[];function o(e){return/^[\-+]\d+$/.test(e)}function s(r){if(o(r)){if(Math.abs(r)1))return e.error("no other directory");u=u.splice(1,1).concat(u)}return t["no-cd"]?u=u.slice(1):(a=n.resolve(u.shift()),r("",a)),i=u,l(t.quiet?"-q":"")}function u(t,c){if(o(t)&&(c=t,t=""),t=e.parseOptions(t,{n:"no-cd",q:"quiet"}),!i.length)return e.error("directory stack empty");if(c=s(c||"+0"),t["no-cd"]||c>0||i.length+c===0)c=c>0?c-1:c,i.splice(c,1);else{var a=n.resolve(i.shift());r("",a)}return l(t.quiet?"-q":"")}function l(r,t){if(o(r)&&(t=r,r=""),(r=e.parseOptions(r,{c:"clear",q:"quiet"})).clear)return i=[];var n=c();return t?((t=s(t))<0&&(t=n.length+t),r.quiet||e.log(n[t]),n[t]):(r.quiet||e.log(n.join(" ")),n)}return cg.pushd=a,cg.popd=u,cg.dirs=l,cg}function ug(){if(ig)return ng;ig=1;var e=o.format,r=Jv();function t(t){var n=[].slice.call(arguments,t?0:1),i={};try{i=r.parseOptions(n[0],{e:"escapes",n:"no_newline"},{silent:!0}),n[0]&&n.shift()}catch(e){r.state.error=null}var o=e.apply(null,n);return i.no_newline||(o+="\n"),process.stdout.write(o),o}return r.register("echo",t,{allowGlobbing:!1}),ng=t}function lg(){if(sg)return og;sg=1;var e=Jv();return og=function(){return e.state.error}}var fg,pg={exports:{}};function hg(){return fg||(fg=1,function(e){if(require.main!==e)throw new Error("This file should not be required");var t=s,n=r,i=process.argv[2],o=n.readFileSync(i,"utf8"),c=JSON.parse(o),a=c.command,u=c.execOptions,l=c.pipe,f=c.stdoutFile,p=c.stderrFile,h=t.exec(a,u,(function(e){e?void 0===e.code?process.exitCode=1:process.exitCode=e.code:process.exitCode=0})),d=n.createWriteStream(f),v=n.createWriteStream(p);h.stdout.pipe(d),h.stderr.pipe(v),h.stdout.pipe(process.stdout),h.stderr.pipe(process.stderr),l&&h.stdin.end(l)}(pg)),pg.exports}pg.exports;var dg,vg,gg,yg,mg,Eg,bg,wg,Og,Sg,Rg,Ig,Ag,jg,xg,kg,Lg,Tg,_g,Ng,Pg,Fg={};function Dg(){if(dg)return Fg;dg=1;var t,n=Jv(),i=e,o=r;function s(e){if(!e||!o.existsSync(e))return!1;if(!n.statFollowLinks(e).isDirectory())return!1;var r=e+"/"+n.randomFileName();try{return o.writeFileSync(r," "),n.unlinkSync(r),e}catch(e){return!1}}function c(){return t||(t=s(i.tmpdir())||s(process.env.TMPDIR)||s(process.env.TEMP)||s(process.env.TMP)||s(process.env.Wimp$ScrapDir)||s("C:\\TEMP")||s("C:\\TMP")||s("\\TEMP")||s("\\TMP")||s("/tmp")||s("/var/tmp")||s("/usr/tmp")||s("."))}return n.register("tempdir",c,{allowGlobbing:!1,wrapOutput:!1}),Fg.tempDir=c,Fg.isCached=function(){return t},Fg.clearCache=function(){t=void 0},Fg}function Cg(){if(gg)return vg;gg=1;var e=t;function r(){return e.resolve(process.cwd())}return Jv().register("pwd",r,{allowGlobbing:!1}),vg=r}function Mg(){if(mg)return yg;mg=1;var e=Jv(),n=Dg().tempDir,i=Cg(),o=t,c=r,a=s,u=20971520,l=1;function f(r,t,s){t=t||{},r||e.error("must specify command");var f=e.readFromPipe();return"function"==typeof t&&(s=t,t={async:!0}),"object"==typeof t&&"function"==typeof s&&(t.async=!0),(t=e.extend({silent:e.config.silent,async:!1},t)).async?function(r,t,n,o){t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t);var s=a.exec(r,t,(function(e,r,t){o&&(e?void 0===e.code?o(1,r,t):o(e.code,r,t):o(0,r,t))}));return n&&s.stdin.end(n),t.silent||(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),s}(r,t,f,s):function(r,t,s){e.config.execPath||e.error("Unable to find a path to the node binary. Please manually set config.execPath");var f=n(),p=o.resolve(f+"/"+e.randomFileName()),h=o.resolve(f+"/"+e.randomFileName()),d=o.resolve(f+"/"+e.randomFileName());t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t),c.existsSync(p)&&e.unlinkSync(p),c.existsSync(h)&&e.unlinkSync(h),c.existsSync(d)&&e.unlinkSync(d),t.cwd=o.resolve(t.cwd);var v={command:r,execOptions:t,pipe:s,stdoutFile:d,stderrFile:h};function g(e,r){c.writeFileSync(e,r,{encoding:"utf8",mode:parseInt("600",8)})}g(d,""),g(h,""),g(p,JSON.stringify(v));var y=[o.join(__dirname,"exec-child.js"),p];t.silent?t.stdio="ignore":t.stdio=[0,1,2];var m=0;try{delete t.shell,a.execFileSync(e.config.execPath,y,t)}catch(e){m=e.status||l}var E="",b="";"buffer"===t.encoding?(E=c.readFileSync(d),b=c.readFileSync(h)):(E=c.readFileSync(d,t.encoding),b=c.readFileSync(h,t.encoding));try{e.unlinkSync(p)}catch(e){}try{e.unlinkSync(h)}catch(e){}try{e.unlinkSync(d)}catch(e){}return 0!==m&&e.error(b,m,{continue:!0,silent:!0}),e.ShellString(E,b,m)}(r,t,f)}return e.register("exec",f,{unix:!1,canReceivePipe:!0,wrapOutput:!1}),yg=f}function Gg(){if(bg)return Eg;bg=1;var e=t,n=r,i=Jv(),o=Kv(),s=e.sep+"**";function c(r,t){r.all_deprecated&&(i.log("ls: Option -a is deprecated. Use -A instead"),r.all=!0),t=t?[].slice.call(arguments,1):["."];var c=[];function a(e,t,n){var o,s;"win32"===process.platform&&(t=t.replace(/\\/g,"/")),r.long?(n=n||(r.link?i.statFollowLinks(e):i.statNoFollowLinks(e)),c.push((o=t,(s=n).name=o,s.toString=function(){return[this.mode,this.nlink,this.uid,this.gid,this.size,this.mtime,this.name].join(" ")},s))):c.push(t)}return t.forEach((function(t){var c;try{if((c=r.link?i.statFollowLinks(t):i.statNoFollowLinks(t)).isSymbolicLink())try{var u=i.statFollowLinks(t);u.isDirectory()&&(c=u)}catch(e){}}catch(e){return void i.error("no such file or directory: "+t,2,{continue:!0})}c.isDirectory()&&!r.directory?r.recursive?o.sync(t+s,{dot:r.all,follow:r.link}).forEach((function(r){e.relative(t,r)&&a(r,e.relative(t,r))})):r.all?n.readdirSync(t).forEach((function(r){a(e.join(t,r),r)})):n.readdirSync(t).forEach((function(r){"."!==r[0]&&a(e.join(t,r),r)})):a(t,t,c)})),c}return i.register("ls",c,{cmdOptions:{R:"recursive",A:"all",L:"link",a:"all_deprecated",d:"directory",l:"long"}}),Eg=c}function $g(){if(Og)return wg;Og=1;var e=t,r=Jv(),n=Gg();function i(t,i){i?"string"==typeof i&&(i=[].slice.call(arguments,1)):r.error("no path specified");var o=[];function s(e){"win32"===process.platform&&(e=e.replace(/\\/g,"/")),o.push(e)}return i.forEach((function(t){var i;try{i=r.statFollowLinks(t)}catch(e){r.error("no such file or directory: "+t)}s(t),i.isDirectory()&&n({recursive:!0,all:!0},t).forEach((function(r){s(e.join(t,r))}))})),o}return r.register("find",i,{}),wg=i}function Bg(){if(Rg)return Sg;Rg=1;var e=Jv(),t=r;function n(r,n,i){var o=e.readFromPipe();i||o||e.error("no paths given",2),i=[].slice.call(arguments,2),o&&i.unshift("-");var s=[];return r.ignoreCase&&(n=new RegExp(n,"i")),i.forEach((function(i){if(t.existsSync(i)||"-"===i){var c="-"===i?o:t.readFileSync(i,"utf8");if(r.nameOnly)c.match(n)&&s.push(i);else c.split("\n").forEach((function(e){var t=e.match(n);(r.inverse&&!t||!r.inverse&&t)&&s.push(e)}))}else e.error("no such file or directory: "+i,2,{continue:!0})})),s.join("\n")+"\n"}return e.register("grep",n,{globStart:2,canReceivePipe:!0,cmdOptions:{v:"inverse",l:"nameOnly",i:"ignoreCase"}}),Sg=n}function Ug(){if(Ag)return Ig;Ag=1;var e=Jv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s;s="-"===n?o:r.numLines<0?t.readFileSync(n,"utf8"):function(r,n){for(var i=e.buffer(),o=i.length,s=o,c=0,a=t.openSync(r,"r"),u=0,l="";s===o&&u and/or "),t=String(t);var s=n.normalize(t).replace(RegExp(n.sep+"$"),""),c=n.resolve(t)===s;if(o=n.resolve(process.cwd(),String(o)),e.existsSync(o)&&(r.force||i.error("Destination file exists",{continue:!0}),e.unlinkSync(o)),r.symlink){var a="win32"===process.platform,u=a?"file":null,l=c?s:n.resolve(process.cwd(),n.dirname(o),t);e.existsSync(l)?a&&i.statFollowLinks(l).isDirectory()&&(u="junction"):i.error("Source file does not exist",{continue:!0});try{e.symlinkSync("junction"===u?l:t,o,u)}catch(e){i.error(e.message)}}else{e.existsSync(t)||i.error("Source file does not exist",{continue:!0});try{e.linkSync(t,o)}catch(e){i.error(e.message)}}return""}return i.register("ln",o,{cmdOptions:{s:"symlink",f:"force"}}),jg=o}function qg(){if(Lg)return kg;Lg=1;var e=Jv(),n=r,i=t;function o(r){var t=i.dirname(r);t===r&&e.error("dirname() failed: ["+r+"]"),n.existsSync(t)||o(t),n.mkdirSync(r,parseInt("0777",8))}function s(r,t){return t||e.error("no paths given"),"string"==typeof t&&(t=[].slice.call(arguments,1)),t.forEach((function(t){try{var s=e.statNoFollowLinks(t);return void(r.fullpath?s.isFile()&&e.error("cannot create directory "+t+": File exists",{continue:!0}):e.error("path already exists: "+t,{continue:!0}))}catch(e){}var c=i.dirname(t);if(n.existsSync(c)||r.fullpath)try{r.fullpath?o(i.resolve(t)):n.mkdirSync(t,parseInt("0777",8))}catch(r){var a;if("EACCES"===r.code)a="Permission denied";else{if("ENOTDIR"!==r.code&&"ENOENT"!==r.code)throw r;a="Not a directory"}e.error("cannot create directory "+t+": "+a,{continue:!0})}else e.error("no such file or directory: "+c,{continue:!0})})),""}return e.register("mkdir",s,{cmdOptions:{p:"fullpath"}}),kg=s}function Wg(){if(_g)return Tg;_g=1;var e=Jv(),t=r;function n(r,o,s){var c;c=t.readdirSync(r);for(var a=0;a1e3)throw e}}catch(t){e.error("could not remove directory (code "+t.code+"): "+r,{continue:!0})}return l}}function i(e){var r=!0;try{var n=t.openSync(e,"a");t.closeSync(n)}catch(e){r=!1}return r}function o(r,t){return t||e.error("no paths given"),(t=[].slice.call(arguments,1)).forEach((function(t){var o;try{var s="/"===t[t.length-1]?t.slice(0,-1):t;o=e.statNoFollowLinks(s)}catch(n){return void(r.force||e.error("no such file or directory: "+t,{continue:!0}))}o.isFile()?function(r,t){t.force||i(r)?e.unlinkSync(r):e.error("permission denied: "+r,{continue:!0})}(t,r):o.isDirectory()?function(r,t){t.recursive?n(r,t.force):e.error("path is a directory",{continue:!0})}(t,r):o.isSymbolicLink()?function(r,t){var i;try{i=e.statFollowLinks(r)}catch(t){return void e.unlinkSync(r)}i.isFile()?e.unlinkSync(r):i.isDirectory()&&("/"===r[r.length-1]?t.recursive?n(r,t.force,!0):e.error("path is a directory",{continue:!0}):e.unlinkSync(r))}(t,r):o.isFIFO()&&function(r){e.unlinkSync(r)}(t)})),""}return e.register("rm",o,{cmdOptions:{f:"force",r:"recursive",R:"recursive"}}),Tg=o}function Vg(){if(Pg)return Ng;Pg=1;var e=r,n=t,i=Jv(),o=rg(),s=Wg();function c(r,t,c){arguments.length<3?i.error("missing and/or "):arguments.length>3?(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]):"string"==typeof t?t=[t]:i.error("invalid arguments");var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force&&i.error("dest file already exists: "+c),t.forEach((function(a,u){if(e.existsSync(a)){var l=c;if(e.existsSync(c)&&i.statFollowLinks(c).isDirectory()&&(l=n.normalize(c+"/"+n.basename(a))),e.existsSync(l)&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,u))r.no_force||i.error("will not overwrite just-created '"+l+"' with '"+a+"'",{continue:!0});else if(e.existsSync(l)&&r.no_force)i.error("dest file already exists: "+l,{continue:!0});else if(n.resolve(a)!==n.dirname(n.resolve(l)))try{e.renameSync(a,l)}catch(e){"EXDEV"===e.code&&(o("-r",a,l),s("-rf",a))}else i.error("cannot move to self: "+a,{continue:!0})}else i.error("no such file or directory: "+a,{continue:!0})})),""}return i.register("mv",c,{cmdOptions:{f:"!no_force",n:"no_force"}}),Ng=c}var Hg,zg={};function Yg(){return Hg||(Hg=1),zg}var Kg,Jg,Qg,Zg,ey,ry={};function ty(){return Kg||(Kg=1),ry}function ny(){if(Qg)return Jg;Qg=1;var e=Jv(),t=r;function n(r,n,i,o){var s=e.readFromPipe();"string"!=typeof i&&"function"!=typeof i&&("number"==typeof i?i=i.toString():e.error("invalid replacement string")),"string"==typeof n&&(n=RegExp(n)),o||s||e.error("no files given"),o=[].slice.call(arguments,3),s&&o.unshift("-");var c=[];return o.forEach((function(o){if(t.existsSync(o)||"-"===o){var a=("-"===o?s:t.readFileSync(o,"utf8")).split("\n").map((function(e){return e.replace(n,i)})).join("\n");c.push(a),r.inplace&&t.writeFileSync(o,a,"utf8")}else e.error("no such file or directory: "+o,2,{continue:!0})})),c.join("\n")}return e.register("sed",n,{globStart:3,canReceivePipe:!0,cmdOptions:{i:"inplace"}}),Jg=n}function iy(){if(ey)return Zg;ey=1;var e=Jv();function r(r){if(!r){var t=[].slice.call(arguments,0);t.length<2&&e.error("must provide an argument"),r=t[1]}var n="+"===r[0];n&&(r="-"+r.slice(1)),r=e.parseOptions(r,{e:"fatal",v:"verbose",f:"noglob"}),n&&Object.keys(r).forEach((function(e){r[e]=!r[e]})),Object.keys(r).forEach((function(t){n!==r[t]&&(e.config[t]=r[t])}))}return e.register("set",r,{allowGlobbing:!1,wrapOutput:!1}),Zg=r}var oy=Df.end,sy=$f("trimEnd")?function(){return oy(this)}:"".trimEnd;ci({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==sy},{trimRight:sy});var cy,ay,uy,ly,fy,py,hy,dy,vy,gy,yy,my,Ey,by,wy,Oy,Sy;function Ry(){if(ay)return cy;ay=1;var e=Jv(),t=r;function n(e){var r=e.match(/^\s*(\d*)\s*(.*)$/);return{num:Number(r[1]),value:r[2]}}function i(e,r){var t=e.toLowerCase(),n=r.toLowerCase();return t===n?-1*e.localeCompare(r):t.localeCompare(n)}function o(e,r){var t=n(e),o=n(r);return t.hasOwnProperty("num")&&o.hasOwnProperty("num")&&t.num!==o.num?t.num-o.num:i(t.value,o.value)}function s(r,n){var s=e.readFromPipe();n||s||e.error("no files given"),n=[].slice.call(arguments,1),s&&n.unshift("-");var c=n.reduce((function(r,n){if("-"!==n){if(!t.existsSync(n))return e.error("no such file or directory: "+n,{continue:!0}),r;if(e.statFollowLinks(n).isDirectory())return e.error("read failed: "+n+": Is a directory",{continue:!0}),r}var i="-"===n?s:t.readFileSync(n,"utf8");return r.concat(i.trimRight().split("\n"))}),[]).sort(r.numerical?o:i);return r.reverse&&(c=c.reverse()),c.join("\n")+"\n"}return e.register("sort",s,{canReceivePipe:!0,cmdOptions:{r:"reverse",n:"numerical"}}),cy=s}function Iy(){if(ly)return uy;ly=1;var e=Jv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),r.numLines=-1*Math.abs(r.numLines),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s=("-"===n?o:t.readFileSync(n,"utf8")).split("\n");""===s[s.length-1]?(s.pop(),c=!0):c=!1,i=i.concat(s.slice(r.numLines))})),c&&i.push(""),i.join("\n")}return e.register("tail",n,{canReceivePipe:!0,cmdOptions:{n:"numLines"}}),uy=n}function Ay(){if(py)return fy;py=1;var e=Jv(),t=r;function n(r,n){n||e.error("no path given");var i=!1;if(Object.keys(r).forEach((function(e){!0===r[e]&&(i=!0)})),i||e.error("could not interpret expression"),r.link)try{return e.statNoFollowLinks(n).isSymbolicLink()}catch(e){return!1}if(!t.existsSync(n))return!1;if(r.exists)return!0;var o=e.statFollowLinks(n);return r.block?o.isBlockDevice():r.character?o.isCharacterDevice():r.directory?o.isDirectory():r.file?o.isFile():r.pipe?o.isFIFO():!!r.socket&&o.isSocket()}return e.register("test",n,{cmdOptions:{b:"block",c:"character",d:"directory",e:"exists",f:"file",L:"link",p:"pipe",S:"socket"},wrapOutput:!1,allowGlobbing:!1}),fy=n}function jy(){if(dy)return hy;dy=1;var e=Jv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.writeFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not write to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("to",o,{pipeOnly:!0,wrapOutput:!1}),hy=o}function xy(){if(gy)return vy;gy=1;var e=Jv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.appendFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not append to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("toEnd",o,{pipeOnly:!0,wrapOutput:!1}),vy=o}function ky(){if(my)return yy;my=1;var e=Jv(),t=r;function n(r,n){return n?"string"==typeof n?n=[].slice.call(arguments,1):e.error("file arg should be a string file path or an Array of string file paths"):e.error("no files given"),n.forEach((function(n){!function(r,n){var o=i(n);if(o&&o.isDirectory())return;if(!o&&r.no_create)return;t.closeSync(t.openSync(n,"a"));var s=new Date,c=r.date||s,a=r.date||s;if(r.reference){var u=i(r.reference);u||e.error("failed to get attributess of "+r.reference),c=u.mtime,a=u.atime}else r.date&&(c=r.date,a=r.date);r.atime_only&&r.mtime_only||(r.atime_only?c=o.mtime:r.mtime_only&&(a=o.atime));t.utimesSync(n,a,c)}(r,n)})),""}function i(r){try{return e.statFollowLinks(r)}catch(e){return null}}return e.register("touch",n,{cmdOptions:{a:"atime_only",c:"no_create",d:"date",m:"mtime_only",r:"reference"}}),yy=n}function Ly(){if(by)return Ey;by=1;var e=Jv(),t=r;function n(r,n,i){var o=e.readFromPipe();o||(n||e.error("no input given"),t.existsSync(n)?e.statFollowLinks(n).isDirectory()&&e.error("error reading '"+n+"'"):e.error(n+": No such file or directory")),i&&t.existsSync(i)&&e.statFollowLinks(i).isDirectory()&&e.error(i+": Is a directory");var s=(n?t.readFileSync(n,"utf8"):o).trimRight().split("\n"),c=s.reduceRight((function(e,t){return 0===e.length?[{count:1,ln:t}]:0===(n=e[0].ln,i=t,r.ignoreCase?n.toLocaleLowerCase().localeCompare(i.toLocaleLowerCase()):n.localeCompare(i))?[{count:e[0].count+1,ln:t}].concat(e.slice(1)):[{count:1,ln:t}].concat(e);var n,i}),[]).filter((function(e){return!r.duplicates||e.count>1})).map((function(e){return(r.count?(t=7,n=e.count,(i=""+n).length0)||r.all);p++){var h=i.resolve(s[p],t);n&&(h=h.toUpperCase());var d=h.match(/\.[^<>:"/\|?*.]+$/);if(d&&f.indexOf(d[0])>=0){if(u(h)){l.push(h);break}}else for(var v=0;v0?r.all?l:l[0]:r.all?[]:null}return wy=l}function _y(){return Sy||(Sy={"/node_modules/shelljs/src/cat.js":Qv,"/node_modules/shelljs/src/cd.js":Zv,"/node_modules/shelljs/src/chmod.js":eg,"/node_modules/shelljs/src/common.js":Jv,"/node_modules/shelljs/src/cp.js":rg,"/node_modules/shelljs/src/dirs.js":ag,"/node_modules/shelljs/src/echo.js":ug,"/node_modules/shelljs/src/error.js":lg,"/node_modules/shelljs/src/exec-child.js":hg,"/node_modules/shelljs/src/exec.js":Mg,"/node_modules/shelljs/src/find.js":$g,"/node_modules/shelljs/src/grep.js":Bg,"/node_modules/shelljs/src/head.js":Ug,"/node_modules/shelljs/src/ln.js":Xg,"/node_modules/shelljs/src/ls.js":Gg,"/node_modules/shelljs/src/mkdir.js":qg,"/node_modules/shelljs/src/mv.js":Vg,"/node_modules/shelljs/src/popd.js":Yg,"/node_modules/shelljs/src/pushd.js":ty,"/node_modules/shelljs/src/pwd.js":Cg,"/node_modules/shelljs/src/rm.js":Wg,"/node_modules/shelljs/src/sed.js":ny,"/node_modules/shelljs/src/set.js":iy,"/node_modules/shelljs/src/sort.js":Ry,"/node_modules/shelljs/src/tail.js":Iy,"/node_modules/shelljs/src/tempdir.js":Dg,"/node_modules/shelljs/src/test.js":Ay,"/node_modules/shelljs/src/to.js":jy,"/node_modules/shelljs/src/toEnd.js":xy,"/node_modules/shelljs/src/touch.js":ky,"/node_modules/shelljs/src/uniq.js":Ly,"/node_modules/shelljs/src/which.js":Ty})}function Ny(e,r){var t,n=function(e){var r=e[0];if("/"===r||"\\"===r)return!1;var t=e[1],n=e[2];return!(!("."!==r||t&&"/"!==t&&"\\"!==t)||!("."!==r||"."!==t||n&&"/"!==n&&"\\"!==n))&&(":"!==t||"/"!==n&&"\\"!==n)}(e);"/"===(e=Py(e))[0]&&(r="");for(var i=_y(),o=["",".js",".json"];!(t=Py(n?r+"/node_modules/"+e:r+"/"+e)).endsWith("/..");){for(var s=0;s0&&".."!==r[n-1]&&"."!==r[n-1]&&(r.splice(--n,2),n--);return e=r.join("/"),t&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}ci({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==sy},{trimEnd:sy});var Fy,Dy={},Cy=["cat","cd","chmod","cp","dirs","echo","exec","find","grep","head","ln","ls","mkdir","mv","pwd","rm","sed","set","sort","tail","tempdir","test","to","toEnd","touch","uniq","which"];function My(){if(Fy)return Dy;Fy=1;var e=Jv();return Cy.forEach((function(e){!function(e){function r(r){var t=Ny(r,e);if(null!==t)return _y()[t]();throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return r.resolve=function(r){var t=Ny(r,e);return null!==t?t:require.resolve(r)},r}("/node_modules/shelljs")("./src/"+e)})),Dy.exit=process.exit,Dy.error=lg(),Dy.ShellString=e.ShellString,Dy.env=process.env,Dy.config=e.config,Dy}a(Cy);var Gy=My(),$y=Jv();Object.keys(Gy).forEach((function(e){c[e]=Gy[e]}));var By=jy();String.prototype.to=$y.wrap("to",By);var Uy=xy();String.prototype.toEnd=$y.wrap("toEnd",Uy),c.config.fatal=!0,c.target={};var Xy,qy=process.argv.slice(2),Wy=qy.indexOf("--");Wy>-1&&(Xy=qy.slice(Wy+1,qy.length),qy=qy.slice(0,Wy)),setTimeout((function(){var e;if(1!==qy.length||"--help"!==qy[0]){for(e in c.target)!function(e,r){c.target[e]=function(){return r.done||(r.done=!0,r.result=r.apply(r,arguments)),r.result}}(e,c.target[e]);qy.length>0?qy.forEach((function(e){e in c.target?c.target[e](Xy):console.log("no such target: "+e)})):"all"in c.target&&c.target.all(Xy)}else for(e in console.log("Available targets:"),c.target)console.log(" "+e)}),0);var Vy={exports:{}};!function(e,r){var t;r=Vy.exports=y,t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var n=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,o=n-6,s=r.re=[],c=r.safeRe=[],a=r.src=[],u=r.tokens={},l=0;function f(e){u[e]=l++}var p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",n],[p,o]];function d(e){for(var r=0;r)?=?)",f("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",f("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",f("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),s[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),c[u.COERCERTL]=new RegExp(d(a[u.COERCE]),"g"),f("LONETILDE"),a[u.LONETILDE]="(?:~>?)",f("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",s[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g"),c[u.TILDETRIM]=new RegExp(d(a[u.TILDETRIM]),"g");f("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",f("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",f("LONECARET"),a[u.LONECARET]="(?:\\^)",f("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",s[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g"),c[u.CARETTRIM]=new RegExp(d(a[u.CARETTRIM]),"g");f("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",f("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",s[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g"),c[u.COMPARATORTRIM]=new RegExp(d(a[u.COMPARATORTRIM]),"g");f("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var v=0;vn)return null;if(!(r.loose?c[u.LOOSE]:c[u.FULL]).test(e))return null;try{return new y(e,r)}catch(e){return null}}function y(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof y){if(e.loose===r.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof y))return new y(e,r);t("SemVer",e,r),this.options=r,this.loose=!!r.loose;var o=e.trim().match(r.loose?c[u.LOOSE]:c[u.FULL]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,r,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new y(e,t).inc(r,n).version}catch(e){return null}},r.diff=function(e,r){if(S(e,r))return null;var t=g(e),n=g(r),i="";if(t.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var s in t)if(("major"===s||"minor"===s||"patch"===s)&&t[s]!==n[s])return i+s;return o},r.compareIdentifiers=E;var m=/^[0-9]+$/;function E(e,r){var t=m.test(e),n=m.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e0}function O(e,r,t){return b(e,r,t)<0}function S(e,r,t){return 0===b(e,r,t)}function R(e,r,t){return 0!==b(e,r,t)}function I(e,r,t){return b(e,r,t)>=0}function A(e,r,t){return b(e,r,t)<=0}function j(e,r,t,n){switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return S(e,t,n);case"!=":return R(e,t,n);case">":return w(e,t,n);case">=":return I(e,t,n);case"<":return O(e,t,n);case"<=":return A(e,t,n);default:throw new TypeError("Invalid operator: "+r)}}function x(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof x){if(e.loose===!!r.loose)return e;e=e.value}if(!(this instanceof x))return new x(e,r);e=e.trim().split(/\s+/).join(" "),t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}r.rcompareIdentifiers=function(e,r){return E(r,e)},r.major=function(e,r){return new y(e,r).major},r.minor=function(e,r){return new y(e,r).minor},r.patch=function(e,r){return new y(e,r).patch},r.compare=b,r.compareLoose=function(e,r){return b(e,r,!0)},r.compareBuild=function(e,r,t){var n=new y(e,t),i=new y(r,t);return n.compare(i)||n.compareBuild(i)},r.rcompare=function(e,r,t){return b(r,e,t)},r.sort=function(e,t){return e.sort((function(e,n){return r.compareBuild(e,n,t)}))},r.rsort=function(e,t){return e.sort((function(e,n){return r.compareBuild(n,e,t)}))},r.gt=w,r.lt=O,r.eq=S,r.neq=R,r.gte=I,r.lte=A,r.cmp=j,r.Comparator=x;var k={};function L(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof L)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new L(e.raw,r);if(e instanceof x)return new L(e.value,r);if(!(this instanceof L))return new L(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function T(e,r){for(var t=!0,n=e.slice(),i=n.pop();t&&n.length;)t=n.every((function(e){return i.intersects(e,r)})),i=n.pop();return t}function _(e){return!e||"x"===e.toLowerCase()||"*"===e}function N(e,r,t,n,i,o,s,c,a,u,l,f,p){return((r=_(t)?"":_(n)?">="+t+".0.0":_(i)?">="+t+"."+n+".0":">="+r)+" "+(c=_(a)?"":_(u)?"<"+(+a+1)+".0.0":_(l)?"<"+a+"."+(+u+1)+".0":f?"<="+a+"."+u+"."+l+"-"+f:"<="+c)).trim()}function P(e,r,n){for(var i=0;i0){var o=e[i].semver;if(o.major===r.major&&o.minor===r.minor&&o.patch===r.patch)return!0}return!1}return!0}function F(e,r,t){try{r=new L(r,t)}catch(e){return!1}return r.test(e)}function D(e,r,t,n){var i,o,s,c,a;switch(e=new y(e,n),r=new L(r,n),t){case">":i=w,o=A,s=O,c=">",a=">=";break;case"<":i=O,o=I,s=w,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F(e,r,n))return!1;for(var u=0;u=0.0.0")),f=f||e,p=p||e,i(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===c||f.operator===a)return!1;if((!p.operator||p.operator===c)&&o(e,p.semver))return!1;if(p.operator===a&&s(e,p.semver))return!1}return!0}x.prototype.parse=function(e){var r=this.options.loose?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new y(t[2],this.options.loose):this.semver=k},x.prototype.toString=function(){return this.value},x.prototype.test=function(e){if(t("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}return j(e,this.operator,this.semver,this.options)},x.prototype.intersects=function(e,r){if(!(e instanceof x))throw new TypeError("a Comparator is required");var t;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||(t=new L(e.value,r),F(this.value,t,r));if(""===e.operator)return""===e.value||(t=new L(this.value,r),F(e.semver,t,r));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),c=j(this.semver,"<",e.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=j(this.semver,">",e.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||o&&s||c||a},r.Range=L,L.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},L.prototype.toString=function(){return this.range},L.prototype.parseRange=function(e){var r=this.options.loose,n=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(n,N),t("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],"$1$2$3"),t("comparator trim",e,c[u.COMPARATORTRIM]),e=(e=(e=e.replace(c[u.TILDETRIM],"$1~")).replace(c[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=r?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],o=e.split(" ").map((function(e){return function(e,r){return t("comp",e,r),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){t("caret",e,r);var n=r.loose?c[u.CARETLOOSE]:c[u.CARET];return e.replace(n,(function(r,n,i,o,s){var c;return t("caret",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":s?(t("replaceCaret pr",s),c="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+s+" <"+(+n+1)+".0.0"):(t("no pr"),c="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),t("caret return",c),c}))}(e,r)})).join(" ")}(e,r),t("caret",e),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){var n=r.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,(function(r,n,i,o,s){var c;return t("tilde",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":s?(t("replaceTilde pr",s),c=">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0"):c=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",t("tilde return",c),c}))}(e,r)})).join(" ")}(e,r),t("tildes",e),e=function(e,r){return t("replaceXRanges",e,r),e.split(/\s+/).map((function(e){return function(e,r){e=e.trim();var n=r.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(function(n,i,o,s,c,a){t("xRange",e,n,i,o,s,c,a);var u=_(o),l=u||_(s),f=l||_(c),p=f;return"="===i&&p&&(i=""),a=r.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(l&&(s=0),c=0,">"===i?(i=">=",l?(o=+o+1,s=0,c=0):(s=+s+1,c=0)):"<="===i&&(i="<",l?o=+o+1:s=+s+1),n=i+o+"."+s+"."+c+a):l?n=">="+o+".0.0"+a+" <"+(+o+1)+".0.0"+a:f&&(n=">="+o+"."+s+".0"+a+" <"+o+"."+(+s+1)+".0"+a),t("xRange return",n),n}))}(e,r)})).join(" ")}(e,r),t("xrange",e),e=function(e,r){return t("replaceStars",e,r),e.trim().replace(c[u.STAR],"")}(e,r),t("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(i)}))),o=o.map((function(e){return new x(e,this.options)}),this)},L.prototype.intersects=function(e,r){if(!(e instanceof L))throw new TypeError("a Range is required");return this.set.some((function(t){return T(t,r)&&e.set.some((function(e){return T(e,r)&&t.every((function(t){return e.every((function(e){return t.intersects(e,r)}))}))}))}))},r.toComparators=function(e,r){return new L(e,r).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},L.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}for(var r=0;r":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!w(t,r)||(t=r);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(t&&e.test(t))return t;return null},r.validRange=function(e,r){try{return new L(e,r).range||"*"}catch(e){return null}},r.ltr=function(e,r,t){return D(e,r,"<",t)},r.gtr=function(e,r,t){return D(e,r,">",t)},r.outside=D,r.prerelease=function(e,r){var t=g(e,r);return t&&t.prerelease.length?t.prerelease:null},r.intersects=function(e,r,t){return e=new L(e,t),r=new L(r,t),e.intersects(r)},r.coerce=function(e,r){if(e instanceof y)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var t=null;if((r=r||{}).rtl){for(var n;(n=c[u.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&n.index+n[0].length===t.index+t[0].length||(t=n),c[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;c[u.COERCERTL].lastIndex=-1}else t=e.match(c[u.COERCE]);if(null===t)return null;return g(t[2]+"."+(t[3]||"0")+"."+(t[4]||"0"),r)}}(0,Vy.exports);var Hy=a(Vy.exports);const zy=global,Yy=new Proxy(global.target,{set:function(e,r,t){return Reflect.set(...arguments)},get:function(e,r,t){return em(`make ${r}`),Reflect.get(...arguments)}}),Ky=["packages","codemods","eslint"],Jy=["eslint","scripts","benchmark",...Ky,"*.{js,cjs,mjs,ts}","--format","codeframe"],Qy=zy.which("yarn").stdout,Zy=process.execPath;function em(...e){console.log.apply(console,e)}function rm(e,r,n,i=!0){em(`${e.replaceAll(Qy,"yarn").replaceAll(Zy,"node")} ${r.join(" ")}`);try{return s.execFileSync(e,r,{stdio:i?"inherit":void 0,cwd:n&&t.resolve(n),env:process.env})}catch(t){throw i&&0!=t.status&&(console.error(new Error(`\ncommand: ${e} ${r.join(" ")}\ncode: ${t.status}`)),process.exit(t.status)),t}}function tm(e,r,t){return rm(Qy,e,r,t)}function nm(e,r,t){return rm(Zy,e,r,t)}function im(e,r){const t=process.env;process.env=Object.assign(Object.assign({},t),r),e(),process.env=t}function om(e,t,n){const i="./build/"+e.toLowerCase();zy.rm("-rf",i),zy.mkdir("-p","build"),rm("git",["clone","--filter=blob:none","--sparse","--single-branch","--shallow-since='2 years ago'",t,i]),rm("git",["sparse-checkout","set",...n],i),rm("git",["checkout","-q",function(e){const t=r.readFileSync("./Makefile","utf8").match(new RegExp(`${e}_COMMIT = (\\w{40})`))[1];if(!t)throw new Error(`Could not find ${e}_COMMIT in Makefile`);return t}(e)],i)}function sm(){const e=JSON.parse(r.readFileSync("./package.json","utf8")).version_babel8;return Ky.forEach((t=>{r.readdirSync(t).forEach((n=>{const i=`${t}/${n}/package.json`;try{const t=JSON.parse(r.readFileSync(i,"utf8"));t.peerDependencies["@babel/core"]=`^${e}`,r.writeFileSync(i,JSON.stringify(t,null,2)+"\n")}catch(e){}}))})),im((()=>tm(["install"])),{YARN_ENABLE_IMMUTABLE_INSTALLS:!1}),e}zy.config.verbose=!0,Yy["clean-all"]=function(){zy.rm("-rf",["node_modules","package-lock.json",".changelog"]),Ky.forEach((e=>{zy.rm("-rf",`${e}/*/test/tmp`),zy.rm("-rf",`${e}/*/package-lock.json`)})),Yy.clean(),Yy["clean-lib"]()},Yy.clean=function(){Yy["test-clean"](),zy.rm("-rf",[".npmrc","coverage","packages/*/npm-debug*","node_modules/.cache"])},Yy["test-clean"]=function(){Ky.forEach((e=>{zy.rm("-rf",`${e}/*/test/tmp`),zy.rm("-rf",`${e}/*/test-fixtures.json`)}))},Yy["clean-lib"]=function(){zy.rm("-rf",Ky.map((e=>`${e}/*/lib`))),nm(["scripts/set-module-type.js"])},Yy["clean-runtime-helpers"]=function(){zy.rm("-rf",["packages/babel-runtime/helpers/**/*.js","packages/babel-runtime-corejs2/helpers/**/*.js","packages/babel-runtime-corejs3/helpers/**/*.js","packages/babel-runtime/helpers/**/*.mjs","packages/babel-runtime-corejs2/helpers/**/*.mjs","packages/babel-runtime-corejs3/helpers/**/*.mjs","packages/babel-runtime-corejs2/core-js"])},Yy["use-cjs"]=function(){nm(["scripts/set-module-type.js","commonjs"]),Yy.bootstrap()},Yy["use-esm"]=function(){nm(["scripts/set-module-type.js","module"]),Yy.bootstrap()},Yy["bootstrap-only"]=function(){Yy["clean-all"](),tm(["install"])},Yy.bootstrap=function(){Yy["bootstrap-only"](),Yy["generate-tsconfig"](),Yy.build()},Yy.build=function(){Yy["build-no-bundle"](),"true"!=process.env.BABEL_COVERAGE&&Yy["build-standalone"]()},Yy["build-standalone"]=function(){tm(["gulp","build-babel-standalone"])},Yy["build-bundle"]=function(){Yy.clean(),Yy["clean-lib"](),nm(["scripts/set-module-type.js"]),tm(["gulp","build"]),Yy["build-dist"]()},Yy["build-no-bundle"]=function(){Yy.clean(),Yy["clean-lib"](),nm(["scripts/set-module-type.js"]),im((()=>{tm(["gulp","build-dev"])}),{BABEL_ENV:"development"}),Yy["build-dist"]()},Yy["build-flow-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index.js.flow",nm(["packages/babel-types/scripts/generators/flow.js"],void 0,!1))},Yy["build-dist"]=function(){Yy["build-plugin-transform-runtime-dist"]()},Yy["build-plugin-transform-runtime-dist"]=function(){nm(["scripts/build-dist.js"],"packages/babel-plugin-transform-runtime")},Yy.prepublish=function(){process.env.BABEL_8_BREAKING?nm(["scripts/set-module-type.js","module"]):nm(["scripts/set-module-type.js","commonjs"]),Yy["bootstrap-only"](),im((()=>{Yy["prepublish-build"](),Yy.test()}),{IS_PUBLISH:"true"}),nm(["scripts/set-module-type.js","clean"])},Yy["prepublish-build"]=function(){Yy["clean-lib"](),Yy["clean-runtime-helpers"](),im((()=>{Yy["build-bundle"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),im((()=>{Yy["prepublish-build-standalone"](),Yy["clone-license"](),Yy["prepublish-prepare-dts"](),Yy["build-flow-typings"]()}),{NODE_ENV:"production",STRIP_BABEL_8_FLAG:"true"})},Yy["prepublish-build-standalone"]=function(){im((()=>{Yy["build-standalone"]()}),{BABEL_ENV:"production",IS_PUBLISH:"true"})},Yy["prepublish-prepare-dts"]=function(){Yy.tscheck(),tm(["gulp","bundle-dts"]),Yy["build-typescript-legacy-typings"]()},Yy.tscheck=function(){Yy["generate-tsconfig"](),zy.rm("-rf","tsconfig.tsbuildinfo"),zy.rm("-rf","dts"),tm(["tsc","-b","."])},Yy["generate-tsconfig"]=function(){nm(["scripts/generators/tsconfig.js"]),nm(["scripts/generators/archived-libs-typings.js"])},Yy["generate-type-helpers"]=function(){tm(["gulp","generate-type-helpers"])},Yy["build-typescript-legacy-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index-legacy.d.ts",nm(["packages/babel-types/scripts/generators/typescript-legacy.js"],void 0,!1))},Yy["clone-license"]=function(){nm(["scripts/clone-license.js"])},Yy.lint=function(){im((()=>{tm(Jy)}),{BABEL_ENV:"test"})},Yy.fix=function(){Yy["fix-json"](),Yy["fix-js"]()},Yy["fix-js"]=function(){tm([...Jy,"--fix"])},Yy["fix-json"]=function(){tm(["prettier",`{${Ky.join(",")}}/*/test/fixtures/**/options.json`,"--write","--loglevel","warn"])},Yy.watch=function(){Yy["build-no-bundle"](),im((()=>{tm(["gulp","watch"])}),{BABEL_ENV:"development",WATCH_SKIP_BUILD:"true"})},Yy.test=function(){Yy.lint(),Yy["test-only"]()},Yy["test-only"]=function(e=[]){tm(["jest",...e])},Yy["test-cov"]=function(){Yy.build(),im((()=>{tm(["c8","jest"])}),{BABEL_ENV:"test",BABEL_COVERAGE:"true"})},Yy["bootstrap-test262"]=function(){om("TEST262","https://github.com/tc39/test262.git",["test","harness"])},Yy["bootstrap-typescript"]=function(){om("TYPESCRIPT","https://github.com/microsoft/TypeScript.git",["tests"])},Yy["bootstrap-flow"]=function(){om("FLOW","https://github.com/facebook/flow.git",["src/parser/test/flow"])},Yy["new-version-checklist"]=function(){},Yy["new-version"]=function(){Yy["new-version-checklist"](),rm("git",["pull","--rebase"]),tm(["release-tool","version","-f","@babel/standalone"])},Yy["new-babel-8-version"]=function(){rm("git",["pull","--rebase"]);const e=JSON.parse(r.readFileSync("./package.json","utf8")),t=Hy.inc(e.version_babel8,"prerelease");return e.version_babel8=t,r.writeFileSync("./package.json",JSON.stringify(e,null,2)+"\n"),rm("git",["add","./package.json"]),rm("git",["commit","-m","Bump Babel 8 version to "+t]),rm("git",["tag",`v${t}`,"-m",`v${t}`]),t},Yy["new-babel-8-version-create-commit-ci"]=function(){tm(["release-tool","version",sm(),"--all","--tag-version-prefix","tmp.v","--yes"])},Yy["new-babel-8-version-create-commit"]=function(){const e=sm();rm("git",["checkout","-b",`release/temp/v${e}`]),tm(["release-tool","version",e,"--all","--tag-version-prefix","tmp.v"]),console.log("Run `BABEL_8_BREAKING=true make publish` to finish publishing")}; +"use strict";var e=require("os"),r=require("fs"),t=require("path"),n=require("events"),i=require("assert"),o=require("util"),s=require("child_process"),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function a(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u=function(e){return e&&e.Math==Math&&e},l=u("object"==typeof globalThis&&globalThis)||u("object"==typeof window&&window)||u("object"==typeof self&&self)||u("object"==typeof c&&c)||function(){return this}()||c||Function("return this")(),f={},p=function(e){try{return!!e()}catch(e){return!0}},h=!p((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d=!p((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),v=d,g=Function.prototype.call,y=v?g.bind(g):function(){return g.apply(g,arguments)},m={},E={}.propertyIsEnumerable,b=Object.getOwnPropertyDescriptor,w=b&&!E.call({1:2},1);m.f=w?function(e){var r=b(this,e);return!!r&&r.enumerable}:E;var O,S,R=function(e,r){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:r}},I=d,A=Function.prototype,j=A.call,x=I&&A.bind.bind(j,j),k=I?x:function(e){return function(){return j.apply(e,arguments)}},L=k,T=L({}.toString),_=L("".slice),N=function(e){return _(T(e),8,-1)},P=p,F=N,D=Object,C=k("".split),M=P((function(){return!D("z").propertyIsEnumerable(0)}))?function(e){return"String"==F(e)?C(e,""):D(e)}:D,G=function(e){return null==e},$=G,B=TypeError,U=function(e){if($(e))throw B("Can't call method on "+e);return e},X=M,q=U,W=function(e){return X(q(e))},V="object"==typeof document&&document.all,H={all:V,IS_HTMLDDA:void 0===V&&void 0!==V},z=H.all,Y=H.IS_HTMLDDA?function(e){return"function"==typeof e||e===z}:function(e){return"function"==typeof e},K=Y,J=H.all,Q=H.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:K(e)||e===J}:function(e){return"object"==typeof e?null!==e:K(e)},Z=l,ee=Y,re=function(e,r){return arguments.length<2?(t=Z[e],ee(t)?t:void 0):Z[e]&&Z[e][r];var t},te=k({}.isPrototypeOf),ne="undefined"!=typeof navigator&&String(navigator.userAgent)||"",ie=l,oe=ne,se=ie.process,ce=ie.Deno,ae=se&&se.versions||ce&&ce.version,ue=ae&&ae.v8;ue&&(S=(O=ue.split("."))[0]>0&&O[0]<4?1:+(O[0]+O[1])),!S&&oe&&(!(O=oe.match(/Edge\/(\d+)/))||O[1]>=74)&&(O=oe.match(/Chrome\/(\d+)/))&&(S=+O[1]);var le=S,fe=le,pe=p,he=l.String,de=!!Object.getOwnPropertySymbols&&!pe((function(){var e=Symbol();return!he(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fe&&fe<41})),ve=de&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ge=re,ye=Y,me=te,Ee=Object,be=ve?function(e){return"symbol"==typeof e}:function(e){var r=ge("Symbol");return ye(r)&&me(r.prototype,Ee(e))},we=String,Oe=function(e){try{return we(e)}catch(e){return"Object"}},Se=Y,Re=Oe,Ie=TypeError,Ae=function(e){if(Se(e))return e;throw Ie(Re(e)+" is not a function")},je=Ae,xe=G,ke=function(e,r){var t=e[r];return xe(t)?void 0:je(t)},Le=y,Te=Y,_e=Q,Ne=TypeError,Pe={exports:{}},Fe=l,De=Object.defineProperty,Ce=function(e,r){try{De(Fe,e,{value:r,configurable:!0,writable:!0})}catch(t){Fe[e]=r}return r},Me=Ce,Ge="__core-js_shared__",$e=l[Ge]||Me(Ge,{}),Be=$e;(Pe.exports=function(e,r){return Be[e]||(Be[e]=void 0!==r?r:{})})("versions",[]).push({version:"3.31.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ue=Pe.exports,Xe=U,qe=Object,We=function(e){return qe(Xe(e))},Ve=We,He=k({}.hasOwnProperty),ze=Object.hasOwn||function(e,r){return He(Ve(e),r)},Ye=k,Ke=0,Je=Math.random(),Qe=Ye(1..toString),Ze=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Qe(++Ke+Je,36)},er=Ue,rr=ze,tr=Ze,nr=de,ir=ve,or=l.Symbol,sr=er("wks"),cr=ir?or.for||or:or&&or.withoutSetter||tr,ar=function(e){return rr(sr,e)||(sr[e]=nr&&rr(or,e)?or[e]:cr("Symbol."+e)),sr[e]},ur=y,lr=Q,fr=be,pr=ke,hr=function(e,r){var t,n;if("string"===r&&Te(t=e.toString)&&!_e(n=Le(t,e)))return n;if(Te(t=e.valueOf)&&!_e(n=Le(t,e)))return n;if("string"!==r&&Te(t=e.toString)&&!_e(n=Le(t,e)))return n;throw Ne("Can't convert object to primitive value")},dr=TypeError,vr=ar("toPrimitive"),gr=function(e,r){if(!lr(e)||fr(e))return e;var t,n=pr(e,vr);if(n){if(void 0===r&&(r="default"),t=ur(n,e,r),!lr(t)||fr(t))return t;throw dr("Can't convert object to primitive value")}return void 0===r&&(r="number"),hr(e,r)},yr=be,mr=function(e){var r=gr(e,"string");return yr(r)?r:r+""},Er=Q,br=l.document,wr=Er(br)&&Er(br.createElement),Or=function(e){return wr?br.createElement(e):{}},Sr=Or,Rr=!h&&!p((function(){return 7!=Object.defineProperty(Sr("div"),"a",{get:function(){return 7}}).a})),Ir=h,Ar=y,jr=m,xr=R,kr=W,Lr=mr,Tr=ze,_r=Rr,Nr=Object.getOwnPropertyDescriptor;f.f=Ir?Nr:function(e,r){if(e=kr(e),r=Lr(r),_r)try{return Nr(e,r)}catch(e){}if(Tr(e,r))return xr(!Ar(jr.f,e,r),e[r])};var Pr={},Fr=h&&p((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Dr=Q,Cr=String,Mr=TypeError,Gr=function(e){if(Dr(e))return e;throw Mr(Cr(e)+" is not an object")},$r=h,Br=Rr,Ur=Fr,Xr=Gr,qr=mr,Wr=TypeError,Vr=Object.defineProperty,Hr=Object.getOwnPropertyDescriptor,zr="enumerable",Yr="configurable",Kr="writable";Pr.f=$r?Ur?function(e,r,t){if(Xr(e),r=qr(r),Xr(t),"function"==typeof e&&"prototype"===r&&"value"in t&&Kr in t&&!t[Kr]){var n=Hr(e,r);n&&n[Kr]&&(e[r]=t.value,t={configurable:Yr in t?t[Yr]:n[Yr],enumerable:zr in t?t[zr]:n[zr],writable:!1})}return Vr(e,r,t)}:Vr:function(e,r,t){if(Xr(e),r=qr(r),Xr(t),Br)try{return Vr(e,r,t)}catch(e){}if("get"in t||"set"in t)throw Wr("Accessors not supported");return"value"in t&&(e[r]=t.value),e};var Jr=Pr,Qr=R,Zr=h?function(e,r,t){return Jr.f(e,r,Qr(1,t))}:function(e,r,t){return e[r]=t,e},et={exports:{}},rt=h,tt=ze,nt=Function.prototype,it=rt&&Object.getOwnPropertyDescriptor,ot=tt(nt,"name"),st={EXISTS:ot,PROPER:ot&&"something"===function(){}.name,CONFIGURABLE:ot&&(!rt||rt&&it(nt,"name").configurable)},ct=Y,at=$e,ut=k(Function.toString);ct(at.inspectSource)||(at.inspectSource=function(e){return ut(e)});var lt,ft,pt,ht=at.inspectSource,dt=Y,vt=l.WeakMap,gt=dt(vt)&&/native code/.test(String(vt)),yt=Ze,mt=Ue("keys"),Et=function(e){return mt[e]||(mt[e]=yt(e))},bt={},wt=gt,Ot=l,St=Q,Rt=Zr,It=ze,At=$e,jt=Et,xt=bt,kt="Object already initialized",Lt=Ot.TypeError,Tt=Ot.WeakMap;if(wt||At.state){var _t=At.state||(At.state=new Tt);_t.get=_t.get,_t.has=_t.has,_t.set=_t.set,lt=function(e,r){if(_t.has(e))throw Lt(kt);return r.facade=e,_t.set(e,r),r},ft=function(e){return _t.get(e)||{}},pt=function(e){return _t.has(e)}}else{var Nt=jt("state");xt[Nt]=!0,lt=function(e,r){if(It(e,Nt))throw Lt(kt);return r.facade=e,Rt(e,Nt,r),r},ft=function(e){return It(e,Nt)?e[Nt]:{}},pt=function(e){return It(e,Nt)}}var Pt={set:lt,get:ft,has:pt,enforce:function(e){return pt(e)?ft(e):lt(e,{})},getterFor:function(e){return function(r){var t;if(!St(r)||(t=ft(r)).type!==e)throw Lt("Incompatible receiver, "+e+" required");return t}}},Ft=k,Dt=p,Ct=Y,Mt=ze,Gt=h,$t=st.CONFIGURABLE,Bt=ht,Ut=Pt.enforce,Xt=Pt.get,qt=String,Wt=Object.defineProperty,Vt=Ft("".slice),Ht=Ft("".replace),zt=Ft([].join),Yt=Gt&&!Dt((function(){return 8!==Wt((function(){}),"length",{value:8}).length})),Kt=String(String).split("String"),Jt=et.exports=function(e,r,t){"Symbol("===Vt(qt(r),0,7)&&(r="["+Ht(qt(r),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(r="get "+r),t&&t.setter&&(r="set "+r),(!Mt(e,"name")||$t&&e.name!==r)&&(Gt?Wt(e,"name",{value:r,configurable:!0}):e.name=r),Yt&&t&&Mt(t,"arity")&&e.length!==t.arity&&Wt(e,"length",{value:t.arity});try{t&&Mt(t,"constructor")&&t.constructor?Gt&&Wt(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=Ut(e);return Mt(n,"source")||(n.source=zt(Kt,"string"==typeof r?r:"")),e};Function.prototype.toString=Jt((function(){return Ct(this)&&Xt(this).source||Bt(this)}),"toString");var Qt=et.exports,Zt=Y,en=Pr,rn=Qt,tn=Ce,nn=function(e,r,t,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:r;if(Zt(t)&&rn(t,o,n),n.global)i?e[r]=t:tn(r,t);else{try{n.unsafe?e[r]&&(i=!0):delete e[r]}catch(e){}i?e[r]=t:en.f(e,r,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},on={},sn=Math.ceil,cn=Math.floor,an=Math.trunc||function(e){var r=+e;return(r>0?cn:sn)(r)},un=function(e){var r=+e;return r!=r||0===r?0:an(r)},ln=un,fn=Math.max,pn=Math.min,hn=function(e,r){var t=ln(e);return t<0?fn(t+r,0):pn(t,r)},dn=un,vn=Math.min,gn=function(e){return e>0?vn(dn(e),9007199254740991):0},yn=gn,mn=function(e){return yn(e.length)},En=W,bn=hn,wn=mn,On=function(e){return function(r,t,n){var i,o=En(r),s=wn(o),c=bn(n,s);if(e&&t!=t){for(;s>c;)if((i=o[c++])!=i)return!0}else for(;s>c;c++)if((e||c in o)&&o[c]===t)return e||c||0;return!e&&-1}},Sn={includes:On(!0),indexOf:On(!1)},Rn=ze,In=W,An=Sn.indexOf,jn=bt,xn=k([].push),kn=function(e,r){var t,n=In(e),i=0,o=[];for(t in n)!Rn(jn,t)&&Rn(n,t)&&xn(o,t);for(;r.length>i;)Rn(n,t=r[i++])&&(~An(o,t)||xn(o,t));return o},Ln=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Tn=kn,_n=Ln.concat("length","prototype");on.f=Object.getOwnPropertyNames||function(e){return Tn(e,_n)};var Nn={};Nn.f=Object.getOwnPropertySymbols;var Pn=re,Fn=on,Dn=Nn,Cn=Gr,Mn=k([].concat),Gn=Pn("Reflect","ownKeys")||function(e){var r=Fn.f(Cn(e)),t=Dn.f;return t?Mn(r,t(e)):r},$n=ze,Bn=Gn,Un=f,Xn=Pr,qn=function(e,r,t){for(var n=Bn(r),i=Xn.f,o=Un.f,s=0;ss;)bi.f(e,t=i[s++],n[t]);return e};var Ri,Ii=re("document","documentElement"),Ai=Gr,ji=di,xi=Ln,ki=bt,Li=Ii,Ti=Or,_i="prototype",Ni="script",Pi=Et("IE_PROTO"),Fi=function(){},Di=function(e){return"<"+Ni+">"+e+""},Ci=function(e){e.write(Di("")),e.close();var r=e.parentWindow.Object;return e=null,r},Mi=function(){try{Ri=new ActiveXObject("htmlfile")}catch(e){}var e,r,t;Mi="undefined"!=typeof document?document.domain&&Ri?Ci(Ri):(r=Ti("iframe"),t="java"+Ni+":",r.style.display="none",Li.appendChild(r),r.src=String(t),(e=r.contentWindow.document).open(),e.write(Di("document.F=Object")),e.close(),e.F):Ci(Ri);for(var n=xi.length;n--;)delete Mi[_i][xi[n]];return Mi()};ki[Pi]=!0;var Gi=Object.create||function(e,r){var t;return null!==e?(Fi[_i]=Ai(e),t=new Fi,Fi[_i]=null,t[Pi]=e):t=Mi(),void 0===r?t:ji.f(t,r)},$i=ar,Bi=Gi,Ui=Pr.f,Xi=$i("unscopables"),qi=Array.prototype;null==qi[Xi]&&Ui(qi,Xi,{configurable:!0,value:Bi(null)});var Wi,Vi,Hi,zi={},Yi=!p((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Ki=ze,Ji=Y,Qi=We,Zi=Yi,eo=Et("IE_PROTO"),ro=Object,to=ro.prototype,no=Zi?ro.getPrototypeOf:function(e){var r=Qi(e);if(Ki(r,eo))return r[eo];var t=r.constructor;return Ji(t)&&r instanceof t?t.prototype:r instanceof ro?to:null},io=p,oo=Y,so=Q,co=no,ao=nn,uo=ar("iterator"),lo=!1;[].keys&&("next"in(Hi=[].keys())?(Vi=co(co(Hi)))!==Object.prototype&&(Wi=Vi):lo=!0);var fo=!so(Wi)||io((function(){var e={};return Wi[uo].call(e)!==e}));fo&&(Wi={}),oo(Wi[uo])||ao(Wi,uo,(function(){return this}));var po={IteratorPrototype:Wi,BUGGY_SAFARI_ITERATORS:lo},ho=po.IteratorPrototype,vo=Gi,go=R,yo=fi,mo=zi,Eo=function(){return this},bo=k,wo=Ae,Oo=Y,So=String,Ro=TypeError,Io=function(e,r,t){try{return bo(wo(Object.getOwnPropertyDescriptor(e,r)[t]))}catch(e){}},Ao=Gr,jo=function(e){if("object"==typeof e||Oo(e))return e;throw Ro("Can't set "+So(e)+" as a prototype")},xo=Object.setPrototypeOf||("__proto__"in{}?function(){var e,r=!1,t={};try{(e=Io(Object.prototype,"__proto__","set"))(t,[]),r=t instanceof Array}catch(e){}return function(t,n){return Ao(t),jo(n),r?e(t,n):t.__proto__=n,t}}():void 0),ko=ci,Lo=y,To=Y,_o=function(e,r,t,n){var i=r+" Iterator";return e.prototype=vo(ho,{next:go(+!n,t)}),yo(e,i,!1),mo[i]=Eo,e},No=no,Po=xo,Fo=fi,Do=Zr,Co=nn,Mo=zi,Go=st.PROPER,$o=st.CONFIGURABLE,Bo=po.IteratorPrototype,Uo=po.BUGGY_SAFARI_ITERATORS,Xo=ar("iterator"),qo="keys",Wo="values",Vo="entries",Ho=function(){return this},zo=W,Yo=function(e){qi[Xi][e]=!0},Ko=zi,Jo=Pt,Qo=Pr.f,Zo=function(e,r,t,n,i,o,s){_o(t,r,n);var c,a,u,l=function(e){if(e===i&&v)return v;if(!Uo&&e in h)return h[e];switch(e){case qo:case Wo:case Vo:return function(){return new t(this,e)}}return function(){return new t(this)}},f=r+" Iterator",p=!1,h=e.prototype,d=h[Xo]||h["@@iterator"]||i&&h[i],v=!Uo&&d||l(i),g="Array"==r&&h.entries||d;if(g&&(c=No(g.call(new e)))!==Object.prototype&&c.next&&(No(c)!==Bo&&(Po?Po(c,Bo):To(c[Xo])||Co(c,Xo,Ho)),Fo(c,f,!0)),Go&&i==Wo&&d&&d.name!==Wo&&($o?Do(h,"name",Wo):(p=!0,v=function(){return Lo(d,this)})),i)if(a={values:l(Wo),keys:o?v:l(qo),entries:l(Vo)},s)for(u in a)(Uo||p||!(u in h))&&Co(h,u,a[u]);else ko({target:r,proto:!0,forced:Uo||p},a);return h[Xo]!==v&&Co(h,Xo,v,{name:i}),Mo[r]=v,a},es=function(e,r){return{value:e,done:r}},rs=h,ts="Array Iterator",ns=Jo.set,is=Jo.getterFor(ts);Zo(Array,"Array",(function(e,r){ns(this,{type:ts,target:zo(e),index:0,kind:r})}),(function(){var e=is(this),r=e.target,t=e.kind,n=e.index++;return!r||n>=r.length?(e.target=void 0,es(void 0,!0)):es("keys"==t?n:"values"==t?r[n]:[n,r[n]],!1)}),"values");var os=Ko.Arguments=Ko.Array;if(Yo("keys"),Yo("values"),Yo("entries"),rs&&"values"!==os.name)try{Qo(os,"name",{value:"values"})}catch(e){}var ss={};ss[ar("toStringTag")]="z";var cs="[object z]"===String(ss),as=Y,us=N,ls=ar("toStringTag"),fs=Object,ps="Arguments"==us(function(){return arguments}()),hs=cs?us:function(e){var r,t,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(t=function(e,r){try{return e[r]}catch(e){}}(r=fs(e),ls))?t:ps?us(r):"Object"==(n=us(r))&&as(r.callee)?"Arguments":n},ds=hs,vs=String,gs=function(e){if("Symbol"===ds(e))throw TypeError("Cannot convert a Symbol value to a string");return vs(e)},ys=Gr,ms=function(){var e=ys(this),r="";return e.hasIndices&&(r+="d"),e.global&&(r+="g"),e.ignoreCase&&(r+="i"),e.multiline&&(r+="m"),e.dotAll&&(r+="s"),e.unicode&&(r+="u"),e.unicodeSets&&(r+="v"),e.sticky&&(r+="y"),r},Es=p,bs=l.RegExp,ws=Es((function(){var e=bs("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Os=ws||Es((function(){return!bs("a","y").sticky})),Ss=ws||Es((function(){var e=bs("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),Rs={BROKEN_CARET:Ss,MISSED_STICKY:Os,UNSUPPORTED_Y:ws},Is=p,As=l.RegExp,js=Is((function(){var e=As(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),xs=p,ks=l.RegExp,Ls=xs((function(){var e=ks("(?b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$c")})),Ts=y,_s=k,Ns=gs,Ps=ms,Fs=Rs,Ds=Gi,Cs=Pt.get,Ms=js,Gs=Ls,$s=Ue("native-string-replace",String.prototype.replace),Bs=RegExp.prototype.exec,Us=Bs,Xs=_s("".charAt),qs=_s("".indexOf),Ws=_s("".replace),Vs=_s("".slice),Hs=function(){var e=/a/,r=/b*/g;return Ts(Bs,e,"a"),Ts(Bs,r,"a"),0!==e.lastIndex||0!==r.lastIndex}(),zs=Fs.BROKEN_CARET,Ys=void 0!==/()??/.exec("")[1];(Hs||Ys||zs||Ms||Gs)&&(Us=function(e){var r,t,n,i,o,s,c,a=this,u=Cs(a),l=Ns(e),f=u.raw;if(f)return f.lastIndex=a.lastIndex,r=Ts(Us,f,l),a.lastIndex=f.lastIndex,r;var p=u.groups,h=zs&&a.sticky,d=Ts(Ps,a),v=a.source,g=0,y=l;if(h&&(d=Ws(d,"y",""),-1===qs(d,"g")&&(d+="g"),y=Vs(l,a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==Xs(l,a.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),t=new RegExp("^(?:"+v+")",d)),Ys&&(t=new RegExp("^"+v+"$(?!\\s)",d)),Hs&&(n=a.lastIndex),i=Ts(Bs,h?t:a,y),h?i?(i.input=Vs(i.input,g),i[0]=Vs(i[0],g),i.index=a.lastIndex,a.lastIndex+=i[0].length):a.lastIndex=0:Hs&&i&&(a.lastIndex=a.global?i.index+i[0].length:n),Ys&&i&&i.length>1&&Ts($s,i[0],t,(function(){for(o=1;o=c?e?"":void 0:(n=Ec(o,s))<55296||n>56319||s+1===c||(i=Ec(o,s+1))<56320||i>57343?e?mc(o,s):n:e?bc(o,s,s+2):i-56320+(n-55296<<10)+65536}},Oc={codeAt:wc(!1),charAt:wc(!0)}.charAt,Sc=function(e,r,t){return r+(t?Oc(e,r).length:1)},Rc=k,Ic=We,Ac=Math.floor,jc=Rc("".charAt),xc=Rc("".replace),kc=Rc("".slice),Lc=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Tc=/\$([$&'`]|\d{1,2})/g,_c=function(e,r,t,n,i,o){var s=t+e.length,c=n.length,a=Tc;return void 0!==i&&(i=Ic(i),a=Lc),xc(o,a,(function(o,a){var u;switch(jc(a,0)){case"$":return"$";case"&":return e;case"`":return kc(r,0,t);case"'":return kc(r,s);case"<":u=i[kc(a,1,-1)];break;default:var l=+a;if(0===l)return o;if(l>c){var f=Ac(l/10);return 0===f?o:f<=c?void 0===n[f-1]?jc(a,1):n[f-1]+jc(a,1):o}u=n[l-1]}return void 0===u?"":u}))},Nc=y,Pc=Gr,Fc=Y,Dc=N,Cc=Ks,Mc=TypeError,Gc=function(e,r){var t=e.exec;if(Fc(t)){var n=Nc(t,e,r);return null!==n&&Pc(n),n}if("RegExp"===Dc(e))return Nc(Cc,e,r);throw Mc("RegExp#exec called on incompatible receiver")},$c=rc,Bc=y,Uc=k,Xc=hc,qc=p,Wc=Gr,Vc=Y,Hc=G,zc=un,Yc=gn,Kc=gs,Jc=U,Qc=Sc,Zc=ke,ea=_c,ra=Gc,ta=ar("replace"),na=Math.max,ia=Math.min,oa=Uc([].concat),sa=Uc([].push),ca=Uc("".indexOf),aa=Uc("".slice),ua="$0"==="a".replace(/./,"$0"),la=!!/./[ta]&&""===/./[ta]("a","$0"),fa=!qc((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}));Xc("replace",(function(e,r,t){var n=la?"$":"$0";return[function(e,t){var n=Jc(this),i=Hc(e)?void 0:Zc(e,ta);return i?Bc(i,e,n,t):Bc(r,Kc(n),e,t)},function(e,i){var o=Wc(this),s=Kc(e);if("string"==typeof i&&-1===ca(i,n)&&-1===ca(i,"$<")){var c=t(r,o,s,i);if(c.done)return c.value}var a=Vc(i);a||(i=Kc(i));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var p=ra(o,s);if(null===p)break;if(sa(f,p),!u)break;""===Kc(p[0])&&(o.lastIndex=Qc(s,Yc(o.lastIndex),l))}for(var h,d="",v=0,g=0;g=v&&(d+=aa(s,v,m)+S,v=m+y.length)}return d+aa(s,v)}]}),!fa||!ua||la);var pa=Q,ha=N,da=ar("match"),va=function(e){var r;return pa(e)&&(void 0!==(r=e[da])?!!r:"RegExp"==ha(e))},ga=y,ya=ze,ma=te,Ea=ms,ba=RegExp.prototype,wa=function(e){var r=e.flags;return void 0!==r||"flags"in ba||ya(e,"flags")||!ma(ba,e)?r:ga(Ea,e)},Oa=ci,Sa=y,Ra=k,Ia=U,Aa=Y,ja=G,xa=va,ka=gs,La=ke,Ta=wa,_a=_c,Na=ar("replace"),Pa=TypeError,Fa=Ra("".indexOf);Ra("".replace);var Da=Ra("".slice),Ca=Math.max,Ma=function(e,r,t){return t>e.length?-1:""===r?t:Fa(e,r,t)};Oa({target:"String",proto:!0},{replaceAll:function(e,r){var t,n,i,o,s,c,a,u,l=Ia(this),f=0,p=0,h="";if(!ja(e)){if(xa(e)&&(t=ka(Ia(Ta(e))),!~Fa(t,"g")))throw Pa("`.replaceAll` does not allow non-global regexes");if(n=La(e,Na))return Sa(n,e,l,r)}for(i=ka(l),o=ka(e),(s=Aa(r))||(r=ka(r)),c=o.length,a=Ca(1,c),f=Ma(i,o,0);-1!==f;)u=s?ka(r(o,f,i)):_a(o,i,f,[],void 0,r),h+=Da(i,p,f)+u,p=f+c,f=Ma(i,o,f+a);return po&&du(i,arguments[o]),i}));f.prototype=u,"Error"!==c?uu?uu(f,l):lu(f,l,{name:!0}):gu&&i in a&&(fu(f,a,i),fu(f,a,"prepareStackTrace")),lu(f,a);try{u.name!==c&&cu(u,"name",c),u.constructor=f}catch(e){}return f}},bu="WebAssembly",wu=l[bu],Ou=7!==Error("e",{cause:7}).cause,Su=function(e,r){var t={};t[e]=Eu(e,r,Ou),yu({global:!0,constructor:!0,arity:1,forced:Ou},t)},Ru=function(e,r){if(wu&&wu[e]){var t={};t[e]=Eu(bu+"."+e,r,Ou),yu({target:bu,stat:!0,constructor:!0,arity:1,forced:Ou},t)}};Su("Error",(function(e){return function(r){return mu(e,this,arguments)}})),Su("EvalError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("RangeError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("ReferenceError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("SyntaxError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("TypeError",(function(e){return function(r){return mu(e,this,arguments)}})),Su("URIError",(function(e){return function(r){return mu(e,this,arguments)}})),Ru("CompileError",(function(e){return function(r){return mu(e,this,arguments)}})),Ru("LinkError",(function(e){return function(r){return mu(e,this,arguments)}})),Ru("RuntimeError",(function(e){return function(r){return mu(e,this,arguments)}}));var Iu=Ae,Au=d,ju=ic(ic.bind),xu=N,ku=Array.isArray||function(e){return"Array"==xu(e)},Lu=k,Tu=p,_u=Y,Nu=hs,Pu=ht,Fu=function(){},Du=[],Cu=re("Reflect","construct"),Mu=/^\s*(?:class|function)\b/,Gu=Lu(Mu.exec),$u=!Mu.exec(Fu),Bu=function(e){if(!_u(e))return!1;try{return Cu(Fu,Du,e),!0}catch(e){return!1}},Uu=function(e){if(!_u(e))return!1;switch(Nu(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return $u||!!Gu(Mu,Pu(e))}catch(e){return!0}};Uu.sham=!0;var Xu=!Cu||Tu((function(){var e;return Bu(Bu.call)||!Bu(Object)||!Bu((function(){e=!0}))||e}))?Uu:Bu,qu=ku,Wu=Xu,Vu=Q,Hu=ar("species"),zu=Array,Yu=function(e){var r;return qu(e)&&(r=e.constructor,(Wu(r)&&(r===zu||qu(r.prototype))||Vu(r)&&null===(r=r[Hu]))&&(r=void 0)),void 0===r?zu:r},Ku=function(e,r){return new(Yu(e))(0===r?0:r)},Ju=function(e,r){return Iu(e),void 0===r?e:Au?ju(e,r):function(){return e.apply(r,arguments)}},Qu=M,Zu=We,el=mn,rl=Ku,tl=k([].push),nl=function(e){var r=1==e,t=2==e,n=3==e,i=4==e,o=6==e,s=7==e,c=5==e||o;return function(a,u,l,f){for(var p,h,d=Zu(a),v=Qu(d),g=Ju(u,l),y=el(v),m=0,E=f||rl,b=r?E(a,y):t||s?E(a,0):void 0;y>m;m++)if((c||m in v)&&(h=g(p=v[m],m,d),e))if(r)b[m]=h;else if(h)switch(e){case 3:return!0;case 5:return p;case 6:return m;case 2:tl(b,p)}else switch(e){case 4:return!1;case 7:tl(b,p)}return o?-1:n||i?i:b}},il={forEach:nl(0),map:nl(1),filter:nl(2),some:nl(3),every:nl(4),find:nl(5),findIndex:nl(6),filterReject:nl(7)},ol=p,sl=le,cl=ar("species"),al=function(e){return sl>=51||!ol((function(){var r=[];return(r.constructor={})[cl]=function(){return{foo:1}},1!==r[e](Boolean).foo}))},ul=il.map;ci({target:"Array",proto:!0,forced:!al("map")},{map:function(e){return ul(this,e,arguments.length>1?arguments[1]:void 0)}});var ll,fl,pl=ci,hl=y,dl=Y,vl=Gr,gl=gs,yl=(ll=!1,(fl=/[ac]/).exec=function(){return ll=!0,/./.exec.apply(this,arguments)},!0===fl.test("abc")&&ll),ml=/./.test;pl({target:"RegExp",proto:!0,forced:!yl},{test:function(e){var r=vl(this),t=gl(e),n=r.exec;if(!dl(n))return hl(ml,r,t);var i=hl(n,r,t);return null!==i&&(vl(i),!0)}});var El=y,bl=Gr,wl=G,Ol=gn,Sl=gs,Rl=U,Il=ke,Al=Sc,jl=Gc;hc("match",(function(e,r,t){return[function(r){var t=Rl(this),n=wl(r)?void 0:Il(r,e);return n?El(n,r,t):new RegExp(r)[e](Sl(t))},function(e){var n=bl(this),i=Sl(e),o=t(r,n,i);if(o.done)return o.value;if(!n.global)return jl(n,i);var s=n.unicode;n.lastIndex=0;for(var c,a=[],u=0;null!==(c=jl(n,i));){var l=Sl(c[0]);a[u]=l,""===l&&(n.lastIndex=Al(i,Ol(n.lastIndex),s)),u++}return 0===u?null:a}]}));var xl=Qt,kl=Pr,Ll=function(e,r,t){return t.get&&xl(t.get,r,{getter:!0}),t.set&&xl(t.set,r,{setter:!0}),kl.f(e,r,t)},Tl=re,_l=Ll,Nl=h,Pl=ar("species"),Fl=h,Dl=l,Cl=k,Ml=Zn,Gl=qa,$l=Zr,Bl=on.f,Ul=te,Xl=va,ql=gs,Wl=wa,Vl=Rs,Hl=$a,zl=nn,Yl=p,Kl=ze,Jl=Pt.enforce,Ql=function(e){var r=Tl(e);Nl&&r&&!r[Pl]&&_l(r,Pl,{configurable:!0,get:function(){return this}})},Zl=js,ef=Ls,rf=ar("match"),tf=Dl.RegExp,nf=tf.prototype,of=Dl.SyntaxError,sf=Cl(nf.exec),cf=Cl("".charAt),af=Cl("".replace),uf=Cl("".indexOf),lf=Cl("".slice),ff=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,pf=/a/g,hf=/a/g,df=new tf(pf)!==pf,vf=Vl.MISSED_STICKY,gf=Vl.UNSUPPORTED_Y,yf=Fl&&(!df||vf||Zl||ef||Yl((function(){return hf[rf]=!1,tf(pf)!=pf||tf(hf)==hf||"/a/i"!=tf(pf,"i")})));if(Ml("RegExp",yf)){for(var mf=function(e,r){var t,n,i,o,s,c,a=Ul(nf,this),u=Xl(e),l=void 0===r,f=[],p=e;if(!a&&u&&l&&e.constructor===mf)return e;if((u||Ul(nf,e))&&(e=e.source,l&&(r=Wl(p))),e=void 0===e?"":ql(e),r=void 0===r?"":ql(r),p=e,Zl&&"dotAll"in pf&&(n=!!r&&uf(r,"s")>-1)&&(r=af(r,/s/g,"")),t=r,vf&&"sticky"in pf&&(i=!!r&&uf(r,"y")>-1)&&gf&&(r=af(r,/y/g,"")),ef&&(o=function(e){for(var r,t=e.length,n=0,i="",o=[],s={},c=!1,a=!1,u=0,l="";n<=t;n++){if("\\"===(r=cf(e,n)))r+=cf(e,++n);else if("]"===r)c=!1;else if(!c)switch(!0){case"["===r:c=!0;break;case"("===r:sf(ff,lf(e,n+1))&&(n+=2,a=!0),i+=r,u++;continue;case">"===r&&a:if(""===l||Kl(s,l))throw new of("Invalid capture group name");s[l]=!0,o[o.length]=[l,u],a=!1,l="";continue}a?l+=r:i+=r}return[i,o]}(e),e=o[0],f=o[1]),s=Gl(tf(e,r),a?this:nf,mf),(n||i||f.length)&&(c=Jl(s),n&&(c.dotAll=!0,c.raw=mf(function(e){for(var r,t=e.length,n=0,i="",o=!1;n<=t;n++)"\\"!==(r=cf(e,n))?o||"."!==r?("["===r?o=!0:"]"===r&&(o=!1),i+=r):i+="[\\s\\S]":i+=r+cf(e,++n);return i}(e),t)),i&&(c.sticky=!0),f.length&&(c.groups=f)),e!==p)try{$l(s,"source",""===p?"(?:)":p)}catch(e){}return s},Ef=Bl(tf),bf=0;Ef.length>bf;)Hl(mf,tf,Ef[bf++]);nf.constructor=mf,mf.prototype=nf,zl(Dl,"RegExp",mf,{constructor:!0})}Ql("RegExp");var wf=h,Of=js,Sf=N,Rf=Ll,If=Pt.get,Af=RegExp.prototype,jf=TypeError;wf&&Of&&Rf(Af,"dotAll",{configurable:!0,get:function(){if(this!==Af){if("RegExp"===Sf(this))return!!If(this).dotAll;throw jf("Incompatible receiver, RegExp required")}}});var xf="\t\n\v\f\r                 \u2028\u2029\ufeff",kf=U,Lf=gs,Tf=xf,_f=k("".replace),Nf=RegExp("^["+Tf+"]+"),Pf=RegExp("(^|[^"+Tf+"])["+Tf+"]+$"),Ff=function(e){return function(r){var t=Lf(kf(r));return 1&e&&(t=_f(t,Nf,"")),2&e&&(t=_f(t,Pf,"$1")),t}},Df={start:Ff(1),end:Ff(2),trim:Ff(3)},Cf=st.PROPER,Mf=p,Gf=xf,$f=function(e){return Mf((function(){return!!Gf[e]()||"​…᠎"!=="​…᠎"[e]()||Cf&&Gf[e].name!==e}))},Bf=Df.trim;ci({target:"String",proto:!0,forced:$f("trim")},{trim:function(){return Bf(this)}});var Uf=k([].slice),Xf=ku,qf=Y,Wf=N,Vf=gs,Hf=k([].push),zf=ci,Yf=re,Kf=rc,Jf=y,Qf=k,Zf=p,ep=Y,rp=be,tp=Uf,np=function(e){if(qf(e))return e;if(Xf(e)){for(var r=e.length,t=[],n=0;n1?arguments[1]:void 0;return Xp?Up(this,e,r)||0:$p(this,e,r)}});var qp=h,Wp=ku,Vp=TypeError,Hp=Object.getOwnPropertyDescriptor,zp=qp&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}()?function(e,r){if(Wp(e)&&!Hp(e,"length").writable)throw Vp("Cannot set read only .length");return e.length=r}:function(e,r){return e.length=r},Yp=TypeError,Kp=function(e){if(e>9007199254740991)throw Yp("Maximum allowed index exceeded");return e},Jp=We,Qp=mn,Zp=zp,eh=Kp;ci({target:"Array",proto:!0,arity:1,forced:p((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var r=Jp(this),t=Qp(r),n=arguments.length;eh(t+n);for(var i=0;i=51||!th((function(){var e=[];return e[ph]=!1,e.concat()[0]!==e})),dh=function(e){if(!ih(e))return!1;var r=e[ph];return void 0!==r?!!r:nh(e)};rh({target:"Array",proto:!0,arity:1,forced:!hh||!lh("concat")},{concat:function(e){var r,t,n,i,o,s=oh(this),c=uh(s,0),a=0;for(r=-1,n=arguments.length;r=r.length)return t&&(t[h]=r),o(null,r);c.lastIndex=u;var e=c.exec(r);return p=l,l+=e[0],f=p+e[1],u=c.lastIndex,v[f]||t&&t[f]===f?process.nextTick(y):t&&Object.prototype.hasOwnProperty.call(t,f)?b(t[f]):i.lstat(f,m)}function m(e,r){if(e)return o(e);if(!r.isSymbolicLink())return v[f]=!0,t&&(t[f]=f),process.nextTick(y);if(!n){var s=r.dev.toString(32)+":"+r.ino.toString(32);if(d.hasOwnProperty(s))return E(null,d[s],f)}i.stat(f,(function(e){if(e)return o(e);i.readlink(f,(function(e,r){n||(d[s]=r),E(e,r)}))}))}function E(r,n,i){if(r)return o(r);var s=e.resolve(p,n);t&&(t[i]=s),b(s)}function b(t){r=e.resolve(t,r.slice(u)),g()}g()},jh}function kh(){if(Ih)return Rh;Ih=1,Rh=a,a.realpath=a,a.sync=u,a.realpathSync=u,a.monkeypatch=function(){e.realpath=a,e.realpathSync=u},a.unmonkeypatch=function(){e.realpath=t,e.realpathSync=n};var e=r,t=e.realpath,n=e.realpathSync,i=process.version,o=/^v[0-5]\./.test(i),s=xh();function c(e){return e&&"realpath"===e.syscall&&("ELOOP"===e.code||"ENOMEM"===e.code||"ENAMETOOLONG"===e.code)}function a(e,r,n){if(o)return t(e,r,n);"function"==typeof r&&(n=r,r=null),t(e,r,(function(t,i){c(t)?s.realpath(e,r,n):n(t,i)}))}function u(e,r){if(o)return n(e,r);try{return n(e,r)}catch(t){if(c(t))return s.realpathSync(e,r);throw t}}return Rh}var Lh=il.filter;ci({target:"Array",proto:!0,forced:!al("filter")},{filter:function(e){return Lh(this,e,arguments.length>1?arguments[1]:void 0)}});var Th,_h,Nh,Ph,Fh,Dh,Ch,Mh,Gh=Xu,$h=Oe,Bh=TypeError,Uh=Gr,Xh=function(e){if(Gh(e))return e;throw Bh($h(e)+" is not a constructor")},qh=G,Wh=ar("species"),Vh=hn,Hh=mn,zh=Op,Yh=Array,Kh=Math.max,Jh=function(e,r,t){for(var n=Hh(e),i=Vh(r,n),o=Vh(void 0===t?n:t,n),s=Yh(Kh(o-i,0)),c=0;i=0&&u>0){for(n=[],o=t.length;l>=0&&!c;)l==a?(n.push(l),a=t.indexOf(e,l+1)):1==n.length?c=[n.pop(),u]:((i=n.pop())=0?a:u;n.length&&(c=[o,s])}return c}return Ph=1,Nh=e,e.range=t,Nh}();Fh=function(e){if(!e)return[];"{}"===e.substr(0,2)&&(e="\\{\\}"+e.substr(2));return d(function(e){return e.split("\\\\").join(t).split("\\{").join(n).split("\\}").join(i).split("\\,").join(o).split("\\.").join(s)}(e),!0).map(a)};var t="\0SLASH"+Math.random()+"\0",n="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",o="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function c(e){return parseInt(e,10)==e?parseInt(e,10):e.charCodeAt(0)}function a(e){return e.split(t).join("\\").split(n).join("{").split(i).join("}").split(o).join(",").split(s).join(".")}function u(e){if(!e)return[""];var t=[],n=r("{","}",e);if(!n)return e.split(",");var i=n.pre,o=n.body,s=n.post,c=i.split(",");c[c.length-1]+="{"+o+"}";var a=u(s);return s.length&&(c[c.length-1]+=a.shift(),c.push.apply(c,a)),t.push.apply(t,c),t}function l(e){return"{"+e+"}"}function f(e){return/^-?0\d/.test(e)}function p(e,r){return e<=r}function h(e,r){return e>=r}function d(t,n){var o=[],s=r("{","}",t);if(!s||/\$$/.test(s.pre))return[t];var a,v=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(s.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(s.body),y=v||g,m=s.body.indexOf(",")>=0;if(!y&&!m)return s.post.match(/,.*\}/)?d(t=s.pre+"{"+s.body+i+s.post):[t];if(y)a=s.body.split(/\.\./);else if(1===(a=u(s.body)).length&&1===(a=d(a[0],!1).map(l)).length)return(w=s.post.length?d(s.post,!1):[""]).map((function(e){return s.pre+a[0]+e}));var E,b=s.pre,w=s.post.length?d(s.post,!1):[""];if(y){var O=c(a[0]),S=c(a[1]),R=Math.max(a[0].length,a[1].length),I=3==a.length?Math.abs(c(a[2])):1,A=p;S0){var T=new Array(L+1).join("0");k=x<0?"-"+T+k.slice(1):T+k}}E.push(k)}}else E=e(a,(function(e){return d(e,!1)}));for(var _=0;_65536)throw new TypeError("pattern is too long")};l.prototype.parse=function(e,t){p(e);var c=this.options;if("**"===e){if(!c.noglobstar)return r;e="*"}if(""===e)return"";var a,u="",l=!!c.nocase,f=!1,d=[],v=[],g=!1,y=-1,m=-1,E="."===e.charAt(0)?"":c.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=this;function w(){if(a){switch(a){case"*":u+=o,l=!0;break;case"?":u+=i,l=!0;break;default:u+="\\"+a}b.debug("clearStateChar %j %j",a,u),a=!1}}for(var O,S=0,R=e.length;S-1;T--){var _=v[T],N=u.slice(0,_.reStart),P=u.slice(_.reStart,_.reEnd-8),F=u.slice(_.reEnd-8,_.reEnd),D=u.slice(_.reEnd);F+=D;var C=N.split("(").length-1,M=D;for(S=0;S=0&&!(i=r[o]);o--);for(o=0;o>> no match, partial?",e,p,t,h),p!==c))}if("string"==typeof l?(u=f===l,this.debug("string match",l,f,u)):(u=f.match(l),this.debug("pattern match",l,f,u)),!u)return!1}if(o===c&&s===a)return!0;if(o===c)return n;if(s===a)return o===c-1&&""===e[o];throw new Error("wtf?")},Ch}rd("split",(function(e,r,t){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,t){var n=ud(od(this)),i=void 0===t?gd:t>>>0;if(0===i)return[];if(void 0===e)return[n];if(!id(e))return Zh(r,n,e,i);for(var o,s,c,a=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=Zh(hd,f,n))&&!((s=f.lastIndex)>l&&(bd(a,wd(n,l,o.index)),o.length>1&&o.index=i));)f.lastIndex===o.index&&f.lastIndex++;return l===n.length?!c&&Ed(f,"")||bd(a,""):bd(a,wd(n,l)),a.length>i?fd(a,0,i):a}:"0".split(void 0,0).length?function(e,t){return void 0===e&&0===t?[]:Zh(r,this,e,t)}:r,[function(r,t){var i=od(this),o=nd(r)?void 0:ld(r,e);return o?Zh(o,r,i,t):Zh(n,ud(i),r,t)},function(e,i){var o=td(this),s=ud(e),c=t(n,o,s,i,n!==r);if(c.done)return c.value;var a=sd(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(vd?"g":"y"),f=new a(vd?"^(?:"+o.source+")":o,l),p=void 0===i?gd:i>>>0;if(0===p)return[];if(0===s.length)return null===pd(f,s)?[s]:[];for(var h=0,d=0,v=[];d0;)e[n]=e[--n];n!==o++&&(e[n]=t)}return e},Md=function(e,r,t,n){for(var i=r.length,o=t.length,s=0,c=0;s3)){if(tv)return!0;if(iv)return iv<603;var e,r,t,n,i="";for(e=65;e<76;e++){switch(r=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:t=3;break;case 68:case 71:t=4;break;default:t=2}for(n=0;n<47;n++)ov.push({k:r+n,v:t})}for(ov.sort((function(e,r){return r.v-e.v})),n=0;nJd(t)?1:-1}}(e)),t=Yd(i),n=0;nu-n+t;o--)xv(a,o-1)}else if(t>n)for(o=u-n;o>l;o--)c=o+t-1,(s=o+n-1)in a?a[c]=a[s]:xv(a,c);for(o=0;oi?(n.splice(0,i),process.nextTick((function(){t.apply(null,o)}))):delete r[e]}}))}(e))})),Pv}function Kv(){if(Cv)return Dv;Cv=1,Dv=m;var e=kh(),r=Id();r.Minimatch;var o=Ld(),s=n.EventEmitter,c=t,a=i,u=Nd(),l=function(){if(dv)return hv;dv=1,hv=p,p.GlobSync=h;var e=kh(),r=Id();r.Minimatch,Kv().Glob;var n=t,o=i,s=Nd(),c=gv(),a=c.setopts,u=c.ownProp,l=c.childrenIgnored,f=c.isIgnored;function p(e,r){if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");return new h(e,r).found}function h(e,r){if(!e)throw new Error("must provide pattern");if("function"==typeof r||3===arguments.length)throw new TypeError("callback provided to sync glob\nSee: https://github.com/isaacs/node-glob/issues/167");if(!(this instanceof h))return new h(e,r);if(a(this,e,r),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var n=0;nthis.maxLength)return!1;if(!this.stat&&u(this.cache,r)){var n=this.cache[r];if(Array.isArray(n)&&(n="DIR"),!t||"DIR"===n)return n;if(t&&"FILE"===n)return!1}var i=this.statCache[r];if(!i){var o;try{o=this.fs.lstatSync(r)}catch(e){if(e&&("ENOENT"===e.code||"ENOTDIR"===e.code))return this.statCache[r]=!1,!1}if(o&&o.isSymbolicLink())try{i=this.fs.statSync(r)}catch(e){i=o}else i=o}return this.statCache[r]=i,n=!0,i&&(n=i.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||n,(!t||"FILE"!==n)&&n},h.prototype._mark=function(e){return c.mark(this,e)},h.prototype._makeAbs=function(e){return c.makeAbs(this,e)},hv}(),f=gv(),p=f.setopts,h=f.ownProp,d=Yv(),v=f.childrenIgnored,g=f.isIgnored,y=zv();function m(e,r,t){if("function"==typeof r&&(t=r,r={}),r||(r={}),r.sync){if(t)throw new TypeError("callback provided to sync glob");return l(e,r)}return new b(e,r,t)}m.sync=l;var E=m.GlobSync=l.GlobSync;function b(e,r,t){if("function"==typeof r&&(t=r,r=null),r&&r.sync){if(t)throw new TypeError("callback provided to sync glob");return new E(e,r)}if(!(this instanceof b))return new b(e,r,t);p(this,e,r),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),"function"==typeof t&&(t=y(t),this.on("error",t),this.on("end",(function(e){t(null,e)})));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(0===n)return c();for(var o=!0,s=0;s1)return!0;for(var i=0;ithis.maxLength)return r();if(!this.stat&&h(this.cache,t)){var i=this.cache[t];if(Array.isArray(i)&&(i="DIR"),!n||"DIR"===i)return r(null,i);if(n&&"FILE"===i)return r()}var o=this.statCache[t];if(void 0!==o){if(!1===o)return r(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&"FILE"===s?r():r(null,s,o)}var c=this,a=d("stat\0"+t,(function(n,i){if(i&&i.isSymbolicLink())return c.fs.stat(t,(function(n,o){n?c._stat2(e,t,null,i,r):c._stat2(e,t,n,o,r)}));c._stat2(e,t,n,i,r)}));a&&c.fs.lstat(t,a)},b.prototype._stat2=function(e,r,t,n,i){if(t&&("ENOENT"===t.code||"ENOTDIR"===t.code))return this.statCache[r]=!1,i();var o="/"===e.slice(-1);if(this.statCache[r]=n,"/"===r.slice(-1)&&n&&!n.isDirectory())return i(null,!1,n);var s=!0;return n&&(s=n.isDirectory()?"DIR":"FILE"),this.cache[r]=this.cache[r]||s,o&&"FILE"===s?i():i(null,s,n)},Dv}function Jv(){if(Mv)return Ah;Mv=1;var t=e,n=r,i=Kv(),o=My(),s=Object.create(o);Ah.extend=Object.assign;var c=Boolean(process.versions.electron),a={fatal:!1,globOptions:{},maxdepth:255,noglob:!1,silent:!1,verbose:!1,execPath:null,bufLength:65536},u={reset:function(){Object.assign(this,a),c||(this.execPath=process.execPath)},resetForTesting:function(){this.reset(),this.silent=!0}};u.reset(),Ah.config=u;var l={error:null,errorCode:0,currentCmd:"shell.js"};function f(e){return"object"==typeof e&&null!==e}function p(){u.silent||console.error.apply(console,arguments)}function h(e){if("string"!=typeof e)throw new TypeError("input must be a string");return e.replace(/\\/g,"/")}function d(e,r,t){if("string"!=typeof e)throw new Error("msg must be a string");var n={continue:!1,code:1,prefix:l.currentCmd+": ",silent:!1};"number"==typeof r&&f(t)?t.code=r:f(r)?t=r:"number"==typeof r?t={code:r}:"number"!=typeof r&&(t={}),t=Object.assign({},n,t),l.errorCode||(l.errorCode=t.code);var i=h(t.prefix+e);if(l.error=l.error?l.error+"\n":"",l.error+=i,u.fatal)throw new Error(i);if(e.length>0&&!t.silent&&p(i),!t.continue)throw{msg:"earlyExit",retValue:new v("",l.error,l.errorCode)}}function v(e,r,t){var n;return e instanceof Array?((n=e).stdout=e.join("\n"),e.length>0&&(n.stdout+="\n")):(n=new String(e)).stdout=e,n.stderr=r,n.code=t,w.forEach((function(e){n[e]=s[e].bind(n)})),n}function g(e,r,t){if("string"!=typeof e&&!f(e))throw new Error("options must be strings or key-value pairs");if(!f(r))throw new Error("parseOptions() internal error: map must be an object");if(t&&!f(t))throw new Error("parseOptions() internal error: errorOptions must be object");if("--"===e)return{};var n={};if(Object.keys(r).forEach((function(e){var t=r[e];"!"!==t[0]&&(n[t]=!1)})),""===e)return n;if("string"==typeof e){if("-"!==e[0])throw new Error("Options string must start with a '-'");e.slice(1).split("").forEach((function(e){if(e in r){var i=r[e];"!"===i[0]?n[i.slice(1)]=!1:n[i]=!0}else d("option not recognized: "+e,t||{})}))}else Object.keys(e).forEach((function(i){var o=i[1];if(o in r){var s=r[o];n[s]=e[i]}else d("option not recognized: "+o,t||{})}));return n}function y(e){if(!Array.isArray(e))throw new TypeError("must be an array");var r=[];return e.forEach((function(e){if("string"!=typeof e)r.push(e);else{var t;try{t=(t=i.sync(e,u.globOptions)).length>0?t:[e]}catch(r){t=[e]}r=r.concat(t)}})),r}Ah.state=l,delete process.env.OLDPWD,Ah.isObject=f,Ah.log=p,Ah.convertErrorOutput=h,Ah.error=d,Ah.ShellString=v,Ah.parseOptions=g,Ah.expand=y;var m="function"==typeof Buffer.alloc?function(e){return Buffer.alloc(e||u.bufLength)}:function(e){return new Buffer(e||u.bufLength)};function E(e,r,n){return n=n||{},function(){var i=null;l.currentCmd=e,l.error=null,l.errorCode=0;try{var o=[].slice.call(arguments,0);if(u.verbose&&console.error.apply(console,[e].concat(o)),l.pipedValue=this&&"string"==typeof this.stdout?this.stdout:"",!1===n.unix)i=r.apply(this,o);else{f(o[0])&&"Object"===o[0].constructor.name||(0===o.length||"string"!=typeof o[0]||o[0].length<=1||"-"!==o[0][0])&&o.unshift(""),o=(o=o.reduce((function(e,r){return Array.isArray(r)?e.concat(r):(e.push(r),e)}),[])).map((function(e){return f(e)&&"String"===e.constructor.name?e.toString():e}));var s=t.homedir();o=o.map((function(e){return"string"==typeof e&&"~/"===e.slice(0,2)||"~"===e?e.replace(/^~/,s):e})),u.noglob||!0!==n.allowGlobbing||(o=o.slice(0,n.globStart).concat(y(o.slice(n.globStart))));try{f(n.cmdOptions)&&(o[0]=g(o[0],n.cmdOptions)),i=r.apply(this,o)}catch(e){if("earlyExit"!==e.msg)throw e;i=e.retValue}}}catch(e){if(!l.error)throw e.name="ShellJSInternalError",e;if(u.fatal)throw e}return n.wrapOutput&&("string"==typeof i||Array.isArray(i))&&(i=new v(i,l.error,l.errorCode)),l.currentCmd="shell.js",i}}Ah.buffer=m,Ah.unlinkSync=function(e){try{n.unlinkSync(e)}catch(r){if("EPERM"!==r.code)throw r;n.chmodSync(e,"0666"),n.unlinkSync(e)}},Ah.statFollowLinks=function(){return n.statSync.apply(n,arguments)},Ah.statNoFollowLinks=function(){return n.lstatSync.apply(n,arguments)},Ah.randomFileName=function(){return"shelljs_"+function e(r){if(1===r)return parseInt(16*Math.random(),10).toString(16);for(var t="",n=0;n0&&"-"===e.charAt(0)?[].unshift.call(arguments,""):n.error("You must specify a file.")),e=n.parseOptions(e,{R:"recursive",c:"changes",v:"verbose"}),t=[].slice.call(arguments,2),e.recursive?(c=[],t.forEach((function e(r){var t=n.statNoFollowLinks(r);t.isSymbolicLink()||(c.push(r),t.isDirectory()&&i.readdirSync(r).forEach((function(t){e(r+"/"+t)})))}))):c=t,c.forEach((function(t){if(t=o.resolve(t),i.existsSync(t)||n.error("File not found: "+t),!e.recursive||!n.statNoFollowLinks(t).isSymbolicLink()){var c=n.statFollowLinks(t),a=c.isDirectory(),u=c.mode,l=u&s.TYPE_MASK,f=u;isNaN(parseInt(r,8))?r.split(",").forEach((function(r){var o=/([ugoa]*)([=\+-])([rwxXst]*)/i.exec(r);if(o){var c=o[1],p=o[2],h=o[3],d=-1!==c.indexOf("u")||"a"===c||""===c,v=-1!==c.indexOf("g")||"a"===c||""===c,g=-1!==c.indexOf("o")||"a"===c||""===c,y=-1!==h.indexOf("r"),m=-1!==h.indexOf("w"),E=-1!==h.indexOf("x"),b=-1!==h.indexOf("X"),w=-1!==h.indexOf("t"),O=-1!==h.indexOf("s");b&&a&&(E=!0);var S=0;switch(d&&(S|=(y?s.OWNER_READ:0)+(m?s.OWNER_WRITE:0)+(E?s.OWNER_EXEC:0)+(O?s.SETUID:0)),v&&(S|=(y?s.GROUP_READ:0)+(m?s.GROUP_WRITE:0)+(E?s.GROUP_EXEC:0)+(O?s.SETGID:0)),g&&(S|=(y?s.OTHER_READ:0)+(m?s.OTHER_WRITE:0)+(E?s.OTHER_EXEC:0)),w&&(S|=s.STICKY),p){case"+":f|=S;break;case"-":f&=~S;break;case"=":f=l+S,n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u);break;default:n.error("Could not recognize operator: `"+p+"`")}e.verbose&&console.log(t+" -> "+f.toString(8)),u!==f&&(!e.verbose&&e.changes&&console.log(t+" -> "+f.toString(8)),i.chmodSync(t,f),u=f)}else n.error("Invalid symbolic mode change: "+r)})):(f=l+parseInt(r,8),n.statFollowLinks(t).isDirectory()&&(f|=s.SETUID+s.SETGID&u),i.chmodSync(t,f))}})),""}return n.register("chmod",c,{}),Xv=c}function rg(){if(Vv)return Wv;Vv=1;var e=r,n=t,i=Jv();function o(r,t,n){e.existsSync(r)||i.error("copyFileSync: no such file or directory: "+r);var o="win32"===process.platform;try{if(n.update&&i.statFollowLinks(r).mtime=i.config.maxdepth)){n++;var u="win32"===process.platform;try{e.mkdirSync(t)}catch(e){if("EEXIST"!==e.code)throw e}for(var l=e.readdirSync(r),f=0;f and/or "):(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]);var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force?new i.ShellString("","",0):(t.forEach((function(a,l){if(!e.existsSync(a))return""===a&&(a="''"),void i.error("no such file or directory: "+a,{continue:!0});var f=i.statFollowLinks(a);if(!r.noFollowsymlink&&f.isDirectory())if(r.recursive){var p=u&&u.isDirectory()?n.join(c,n.basename(a)):c;try{i.statFollowLinks(n.dirname(c)),s(a,p,0,{no_force:r.no_force,followsymlink:r.followsymlink})}catch(e){i.error("cannot create directory '"+c+"': No such file or directory")}}else i.error("omitting directory '"+a+"'",{continue:!0});else{var h=c;u&&u.isDirectory()&&(h=n.normalize(c+"/"+n.basename(a)));var d=e.existsSync(h);if(d&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,l))return void(r.no_force||i.error("will not overwrite just-created '"+h+"' with '"+a+"'",{continue:!0}));if(d&&r.no_force)return;if(""===n.relative(a,h))return void i.error("'"+h+"' and '"+a+"' are the same file",{continue:!0});o(a,h,r)}})),new i.ShellString("",i.state.error,i.state.errorCode))}return i.register("cp",a,{cmdOptions:{f:"!no_force",n:"no_force",u:"update",R:"recursive",r:"recursive",L:"followsymlink",P:"noFollowsymlink"},wrapOutput:!1}),Wv=a}var tg,ng,ig,og,sg,cg={};function ag(){if(tg)return cg;tg=1;var e=Jv(),r=Zv(),n=t;e.register("dirs",l,{wrapOutput:!1}),e.register("pushd",a,{wrapOutput:!1}),e.register("popd",u,{wrapOutput:!1});var i=[];function o(e){return/^[\-+]\d+$/.test(e)}function s(r){if(o(r)){if(Math.abs(r)1))return e.error("no other directory");u=u.splice(1,1).concat(u)}return t["no-cd"]?u=u.slice(1):(a=n.resolve(u.shift()),r("",a)),i=u,l(t.quiet?"-q":"")}function u(t,c){if(o(t)&&(c=t,t=""),t=e.parseOptions(t,{n:"no-cd",q:"quiet"}),!i.length)return e.error("directory stack empty");if(c=s(c||"+0"),t["no-cd"]||c>0||i.length+c===0)c=c>0?c-1:c,i.splice(c,1);else{var a=n.resolve(i.shift());r("",a)}return l(t.quiet?"-q":"")}function l(r,t){if(o(r)&&(t=r,r=""),(r=e.parseOptions(r,{c:"clear",q:"quiet"})).clear)return i=[];var n=c();return t?((t=s(t))<0&&(t=n.length+t),r.quiet||e.log(n[t]),n[t]):(r.quiet||e.log(n.join(" ")),n)}return cg.pushd=a,cg.popd=u,cg.dirs=l,cg}function ug(){if(ig)return ng;ig=1;var e=o.format,r=Jv();function t(t){var n=[].slice.call(arguments,t?0:1),i={};try{i=r.parseOptions(n[0],{e:"escapes",n:"no_newline"},{silent:!0}),n[0]&&n.shift()}catch(e){r.state.error=null}var o=e.apply(null,n);return i.no_newline||(o+="\n"),process.stdout.write(o),o}return r.register("echo",t,{allowGlobbing:!1}),ng=t}function lg(){if(sg)return og;sg=1;var e=Jv();return og=function(){return e.state.error}}var fg,pg={exports:{}};function hg(){return fg||(fg=1,function(e){if(require.main!==e)throw new Error("This file should not be required");var t=s,n=r,i=process.argv[2],o=n.readFileSync(i,"utf8"),c=JSON.parse(o),a=c.command,u=c.execOptions,l=c.pipe,f=c.stdoutFile,p=c.stderrFile,h=t.exec(a,u,(function(e){e?void 0===e.code?process.exitCode=1:process.exitCode=e.code:process.exitCode=0})),d=n.createWriteStream(f),v=n.createWriteStream(p);h.stdout.pipe(d),h.stderr.pipe(v),h.stdout.pipe(process.stdout),h.stderr.pipe(process.stderr),l&&h.stdin.end(l)}(pg)),pg.exports}pg.exports;var dg,vg,gg,yg,mg,Eg,bg,wg,Og,Sg,Rg,Ig,Ag,jg,xg,kg,Lg,Tg,_g,Ng,Pg,Fg={};function Dg(){if(dg)return Fg;dg=1;var t,n=Jv(),i=e,o=r;function s(e){if(!e||!o.existsSync(e))return!1;if(!n.statFollowLinks(e).isDirectory())return!1;var r=e+"/"+n.randomFileName();try{return o.writeFileSync(r," "),n.unlinkSync(r),e}catch(e){return!1}}function c(){return t||(t=s(i.tmpdir())||s(process.env.TMPDIR)||s(process.env.TEMP)||s(process.env.TMP)||s(process.env.Wimp$ScrapDir)||s("C:\\TEMP")||s("C:\\TMP")||s("\\TEMP")||s("\\TMP")||s("/tmp")||s("/var/tmp")||s("/usr/tmp")||s("."))}return n.register("tempdir",c,{allowGlobbing:!1,wrapOutput:!1}),Fg.tempDir=c,Fg.isCached=function(){return t},Fg.clearCache=function(){t=void 0},Fg}function Cg(){if(gg)return vg;gg=1;var e=t;function r(){return e.resolve(process.cwd())}return Jv().register("pwd",r,{allowGlobbing:!1}),vg=r}function Mg(){if(mg)return yg;mg=1;var e=Jv(),n=Dg().tempDir,i=Cg(),o=t,c=r,a=s,u=20971520,l=1;function f(r,t,s){t=t||{},r||e.error("must specify command");var f=e.readFromPipe();return"function"==typeof t&&(s=t,t={async:!0}),"object"==typeof t&&"function"==typeof s&&(t.async=!0),(t=e.extend({silent:e.config.silent,async:!1},t)).async?function(r,t,n,o){t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t);var s=a.exec(r,t,(function(e,r,t){o&&(e?void 0===e.code?o(1,r,t):o(e.code,r,t):o(0,r,t))}));return n&&s.stdin.end(n),t.silent||(s.stdout.pipe(process.stdout),s.stderr.pipe(process.stderr)),s}(r,t,f,s):function(r,t,s){e.config.execPath||e.error("Unable to find a path to the node binary. Please manually set config.execPath");var f=n(),p=o.resolve(f+"/"+e.randomFileName()),h=o.resolve(f+"/"+e.randomFileName()),d=o.resolve(f+"/"+e.randomFileName());t=e.extend({silent:e.config.silent,cwd:i().toString(),env:process.env,maxBuffer:u,encoding:"utf8"},t),c.existsSync(p)&&e.unlinkSync(p),c.existsSync(h)&&e.unlinkSync(h),c.existsSync(d)&&e.unlinkSync(d),t.cwd=o.resolve(t.cwd);var v={command:r,execOptions:t,pipe:s,stdoutFile:d,stderrFile:h};function g(e,r){c.writeFileSync(e,r,{encoding:"utf8",mode:parseInt("600",8)})}g(d,""),g(h,""),g(p,JSON.stringify(v));var y=[o.join(__dirname,"exec-child.js"),p];t.silent?t.stdio="ignore":t.stdio=[0,1,2];var m=0;try{delete t.shell,a.execFileSync(e.config.execPath,y,t)}catch(e){m=e.status||l}var E="",b="";"buffer"===t.encoding?(E=c.readFileSync(d),b=c.readFileSync(h)):(E=c.readFileSync(d,t.encoding),b=c.readFileSync(h,t.encoding));try{e.unlinkSync(p)}catch(e){}try{e.unlinkSync(h)}catch(e){}try{e.unlinkSync(d)}catch(e){}return 0!==m&&e.error(b,m,{continue:!0,silent:!0}),e.ShellString(E,b,m)}(r,t,f)}return e.register("exec",f,{unix:!1,canReceivePipe:!0,wrapOutput:!1}),yg=f}function Gg(){if(bg)return Eg;bg=1;var e=t,n=r,i=Jv(),o=Kv(),s=e.sep+"**";function c(r,t){r.all_deprecated&&(i.log("ls: Option -a is deprecated. Use -A instead"),r.all=!0),t=t?[].slice.call(arguments,1):["."];var c=[];function a(e,t,n){var o,s;"win32"===process.platform&&(t=t.replace(/\\/g,"/")),r.long?(n=n||(r.link?i.statFollowLinks(e):i.statNoFollowLinks(e)),c.push((o=t,(s=n).name=o,s.toString=function(){return[this.mode,this.nlink,this.uid,this.gid,this.size,this.mtime,this.name].join(" ")},s))):c.push(t)}return t.forEach((function(t){var c;try{if((c=r.link?i.statFollowLinks(t):i.statNoFollowLinks(t)).isSymbolicLink())try{var u=i.statFollowLinks(t);u.isDirectory()&&(c=u)}catch(e){}}catch(e){return void i.error("no such file or directory: "+t,2,{continue:!0})}c.isDirectory()&&!r.directory?r.recursive?o.sync(t+s,{dot:r.all,follow:r.link}).forEach((function(r){e.relative(t,r)&&a(r,e.relative(t,r))})):r.all?n.readdirSync(t).forEach((function(r){a(e.join(t,r),r)})):n.readdirSync(t).forEach((function(r){"."!==r[0]&&a(e.join(t,r),r)})):a(t,t,c)})),c}return i.register("ls",c,{cmdOptions:{R:"recursive",A:"all",L:"link",a:"all_deprecated",d:"directory",l:"long"}}),Eg=c}function $g(){if(Og)return wg;Og=1;var e=t,r=Jv(),n=Gg();function i(t,i){i?"string"==typeof i&&(i=[].slice.call(arguments,1)):r.error("no path specified");var o=[];function s(e){"win32"===process.platform&&(e=e.replace(/\\/g,"/")),o.push(e)}return i.forEach((function(t){var i;try{i=r.statFollowLinks(t)}catch(e){r.error("no such file or directory: "+t)}s(t),i.isDirectory()&&n({recursive:!0,all:!0},t).forEach((function(r){s(e.join(t,r))}))})),o}return r.register("find",i,{}),wg=i}function Bg(){if(Rg)return Sg;Rg=1;var e=Jv(),t=r;function n(r,n,i){var o=e.readFromPipe();i||o||e.error("no paths given",2),i=[].slice.call(arguments,2),o&&i.unshift("-");var s=[];return r.ignoreCase&&(n=new RegExp(n,"i")),i.forEach((function(i){if(t.existsSync(i)||"-"===i){var c="-"===i?o:t.readFileSync(i,"utf8");if(r.nameOnly)c.match(n)&&s.push(i);else c.split("\n").forEach((function(e){var t=e.match(n);(r.inverse&&!t||!r.inverse&&t)&&s.push(e)}))}else e.error("no such file or directory: "+i,2,{continue:!0})})),s.join("\n")+"\n"}return e.register("grep",n,{globStart:2,canReceivePipe:!0,cmdOptions:{v:"inverse",l:"nameOnly",i:"ignoreCase"}}),Sg=n}function Ug(){if(Ag)return Ig;Ag=1;var e=Jv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s;s="-"===n?o:r.numLines<0?t.readFileSync(n,"utf8"):function(r,n){for(var i=e.buffer(),o=i.length,s=o,c=0,a=t.openSync(r,"r"),u=0,l="";s===o&&u and/or "),t=String(t);var s=n.normalize(t).replace(RegExp(n.sep+"$"),""),c=n.resolve(t)===s;if(o=n.resolve(process.cwd(),String(o)),e.existsSync(o)&&(r.force||i.error("Destination file exists",{continue:!0}),e.unlinkSync(o)),r.symlink){var a="win32"===process.platform,u=a?"file":null,l=c?s:n.resolve(process.cwd(),n.dirname(o),t);e.existsSync(l)?a&&i.statFollowLinks(l).isDirectory()&&(u="junction"):i.error("Source file does not exist",{continue:!0});try{e.symlinkSync("junction"===u?l:t,o,u)}catch(e){i.error(e.message)}}else{e.existsSync(t)||i.error("Source file does not exist",{continue:!0});try{e.linkSync(t,o)}catch(e){i.error(e.message)}}return""}return i.register("ln",o,{cmdOptions:{s:"symlink",f:"force"}}),jg=o}function qg(){if(Lg)return kg;Lg=1;var e=Jv(),n=r,i=t;function o(r){var t=i.dirname(r);t===r&&e.error("dirname() failed: ["+r+"]"),n.existsSync(t)||o(t),n.mkdirSync(r,parseInt("0777",8))}function s(r,t){return t||e.error("no paths given"),"string"==typeof t&&(t=[].slice.call(arguments,1)),t.forEach((function(t){try{var s=e.statNoFollowLinks(t);return void(r.fullpath?s.isFile()&&e.error("cannot create directory "+t+": File exists",{continue:!0}):e.error("path already exists: "+t,{continue:!0}))}catch(e){}var c=i.dirname(t);if(n.existsSync(c)||r.fullpath)try{r.fullpath?o(i.resolve(t)):n.mkdirSync(t,parseInt("0777",8))}catch(r){var a;if("EACCES"===r.code)a="Permission denied";else{if("ENOTDIR"!==r.code&&"ENOENT"!==r.code)throw r;a="Not a directory"}e.error("cannot create directory "+t+": "+a,{continue:!0})}else e.error("no such file or directory: "+c,{continue:!0})})),""}return e.register("mkdir",s,{cmdOptions:{p:"fullpath"}}),kg=s}function Wg(){if(_g)return Tg;_g=1;var e=Jv(),t=r;function n(r,o,s){var c;c=t.readdirSync(r);for(var a=0;a1e3)throw e}}catch(t){e.error("could not remove directory (code "+t.code+"): "+r,{continue:!0})}return l}}function i(e){var r=!0;try{var n=t.openSync(e,"a");t.closeSync(n)}catch(e){r=!1}return r}function o(r,t){return t||e.error("no paths given"),(t=[].slice.call(arguments,1)).forEach((function(t){var o;try{var s="/"===t[t.length-1]?t.slice(0,-1):t;o=e.statNoFollowLinks(s)}catch(n){return void(r.force||e.error("no such file or directory: "+t,{continue:!0}))}o.isFile()?function(r,t){t.force||i(r)?e.unlinkSync(r):e.error("permission denied: "+r,{continue:!0})}(t,r):o.isDirectory()?function(r,t){t.recursive?n(r,t.force):e.error("path is a directory",{continue:!0})}(t,r):o.isSymbolicLink()?function(r,t){var i;try{i=e.statFollowLinks(r)}catch(t){return void e.unlinkSync(r)}i.isFile()?e.unlinkSync(r):i.isDirectory()&&("/"===r[r.length-1]?t.recursive?n(r,t.force,!0):e.error("path is a directory",{continue:!0}):e.unlinkSync(r))}(t,r):o.isFIFO()&&function(r){e.unlinkSync(r)}(t)})),""}return e.register("rm",o,{cmdOptions:{f:"force",r:"recursive",R:"recursive"}}),Tg=o}function Vg(){if(Pg)return Ng;Pg=1;var e=r,n=t,i=Jv(),o=rg(),s=Wg();function c(r,t,c){arguments.length<3?i.error("missing and/or "):arguments.length>3?(t=[].slice.call(arguments,1,arguments.length-1),c=arguments[arguments.length-1]):"string"==typeof t?t=[t]:i.error("invalid arguments");var a=e.existsSync(c),u=a&&i.statFollowLinks(c);return a&&u.isDirectory()||!(t.length>1)||i.error("dest is not a directory (too many sources)"),a&&u.isFile()&&r.no_force&&i.error("dest file already exists: "+c),t.forEach((function(a,u){if(e.existsSync(a)){var l=c;if(e.existsSync(c)&&i.statFollowLinks(c).isDirectory()&&(l=n.normalize(c+"/"+n.basename(a))),e.existsSync(l)&&function(e,r){var t=e[r];return e.slice(0,r).some((function(e){return n.basename(e)===n.basename(t)}))}(t,u))r.no_force||i.error("will not overwrite just-created '"+l+"' with '"+a+"'",{continue:!0});else if(e.existsSync(l)&&r.no_force)i.error("dest file already exists: "+l,{continue:!0});else if(n.resolve(a)!==n.dirname(n.resolve(l)))try{e.renameSync(a,l)}catch(e){"EXDEV"===e.code&&(o("-r",a,l),s("-rf",a))}else i.error("cannot move to self: "+a,{continue:!0})}else i.error("no such file or directory: "+a,{continue:!0})})),""}return i.register("mv",c,{cmdOptions:{f:"!no_force",n:"no_force"}}),Ng=c}var Hg,zg={};function Yg(){return Hg||(Hg=1),zg}var Kg,Jg,Qg,Zg,ey,ry={};function ty(){return Kg||(Kg=1),ry}function ny(){if(Qg)return Jg;Qg=1;var e=Jv(),t=r;function n(r,n,i,o){var s=e.readFromPipe();"string"!=typeof i&&"function"!=typeof i&&("number"==typeof i?i=i.toString():e.error("invalid replacement string")),"string"==typeof n&&(n=RegExp(n)),o||s||e.error("no files given"),o=[].slice.call(arguments,3),s&&o.unshift("-");var c=[];return o.forEach((function(o){if(t.existsSync(o)||"-"===o){var a=("-"===o?s:t.readFileSync(o,"utf8")).split("\n").map((function(e){return e.replace(n,i)})).join("\n");c.push(a),r.inplace&&t.writeFileSync(o,a,"utf8")}else e.error("no such file or directory: "+o,2,{continue:!0})})),c.join("\n")}return e.register("sed",n,{globStart:3,canReceivePipe:!0,cmdOptions:{i:"inplace"}}),Jg=n}function iy(){if(ey)return Zg;ey=1;var e=Jv();function r(r){if(!r){var t=[].slice.call(arguments,0);t.length<2&&e.error("must provide an argument"),r=t[1]}var n="+"===r[0];n&&(r="-"+r.slice(1)),r=e.parseOptions(r,{e:"fatal",v:"verbose",f:"noglob"}),n&&Object.keys(r).forEach((function(e){r[e]=!r[e]})),Object.keys(r).forEach((function(t){n!==r[t]&&(e.config[t]=r[t])}))}return e.register("set",r,{allowGlobbing:!1,wrapOutput:!1}),Zg=r}var oy=Df.end,sy=$f("trimEnd")?function(){return oy(this)}:"".trimEnd;ci({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==sy},{trimRight:sy});var cy,ay,uy,ly,fy,py,hy,dy,vy,gy,yy,my,Ey,by,wy,Oy,Sy;function Ry(){if(ay)return cy;ay=1;var e=Jv(),t=r;function n(e){var r=e.match(/^\s*(\d*)\s*(.*)$/);return{num:Number(r[1]),value:r[2]}}function i(e,r){var t=e.toLowerCase(),n=r.toLowerCase();return t===n?-1*e.localeCompare(r):t.localeCompare(n)}function o(e,r){var t=n(e),o=n(r);return t.hasOwnProperty("num")&&o.hasOwnProperty("num")&&t.num!==o.num?t.num-o.num:i(t.value,o.value)}function s(r,n){var s=e.readFromPipe();n||s||e.error("no files given"),n=[].slice.call(arguments,1),s&&n.unshift("-");var c=n.reduce((function(r,n){if("-"!==n){if(!t.existsSync(n))return e.error("no such file or directory: "+n,{continue:!0}),r;if(e.statFollowLinks(n).isDirectory())return e.error("read failed: "+n+": Is a directory",{continue:!0}),r}var i="-"===n?s:t.readFileSync(n,"utf8");return r.concat(i.trimRight().split("\n"))}),[]).sort(r.numerical?o:i);return r.reverse&&(c=c.reverse()),c.join("\n")+"\n"}return e.register("sort",s,{canReceivePipe:!0,cmdOptions:{r:"reverse",n:"numerical"}}),cy=s}function Iy(){if(ly)return uy;ly=1;var e=Jv(),t=r;function n(r,n){var i=[],o=e.readFromPipe();n||o||e.error("no paths given");var s=1;!0===r.numLines?(s=2,r.numLines=Number(arguments[1])):!1===r.numLines&&(r.numLines=10),r.numLines=-1*Math.abs(r.numLines),n=[].slice.call(arguments,s),o&&n.unshift("-");var c=!1;return n.forEach((function(n){if("-"!==n){if(!t.existsSync(n))return void e.error("no such file or directory: "+n,{continue:!0});if(e.statFollowLinks(n).isDirectory())return void e.error("error reading '"+n+"': Is a directory",{continue:!0})}var s=("-"===n?o:t.readFileSync(n,"utf8")).split("\n");""===s[s.length-1]?(s.pop(),c=!0):c=!1,i=i.concat(s.slice(r.numLines))})),c&&i.push(""),i.join("\n")}return e.register("tail",n,{canReceivePipe:!0,cmdOptions:{n:"numLines"}}),uy=n}function Ay(){if(py)return fy;py=1;var e=Jv(),t=r;function n(r,n){n||e.error("no path given");var i=!1;if(Object.keys(r).forEach((function(e){!0===r[e]&&(i=!0)})),i||e.error("could not interpret expression"),r.link)try{return e.statNoFollowLinks(n).isSymbolicLink()}catch(e){return!1}if(!t.existsSync(n))return!1;if(r.exists)return!0;var o=e.statFollowLinks(n);return r.block?o.isBlockDevice():r.character?o.isCharacterDevice():r.directory?o.isDirectory():r.file?o.isFile():r.pipe?o.isFIFO():!!r.socket&&o.isSocket()}return e.register("test",n,{cmdOptions:{b:"block",c:"character",d:"directory",e:"exists",f:"file",L:"link",p:"pipe",S:"socket"},wrapOutput:!1,allowGlobbing:!1}),fy=n}function jy(){if(dy)return hy;dy=1;var e=Jv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.writeFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not write to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("to",o,{pipeOnly:!0,wrapOutput:!1}),hy=o}function xy(){if(gy)return vy;gy=1;var e=Jv(),n=r,i=t;function o(r,t){t||e.error("wrong arguments"),n.existsSync(i.dirname(t))||e.error("no such file or directory: "+i.dirname(t));try{return n.appendFileSync(t,this.stdout||this.toString(),"utf8"),this}catch(r){e.error("could not append to file (code "+r.code+"): "+t,{continue:!0})}}return e.register("toEnd",o,{pipeOnly:!0,wrapOutput:!1}),vy=o}function ky(){if(my)return yy;my=1;var e=Jv(),t=r;function n(r,n){return n?"string"==typeof n?n=[].slice.call(arguments,1):e.error("file arg should be a string file path or an Array of string file paths"):e.error("no files given"),n.forEach((function(n){!function(r,n){var o=i(n);if(o&&o.isDirectory())return;if(!o&&r.no_create)return;t.closeSync(t.openSync(n,"a"));var s=new Date,c=r.date||s,a=r.date||s;if(r.reference){var u=i(r.reference);u||e.error("failed to get attributess of "+r.reference),c=u.mtime,a=u.atime}else r.date&&(c=r.date,a=r.date);r.atime_only&&r.mtime_only||(r.atime_only?c=o.mtime:r.mtime_only&&(a=o.atime));t.utimesSync(n,a,c)}(r,n)})),""}function i(r){try{return e.statFollowLinks(r)}catch(e){return null}}return e.register("touch",n,{cmdOptions:{a:"atime_only",c:"no_create",d:"date",m:"mtime_only",r:"reference"}}),yy=n}function Ly(){if(by)return Ey;by=1;var e=Jv(),t=r;function n(r,n,i){var o=e.readFromPipe();o||(n||e.error("no input given"),t.existsSync(n)?e.statFollowLinks(n).isDirectory()&&e.error("error reading '"+n+"'"):e.error(n+": No such file or directory")),i&&t.existsSync(i)&&e.statFollowLinks(i).isDirectory()&&e.error(i+": Is a directory");var s=(n?t.readFileSync(n,"utf8"):o).trimRight().split("\n"),c=s.reduceRight((function(e,t){return 0===e.length?[{count:1,ln:t}]:0===(n=e[0].ln,i=t,r.ignoreCase?n.toLocaleLowerCase().localeCompare(i.toLocaleLowerCase()):n.localeCompare(i))?[{count:e[0].count+1,ln:t}].concat(e.slice(1)):[{count:1,ln:t}].concat(e);var n,i}),[]).filter((function(e){return!r.duplicates||e.count>1})).map((function(e){return(r.count?(t=7,n=e.count,(i=""+n).length0)||r.all);p++){var h=i.resolve(s[p],t);n&&(h=h.toUpperCase());var d=h.match(/\.[^<>:"/\|?*.]+$/);if(d&&f.indexOf(d[0])>=0){if(u(h)){l.push(h);break}}else for(var v=0;v0?r.all?l:l[0]:r.all?[]:null}return wy=l}function _y(){return Sy||(Sy={"/node_modules/shelljs/src/cat.js":Qv,"/node_modules/shelljs/src/cd.js":Zv,"/node_modules/shelljs/src/chmod.js":eg,"/node_modules/shelljs/src/common.js":Jv,"/node_modules/shelljs/src/cp.js":rg,"/node_modules/shelljs/src/dirs.js":ag,"/node_modules/shelljs/src/echo.js":ug,"/node_modules/shelljs/src/error.js":lg,"/node_modules/shelljs/src/exec-child.js":hg,"/node_modules/shelljs/src/exec.js":Mg,"/node_modules/shelljs/src/find.js":$g,"/node_modules/shelljs/src/grep.js":Bg,"/node_modules/shelljs/src/head.js":Ug,"/node_modules/shelljs/src/ln.js":Xg,"/node_modules/shelljs/src/ls.js":Gg,"/node_modules/shelljs/src/mkdir.js":qg,"/node_modules/shelljs/src/mv.js":Vg,"/node_modules/shelljs/src/popd.js":Yg,"/node_modules/shelljs/src/pushd.js":ty,"/node_modules/shelljs/src/pwd.js":Cg,"/node_modules/shelljs/src/rm.js":Wg,"/node_modules/shelljs/src/sed.js":ny,"/node_modules/shelljs/src/set.js":iy,"/node_modules/shelljs/src/sort.js":Ry,"/node_modules/shelljs/src/tail.js":Iy,"/node_modules/shelljs/src/tempdir.js":Dg,"/node_modules/shelljs/src/test.js":Ay,"/node_modules/shelljs/src/to.js":jy,"/node_modules/shelljs/src/toEnd.js":xy,"/node_modules/shelljs/src/touch.js":ky,"/node_modules/shelljs/src/uniq.js":Ly,"/node_modules/shelljs/src/which.js":Ty})}function Ny(e,r){var t,n=function(e){var r=e[0];if("/"===r||"\\"===r)return!1;var t=e[1],n=e[2];return!(!("."!==r||t&&"/"!==t&&"\\"!==t)||!("."!==r||"."!==t||n&&"/"!==n&&"\\"!==n))&&(":"!==t||"/"!==n&&"\\"!==n)}(e);"/"===(e=Py(e))[0]&&(r="");for(var i=_y(),o=["",".js",".json"];!(t=Py(n?r+"/node_modules/"+e:r+"/"+e)).endsWith("/..");){for(var s=0;s0&&".."!==r[n-1]&&"."!==r[n-1]&&(r.splice(--n,2),n--);return e=r.join("/"),t&&"/"!==e[0]?e="/"+e:0===e.length&&(e="."),e}ci({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==sy},{trimEnd:sy});var Fy,Dy={},Cy=["cat","cd","chmod","cp","dirs","echo","exec","find","grep","head","ln","ls","mkdir","mv","pwd","rm","sed","set","sort","tail","tempdir","test","to","toEnd","touch","uniq","which"];function My(){if(Fy)return Dy;Fy=1;var e=Jv();return Cy.forEach((function(e){!function(e){function r(r){var t=Ny(r,e);if(null!==t)return _y()[t]();throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}return r.resolve=function(r){var t=Ny(r,e);return null!==t?t:require.resolve(r)},r}("/node_modules/shelljs")("./src/"+e)})),Dy.exit=process.exit,Dy.error=lg(),Dy.ShellString=e.ShellString,Dy.env=process.env,Dy.config=e.config,Dy}a(Cy);var Gy=My(),$y=Jv();Object.keys(Gy).forEach((function(e){c[e]=Gy[e]}));var By=jy();String.prototype.to=$y.wrap("to",By);var Uy=xy();String.prototype.toEnd=$y.wrap("toEnd",Uy),c.config.fatal=!0,c.target={};var Xy,qy=process.argv.slice(2),Wy=qy.indexOf("--");Wy>-1&&(Xy=qy.slice(Wy+1,qy.length),qy=qy.slice(0,Wy)),setTimeout((function(){var e;if(1!==qy.length||"--help"!==qy[0]){for(e in c.target)!function(e,r){c.target[e]=function(){return r.done||(r.done=!0,r.result=r.apply(r,arguments)),r.result}}(e,c.target[e]);qy.length>0?qy.forEach((function(e){e in c.target?c.target[e](Xy):console.log("no such target: "+e)})):"all"in c.target&&c.target.all(Xy)}else for(e in console.log("Available targets:"),c.target)console.log(" "+e)}),0);var Vy={exports:{}};!function(e,r){var t;r=Vy.exports=y,t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:function(){},r.SEMVER_SPEC_VERSION="2.0.0";var n=256,i=Number.MAX_SAFE_INTEGER||9007199254740991,o=n-6,s=r.re=[],c=r.safeRe=[],a=r.src=[],u=r.tokens={},l=0;function f(e){u[e]=l++}var p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",n],[p,o]];function d(e){for(var r=0;r)?=?)",f("XRANGEIDENTIFIERLOOSE"),a[u.XRANGEIDENTIFIERLOOSE]=a[u.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",f("XRANGEIDENTIFIER"),a[u.XRANGEIDENTIFIER]=a[u.NUMERICIDENTIFIER]+"|x|X|\\*",f("XRANGEPLAIN"),a[u.XRANGEPLAIN]="[v=\\s]*("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:\\.("+a[u.XRANGEIDENTIFIER]+")(?:"+a[u.PRERELEASE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGEPLAINLOOSE"),a[u.XRANGEPLAINLOOSE]="[v=\\s]*("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+a[u.XRANGEIDENTIFIERLOOSE]+")(?:"+a[u.PRERELEASELOOSE]+")?"+a[u.BUILD]+"?)?)?",f("XRANGE"),a[u.XRANGE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAIN]+"$",f("XRANGELOOSE"),a[u.XRANGELOOSE]="^"+a[u.GTLT]+"\\s*"+a[u.XRANGEPLAINLOOSE]+"$",f("COERCE"),a[u.COERCE]="(^|[^\\d])(\\d{1,16})(?:\\.(\\d{1,16}))?(?:\\.(\\d{1,16}))?(?:$|[^\\d])",f("COERCERTL"),s[u.COERCERTL]=new RegExp(a[u.COERCE],"g"),c[u.COERCERTL]=new RegExp(d(a[u.COERCE]),"g"),f("LONETILDE"),a[u.LONETILDE]="(?:~>?)",f("TILDETRIM"),a[u.TILDETRIM]="(\\s*)"+a[u.LONETILDE]+"\\s+",s[u.TILDETRIM]=new RegExp(a[u.TILDETRIM],"g"),c[u.TILDETRIM]=new RegExp(d(a[u.TILDETRIM]),"g");f("TILDE"),a[u.TILDE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAIN]+"$",f("TILDELOOSE"),a[u.TILDELOOSE]="^"+a[u.LONETILDE]+a[u.XRANGEPLAINLOOSE]+"$",f("LONECARET"),a[u.LONECARET]="(?:\\^)",f("CARETTRIM"),a[u.CARETTRIM]="(\\s*)"+a[u.LONECARET]+"\\s+",s[u.CARETTRIM]=new RegExp(a[u.CARETTRIM],"g"),c[u.CARETTRIM]=new RegExp(d(a[u.CARETTRIM]),"g");f("CARET"),a[u.CARET]="^"+a[u.LONECARET]+a[u.XRANGEPLAIN]+"$",f("CARETLOOSE"),a[u.CARETLOOSE]="^"+a[u.LONECARET]+a[u.XRANGEPLAINLOOSE]+"$",f("COMPARATORLOOSE"),a[u.COMPARATORLOOSE]="^"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+")$|^$",f("COMPARATOR"),a[u.COMPARATOR]="^"+a[u.GTLT]+"\\s*("+a[u.FULLPLAIN]+")$|^$",f("COMPARATORTRIM"),a[u.COMPARATORTRIM]="(\\s*)"+a[u.GTLT]+"\\s*("+a[u.LOOSEPLAIN]+"|"+a[u.XRANGEPLAIN]+")",s[u.COMPARATORTRIM]=new RegExp(a[u.COMPARATORTRIM],"g"),c[u.COMPARATORTRIM]=new RegExp(d(a[u.COMPARATORTRIM]),"g");f("HYPHENRANGE"),a[u.HYPHENRANGE]="^\\s*("+a[u.XRANGEPLAIN]+")\\s+-\\s+("+a[u.XRANGEPLAIN]+")\\s*$",f("HYPHENRANGELOOSE"),a[u.HYPHENRANGELOOSE]="^\\s*("+a[u.XRANGEPLAINLOOSE]+")\\s+-\\s+("+a[u.XRANGEPLAINLOOSE]+")\\s*$",f("STAR"),a[u.STAR]="(<|>)?=?\\s*\\*";for(var v=0;vn)return null;if(!(r.loose?c[u.LOOSE]:c[u.FULL]).test(e))return null;try{return new y(e,r)}catch(e){return null}}function y(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof y){if(e.loose===r.loose)return e;e=e.version}else if("string"!=typeof e)throw new TypeError("Invalid Version: "+e);if(e.length>n)throw new TypeError("version is longer than "+n+" characters");if(!(this instanceof y))return new y(e,r);t("SemVer",e,r),this.options=r,this.loose=!!r.loose;var o=e.trim().match(r.loose?c[u.LOOSE]:c[u.FULL]);if(!o)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+o[1],this.minor=+o[2],this.patch=+o[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");o[4]?this.prerelease=o[4].split(".").map((function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}r&&(this.prerelease[0]===r?isNaN(this.prerelease[1])&&(this.prerelease=[r,0]):this.prerelease=[r,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},r.inc=function(e,r,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new y(e,t).inc(r,n).version}catch(e){return null}},r.diff=function(e,r){if(S(e,r))return null;var t=g(e),n=g(r),i="";if(t.prerelease.length||n.prerelease.length){i="pre";var o="prerelease"}for(var s in t)if(("major"===s||"minor"===s||"patch"===s)&&t[s]!==n[s])return i+s;return o},r.compareIdentifiers=E;var m=/^[0-9]+$/;function E(e,r){var t=m.test(e),n=m.test(r);return t&&n&&(e=+e,r=+r),e===r?0:t&&!n?-1:n&&!t?1:e0}function O(e,r,t){return b(e,r,t)<0}function S(e,r,t){return 0===b(e,r,t)}function R(e,r,t){return 0!==b(e,r,t)}function I(e,r,t){return b(e,r,t)>=0}function A(e,r,t){return b(e,r,t)<=0}function j(e,r,t,n){switch(r){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e===t;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof t&&(t=t.version),e!==t;case"":case"=":case"==":return S(e,t,n);case"!=":return R(e,t,n);case">":return w(e,t,n);case">=":return I(e,t,n);case"<":return O(e,t,n);case"<=":return A(e,t,n);default:throw new TypeError("Invalid operator: "+r)}}function x(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof x){if(e.loose===!!r.loose)return e;e=e.value}if(!(this instanceof x))return new x(e,r);e=e.trim().split(/\s+/).join(" "),t("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===k?this.value="":this.value=this.operator+this.semver.version,t("comp",this)}r.rcompareIdentifiers=function(e,r){return E(r,e)},r.major=function(e,r){return new y(e,r).major},r.minor=function(e,r){return new y(e,r).minor},r.patch=function(e,r){return new y(e,r).patch},r.compare=b,r.compareLoose=function(e,r){return b(e,r,!0)},r.compareBuild=function(e,r,t){var n=new y(e,t),i=new y(r,t);return n.compare(i)||n.compareBuild(i)},r.rcompare=function(e,r,t){return b(r,e,t)},r.sort=function(e,t){return e.sort((function(e,n){return r.compareBuild(e,n,t)}))},r.rsort=function(e,t){return e.sort((function(e,n){return r.compareBuild(n,e,t)}))},r.gt=w,r.lt=O,r.eq=S,r.neq=R,r.gte=I,r.lte=A,r.cmp=j,r.Comparator=x;var k={};function L(e,r){if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),e instanceof L)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new L(e.raw,r);if(e instanceof x)return new L(e.value,r);if(!(this instanceof L))return new L(e,r);if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((function(e){return this.parseRange(e.trim())}),this).filter((function(e){return e.length})),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}function T(e,r){for(var t=!0,n=e.slice(),i=n.pop();t&&n.length;)t=n.every((function(e){return i.intersects(e,r)})),i=n.pop();return t}function _(e){return!e||"x"===e.toLowerCase()||"*"===e}function N(e,r,t,n,i,o,s,c,a,u,l,f,p){return((r=_(t)?"":_(n)?">="+t+".0.0":_(i)?">="+t+"."+n+".0":">="+r)+" "+(c=_(a)?"":_(u)?"<"+(+a+1)+".0.0":_(l)?"<"+a+"."+(+u+1)+".0":f?"<="+a+"."+u+"."+l+"-"+f:"<="+c)).trim()}function P(e,r,n){for(var i=0;i0){var o=e[i].semver;if(o.major===r.major&&o.minor===r.minor&&o.patch===r.patch)return!0}return!1}return!0}function F(e,r,t){try{r=new L(r,t)}catch(e){return!1}return r.test(e)}function D(e,r,t,n){var i,o,s,c,a;switch(e=new y(e,n),r=new L(r,n),t){case">":i=w,o=A,s=O,c=">",a=">=";break;case"<":i=O,o=I,s=w,c="<",a="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(F(e,r,n))return!1;for(var u=0;u=0.0.0")),f=f||e,p=p||e,i(e.semver,f.semver,n)?f=e:s(e.semver,p.semver,n)&&(p=e)})),f.operator===c||f.operator===a)return!1;if((!p.operator||p.operator===c)&&o(e,p.semver))return!1;if(p.operator===a&&s(e,p.semver))return!1}return!0}x.prototype.parse=function(e){var r=this.options.loose?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new y(t[2],this.options.loose):this.semver=k},x.prototype.toString=function(){return this.value},x.prototype.test=function(e){if(t("Comparator.test",e,this.options.loose),this.semver===k||e===k)return!0;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}return j(e,this.operator,this.semver,this.options)},x.prototype.intersects=function(e,r){if(!(e instanceof x))throw new TypeError("a Comparator is required");var t;if(r&&"object"==typeof r||(r={loose:!!r,includePrerelease:!1}),""===this.operator)return""===this.value||(t=new L(e.value,r),F(this.value,t,r));if(""===e.operator)return""===e.value||(t=new L(this.value,r),F(e.semver,t,r));var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),i=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),o=this.semver.version===e.semver.version,s=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),c=j(this.semver,"<",e.semver,r)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),a=j(this.semver,">",e.semver,r)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||i||o&&s||c||a},r.Range=L,L.prototype.format=function(){return this.range=this.set.map((function(e){return e.join(" ").trim()})).join("||").trim(),this.range},L.prototype.toString=function(){return this.range},L.prototype.parseRange=function(e){var r=this.options.loose,n=r?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];e=e.replace(n,N),t("hyphen replace",e),e=e.replace(c[u.COMPARATORTRIM],"$1$2$3"),t("comparator trim",e,c[u.COMPARATORTRIM]),e=(e=(e=e.replace(c[u.TILDETRIM],"$1~")).replace(c[u.CARETTRIM],"$1^")).split(/\s+/).join(" ");var i=r?c[u.COMPARATORLOOSE]:c[u.COMPARATOR],o=e.split(" ").map((function(e){return function(e,r){return t("comp",e,r),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){t("caret",e,r);var n=r.loose?c[u.CARETLOOSE]:c[u.CARET];return e.replace(n,(function(r,n,i,o,s){var c;return t("caret",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c="0"===n?">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":">="+n+"."+i+".0 <"+(+n+1)+".0.0":s?(t("replaceCaret pr",s),c="0"===n?"0"===i?">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+"-"+s+" <"+(+n+1)+".0.0"):(t("no pr"),c="0"===n?"0"===i?">="+n+"."+i+"."+o+" <"+n+"."+i+"."+(+o+1):">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0":">="+n+"."+i+"."+o+" <"+(+n+1)+".0.0"),t("caret return",c),c}))}(e,r)})).join(" ")}(e,r),t("caret",e),e=function(e,r){return e.trim().split(/\s+/).map((function(e){return function(e,r){var n=r.loose?c[u.TILDELOOSE]:c[u.TILDE];return e.replace(n,(function(r,n,i,o,s){var c;return t("tilde",e,r,n,i,o,s),_(n)?c="":_(i)?c=">="+n+".0.0 <"+(+n+1)+".0.0":_(o)?c=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0":s?(t("replaceTilde pr",s),c=">="+n+"."+i+"."+o+"-"+s+" <"+n+"."+(+i+1)+".0"):c=">="+n+"."+i+"."+o+" <"+n+"."+(+i+1)+".0",t("tilde return",c),c}))}(e,r)})).join(" ")}(e,r),t("tildes",e),e=function(e,r){return t("replaceXRanges",e,r),e.split(/\s+/).map((function(e){return function(e,r){e=e.trim();var n=r.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return e.replace(n,(function(n,i,o,s,c,a){t("xRange",e,n,i,o,s,c,a);var u=_(o),l=u||_(s),f=l||_(c),p=f;return"="===i&&p&&(i=""),a=r.includePrerelease?"-0":"",u?n=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(l&&(s=0),c=0,">"===i?(i=">=",l?(o=+o+1,s=0,c=0):(s=+s+1,c=0)):"<="===i&&(i="<",l?o=+o+1:s=+s+1),n=i+o+"."+s+"."+c+a):l?n=">="+o+".0.0"+a+" <"+(+o+1)+".0.0"+a:f&&(n=">="+o+"."+s+".0"+a+" <"+o+"."+(+s+1)+".0"+a),t("xRange return",n),n}))}(e,r)})).join(" ")}(e,r),t("xrange",e),e=function(e,r){return t("replaceStars",e,r),e.trim().replace(c[u.STAR],"")}(e,r),t("stars",e),e}(e,this.options)}),this).join(" ").split(/\s+/);return this.options.loose&&(o=o.filter((function(e){return!!e.match(i)}))),o=o.map((function(e){return new x(e,this.options)}),this)},L.prototype.intersects=function(e,r){if(!(e instanceof L))throw new TypeError("a Range is required");return this.set.some((function(t){return T(t,r)&&e.set.some((function(e){return T(e,r)&&t.every((function(t){return e.every((function(e){return t.intersects(e,r)}))}))}))}))},r.toComparators=function(e,r){return new L(e,r).set.map((function(e){return e.map((function(e){return e.value})).join(" ").trim().split(" ")}))},L.prototype.test=function(e){if(!e)return!1;if("string"==typeof e)try{e=new y(e,this.options)}catch(e){return!1}for(var r=0;r":0===r.prerelease.length?r.patch++:r.prerelease.push(0),r.raw=r.format();case"":case">=":t&&!w(t,r)||(t=r);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}}))}if(t&&e.test(t))return t;return null},r.validRange=function(e,r){try{return new L(e,r).range||"*"}catch(e){return null}},r.ltr=function(e,r,t){return D(e,r,"<",t)},r.gtr=function(e,r,t){return D(e,r,">",t)},r.outside=D,r.prerelease=function(e,r){var t=g(e,r);return t&&t.prerelease.length?t.prerelease:null},r.intersects=function(e,r,t){return e=new L(e,t),r=new L(r,t),e.intersects(r)},r.coerce=function(e,r){if(e instanceof y)return e;"number"==typeof e&&(e=String(e));if("string"!=typeof e)return null;var t=null;if((r=r||{}).rtl){for(var n;(n=c[u.COERCERTL].exec(e))&&(!t||t.index+t[0].length!==e.length);)t&&n.index+n[0].length===t.index+t[0].length||(t=n),c[u.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;c[u.COERCERTL].lastIndex=-1}else t=e.match(c[u.COERCE]);if(null===t)return null;return g(t[2]+"."+(t[3]||"0")+"."+(t[4]||"0"),r)}}(0,Vy.exports);var Hy=a(Vy.exports);const zy=global,Yy=new Proxy(global.target,{set:function(e,r,t){return Reflect.set(...arguments)},get:function(e,r,t){return em(`make ${r}`),Reflect.get(...arguments)}}),Ky=["packages","codemods","eslint"],Jy=["eslint","scripts","benchmark",...Ky,"*.{js,cjs,mjs,ts}","--format","codeframe"],Qy=zy.which("yarn").stdout,Zy=process.execPath;function em(...e){console.log.apply(console,e)}function rm(e,r,n,i=!0){em(`${e.replaceAll(Qy,"yarn").replaceAll(Zy,"node")} ${r.join(" ")}`);try{return s.execFileSync(e,r,{stdio:i?"inherit":void 0,cwd:n&&t.resolve(n),env:process.env})}catch(t){throw i&&0!=t.status&&(console.error(new Error(`\ncommand: ${e} ${r.join(" ")}\ncode: ${t.status}`)),process.exit(t.status)),t}}function tm(e,r,t){return rm(Qy,e,r,t)}function nm(e,r,t){return rm(Zy,e,r,t)}function im(e,r){const t=process.env;process.env=Object.assign(Object.assign({},t),r),e(),process.env=t}function om(e,t,n){const i="./build/"+e.toLowerCase();zy.rm("-rf",i),zy.mkdir("-p","build"),rm("git",["clone","--filter=blob:none","--sparse","--single-branch","--shallow-since='2 years ago'",t,i]),rm("git",["sparse-checkout","set",...n],i),rm("git",["checkout","-q",function(e){const t=r.readFileSync("./Makefile","utf8").match(new RegExp(`${e}_COMMIT = (\\w{40})`))[1];if(!t)throw new Error(`Could not find ${e}_COMMIT in Makefile`);return t}(e)],i)}function sm(){const e=JSON.parse(r.readFileSync("./package.json","utf8")).version_babel8;return Ky.forEach((t=>{r.readdirSync(t).forEach((n=>{const i=`${t}/${n}/package.json`;try{const t=JSON.parse(r.readFileSync(i,"utf8"));t.peerDependencies["@babel/core"]=`^${e}`,r.writeFileSync(i,JSON.stringify(t,null,2)+"\n")}catch(e){}}))})),im((()=>tm(["install"])),{YARN_ENABLE_IMMUTABLE_INSTALLS:!1}),e}zy.config.verbose=!0,Yy["clean-all"]=function(){zy.rm("-rf",["node_modules","package-lock.json",".changelog"]),Ky.forEach((e=>{zy.rm("-rf",`${e}/*/test/tmp`),zy.rm("-rf",`${e}/*/package-lock.json`)})),Yy.clean(),Yy["clean-lib"]()},Yy.clean=function(){Yy["test-clean"](),zy.rm("-rf",[".npmrc","coverage","packages/*/npm-debug*","node_modules/.cache"])},Yy["test-clean"]=function(){Ky.forEach((e=>{zy.rm("-rf",`${e}/*/test/tmp`),zy.rm("-rf",`${e}/*/test-fixtures.json`)}))},Yy["clean-lib"]=function(){zy.rm("-rf",Ky.map((e=>`${e}/*/lib`))),nm(["scripts/set-module-type.js"])},Yy["clean-runtime-helpers"]=function(){zy.rm("-rf",["packages/babel-runtime/helpers/**/*.js","packages/babel-runtime-corejs2/helpers/**/*.js","packages/babel-runtime-corejs3/helpers/**/*.js","packages/babel-runtime/helpers/**/*.mjs","packages/babel-runtime-corejs2/helpers/**/*.mjs","packages/babel-runtime-corejs3/helpers/**/*.mjs","packages/babel-runtime-corejs2/core-js"])},Yy["use-cjs"]=function(){nm(["scripts/set-module-type.js","commonjs"]),Yy.bootstrap()},Yy["use-esm"]=function(){nm(["scripts/set-module-type.js","module"]),Yy.bootstrap()},Yy["bootstrap-only"]=function(){Yy["clean-all"](),tm(["install"])},Yy.bootstrap=function(){Yy["bootstrap-only"](),Yy["generate-tsconfig"](),Yy.build()},Yy.build=function(){Yy["build-no-bundle"](),"true"!=process.env.BABEL_COVERAGE&&Yy["build-standalone"]()},Yy["build-standalone"]=function(){tm(["gulp","build-babel-standalone"])},Yy["build-bundle"]=function(){Yy.clean(),Yy["clean-lib"](),nm(["scripts/set-module-type.js"]),tm(["gulp","build"]),Yy["build-dist"]()},Yy["build-no-bundle"]=function(){Yy.clean(),Yy["clean-lib"](),nm(["scripts/set-module-type.js"]),im((()=>{tm(["gulp","build-dev"])}),{BABEL_ENV:"development"}),Yy["build-dist"]()},Yy["build-flow-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index.js.flow",nm(["packages/babel-types/scripts/generators/flow.js"],void 0,!1))},Yy["build-dist"]=function(){Yy["build-plugin-transform-runtime-dist"]()},Yy["build-plugin-transform-runtime-dist"]=function(){nm(["scripts/build-dist.js"],"packages/babel-plugin-transform-runtime")},Yy.prepublish=function(){process.env.BABEL_8_BREAKING?nm(["scripts/set-module-type.js","module"]):nm(["scripts/set-module-type.js","commonjs"]),Yy["bootstrap-only"](),im((()=>{Yy["prepublish-build"](),Yy.test()}),{IS_PUBLISH:"true"}),nm(["scripts/set-module-type.js","clean"])},Yy["prepublish-build"]=function(){Yy["clean-lib"](),Yy["clean-runtime-helpers"](),im((()=>{Yy["build-bundle"]()}),{NODE_ENV:"production",BABEL_ENV:"production",STRIP_BABEL_8_FLAG:"true"}),im((()=>{Yy["prepublish-build-standalone"](),Yy["clone-license"](),Yy["prepublish-prepare-dts"](),Yy["build-flow-typings"]()}),{NODE_ENV:"production",STRIP_BABEL_8_FLAG:"true"})},Yy["prepublish-build-standalone"]=function(){im((()=>{Yy["build-standalone"]()}),{BABEL_ENV:"production",IS_PUBLISH:"true"})},Yy["prepublish-prepare-dts"]=function(){Yy.tscheck(),tm(["gulp","bundle-dts"]),Yy["build-typescript-legacy-typings"]()},Yy.tscheck=function(){Yy["generate-tsconfig"](),zy.rm("-rf","tsconfig.tsbuildinfo"),zy.rm("-rf","dts"),tm(["tsc","-b","."])},Yy["generate-tsconfig"]=function(){nm(["scripts/generators/tsconfig.js"]),nm(["scripts/generators/archived-libs-typings.js"])},Yy["generate-type-helpers"]=function(){tm(["gulp","generate-type-helpers"])},Yy["build-typescript-legacy-typings"]=function(){r.writeFileSync("packages/babel-types/lib/index-legacy.d.ts",nm(["packages/babel-types/scripts/generators/typescript-legacy.js"],void 0,!1))},Yy["clone-license"]=function(){nm(["scripts/clone-license.js"])},Yy.lint=function(){im((()=>{tm(Jy)}),{BABEL_ENV:"test"})},Yy.fix=function(){Yy["fix-json"](),Yy["fix-js"]()},Yy["fix-js"]=function(){tm([...Jy,"--fix"])},Yy["fix-json"]=function(){tm(["prettier",`{${Ky.join(",")}}/*/test/fixtures/**/options.json`,"--write","--loglevel","warn"])},Yy.watch=function(){Yy["build-no-bundle"](),im((()=>{tm(["gulp","watch"])}),{BABEL_ENV:"development",WATCH_SKIP_BUILD:"true"})},Yy.test=function(){Yy.lint(),Yy["test-only"]()},Yy["test-only"]=function(e=[]){tm(["jest",...e])},Yy["test-cov"]=function(){Yy.build(),im((()=>{tm(["c8","jest"])}),{BABEL_ENV:"test",BABEL_COVERAGE:"true"})},Yy["bootstrap-test262"]=function(){om("TEST262","https://github.com/tc39/test262.git",["test","harness"])},Yy["bootstrap-typescript"]=function(){om("TYPESCRIPT","https://github.com/microsoft/TypeScript.git",["tests"])},Yy["bootstrap-flow"]=function(){om("FLOW","https://github.com/facebook/flow.git",["src/parser/test/flow"])},Yy["new-version-checklist"]=function(){console.log("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!! !!!!!!\n!!!!!! Set the minimum required core version in the !!!!!!\n!!!!!! import source transform to the new minor. !!!!!!\n!!!!!! !!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n ".trim()),process.exit(1)},Yy["new-version"]=function(){Yy["new-version-checklist"](),rm("git",["pull","--rebase"]),tm(["release-tool","version","-f","@babel/standalone"])},Yy["new-babel-8-version"]=function(){rm("git",["pull","--rebase"]);const e=JSON.parse(r.readFileSync("./package.json","utf8")),t=Hy.inc(e.version_babel8,"prerelease");return e.version_babel8=t,r.writeFileSync("./package.json",JSON.stringify(e,null,2)+"\n"),rm("git",["add","./package.json"]),rm("git",["commit","-m","Bump Babel 8 version to "+t]),rm("git",["tag",`v${t}`,"-m",`v${t}`]),t},Yy["new-babel-8-version-create-commit-ci"]=function(){tm(["release-tool","version",sm(),"--all","--tag-version-prefix","tmp.v","--yes"])},Yy["new-babel-8-version-create-commit"]=function(){const e=sm();rm("git",["checkout","-b",`release/temp/v${e}`]),tm(["release-tool","version",e,"--all","--tag-version-prefix","tmp.v"]),console.log("Run `BABEL_8_BREAKING=true make publish` to finish publishing")}; diff --git a/Makefile.source.mjs b/Makefile.source.mjs index dcd850d6f160..46399d1f2854 100644 --- a/Makefile.source.mjs +++ b/Makefile.source.mjs @@ -450,14 +450,14 @@ target["bootstrap-flow"] = function () { target["new-version-checklist"] = function () { // eslint-disable-next-line no-constant-condition - if (0) { + if (1) { console.log( ` !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!! !!!!!! -!!!!!! Write any important message here, and change the !!!!!! -!!!!!! if (0) above to if (1) !!!!!! +!!!!!! Set the minimum required core version in the !!!!!! +!!!!!! import source transform to the new minor. !!!!!! !!!!!! !!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/packages/babel-plugin-proposal-import-wasm-source/.npmignore b/packages/babel-plugin-proposal-import-wasm-source/.npmignore new file mode 100644 index 000000000000..f9806945836e --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/.npmignore @@ -0,0 +1,3 @@ +src +test +*.log diff --git a/packages/babel-plugin-proposal-import-wasm-source/README.md b/packages/babel-plugin-proposal-import-wasm-source/README.md new file mode 100644 index 000000000000..54179419a7f4 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-proposal-import-wasm-source + +> Transform source phase imports (`import source ... from '...'`) to work in browsers and Node.js, assuming that the imported source is a WebAssembly module. + +See our website [@babel/plugin-proposal-import-wasm-source](https://babeljs.io/docs/babel-plugin-proposal-import-wasm-source) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-proposal-import-wasm-source +``` + +or using yarn: + +```sh +yarn add @babel/plugin-proposal-import-wasm-source --dev +``` diff --git a/packages/babel-plugin-proposal-import-wasm-source/package.json b/packages/babel-plugin-proposal-import-wasm-source/package.json new file mode 100644 index 000000000000..c86ac411f5ea --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/package.json @@ -0,0 +1,65 @@ +{ + "name": "@babel/plugin-proposal-import-wasm-source", + "version": "7.22.5", + "description": "Transform source phase imports (`import source ... from '...'`) to work in browsers and Node.js, assuming that the imported source is a WebAssembly module.", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-plugin-proposal-import-wasm-source" + }, + "homepage": "https://babel.dev/docs/en/next/babel-plugin-proposal-import-wasm-source", + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "exports": { + ".": "./lib/index.js", + "./package.json": "./package.json" + }, + "keywords": [ + "babel-plugin", + "import", + "source", + "phase", + "wasm", + "WebAssembly", + "assertions", + "proposal", + "stage-3" + ], + "dependencies": { + "@babel/helper-compilation-targets": "workspace:^", + "@babel/helper-module-imports": "workspace:^", + "@babel/helper-plugin-utils": "workspace:^", + "@babel/plugin-syntax-import-source": "workspace:^" + }, + "peerDependencies": { + "@babel/core": "^7.22.0" + }, + "devDependencies": { + "@babel/core": "workspace:^", + "@babel/helper-plugin-test-runner": "workspace:^" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "type": "commonjs", + "conditions": { + "USE_ESM": [ + { + "type": "module" + }, + null + ], + "BABEL_8_BREAKING": [ + { + "engines": { + "node": "^16.20.0 || ^18.16.0 || >=20.0.0" + } + }, + {} + ] + } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/src/index.ts b/packages/babel-plugin-proposal-import-wasm-source/src/index.ts new file mode 100644 index 000000000000..8832ee91a8d9 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/src/index.ts @@ -0,0 +1,322 @@ +import { declare } from "@babel/helper-plugin-utils"; +import type { NodePath } from "@babel/traverse"; +import type { types as t, File } from "@babel/core"; +import { addNamed } from "@babel/helper-module-imports"; +import { isRequired } from "@babel/helper-compilation-targets"; +import syntaxImportSourcePhase from "@babel/plugin-syntax-import-source"; + +// `import.meta.resolve` compat data. +// Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta/resolve#browser_compatibility +// Once Node.js implements `fetch` of local files, we can re-use the web implementation for it +// similarly to how we do for Deno. +const imrCompatData = { + compatData: { + web: { + chrome: "105.0.0", + edge: "105.0.0", + firefox: "106.0.0", + opera: "91.0.0", + safari: "16.4.0", + opera_mobile: "72.0.0", + ios: "16.4.0", + samsung: "20.0", + deno: "1.24.0", + }, + node: { + node: "20.6.0", + }, + }, +}; + +function isEmpty(obj: object) { + return Object.keys(obj).length === 0; +} + +function imp(path: NodePath, name: string, module: string) { + return addNamed(path, name, module, { importedType: "es6" }); +} + +export default declare(api => { + const { types: t, template } = api; + api.assertVersion(7); + + const { node: nodeTarget, ...webTargets } = api.targets(); + const emptyNodeTarget = nodeTarget == null; + const emptyWebTargets = isEmpty(webTargets); + const needsNodeSupport = !emptyNodeTarget || emptyWebTargets; + const needsWebSupport = !emptyWebTargets || emptyNodeTarget; + + const nodeSupportsIMR = + !emptyNodeTarget && + !isRequired("node", { node: nodeTarget }, imrCompatData); + const webSupportsIMR = + !emptyWebTargets && !isRequired("web", webTargets, imrCompatData); + + let helperESM: ReturnType; + let helperCJS: ReturnType; + + const getHelper = (file: File) => { + const modules = file.get("@babel/plugin-transform-modules-*"); + if (modules === "commonjs") { + return (helperCJS ??= buildHelper(true)); + } + if (modules == null) { + return (helperESM ??= buildHelper(false)); + } + throw new Error( + `@babel/plugin-proposal-import-wasm-source can only be used when not ` + + `compiling modules, or when compiling them to CommonJS.`, + ); + }; + + return { + name: "proposal-import-wasm-source", + + inherits: syntaxImportSourcePhase, + + visitor: { + Program(path) { + if (path.node.sourceType !== "module") return; + + const helper = getHelper(this.file); + + // TS reports that 'Assertions require every name in the call target to be + // declared with an explicit type annotation.' if we just call + // t.assertImportDefaultSpecifier, so we _explicitly_ annotate `t` as + // having type `typeof t`. Unfortunately this is a design limitation of + // the TS type checker, so we need to manually help it: + // https://github.com/microsoft/TypeScript/issues/36931 + const t2: typeof t = t; + + const ids: t.Identifier[] = []; + const fetches: t.Expression[] = []; + for (const decl of path.get("body")) { + if (!decl.isImportDeclaration({ phase: "source" })) continue; + + if (decl.node.attributes?.length || decl.node.assertions?.length) { + throw path.buildCodeFrameError( + "`import source` with import attributes cannot be compiled.", + ); + } + + const specifier = decl.node.specifiers[0]; + t2.assertImportDefaultSpecifier(specifier); + + ids.push(specifier.local); + fetches.push(helper.buildFetch(decl.node.source, path)); + decl.remove(); + } + if (ids.length === 0) return; + + const declarators: t.VariableDeclarator[] = []; + if (ids.length === 1) { + let rhs = fetches[0]; + if (helper.needsAwait) rhs = t.awaitExpression(rhs); + declarators.push(t.variableDeclarator(ids[0], rhs)); + } else if (helper.needsAwait) { + declarators.push( + t.variableDeclarator( + t.arrayPattern(ids), + t.awaitExpression( + template.expression.ast` + Promise.all(${t.arrayExpression(fetches)}) + `, + ), + ), + ); + } else { + for (let i = 0; i < ids.length; i++) { + declarators.push(t.variableDeclarator(ids[i], fetches[i])); + } + } + + path.unshiftContainer( + "body", + t.variableDeclaration("const", declarators), + ); + }, + + ImportExpression(path) { + if (path.node.phase !== "source") return; + + if (path.node.options) { + throw path.buildCodeFrameError( + "`import.source` with an options bag cannot be compiled.", + ); + } + + path.replaceWith( + getHelper(this.file).buildFetchAsync(path.node.source, path), + ); + }, + }, + }; + + function buildHelper(toCommonJS: boolean) { + let buildFetchAsync: ( + specifier: t.Expression, + path: NodePath, + ) => t.Expression; + let buildFetchSync: typeof buildFetchAsync; + + // "p" stands for pattern matching :) + const p = ({ + web: w, + node: n, + webIMR: wI = webSupportsIMR, + nodeIMR: nI = nodeSupportsIMR, + toCJS: c = toCommonJS, + }: { + web: boolean; + node: boolean; + webIMR?: boolean; + nodeIMR?: boolean; + toCJS?: boolean; + preferSync?: boolean; + }) => +w + (+n << 1) + (+wI << 2) + (+nI << 3) + (+c << 4); + + const imr = (s: t.Expression) => template.expression.ast` + import.meta.resolve(${s}) + `; + const imrWithFallback = (s: t.Expression) => template.expression.ast` + import.meta.resolve?.(${s}) ?? + new URL(${t.cloneNode(s)}, import.meta.url) + `; + + switch ( + p({ + web: needsWebSupport, + node: needsNodeSupport, + webIMR: webSupportsIMR, + nodeIMR: nodeSupportsIMR, + toCJS: toCommonJS, + }) + ) { + case p({ web: true, node: true }): + buildFetchAsync = specifier => { + const web = template.expression.ast` + WebAssembly.compileStreaming(fetch( + ${(webSupportsIMR ? imr : imrWithFallback)( + t.cloneNode(specifier), + )} + )) + `; + const node = nodeSupportsIMR + ? template.expression.ast` + import("fs") + .then(fs => fs.promises.readFile(new URL(${imr(specifier)}))) + .then(WebAssembly.compile) + ` + : template.expression.ast` + Promise.all([import("fs"), import("module")]) + .then(([fs, module]) => + fs.promises.readFile( + module.createRequire(import.meta.url) + .resolve(${specifier}) + ) + ) + .then(WebAssembly.compile) + `; + return template.expression.ast` + typeof process === "object" && process.versions?.node + ? ${node} + : ${web} + `; + }; + break; + case p({ web: true, node: true, webIMR: false, nodeIMR: true }): + buildFetchAsync = specifier => template.expression.ast` + typeof process === "object" && process.versions?.node + ? import("fs").then(fs => + new WebAssembly.Module(fs.readFileSync( + new URL(${imr(specifier)}) + )) + ) + : WebAssembly.compileStreaming(fetch(${imrWithFallback(specifier)})) + `; + break; + case p({ web: true, node: false, webIMR: true }): + buildFetchAsync = specifier => template.expression.ast` + WebAssembly.compileStreaming(fetch(${imr(specifier)})) + `; + break; + case p({ web: true, node: false, webIMR: false }): + buildFetchAsync = specifier => template.expression.ast` + WebAssembly.compileStreaming(fetch(${imrWithFallback(specifier)})) + `; + break; + case p({ web: false, node: true, toCJS: true }): + buildFetchSync = specifier => template.expression.ast` + new WebAssembly.Module( + require("fs").readFileSync( + require.resolve(${specifier}) + ) + ) + `; + buildFetchAsync = specifier => template.expression.ast` + require("fs").promises.readFile(require.resolve(${specifier})) + .then(WebAssembly.compile) + `; + break; + case p({ web: false, node: true, toCJS: false, nodeIMR: true }): + buildFetchSync = (specifier, path) => template.expression.ast` + new WebAssembly.Module( + ${imp(path, "readFileSync", "fs")}( + new URL(${imr(specifier)}) + ) + ) + `; + buildFetchAsync = (specifier, path) => template.expression.ast` + ${imp(path, "promises", "fs")} + .readFile(new URL(${imr(specifier)})) + .then(WebAssembly.compile) + `; + break; + case p({ web: false, node: true, toCJS: false, nodeIMR: false }): + buildFetchSync = (specifier, path) => template.expression.ast` + new WebAssembly.Module( + ${imp(path, "readFileSync", "fs")}( + ${imp(path, "createRequire", "module")}(import.meta.url) + .resolve(${specifier}) + ) + ) + `; + buildFetchAsync = (specifier, path) => template.expression.ast` + ${imp(path, "promises", "fs")} + .readFile( + ${imp(path, "createRequire", "module")}(import.meta.url) + .resolve(${specifier}) + ) + .then(WebAssembly.compile) + `; + break; + default: + throw new Error("Internal Babel error: unreachable code."); + } + + buildFetchAsync ??= buildFetchSync; + const buildFetchAsyncWrapped: typeof buildFetchAsync = ( + expression, + path, + ) => { + if (t.isStringLiteral(expression)) { + return template.expression.ast` + Promise.resolve().then(() => ${buildFetchAsync(expression, path)}) + `; + } else { + return template.expression.ast` + Promise.resolve(\`\${${expression}}\`).then((s) => ${buildFetchAsync( + t.identifier("s"), + path, + )}) + `; + } + }; + + return { + buildFetch: buildFetchSync || buildFetchAsync, + buildFetchAsync: buildFetchAsyncWrapped, + needsAwait: !buildFetchSync, + }; + } +}); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/options.json new file mode 100644 index 000000000000..c5386c4deff1 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "targets": [], + "plugins": ["proposal-import-wasm-source"] +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/output.mjs new file mode 100644 index 000000000000..e527dbb1f349 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-empty-targets/output.mjs @@ -0,0 +1 @@ +const s = await (typeof process === "object" && process.versions?.node ? Promise.all([import("fs"), import("module")]).then(([fs, module]) => fs.promises.readFile(module.createRequire(import.meta.url).resolve("./x.wasm"))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve?.("./x.wasm") ?? new URL("./x.wasm", import.meta.url)))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-multiple/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-multiple/input.js new file mode 100644 index 000000000000..6c4286ac051f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-multiple/input.js @@ -0,0 +1,3 @@ +import source s from "./x.wasm"; +someBody; +import source s2 from "./x2.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-multiple/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-multiple/output.mjs new file mode 100644 index 000000000000..96a8ecc58c5c --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration-multiple/output.mjs @@ -0,0 +1,2 @@ +const [s, s2] = await Promise.all([typeof process === "object" && process.versions?.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve("./x.wasm")))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm"))), typeof process === "object" && process.versions?.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve("./x2.wasm")))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve("./x2.wasm")))]); +someBody; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration/output.mjs new file mode 100644 index 000000000000..da09594aeeb5 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-declaration/output.mjs @@ -0,0 +1 @@ +const s = await (typeof process === "object" && process.versions?.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve("./x.wasm")))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm")))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/input.js new file mode 100644 index 000000000000..ee52404d34ca --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/input.js @@ -0,0 +1 @@ +let promise = import.source(getSpecifier()); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/output.mjs new file mode 100644 index 000000000000..bc7fe6d1d3f8 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression-dynamic-specifier/output.mjs @@ -0,0 +1 @@ +let promise = Promise.resolve(`${getSpecifier()}`).then(s => typeof process === "object" && process.versions?.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve(s)))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve(s)))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression/input.js new file mode 100644 index 000000000000..510a937e7f53 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression/input.js @@ -0,0 +1 @@ +let promise = import.source("./x.wasm"); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression/output.mjs new file mode 100644 index 000000000000..630a42c01476 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-expression/output.mjs @@ -0,0 +1 @@ +let promise = Promise.resolve().then(() => typeof process === "object" && process.versions?.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve("./x.wasm")))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm")))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/options.json new file mode 100644 index 000000000000..2366608f71b5 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/options.json @@ -0,0 +1,3 @@ +{ + "targets": { "firefox": "90", "node": "20.0" } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/output.mjs new file mode 100644 index 000000000000..e527dbb1f349 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-both/output.mjs @@ -0,0 +1 @@ +const s = await (typeof process === "object" && process.versions?.node ? Promise.all([import("fs"), import("module")]).then(([fs, module]) => fs.promises.readFile(module.createRequire(import.meta.url).resolve("./x.wasm"))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve?.("./x.wasm") ?? new URL("./x.wasm", import.meta.url)))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/options.json new file mode 100644 index 000000000000..2e01a8315e66 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/options.json @@ -0,0 +1,3 @@ +{ + "targets": { "firefox": "90", "node": "20.6" } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/output.mjs new file mode 100644 index 000000000000..12b37b5a8e6e --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-browser/output.mjs @@ -0,0 +1 @@ +const s = await (typeof process === "object" && process.versions?.node ? import("fs").then(fs => fs.promises.readFile(new URL(import.meta.resolve("./x.wasm")))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve?.("./x.wasm") ?? new URL("./x.wasm", import.meta.url)))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/options.json new file mode 100644 index 000000000000..bcb41000de6b --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/options.json @@ -0,0 +1,3 @@ +{ + "targets": { "firefox": "110", "node": "20.0" } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/output.mjs new file mode 100644 index 000000000000..3c397cb9b053 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/import-meta-resolve-fallback-for-node/output.mjs @@ -0,0 +1 @@ +const s = await (typeof process === "object" && process.versions?.node ? Promise.all([import("fs"), import("module")]).then(([fs, module]) => fs.promises.readFile(module.createRequire(import.meta.url).resolve("./x.wasm"))).then(WebAssembly.compile) : WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm")))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/options.json new file mode 100644 index 000000000000..25ca931e5586 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser-and-node-esm/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "targets": { "firefox": "110", "node": "20.6" }, + "plugins": ["proposal-import-wasm-source"] +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration-multiple/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration-multiple/input.js new file mode 100644 index 000000000000..6c4286ac051f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration-multiple/input.js @@ -0,0 +1,3 @@ +import source s from "./x.wasm"; +someBody; +import source s2 from "./x2.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration-multiple/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration-multiple/output.mjs new file mode 100644 index 000000000000..facc8777b48b --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration-multiple/output.mjs @@ -0,0 +1,2 @@ +const [s, s2] = await Promise.all([WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm"))), WebAssembly.compileStreaming(fetch(import.meta.resolve("./x2.wasm")))]); +someBody; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration/output.mjs new file mode 100644 index 000000000000..a2983429f09a --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-declaration/output.mjs @@ -0,0 +1 @@ +const s = await WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm"))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/input.js new file mode 100644 index 000000000000..ee52404d34ca --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/input.js @@ -0,0 +1 @@ +let promise = import.source(getSpecifier()); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/output.mjs new file mode 100644 index 000000000000..5b88d5969c7e --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression-dynamic-specifier/output.mjs @@ -0,0 +1 @@ +let promise = Promise.resolve(`${getSpecifier()}`).then(s => WebAssembly.compileStreaming(fetch(import.meta.resolve(s)))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression/input.js new file mode 100644 index 000000000000..510a937e7f53 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression/input.js @@ -0,0 +1 @@ +let promise = import.source("./x.wasm"); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression/output.mjs new file mode 100644 index 000000000000..0cc78268bfbf --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-expression/output.mjs @@ -0,0 +1 @@ +let promise = Promise.resolve().then(() => WebAssembly.compileStreaming(fetch(import.meta.resolve("./x.wasm")))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/options.json new file mode 100644 index 000000000000..82d13dd327a4 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/options.json @@ -0,0 +1,3 @@ +{ + "targets": { "firefox": "90" } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/output.mjs new file mode 100644 index 000000000000..70b36dfc3a24 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/import-meta-resolve-fallback/output.mjs @@ -0,0 +1 @@ +const s = await WebAssembly.compileStreaming(fetch(import.meta.resolve?.("./x.wasm") ?? new URL("./x.wasm", import.meta.url))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/options.json new file mode 100644 index 000000000000..bf24000a7f29 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/browser/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "targets": { "firefox": "110" }, + "plugins": ["proposal-import-wasm-source"] +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-assertions/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-assertions/input.js new file mode 100644 index 000000000000..437b053e6bf1 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-assertions/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm" assert { some: "attr" }; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-assertions/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-assertions/options.json new file mode 100644 index 000000000000..7158df3ed88e --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-assertions/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "plugins": ["proposal-import-wasm-source", "syntax-import-assertions"], + "throws": "`import source` with import attributes cannot be compiled." +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-attributes/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-attributes/input.js new file mode 100644 index 000000000000..e551a2171a3e --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-attributes/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm" with { some: "attr" }; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-attributes/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-attributes/options.json new file mode 100644 index 000000000000..f2050f9e154f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-declaration-with-attributes/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "plugins": ["proposal-import-wasm-source", "syntax-import-attributes"], + "throws": "`import source` with import attributes cannot be compiled." +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-expression-with-options/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-expression-with-options/input.js new file mode 100644 index 000000000000..0e9335497a42 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-expression-with-options/input.js @@ -0,0 +1 @@ +let promise = import.source("./x.wasm", { with: { some: "attr" }}); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-expression-with-options/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-expression-with-options/options.json new file mode 100644 index 000000000000..d308b8e9919f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/errors/import-expression-with-options/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "plugins": ["proposal-import-wasm-source", "syntax-import-attributes"], + "throws": "`import.source` with an options bag cannot be compiled." +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration-multiple/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration-multiple/input.js new file mode 100644 index 000000000000..6c4286ac051f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration-multiple/input.js @@ -0,0 +1,3 @@ +import source s from "./x.wasm"; +someBody; +import source s2 from "./x2.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration-multiple/output.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration-multiple/output.js new file mode 100644 index 000000000000..44464f8f0b31 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration-multiple/output.js @@ -0,0 +1,5 @@ +"use strict"; + +const s = new WebAssembly.Module(require("fs").readFileSync(require.resolve("./x.wasm"))), + s2 = new WebAssembly.Module(require("fs").readFileSync(require.resolve("./x2.wasm"))); +someBody; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration/output.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration/output.js new file mode 100644 index 000000000000..09104427c1d2 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-declaration/output.js @@ -0,0 +1,3 @@ +"use strict"; + +const s = new WebAssembly.Module(require("fs").readFileSync(require.resolve("./x.wasm"))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/input.js new file mode 100644 index 000000000000..ee52404d34ca --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/input.js @@ -0,0 +1 @@ +let promise = import.source(getSpecifier()); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/output.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/output.js new file mode 100644 index 000000000000..566c817c9b15 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression-dynamic-specifier/output.js @@ -0,0 +1,3 @@ +"use strict"; + +let promise = Promise.resolve(`${getSpecifier()}`).then(s => require("fs").promises.readFile(require.resolve(s)).then(WebAssembly.compile)); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression/input.js new file mode 100644 index 000000000000..510a937e7f53 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression/input.js @@ -0,0 +1 @@ +let promise = import.source("./x.wasm"); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression/output.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression/output.js new file mode 100644 index 000000000000..a9da73015776 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-expression/output.js @@ -0,0 +1,3 @@ +"use strict"; + +let promise = Promise.resolve().then(() => require("fs").promises.readFile(require.resolve("./x.wasm")).then(WebAssembly.compile)); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/options.json new file mode 100644 index 000000000000..053554c04350 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/options.json @@ -0,0 +1,3 @@ +{ + "targets": { "node": "20.0" } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/output.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/output.js new file mode 100644 index 000000000000..09104427c1d2 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/import-meta-resolve-fallback/output.js @@ -0,0 +1,3 @@ +"use strict"; + +const s = new WebAssembly.Module(require("fs").readFileSync(require.resolve("./x.wasm"))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/options.json new file mode 100644 index 000000000000..c8a5808ffca0 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-cjs/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "targets": { "node": "20.6" }, + "plugins": ["proposal-import-wasm-source", "transform-modules-commonjs"] +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/input.js new file mode 100644 index 000000000000..6c4286ac051f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/input.js @@ -0,0 +1,3 @@ +import source s from "./x.wasm"; +someBody; +import source s2 from "./x2.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/output.mjs new file mode 100644 index 000000000000..dd94ae42dbc0 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration-multiple/output.mjs @@ -0,0 +1,5 @@ +import { readFileSync as _readFileSync2 } from "fs"; +import { readFileSync as _readFileSync } from "fs"; +const s = new WebAssembly.Module(_readFileSync(new URL(import.meta.resolve("./x.wasm")))), + s2 = new WebAssembly.Module(_readFileSync2(new URL(import.meta.resolve("./x2.wasm")))); +someBody; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration/output.mjs new file mode 100644 index 000000000000..279348b8a39b --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-declaration/output.mjs @@ -0,0 +1,2 @@ +import { readFileSync as _readFileSync } from "fs"; +const s = new WebAssembly.Module(_readFileSync(new URL(import.meta.resolve("./x.wasm")))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/input.js new file mode 100644 index 000000000000..ee52404d34ca --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/input.js @@ -0,0 +1 @@ +let promise = import.source(getSpecifier()); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/output.mjs new file mode 100644 index 000000000000..012c1d1ff02f --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression-dynamic-specifier/output.mjs @@ -0,0 +1,2 @@ +import { promises as _promises } from "fs"; +let promise = Promise.resolve(`${getSpecifier()}`).then(s => _promises.readFile(new URL(import.meta.resolve(s))).then(WebAssembly.compile)); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression/input.js new file mode 100644 index 000000000000..510a937e7f53 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression/input.js @@ -0,0 +1 @@ +let promise = import.source("./x.wasm"); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression/output.mjs new file mode 100644 index 000000000000..500ab30a8397 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-expression/output.mjs @@ -0,0 +1,2 @@ +import { promises as _promises } from "fs"; +let promise = Promise.resolve().then(() => _promises.readFile(new URL(import.meta.resolve("./x.wasm"))).then(WebAssembly.compile)); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/input.js b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/input.js new file mode 100644 index 000000000000..d7d6128783e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/input.js @@ -0,0 +1 @@ +import source s from "./x.wasm"; diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/options.json new file mode 100644 index 000000000000..053554c04350 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/options.json @@ -0,0 +1,3 @@ +{ + "targets": { "node": "20.0" } +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/output.mjs b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/output.mjs new file mode 100644 index 000000000000..6f0fd5f4fbbb --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/import-meta-resolve-fallback/output.mjs @@ -0,0 +1,3 @@ +import { createRequire as _createRequire } from "module"; +import { readFileSync as _readFileSync } from "fs"; +const s = new WebAssembly.Module(_readFileSync(_createRequire(import.meta.url).resolve("./x.wasm"))); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/options.json b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/options.json new file mode 100644 index 000000000000..fd9fdb610859 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/fixtures/node-esm/options.json @@ -0,0 +1,5 @@ +{ + "sourceType": "module", + "targets": { "node": "20.6" }, + "plugins": ["proposal-import-wasm-source"] +} diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/index.js b/packages/babel-plugin-proposal-import-wasm-source/test/index.js new file mode 100644 index 000000000000..21a55ce6b5e7 --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/index.js @@ -0,0 +1,3 @@ +import runner from "@babel/helper-plugin-test-runner"; + +runner(import.meta.url); diff --git a/packages/babel-plugin-proposal-import-wasm-source/test/package.json b/packages/babel-plugin-proposal-import-wasm-source/test/package.json new file mode 100644 index 000000000000..5ffd9800b97c --- /dev/null +++ b/packages/babel-plugin-proposal-import-wasm-source/test/package.json @@ -0,0 +1 @@ +{ "type": "module" } diff --git a/packages/babel-plugin-syntax-import-source/.npmignore b/packages/babel-plugin-syntax-import-source/.npmignore new file mode 100644 index 000000000000..281df3934ba3 --- /dev/null +++ b/packages/babel-plugin-syntax-import-source/.npmignore @@ -0,0 +1,2 @@ +src +test diff --git a/packages/babel-plugin-syntax-import-source/README.md b/packages/babel-plugin-syntax-import-source/README.md new file mode 100644 index 000000000000..0dfacaba46dd --- /dev/null +++ b/packages/babel-plugin-syntax-import-source/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-syntax-import-source + +> Allow parsing of the `import source` proposal. + +See our website [@babel/plugin-syntax-import-source](https://babeljs.io/docs/babel-plugin-syntax-import-source) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-syntax-import-source +``` + +or using yarn: + +```sh +yarn add @babel/plugin-syntax-import-source --dev +``` diff --git a/packages/babel-plugin-syntax-import-source/package.json b/packages/babel-plugin-syntax-import-source/package.json new file mode 100644 index 000000000000..2e0d2da6aba0 --- /dev/null +++ b/packages/babel-plugin-syntax-import-source/package.json @@ -0,0 +1,52 @@ +{ + "name": "@babel/plugin-syntax-import-source", + "version": "7.22.5", + "description": "Allow parsing of the `import source` proposal.", + "repository": { + "type": "git", + "url": "https://github.com/babel/babel.git", + "directory": "packages/babel-plugin-syntax-import-source" + }, + "license": "MIT", + "publishConfig": { + "access": "public" + }, + "main": "./lib/index.js", + "keywords": [ + "babel-plugin" + ], + "dependencies": { + "@babel/helper-plugin-utils": "workspace:^" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + }, + "devDependencies": { + "@babel/core": "workspace:^" + }, + "engines": { + "node": ">=6.9.0" + }, + "author": "The Babel Team (https://babel.dev/team)", + "conditions": { + "USE_ESM": [ + { + "type": "module" + }, + null + ], + "BABEL_8_BREAKING": [ + { + "engines": { + "node": "^16.20.0 || ^18.16.0 || >=20.0.0" + } + }, + {} + ] + }, + "exports": { + ".": "./lib/index.js", + "./package.json": "./package.json" + }, + "type": "commonjs" +} diff --git a/packages/babel-plugin-syntax-import-source/src/index.ts b/packages/babel-plugin-syntax-import-source/src/index.ts new file mode 100644 index 000000000000..a08312c61d51 --- /dev/null +++ b/packages/babel-plugin-syntax-import-source/src/index.ts @@ -0,0 +1,13 @@ +import { declare } from "@babel/helper-plugin-utils"; +export default declare(api => { + api.assertVersion("^7.22.0"); + + return { + name: "syntax-import-source", + + manipulateOptions({ parserOpts }) { + parserOpts.plugins.push("sourcePhaseImports"); + parserOpts.createImportExpressions = true; + }, + }; +}); diff --git a/tsconfig.json b/tsconfig.json index 9145aa192015..b18426559802 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -52,6 +52,7 @@ "./packages/babel-plugin-proposal-function-sent/src/**/*.ts", "./packages/babel-plugin-proposal-import-attributes-to-assertions/src/**/*.ts", "./packages/babel-plugin-proposal-import-defer/src/**/*.ts", + "./packages/babel-plugin-proposal-import-wasm-source/src/**/*.ts", "./packages/babel-plugin-proposal-partial-application/src/**/*.ts", "./packages/babel-plugin-proposal-pipeline-operator/src/**/*.ts", "./packages/babel-plugin-proposal-record-and-tuple/src/**/*.ts", @@ -71,6 +72,7 @@ "./packages/babel-plugin-syntax-import-attributes/src/**/*.ts", "./packages/babel-plugin-syntax-import-defer/src/**/*.ts", "./packages/babel-plugin-syntax-import-reflection/src/**/*.ts", + "./packages/babel-plugin-syntax-import-source/src/**/*.ts", "./packages/babel-plugin-syntax-jsx/src/**/*.ts", "./packages/babel-plugin-syntax-module-blocks/src/**/*.ts", "./packages/babel-plugin-syntax-partial-application/src/**/*.ts", @@ -328,6 +330,9 @@ "@babel/plugin-proposal-import-defer": [ "./packages/babel-plugin-proposal-import-defer/src" ], + "@babel/plugin-proposal-import-wasm-source": [ + "./packages/babel-plugin-proposal-import-wasm-source/src" + ], "@babel/plugin-proposal-partial-application": [ "./packages/babel-plugin-proposal-partial-application/src" ], @@ -385,6 +390,9 @@ "@babel/plugin-syntax-import-reflection": [ "./packages/babel-plugin-syntax-import-reflection/src" ], + "@babel/plugin-syntax-import-source": [ + "./packages/babel-plugin-syntax-import-source/src" + ], "@babel/plugin-syntax-jsx": [ "./packages/babel-plugin-syntax-jsx/src" ], diff --git a/yarn.lock b/yarn.lock index 608c5c9224bc..e8d46fe816b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1576,6 +1576,21 @@ __metadata: languageName: unknown linkType: soft +"@babel/plugin-proposal-import-wasm-source@workspace:packages/babel-plugin-proposal-import-wasm-source": + version: 0.0.0-use.local + resolution: "@babel/plugin-proposal-import-wasm-source@workspace:packages/babel-plugin-proposal-import-wasm-source" + dependencies: + "@babel/core": "workspace:^" + "@babel/helper-compilation-targets": "workspace:^" + "@babel/helper-module-imports": "workspace:^" + "@babel/helper-plugin-test-runner": "workspace:^" + "@babel/helper-plugin-utils": "workspace:^" + "@babel/plugin-syntax-import-source": "workspace:^" + peerDependencies: + "@babel/core": ^7.22.0 + languageName: unknown + linkType: soft + "@babel/plugin-proposal-partial-application@workspace:packages/babel-plugin-proposal-partial-application": version: 0.0.0-use.local resolution: "@babel/plugin-proposal-partial-application@workspace:packages/babel-plugin-proposal-partial-application" @@ -1967,6 +1982,17 @@ __metadata: languageName: unknown linkType: soft +"@babel/plugin-syntax-import-source@workspace:^, @babel/plugin-syntax-import-source@workspace:packages/babel-plugin-syntax-import-source": + version: 0.0.0-use.local + resolution: "@babel/plugin-syntax-import-source@workspace:packages/babel-plugin-syntax-import-source" + dependencies: + "@babel/core": "workspace:^" + "@babel/helper-plugin-utils": "workspace:^" + peerDependencies: + "@babel/core": ^7.0.0-0 + languageName: unknown + linkType: soft + "@babel/plugin-syntax-json-strings-BABEL_8_BREAKING-false@npm:@babel/plugin-syntax-json-strings@^7.8.3, @babel/plugin-syntax-json-strings@npm:^7.8.3": version: 7.8.3 resolution: "@babel/plugin-syntax-json-strings@npm:7.8.3"