@chromatic-com/playwright 0.6.0 → 0.6.1-ea4e596-20240223213449

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,22 +3,22 @@
3
3
 
4
4
  var child_process = require('child_process');
5
5
  var ft = require('path');
6
- var Ot = require('fs');
6
+ var xt = require('fs');
7
7
  var promises = require('fs/promises');
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
10
10
 
11
11
  var ft__default = /*#__PURE__*/_interopDefault(ft);
12
- var Ot__default = /*#__PURE__*/_interopDefault(Ot);
12
+ var xt__default = /*#__PURE__*/_interopDefault(xt);
13
13
 
14
- var tt=(p=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(p,{get:(c,t)=>(typeof require<"u"?require:c)[t]}):p)(function(p){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+p+'" is not supported')});var Ft=Object.create,St=Object.defineProperty,xt=Object.getOwnPropertyDescriptor,Pt=Object.getOwnPropertyNames,Nt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty,G=(p=>typeof tt<"u"?tt:typeof Proxy<"u"?new Proxy(p,{get:(c,t)=>(typeof tt<"u"?tt:c)[t]}):p)(function(p){if(typeof tt<"u")return tt.apply(this,arguments);throw new Error('Dynamic require of "'+p+'" is not supported')}),I=(p,c)=>()=>(c||p((c={exports:{}}).exports,c),c.exports),Dt=(p,c,t,n)=>{if(c&&typeof c=="object"||typeof c=="function")for(let i of Pt(c))!Ct.call(p,i)&&i!==t&&St(p,i,{get:()=>c[i],enumerable:!(n=xt(c,i))||n.enumerable});return p},jt=(p,c,t)=>(t=p!=null?Ft(Nt(p)):{},Dt(c||!p||!p.__esModule?St(t,"default",{value:p,enumerable:!0}):t,p)),X=I(p=>{p.fromCallback=function(c){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")c.apply(this,t);else return new Promise((n,i)=>{c.call(this,...t,(l,f)=>l!=null?i(l):n(f));})},"name",{value:c.name})},p.fromPromise=function(c){return Object.defineProperty(function(...t){let n=t[t.length-1];if(typeof n!="function")return c.apply(this,t);c.apply(this,t.slice(0,-1)).then(i=>n(null,i),n);},"name",{value:c.name})};}),Lt=I((p,c)=>{var t=G("constants"),n=process.cwd,i=null,l=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=n.call(process)),i};try{process.cwd();}catch{}typeof process.chdir=="function"&&(f=process.chdir,process.chdir=function(r){i=null,f.call(process,r);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,f));var f;c.exports=a;function a(r){t.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&m(r),r.lutimes||O(r),r.chown=P(r.chown),r.fchown=P(r.fchown),r.lchown=P(r.lchown),r.chmod=h(r.chmod),r.fchmod=h(r.fchmod),r.lchmod=h(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=D(r.chmodSync),r.fchmodSync=D(r.fchmodSync),r.lchmodSync=D(r.lchmodSync),r.stat=u(r.stat),r.fstat=u(r.fstat),r.lstat=u(r.lstat),r.statSync=b(r.statSync),r.fstatSync=b(r.fstatSync),r.lstatSync=b(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(e,s,y){y&&process.nextTick(y);},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(e,s,y,d){d&&process.nextTick(d);},r.lchownSync=function(){}),l==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(e){function s(y,d,k){var S=Date.now(),v=0;e(y,d,function g(j){if(j&&(j.code==="EACCES"||j.code==="EPERM"||j.code==="EBUSY")&&Date.now()-S<6e4){setTimeout(function(){r.stat(d,function(L,E){L&&L.code==="ENOENT"?e(y,d,g):k(j);});},v),v<100&&(v+=10);return}k&&k(j);});}return Object.setPrototypeOf&&Object.setPrototypeOf(s,e),s}(r.rename)),r.read=typeof r.read!="function"?r.read:function(e){function s(y,d,k,S,v,g){var j;if(g&&typeof g=="function"){var L=0;j=function(E,C,w){if(E&&E.code==="EAGAIN"&&L<10)return L++,e.call(r,y,d,k,S,v,j);g.apply(this,arguments);};}return e.call(r,y,d,k,S,v,j)}return Object.setPrototypeOf&&Object.setPrototypeOf(s,e),s}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(e){return function(s,y,d,k,S){for(var v=0;;)try{return e.call(r,s,y,d,k,S)}catch(g){if(g.code==="EAGAIN"&&v<10){v++;continue}throw g}}}(r.readSync);function m(e){e.lchmod=function(s,y,d){e.open(s,t.O_WRONLY|t.O_SYMLINK,y,function(k,S){if(k){d&&d(k);return}e.fchmod(S,y,function(v){e.close(S,function(g){d&&d(v||g);});});});},e.lchmodSync=function(s,y){var d=e.openSync(s,t.O_WRONLY|t.O_SYMLINK,y),k=!0,S;try{S=e.fchmodSync(d,y),k=!1;}finally{if(k)try{e.closeSync(d);}catch{}else e.closeSync(d);}return S};}function O(e){t.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(s,y,d,k){e.open(s,t.O_SYMLINK,function(S,v){if(S){k&&k(S);return}e.futimes(v,y,d,function(g){e.close(v,function(j){k&&k(g||j);});});});},e.lutimesSync=function(s,y,d){var k=e.openSync(s,t.O_SYMLINK),S,v=!0;try{S=e.futimesSync(k,y,d),v=!1;}finally{if(v)try{e.closeSync(k);}catch{}else e.closeSync(k);}return S}):e.futimes&&(e.lutimes=function(s,y,d,k){k&&process.nextTick(k);},e.lutimesSync=function(){});}function h(e){return e&&function(s,y,d){return e.call(r,s,y,function(k){x(k)&&(k=null),d&&d.apply(this,arguments);})}}function D(e){return e&&function(s,y){try{return e.call(r,s,y)}catch(d){if(!x(d))throw d}}}function P(e){return e&&function(s,y,d,k){return e.call(r,s,y,d,function(S){x(S)&&(S=null),k&&k.apply(this,arguments);})}}function o(e){return e&&function(s,y,d){try{return e.call(r,s,y,d)}catch(k){if(!x(k))throw k}}}function u(e){return e&&function(s,y,d){typeof y=="function"&&(d=y,y=null);function k(S,v){v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),d&&d.apply(this,arguments);}return y?e.call(r,s,y,k):e.call(r,s,k)}}function b(e){return e&&function(s,y){var d=y?e.call(r,s,y):e.call(r,s);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function x(e){if(!e||e.code==="ENOSYS")return !0;var s=!process.getuid||process.getuid()!==0;return !!(s&&(e.code==="EINVAL"||e.code==="EPERM"))}}}),Tt=I((p,c)=>{var t=G("stream").Stream;c.exports=n;function n(i){return {ReadStream:l,WriteStream:f};function l(a,r){if(!(this instanceof l))return new l(a,r);t.call(this);var m=this;this.path=a,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var O=Object.keys(r),h=0,D=O.length;h<D;h++){var P=O[h];this[P]=r[P];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){m._read();});return}i.open(this.path,this.flags,this.mode,function(o,u){if(o){m.emit("error",o),m.readable=!1;return}m.fd=u,m.emit("open",u),m._read();});}function f(a,r){if(!(this instanceof f))return new f(a,r);t.call(this),this.path=a,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var m=Object.keys(r),O=0,h=m.length;O<h;O++){var D=m[O];this[D]=r[D];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}}),_t=I((p,c)=>{c.exports=n;var t=Object.getPrototypeOf||function(i){return i.__proto__};function n(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var l={__proto__:t(i)};else var l=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(f){Object.defineProperty(l,f,Object.getOwnPropertyDescriptor(i,f));}),l}}),Q=I((p,c)=>{var t=G("fs"),n=Lt(),i=Tt(),l=_t(),f=G("util"),a,r;typeof Symbol=="function"&&typeof Symbol.for=="function"?(a=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(a="___graceful-fs.queue",r="___graceful-fs.previous");function m(){}function O(e,s){Object.defineProperty(e,a,{get:function(){return s}});}var h=m;f.debuglog?h=f.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(h=function(){var e=f.format.apply(f,arguments);e="GFS4: "+e.split(/\n/).join(`
15
- GFS4: `),console.error(e);}),t[a]||(D=global[a]||[],O(t,D),t.close=function(e){function s(y,d){return e.call(t,y,function(k){k||b(),typeof d=="function"&&d.apply(this,arguments);})}return Object.defineProperty(s,r,{value:e}),s}(t.close),t.closeSync=function(e){function s(y){e.apply(t,arguments),b();}return Object.defineProperty(s,r,{value:e}),s}(t.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){h(t[a]),G("assert").equal(t[a].length,0);}));var D;global[a]||O(global,t[a]),c.exports=P(l(t)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!t.__patched&&(c.exports=P(t),t.__patched=!0);function P(e){n(e),e.gracefulify=P,e.createReadStream=st,e.createWriteStream=at;var s=e.readFile;e.readFile=y;function y(T,M,R){return typeof M=="function"&&(R=M,M=null),B(T,M,R);function B(K,Y,U,q){return s(K,Y,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?o([B,[K,Y,U],W,q||Date.now(),Date.now()]):typeof U=="function"&&U.apply(this,arguments);})}}var d=e.writeFile;e.writeFile=k;function k(T,M,R,B){return typeof R=="function"&&(B=R,R=null),K(T,M,R,B);function K(Y,U,q,W,z){return d(Y,U,q,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[Y,U,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var S=e.appendFile;S&&(e.appendFile=v);function v(T,M,R,B){return typeof R=="function"&&(B=R,R=null),K(T,M,R,B);function K(Y,U,q,W,z){return S(Y,U,q,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[Y,U,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var g=e.copyFile;g&&(e.copyFile=j);function j(T,M,R,B){return typeof R=="function"&&(B=R,R=0),K(T,M,R,B);function K(Y,U,q,W,z){return g(Y,U,q,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[Y,U,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var L=e.readdir;e.readdir=C;var E=/^v[0-5]\./;function C(T,M,R){typeof M=="function"&&(R=M,M=null);var B=E.test(process.version)?function(Y,U,q,W){return L(Y,K(Y,U,q,W))}:function(Y,U,q,W){return L(Y,U,K(Y,U,q,W))};return B(T,M,R);function K(Y,U,q,W){return function(z,J){z&&(z.code==="EMFILE"||z.code==="ENFILE")?o([B,[Y,U,q],z,W||Date.now(),Date.now()]):(J&&J.sort&&J.sort(),typeof q=="function"&&q.call(this,z,J));}}}if(process.version.substr(0,4)==="v0.8"){var w=i(e);A=w.ReadStream,H=w.WriteStream;}var N=e.ReadStream;N&&(A.prototype=Object.create(N.prototype),A.prototype.open=V);var F=e.WriteStream;F&&(H.prototype=Object.create(F.prototype),H.prototype.open=rt),Object.defineProperty(e,"ReadStream",{get:function(){return A},set:function(T){A=T;},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return H},set:function(T){H=T;},enumerable:!0,configurable:!0});var _=A;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(T){_=T;},enumerable:!0,configurable:!0});var $=H;Object.defineProperty(e,"FileWriteStream",{get:function(){return $},set:function(T){$=T;},enumerable:!0,configurable:!0});function A(T,M){return this instanceof A?(N.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function V(){var T=this;ut(T.path,T.flags,T.mode,function(M,R){M?(T.autoClose&&T.destroy(),T.emit("error",M)):(T.fd=R,T.emit("open",R),T.read());});}function H(T,M){return this instanceof H?(F.apply(this,arguments),this):H.apply(Object.create(H.prototype),arguments)}function rt(){var T=this;ut(T.path,T.flags,T.mode,function(M,R){M?(T.destroy(),T.emit("error",M)):(T.fd=R,T.emit("open",R));});}function st(T,M){return new e.ReadStream(T,M)}function at(T,M){return new e.WriteStream(T,M)}var ot=e.open;e.open=ut;function ut(T,M,R,B){return typeof R=="function"&&(B=R,R=null),K(T,M,R,B);function K(Y,U,q,W,z){return ot(Y,U,q,function(J,ge){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[Y,U,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}return e}function o(e){h("ENQUEUE",e[0].name,e[1]),t[a].push(e),x();}var u;function b(){for(var e=Date.now(),s=0;s<t[a].length;++s)t[a][s].length>2&&(t[a][s][3]=e,t[a][s][4]=e);x();}function x(){if(clearTimeout(u),u=void 0,t[a].length!==0){var e=t[a].shift(),s=e[0],y=e[1],d=e[2],k=e[3],S=e[4];if(k===void 0)h("RETRY",s.name,y),s.apply(null,y);else if(Date.now()-k>=6e4){h("TIMEOUT",s.name,y);var v=y.pop();typeof v=="function"&&v.call(null,d);}else {var g=Date.now()-S,j=Math.max(S-k,1),L=Math.min(j*1.2,100);g>=L?(h("RETRY",s.name,y),s.apply(null,y.concat([k]))):t[a].push(e);}u===void 0&&(u=setTimeout(x,0));}}}),nt=I(p=>{var c=X().fromCallback,t=Q(),n=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(i=>typeof t[i]=="function");Object.assign(p,t),n.forEach(i=>{p[i]=c(t[i]);}),p.exists=function(i,l){return typeof l=="function"?t.exists(i,l):new Promise(f=>t.exists(i,f))},p.read=function(i,l,f,a,r,m){return typeof m=="function"?t.read(i,l,f,a,r,m):new Promise((O,h)=>{t.read(i,l,f,a,r,(D,P,o)=>{if(D)return h(D);O({bytesRead:P,buffer:o});});})},p.write=function(i,l,...f){return typeof f[f.length-1]=="function"?t.write(i,l,...f):new Promise((a,r)=>{t.write(i,l,...f,(m,O,h)=>{if(m)return r(m);a({bytesWritten:O,buffer:h});});})},p.readv=function(i,l,...f){return typeof f[f.length-1]=="function"?t.readv(i,l,...f):new Promise((a,r)=>{t.readv(i,l,...f,(m,O,h)=>{if(m)return r(m);a({bytesRead:O,buffers:h});});})},p.writev=function(i,l,...f){return typeof f[f.length-1]=="function"?t.writev(i,l,...f):new Promise((a,r)=>{t.writev(i,l,...f,(m,O,h)=>{if(m)return r(m);a({bytesWritten:O,buffers:h});});})},typeof t.realpath.native=="function"?p.realpath.native=c(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");}),$t=I((p,c)=>{var t=G("path");c.exports.checkPath=function(n){if(process.platform==="win32"&&/[<>:"|?*]/.test(n.replace(t.parse(n).root,""))){let i=new Error(`Path contains invalid characters: ${n}`);throw i.code="EINVAL",i}};}),It=I((p,c)=>{var t=nt(),{checkPath:n}=$t(),i=l=>typeof l=="number"?l:{...{mode:511},...l}.mode;c.exports.makeDir=async(l,f)=>(n(l),t.mkdir(l,{mode:i(f),recursive:!0})),c.exports.makeDirSync=(l,f)=>(n(l),t.mkdirSync(l,{mode:i(f),recursive:!0}));}),Z=I((p,c)=>{var t=X().fromPromise,{makeDir:n,makeDirSync:i}=It(),l=t(n);c.exports={mkdirs:l,mkdirsSync:i,mkdirp:l,mkdirpSync:i,ensureDir:l,ensureDirSync:i};}),et=I((p,c)=>{var t=X().fromPromise,n=nt();function i(l){return n.access(l).then(()=>!0).catch(()=>!1)}c.exports={pathExists:t(i),pathExistsSync:n.existsSync};}),wt=I((p,c)=>{var t=Q();function n(l,f,a,r){t.open(l,"r+",(m,O)=>{if(m)return r(m);t.futimes(O,f,a,h=>{t.close(O,D=>{r&&r(h||D);});});});}function i(l,f,a){let r=t.openSync(l,"r+");return t.futimesSync(r,f,a),t.closeSync(r)}c.exports={utimesMillis:n,utimesMillisSync:i};}),it=I((p,c)=>{var t=nt(),n=G("path"),i=G("util");function l(o,u,b){let x=b.dereference?e=>t.stat(e,{bigint:!0}):e=>t.lstat(e,{bigint:!0});return Promise.all([x(o),x(u).catch(e=>{if(e.code==="ENOENT")return null;throw e})]).then(([e,s])=>({srcStat:e,destStat:s}))}function f(o,u,b){let x,e=b.dereference?y=>t.statSync(y,{bigint:!0}):y=>t.lstatSync(y,{bigint:!0}),s=e(o);try{x=e(u);}catch(y){if(y.code==="ENOENT")return {srcStat:s,destStat:null};throw y}return {srcStat:s,destStat:x}}function a(o,u,b,x,e){i.callbackify(l)(o,u,x,(s,y)=>{if(s)return e(s);let{srcStat:d,destStat:k}=y;if(k){if(h(d,k)){let S=n.basename(o),v=n.basename(u);return b==="move"&&S!==v&&S.toLowerCase()===v.toLowerCase()?e(null,{srcStat:d,destStat:k,isChangingCase:!0}):e(new Error("Source and destination must not be the same."))}if(d.isDirectory()&&!k.isDirectory())return e(new Error(`Cannot overwrite non-directory '${u}' with directory '${o}'.`));if(!d.isDirectory()&&k.isDirectory())return e(new Error(`Cannot overwrite directory '${u}' with non-directory '${o}'.`))}return d.isDirectory()&&D(o,u)?e(new Error(P(o,u,b))):e(null,{srcStat:d,destStat:k})});}function r(o,u,b,x){let{srcStat:e,destStat:s}=f(o,u,x);if(s){if(h(e,s)){let y=n.basename(o),d=n.basename(u);if(b==="move"&&y!==d&&y.toLowerCase()===d.toLowerCase())return {srcStat:e,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(e.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${u}' with directory '${o}'.`);if(!e.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${u}' with non-directory '${o}'.`)}if(e.isDirectory()&&D(o,u))throw new Error(P(o,u,b));return {srcStat:e,destStat:s}}function m(o,u,b,x,e){let s=n.resolve(n.dirname(o)),y=n.resolve(n.dirname(b));if(y===s||y===n.parse(y).root)return e();t.stat(y,{bigint:!0},(d,k)=>d?d.code==="ENOENT"?e():e(d):h(u,k)?e(new Error(P(o,b,x))):m(o,u,y,x,e));}function O(o,u,b,x){let e=n.resolve(n.dirname(o)),s=n.resolve(n.dirname(b));if(s===e||s===n.parse(s).root)return;let y;try{y=t.statSync(s,{bigint:!0});}catch(d){if(d.code==="ENOENT")return;throw d}if(h(u,y))throw new Error(P(o,b,x));return O(o,u,s,x)}function h(o,u){return u.ino&&u.dev&&u.ino===o.ino&&u.dev===o.dev}function D(o,u){let b=n.resolve(o).split(n.sep).filter(e=>e),x=n.resolve(u).split(n.sep).filter(e=>e);return b.reduce((e,s,y)=>e&&x[y]===s,!0)}function P(o,u,b){return `Cannot ${b} '${o}' to a subdirectory of itself, '${u}'.`}c.exports={checkPaths:a,checkPathsSync:r,checkParentPaths:m,checkParentPathsSync:O,isSrcSubdir:D,areIdentical:h};}),Rt=I((p,c)=>{var t=Q(),n=G("path"),i=Z().mkdirs,l=et().pathExists,f=wt().utimesMillis,a=it();function r(E,C,w,N){typeof w=="function"&&!N?(N=w,w={}):typeof w=="function"&&(w={filter:w}),N=N||function(){},w=w||{},w.clobber="clobber"in w?!!w.clobber:!0,w.overwrite="overwrite"in w?!!w.overwrite:w.clobber,w.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
14
+ var tt=(l=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(l,{get:(c,t)=>(typeof require<"u"?require:c)[t]}):l)(function(l){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+l+'" is not supported')});var Pt=Object.create,St=Object.defineProperty,Ft=Object.getOwnPropertyDescriptor,Nt=Object.getOwnPropertyNames,Dt=Object.getPrototypeOf,Ct=Object.prototype.hasOwnProperty,G=(l=>typeof tt<"u"?tt:typeof Proxy<"u"?new Proxy(l,{get:(c,t)=>(typeof tt<"u"?tt:c)[t]}):l)(function(l){if(typeof tt<"u")return tt.apply(this,arguments);throw new Error('Dynamic require of "'+l+'" is not supported')}),$=(l,c)=>()=>(c||l((c={exports:{}}).exports,c),c.exports),jt=(l,c,t,n)=>{if(c&&typeof c=="object"||typeof c=="function")for(let i of Nt(c))!Ct.call(l,i)&&i!==t&&St(l,i,{get:()=>c[i],enumerable:!(n=Ft(c,i))||n.enumerable});return l},Lt=(l,c,t)=>(t=l!=null?Pt(Dt(l)):{},jt(c||!l||!l.__esModule?St(t,"default",{value:l,enumerable:!0}):t,l)),X=$(l=>{l.fromCallback=function(c){return Object.defineProperty(function(...t){if(typeof t[t.length-1]=="function")c.apply(this,t);else return new Promise((n,i)=>{c.call(this,...t,(y,u)=>y!=null?i(y):n(u));})},"name",{value:c.name})},l.fromPromise=function(c){return Object.defineProperty(function(...t){let n=t[t.length-1];if(typeof n!="function")return c.apply(this,t);c.apply(this,t.slice(0,-1)).then(i=>n(null,i),n);},"name",{value:c.name})};}),Tt=$((l,c)=>{var t=G("constants"),n=process.cwd,i=null,y=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return i||(i=n.call(process)),i};try{process.cwd();}catch{}typeof process.chdir=="function"&&(u=process.chdir,process.chdir=function(r){i=null,u.call(process,r);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,u));var u;c.exports=a;function a(r){t.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&m(r),r.lutimes||O(r),r.chown=F(r.chown),r.fchown=F(r.fchown),r.lchown=F(r.lchown),r.chmod=h(r.chmod),r.fchmod=h(r.fchmod),r.lchmod=h(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=C(r.chmodSync),r.fchmodSync=C(r.fchmodSync),r.lchmodSync=C(r.lchmodSync),r.stat=f(r.stat),r.fstat=f(r.fstat),r.lstat=f(r.lstat),r.statSync=b(r.statSync),r.fstatSync=b(r.fstatSync),r.lstatSync=b(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(e,s,p){p&&process.nextTick(p);},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(e,s,p,d){d&&process.nextTick(d);},r.lchownSync=function(){}),y==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:function(e){function s(p,d,k){var S=Date.now(),v=0;e(p,d,function g(j){if(j&&(j.code==="EACCES"||j.code==="EPERM"||j.code==="EBUSY")&&Date.now()-S<6e4){setTimeout(function(){r.stat(d,function(L,E){L&&L.code==="ENOENT"?e(p,d,g):k(j);});},v),v<100&&(v+=10);return}k&&k(j);});}return Object.setPrototypeOf&&Object.setPrototypeOf(s,e),s}(r.rename)),r.read=typeof r.read!="function"?r.read:function(e){function s(p,d,k,S,v,g){var j;if(g&&typeof g=="function"){var L=0;j=function(E,D,w){if(E&&E.code==="EAGAIN"&&L<10)return L++,e.call(r,p,d,k,S,v,j);g.apply(this,arguments);};}return e.call(r,p,d,k,S,v,j)}return Object.setPrototypeOf&&Object.setPrototypeOf(s,e),s}(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:function(e){return function(s,p,d,k,S){for(var v=0;;)try{return e.call(r,s,p,d,k,S)}catch(g){if(g.code==="EAGAIN"&&v<10){v++;continue}throw g}}}(r.readSync);function m(e){e.lchmod=function(s,p,d){e.open(s,t.O_WRONLY|t.O_SYMLINK,p,function(k,S){if(k){d&&d(k);return}e.fchmod(S,p,function(v){e.close(S,function(g){d&&d(v||g);});});});},e.lchmodSync=function(s,p){var d=e.openSync(s,t.O_WRONLY|t.O_SYMLINK,p),k=!0,S;try{S=e.fchmodSync(d,p),k=!1;}finally{if(k)try{e.closeSync(d);}catch{}else e.closeSync(d);}return S};}function O(e){t.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(s,p,d,k){e.open(s,t.O_SYMLINK,function(S,v){if(S){k&&k(S);return}e.futimes(v,p,d,function(g){e.close(v,function(j){k&&k(g||j);});});});},e.lutimesSync=function(s,p,d){var k=e.openSync(s,t.O_SYMLINK),S,v=!0;try{S=e.futimesSync(k,p,d),v=!1;}finally{if(v)try{e.closeSync(k);}catch{}else e.closeSync(k);}return S}):e.futimes&&(e.lutimes=function(s,p,d,k){k&&process.nextTick(k);},e.lutimesSync=function(){});}function h(e){return e&&function(s,p,d){return e.call(r,s,p,function(k){P(k)&&(k=null),d&&d.apply(this,arguments);})}}function C(e){return e&&function(s,p){try{return e.call(r,s,p)}catch(d){if(!P(d))throw d}}}function F(e){return e&&function(s,p,d,k){return e.call(r,s,p,d,function(S){P(S)&&(S=null),k&&k.apply(this,arguments);})}}function o(e){return e&&function(s,p,d){try{return e.call(r,s,p,d)}catch(k){if(!P(k))throw k}}}function f(e){return e&&function(s,p,d){typeof p=="function"&&(d=p,p=null);function k(S,v){v&&(v.uid<0&&(v.uid+=4294967296),v.gid<0&&(v.gid+=4294967296)),d&&d.apply(this,arguments);}return p?e.call(r,s,p,k):e.call(r,s,k)}}function b(e){return e&&function(s,p){var d=p?e.call(r,s,p):e.call(r,s);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function P(e){if(!e||e.code==="ENOSYS")return !0;var s=!process.getuid||process.getuid()!==0;return !!(s&&(e.code==="EINVAL"||e.code==="EPERM"))}}}),_t=$((l,c)=>{var t=G("stream").Stream;c.exports=n;function n(i){return {ReadStream:y,WriteStream:u};function y(a,r){if(!(this instanceof y))return new y(a,r);t.call(this);var m=this;this.path=a,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,r=r||{};for(var O=Object.keys(r),h=0,C=O.length;h<C;h++){var F=O[h];this[F]=r[F];}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){m._read();});return}i.open(this.path,this.flags,this.mode,function(o,f){if(o){m.emit("error",o),m.readable=!1;return}m.fd=f,m.emit("open",f),m._read();});}function u(a,r){if(!(this instanceof u))return new u(a,r);t.call(this),this.path=a,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var m=Object.keys(r),O=0,h=m.length;O<h;O++){var C=m[O];this[C]=r[C];}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=i.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}}),It=$((l,c)=>{c.exports=n;var t=Object.getPrototypeOf||function(i){return i.__proto__};function n(i){if(i===null||typeof i!="object")return i;if(i instanceof Object)var y={__proto__:t(i)};else var y=Object.create(null);return Object.getOwnPropertyNames(i).forEach(function(u){Object.defineProperty(y,u,Object.getOwnPropertyDescriptor(i,u));}),y}}),Q=$((l,c)=>{var t=G("fs"),n=Tt(),i=_t(),y=It(),u=G("util"),a,r;typeof Symbol=="function"&&typeof Symbol.for=="function"?(a=Symbol.for("graceful-fs.queue"),r=Symbol.for("graceful-fs.previous")):(a="___graceful-fs.queue",r="___graceful-fs.previous");function m(){}function O(e,s){Object.defineProperty(e,a,{get:function(){return s}});}var h=m;u.debuglog?h=u.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(h=function(){var e=u.format.apply(u,arguments);e="GFS4: "+e.split(/\n/).join(`
15
+ GFS4: `),console.error(e);}),t[a]||(C=global[a]||[],O(t,C),t.close=function(e){function s(p,d){return e.call(t,p,function(k){k||b(),typeof d=="function"&&d.apply(this,arguments);})}return Object.defineProperty(s,r,{value:e}),s}(t.close),t.closeSync=function(e){function s(p){e.apply(t,arguments),b();}return Object.defineProperty(s,r,{value:e}),s}(t.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){h(t[a]),G("assert").equal(t[a].length,0);}));var C;global[a]||O(global,t[a]),c.exports=F(y(t)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!t.__patched&&(c.exports=F(t),t.__patched=!0);function F(e){n(e),e.gracefulify=F,e.createReadStream=st,e.createWriteStream=at;var s=e.readFile;e.readFile=p;function p(T,M,R){return typeof M=="function"&&(R=M,M=null),B(T,M,R);function B(K,U,Y,q){return s(K,U,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?o([B,[K,U,Y],W,q||Date.now(),Date.now()]):typeof Y=="function"&&Y.apply(this,arguments);})}}var d=e.writeFile;e.writeFile=k;function k(T,M,R,B){return typeof R=="function"&&(B=R,R=null),K(T,M,R,B);function K(U,Y,q,W,z){return d(U,Y,q,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[U,Y,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var S=e.appendFile;S&&(e.appendFile=v);function v(T,M,R,B){return typeof R=="function"&&(B=R,R=null),K(T,M,R,B);function K(U,Y,q,W,z){return S(U,Y,q,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[U,Y,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var g=e.copyFile;g&&(e.copyFile=j);function j(T,M,R,B){return typeof R=="function"&&(B=R,R=0),K(T,M,R,B);function K(U,Y,q,W,z){return g(U,Y,q,function(J){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[U,Y,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}var L=e.readdir;e.readdir=D;var E=/^v[0-5]\./;function D(T,M,R){typeof M=="function"&&(R=M,M=null);var B=E.test(process.version)?function(U,Y,q,W){return L(U,K(U,Y,q,W))}:function(U,Y,q,W){return L(U,Y,K(U,Y,q,W))};return B(T,M,R);function K(U,Y,q,W){return function(z,J){z&&(z.code==="EMFILE"||z.code==="ENFILE")?o([B,[U,Y,q],z,W||Date.now(),Date.now()]):(J&&J.sort&&J.sort(),typeof q=="function"&&q.call(this,z,J));}}}if(process.version.substr(0,4)==="v0.8"){var w=i(e);A=w.ReadStream,H=w.WriteStream;}var N=e.ReadStream;N&&(A.prototype=Object.create(N.prototype),A.prototype.open=V);var x=e.WriteStream;x&&(H.prototype=Object.create(x.prototype),H.prototype.open=rt),Object.defineProperty(e,"ReadStream",{get:function(){return A},set:function(T){A=T;},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return H},set:function(T){H=T;},enumerable:!0,configurable:!0});var _=A;Object.defineProperty(e,"FileReadStream",{get:function(){return _},set:function(T){_=T;},enumerable:!0,configurable:!0});var I=H;Object.defineProperty(e,"FileWriteStream",{get:function(){return I},set:function(T){I=T;},enumerable:!0,configurable:!0});function A(T,M){return this instanceof A?(N.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function V(){var T=this;ut(T.path,T.flags,T.mode,function(M,R){M?(T.autoClose&&T.destroy(),T.emit("error",M)):(T.fd=R,T.emit("open",R),T.read());});}function H(T,M){return this instanceof H?(x.apply(this,arguments),this):H.apply(Object.create(H.prototype),arguments)}function rt(){var T=this;ut(T.path,T.flags,T.mode,function(M,R){M?(T.destroy(),T.emit("error",M)):(T.fd=R,T.emit("open",R));});}function st(T,M){return new e.ReadStream(T,M)}function at(T,M){return new e.WriteStream(T,M)}var ot=e.open;e.open=ut;function ut(T,M,R,B){return typeof R=="function"&&(B=R,R=null),K(T,M,R,B);function K(U,Y,q,W,z){return ot(U,Y,q,function(J,ke){J&&(J.code==="EMFILE"||J.code==="ENFILE")?o([K,[U,Y,q,W],J,z||Date.now(),Date.now()]):typeof W=="function"&&W.apply(this,arguments);})}}return e}function o(e){h("ENQUEUE",e[0].name,e[1]),t[a].push(e),P();}var f;function b(){for(var e=Date.now(),s=0;s<t[a].length;++s)t[a][s].length>2&&(t[a][s][3]=e,t[a][s][4]=e);P();}function P(){if(clearTimeout(f),f=void 0,t[a].length!==0){var e=t[a].shift(),s=e[0],p=e[1],d=e[2],k=e[3],S=e[4];if(k===void 0)h("RETRY",s.name,p),s.apply(null,p);else if(Date.now()-k>=6e4){h("TIMEOUT",s.name,p);var v=p.pop();typeof v=="function"&&v.call(null,d);}else {var g=Date.now()-S,j=Math.max(S-k,1),L=Math.min(j*1.2,100);g>=L?(h("RETRY",s.name,p),s.apply(null,p.concat([k]))):t[a].push(e);}f===void 0&&(f=setTimeout(P,0));}}}),nt=$(l=>{var c=X().fromCallback,t=Q(),n=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(i=>typeof t[i]=="function");Object.assign(l,t),n.forEach(i=>{l[i]=c(t[i]);}),l.exists=function(i,y){return typeof y=="function"?t.exists(i,y):new Promise(u=>t.exists(i,u))},l.read=function(i,y,u,a,r,m){return typeof m=="function"?t.read(i,y,u,a,r,m):new Promise((O,h)=>{t.read(i,y,u,a,r,(C,F,o)=>{if(C)return h(C);O({bytesRead:F,buffer:o});});})},l.write=function(i,y,...u){return typeof u[u.length-1]=="function"?t.write(i,y,...u):new Promise((a,r)=>{t.write(i,y,...u,(m,O,h)=>{if(m)return r(m);a({bytesWritten:O,buffer:h});});})},l.readv=function(i,y,...u){return typeof u[u.length-1]=="function"?t.readv(i,y,...u):new Promise((a,r)=>{t.readv(i,y,...u,(m,O,h)=>{if(m)return r(m);a({bytesRead:O,buffers:h});});})},l.writev=function(i,y,...u){return typeof u[u.length-1]=="function"?t.writev(i,y,...u):new Promise((a,r)=>{t.writev(i,y,...u,(m,O,h)=>{if(m)return r(m);a({bytesWritten:O,buffers:h});});})},typeof t.realpath.native=="function"?l.realpath.native=c(t.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");}),$t=$((l,c)=>{var t=G("path");c.exports.checkPath=function(n){if(process.platform==="win32"&&/[<>:"|?*]/.test(n.replace(t.parse(n).root,""))){let i=new Error(`Path contains invalid characters: ${n}`);throw i.code="EINVAL",i}};}),Rt=$((l,c)=>{var t=nt(),{checkPath:n}=$t(),i=y=>typeof y=="number"?y:{...{mode:511},...y}.mode;c.exports.makeDir=async(y,u)=>(n(y),t.mkdir(y,{mode:i(u),recursive:!0})),c.exports.makeDirSync=(y,u)=>(n(y),t.mkdirSync(y,{mode:i(u),recursive:!0}));}),Z=$((l,c)=>{var t=X().fromPromise,{makeDir:n,makeDirSync:i}=Rt(),y=t(n);c.exports={mkdirs:y,mkdirsSync:i,mkdirp:y,mkdirpSync:i,ensureDir:y,ensureDirSync:i};}),et=$((l,c)=>{var t=X().fromPromise,n=nt();function i(y){return n.access(y).then(()=>!0).catch(()=>!1)}c.exports={pathExists:t(i),pathExistsSync:n.existsSync};}),wt=$((l,c)=>{var t=Q();function n(y,u,a,r){t.open(y,"r+",(m,O)=>{if(m)return r(m);t.futimes(O,u,a,h=>{t.close(O,C=>{r&&r(h||C);});});});}function i(y,u,a){let r=t.openSync(y,"r+");return t.futimesSync(r,u,a),t.closeSync(r)}c.exports={utimesMillis:n,utimesMillisSync:i};}),it=$((l,c)=>{var t=nt(),n=G("path"),i=G("util");function y(o,f,b){let P=b.dereference?e=>t.stat(e,{bigint:!0}):e=>t.lstat(e,{bigint:!0});return Promise.all([P(o),P(f).catch(e=>{if(e.code==="ENOENT")return null;throw e})]).then(([e,s])=>({srcStat:e,destStat:s}))}function u(o,f,b){let P,e=b.dereference?p=>t.statSync(p,{bigint:!0}):p=>t.lstatSync(p,{bigint:!0}),s=e(o);try{P=e(f);}catch(p){if(p.code==="ENOENT")return {srcStat:s,destStat:null};throw p}return {srcStat:s,destStat:P}}function a(o,f,b,P,e){i.callbackify(y)(o,f,P,(s,p)=>{if(s)return e(s);let{srcStat:d,destStat:k}=p;if(k){if(h(d,k)){let S=n.basename(o),v=n.basename(f);return b==="move"&&S!==v&&S.toLowerCase()===v.toLowerCase()?e(null,{srcStat:d,destStat:k,isChangingCase:!0}):e(new Error("Source and destination must not be the same."))}if(d.isDirectory()&&!k.isDirectory())return e(new Error(`Cannot overwrite non-directory '${f}' with directory '${o}'.`));if(!d.isDirectory()&&k.isDirectory())return e(new Error(`Cannot overwrite directory '${f}' with non-directory '${o}'.`))}return d.isDirectory()&&C(o,f)?e(new Error(F(o,f,b))):e(null,{srcStat:d,destStat:k})});}function r(o,f,b,P){let{srcStat:e,destStat:s}=u(o,f,P);if(s){if(h(e,s)){let p=n.basename(o),d=n.basename(f);if(b==="move"&&p!==d&&p.toLowerCase()===d.toLowerCase())return {srcStat:e,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(e.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${f}' with directory '${o}'.`);if(!e.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${f}' with non-directory '${o}'.`)}if(e.isDirectory()&&C(o,f))throw new Error(F(o,f,b));return {srcStat:e,destStat:s}}function m(o,f,b,P,e){let s=n.resolve(n.dirname(o)),p=n.resolve(n.dirname(b));if(p===s||p===n.parse(p).root)return e();t.stat(p,{bigint:!0},(d,k)=>d?d.code==="ENOENT"?e():e(d):h(f,k)?e(new Error(F(o,b,P))):m(o,f,p,P,e));}function O(o,f,b,P){let e=n.resolve(n.dirname(o)),s=n.resolve(n.dirname(b));if(s===e||s===n.parse(s).root)return;let p;try{p=t.statSync(s,{bigint:!0});}catch(d){if(d.code==="ENOENT")return;throw d}if(h(f,p))throw new Error(F(o,b,P));return O(o,f,s,P)}function h(o,f){return f.ino&&f.dev&&f.ino===o.ino&&f.dev===o.dev}function C(o,f){let b=n.resolve(o).split(n.sep).filter(e=>e),P=n.resolve(f).split(n.sep).filter(e=>e);return b.reduce((e,s,p)=>e&&P[p]===s,!0)}function F(o,f,b){return `Cannot ${b} '${o}' to a subdirectory of itself, '${f}'.`}c.exports={checkPaths:a,checkPathsSync:r,checkParentPaths:m,checkParentPathsSync:O,isSrcSubdir:C,areIdentical:h};}),Mt=$((l,c)=>{var t=Q(),n=G("path"),i=Z().mkdirs,y=et().pathExists,u=wt().utimesMillis,a=it();function r(E,D,w,N){typeof w=="function"&&!N?(N=w,w={}):typeof w=="function"&&(w={filter:w}),N=N||function(){},w=w||{},w.clobber="clobber"in w?!!w.clobber:!0,w.overwrite="overwrite"in w?!!w.overwrite:w.clobber,w.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
16
16
 
17
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),a.checkPaths(E,C,"copy",w,(F,_)=>{if(F)return N(F);let{srcStat:$,destStat:A}=_;a.checkParentPaths(E,$,C,"copy",V=>{if(V)return N(V);O(E,C,w,(H,rt)=>{if(H)return N(H);if(!rt)return N();m(A,E,C,w,N);});});});}function m(E,C,w,N,F){let _=n.dirname(w);l(_,($,A)=>{if($)return F($);if(A)return h(E,C,w,N,F);i(_,V=>V?F(V):h(E,C,w,N,F));});}function O(E,C,w,N){if(!w.filter)return N(null,!0);Promise.resolve(w.filter(E,C)).then(F=>N(null,F),F=>N(F));}function h(E,C,w,N,F){(N.dereference?t.stat:t.lstat)(C,(_,$)=>_?F(_):$.isDirectory()?d($,E,C,w,N,F):$.isFile()||$.isCharacterDevice()||$.isBlockDevice()?D($,E,C,w,N,F):$.isSymbolicLink()?j(E,C,w,N,F):$.isSocket()?F(new Error(`Cannot copy a socket file: ${C}`)):$.isFIFO()?F(new Error(`Cannot copy a FIFO pipe: ${C}`)):F(new Error(`Unknown file: ${C}`)));}function D(E,C,w,N,F,_){return C?P(E,w,N,F,_):o(E,w,N,F,_)}function P(E,C,w,N,F){if(N.overwrite)t.unlink(w,_=>_?F(_):o(E,C,w,N,F));else return N.errorOnExist?F(new Error(`'${w}' already exists`)):F()}function o(E,C,w,N,F){t.copyFile(C,w,_=>_?F(_):N.preserveTimestamps?u(E.mode,C,w,F):s(w,E.mode,F));}function u(E,C,w,N){return b(E)?x(w,E,F=>F?N(F):e(E,C,w,N)):e(E,C,w,N)}function b(E){return (E&128)===0}function x(E,C,w){return s(E,C|128,w)}function e(E,C,w,N){y(C,w,F=>F?N(F):s(w,E,N));}function s(E,C,w){return t.chmod(E,C,w)}function y(E,C,w){t.stat(E,(N,F)=>N?w(N):f(C,F.atime,F.mtime,w));}function d(E,C,w,N,F,_){return C?S(w,N,F,_):k(E.mode,w,N,F,_)}function k(E,C,w,N,F){t.mkdir(w,_=>{if(_)return F(_);S(C,w,N,$=>$?F($):s(w,E,F));});}function S(E,C,w,N){t.readdir(E,(F,_)=>F?N(F):v(_,E,C,w,N));}function v(E,C,w,N,F){let _=E.pop();return _?g(E,_,C,w,N,F):F()}function g(E,C,w,N,F,_){let $=n.join(w,C),A=n.join(N,C);O($,A,F,(V,H)=>{if(V)return _(V);if(!H)return v(E,w,N,F,_);a.checkPaths($,A,"copy",F,(rt,st)=>{if(rt)return _(rt);let{destStat:at}=st;h(at,$,A,F,ot=>ot?_(ot):v(E,w,N,F,_));});});}function j(E,C,w,N,F){t.readlink(C,(_,$)=>{if(_)return F(_);if(N.dereference&&($=n.resolve(process.cwd(),$)),E)t.readlink(w,(A,V)=>A?A.code==="EINVAL"||A.code==="UNKNOWN"?t.symlink($,w,F):F(A):(N.dereference&&(V=n.resolve(process.cwd(),V)),a.isSrcSubdir($,V)?F(new Error(`Cannot copy '${$}' to a subdirectory of itself, '${V}'.`)):a.isSrcSubdir(V,$)?F(new Error(`Cannot overwrite '${V}' with '${$}'.`)):L($,w,F)));else return t.symlink($,w,F)});}function L(E,C,w){t.unlink(C,N=>N?w(N):t.symlink(E,C,w));}c.exports=r;}),Mt=I((p,c)=>{var t=Q(),n=G("path"),i=Z().mkdirsSync,l=wt().utimesMillisSync,f=it();function a(S,v,g){typeof g=="function"&&(g={filter:g}),g=g||{},g.clobber="clobber"in g?!!g.clobber:!0,g.overwrite="overwrite"in g?!!g.overwrite:g.clobber,g.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
17
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001"),a.checkPaths(E,D,"copy",w,(x,_)=>{if(x)return N(x);let{srcStat:I,destStat:A}=_;a.checkParentPaths(E,I,D,"copy",V=>{if(V)return N(V);O(E,D,w,(H,rt)=>{if(H)return N(H);if(!rt)return N();m(A,E,D,w,N);});});});}function m(E,D,w,N,x){let _=n.dirname(w);y(_,(I,A)=>{if(I)return x(I);if(A)return h(E,D,w,N,x);i(_,V=>V?x(V):h(E,D,w,N,x));});}function O(E,D,w,N){if(!w.filter)return N(null,!0);Promise.resolve(w.filter(E,D)).then(x=>N(null,x),x=>N(x));}function h(E,D,w,N,x){(N.dereference?t.stat:t.lstat)(D,(_,I)=>_?x(_):I.isDirectory()?d(I,E,D,w,N,x):I.isFile()||I.isCharacterDevice()||I.isBlockDevice()?C(I,E,D,w,N,x):I.isSymbolicLink()?j(E,D,w,N,x):I.isSocket()?x(new Error(`Cannot copy a socket file: ${D}`)):I.isFIFO()?x(new Error(`Cannot copy a FIFO pipe: ${D}`)):x(new Error(`Unknown file: ${D}`)));}function C(E,D,w,N,x,_){return D?F(E,w,N,x,_):o(E,w,N,x,_)}function F(E,D,w,N,x){if(N.overwrite)t.unlink(w,_=>_?x(_):o(E,D,w,N,x));else return N.errorOnExist?x(new Error(`'${w}' already exists`)):x()}function o(E,D,w,N,x){t.copyFile(D,w,_=>_?x(_):N.preserveTimestamps?f(E.mode,D,w,x):s(w,E.mode,x));}function f(E,D,w,N){return b(E)?P(w,E,x=>x?N(x):e(E,D,w,N)):e(E,D,w,N)}function b(E){return (E&128)===0}function P(E,D,w){return s(E,D|128,w)}function e(E,D,w,N){p(D,w,x=>x?N(x):s(w,E,N));}function s(E,D,w){return t.chmod(E,D,w)}function p(E,D,w){t.stat(E,(N,x)=>N?w(N):u(D,x.atime,x.mtime,w));}function d(E,D,w,N,x,_){return D?S(w,N,x,_):k(E.mode,w,N,x,_)}function k(E,D,w,N,x){t.mkdir(w,_=>{if(_)return x(_);S(D,w,N,I=>I?x(I):s(w,E,x));});}function S(E,D,w,N){t.readdir(E,(x,_)=>x?N(x):v(_,E,D,w,N));}function v(E,D,w,N,x){let _=E.pop();return _?g(E,_,D,w,N,x):x()}function g(E,D,w,N,x,_){let I=n.join(w,D),A=n.join(N,D);O(I,A,x,(V,H)=>{if(V)return _(V);if(!H)return v(E,w,N,x,_);a.checkPaths(I,A,"copy",x,(rt,st)=>{if(rt)return _(rt);let{destStat:at}=st;h(at,I,A,x,ot=>ot?_(ot):v(E,w,N,x,_));});});}function j(E,D,w,N,x){t.readlink(D,(_,I)=>{if(_)return x(_);if(N.dereference&&(I=n.resolve(process.cwd(),I)),E)t.readlink(w,(A,V)=>A?A.code==="EINVAL"||A.code==="UNKNOWN"?t.symlink(I,w,x):x(A):(N.dereference&&(V=n.resolve(process.cwd(),V)),a.isSrcSubdir(I,V)?x(new Error(`Cannot copy '${I}' to a subdirectory of itself, '${V}'.`)):a.isSrcSubdir(V,I)?x(new Error(`Cannot overwrite '${V}' with '${I}'.`)):L(I,w,x)));else return t.symlink(I,w,x)});}function L(E,D,w){t.unlink(D,N=>N?w(N):t.symlink(E,D,w));}c.exports=r;}),Wt=$((l,c)=>{var t=Q(),n=G("path"),i=Z().mkdirsSync,y=wt().utimesMillisSync,u=it();function a(S,v,g){typeof g=="function"&&(g={filter:g}),g=g||{},g.clobber="clobber"in g?!!g.clobber:!0,g.overwrite="overwrite"in g?!!g.overwrite:g.clobber,g.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
18
18
 
19
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:j,destStat:L}=f.checkPathsSync(S,v,"copy",g);if(f.checkParentPathsSync(S,j,v,"copy"),g.filter&&!g.filter(S,v))return;let E=n.dirname(v);return t.existsSync(E)||i(E),r(L,S,v,g)}function r(S,v,g,j){let L=(j.dereference?t.statSync:t.lstatSync)(v);if(L.isDirectory())return x(L,S,v,g,j);if(L.isFile()||L.isCharacterDevice()||L.isBlockDevice())return m(L,S,v,g,j);if(L.isSymbolicLink())return d(S,v,g,j);throw L.isSocket()?new Error(`Cannot copy a socket file: ${v}`):L.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${v}`):new Error(`Unknown file: ${v}`)}function m(S,v,g,j,L){return v?O(S,g,j,L):h(S,g,j,L)}function O(S,v,g,j){if(j.overwrite)return t.unlinkSync(g),h(S,v,g,j);if(j.errorOnExist)throw new Error(`'${g}' already exists`)}function h(S,v,g,j){return t.copyFileSync(v,g),j.preserveTimestamps&&D(S.mode,v,g),u(g,S.mode)}function D(S,v,g){return P(S)&&o(g,S),b(v,g)}function P(S){return (S&128)===0}function o(S,v){return u(S,v|128)}function u(S,v){return t.chmodSync(S,v)}function b(S,v){let g=t.statSync(S);return l(v,g.atime,g.mtime)}function x(S,v,g,j,L){return v?s(g,j,L):e(S.mode,g,j,L)}function e(S,v,g,j){return t.mkdirSync(g),s(v,g,j),u(g,S)}function s(S,v,g){t.readdirSync(S).forEach(j=>y(j,S,v,g));}function y(S,v,g,j){let L=n.join(v,S),E=n.join(g,S);if(j.filter&&!j.filter(L,E))return;let{destStat:C}=f.checkPathsSync(L,E,"copy",j);return r(C,L,E,j)}function d(S,v,g,j){let L=t.readlinkSync(v);if(j.dereference&&(L=n.resolve(process.cwd(),L)),S){let E;try{E=t.readlinkSync(g);}catch(C){if(C.code==="EINVAL"||C.code==="UNKNOWN")return t.symlinkSync(L,g);throw C}if(j.dereference&&(E=n.resolve(process.cwd(),E)),f.isSrcSubdir(L,E))throw new Error(`Cannot copy '${L}' to a subdirectory of itself, '${E}'.`);if(f.isSrcSubdir(E,L))throw new Error(`Cannot overwrite '${E}' with '${L}'.`);return k(L,g)}else return t.symlinkSync(L,g)}function k(S,v){return t.unlinkSync(v),t.symlinkSync(S,v)}c.exports=a;}),lt=I((p,c)=>{var t=X().fromCallback;c.exports={copy:t(Rt()),copySync:Mt()};}),ct=I((p,c)=>{var t=Q(),n=X().fromCallback;function i(f,a){t.rm(f,{recursive:!0,force:!0},a);}function l(f){t.rmSync(f,{recursive:!0,force:!0});}c.exports={remove:n(i),removeSync:l};}),Wt=I((p,c)=>{var t=X().fromPromise,n=nt(),i=G("path"),l=Z(),f=ct(),a=t(async function(m){let O;try{O=await n.readdir(m);}catch{return l.mkdirs(m)}return Promise.all(O.map(h=>f.remove(i.join(m,h))))});function r(m){let O;try{O=n.readdirSync(m);}catch{return l.mkdirsSync(m)}O.forEach(h=>{h=i.join(m,h),f.removeSync(h);});}c.exports={emptyDirSync:r,emptydirSync:r,emptyDir:a,emptydir:a};}),Jt=I((p,c)=>{var t=X().fromCallback,n=G("path"),i=Q(),l=Z();function f(r,m){function O(){i.writeFile(r,"",h=>{if(h)return m(h);m();});}i.stat(r,(h,D)=>{if(!h&&D.isFile())return m();let P=n.dirname(r);i.stat(P,(o,u)=>{if(o)return o.code==="ENOENT"?l.mkdirs(P,b=>{if(b)return m(b);O();}):m(o);u.isDirectory()?O():i.readdir(P,b=>{if(b)return m(b)});});});}function a(r){let m;try{m=i.statSync(r);}catch{}if(m&&m.isFile())return;let O=n.dirname(r);try{i.statSync(O).isDirectory()||i.readdirSync(O);}catch(h){if(h&&h.code==="ENOENT")l.mkdirsSync(O);else throw h}i.writeFileSync(r,"");}c.exports={createFile:t(f),createFileSync:a};}),At=I((p,c)=>{var t=X().fromCallback,n=G("path"),i=Q(),l=Z(),f=et().pathExists,{areIdentical:a}=it();function r(O,h,D){function P(o,u){i.link(o,u,b=>{if(b)return D(b);D(null);});}i.lstat(h,(o,u)=>{i.lstat(O,(b,x)=>{if(b)return b.message=b.message.replace("lstat","ensureLink"),D(b);if(u&&a(x,u))return D(null);let e=n.dirname(h);f(e,(s,y)=>{if(s)return D(s);if(y)return P(O,h);l.mkdirs(e,d=>{if(d)return D(d);P(O,h);});});});});}function m(O,h){let D;try{D=i.lstatSync(h);}catch{}try{let o=i.lstatSync(O);if(D&&a(o,D))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let P=n.dirname(h);return i.existsSync(P)||l.mkdirsSync(P),i.linkSync(O,h)}c.exports={createLink:t(r),createLinkSync:m};}),Yt=I((p,c)=>{var t=G("path"),n=Q(),i=et().pathExists;function l(a,r,m){if(t.isAbsolute(a))return n.lstat(a,O=>O?(O.message=O.message.replace("lstat","ensureSymlink"),m(O)):m(null,{toCwd:a,toDst:a}));{let O=t.dirname(r),h=t.join(O,a);return i(h,(D,P)=>D?m(D):P?m(null,{toCwd:h,toDst:a}):n.lstat(a,o=>o?(o.message=o.message.replace("lstat","ensureSymlink"),m(o)):m(null,{toCwd:a,toDst:t.relative(O,a)})))}}function f(a,r){let m;if(t.isAbsolute(a)){if(m=n.existsSync(a),!m)throw new Error("absolute srcpath does not exist");return {toCwd:a,toDst:a}}else {let O=t.dirname(r),h=t.join(O,a);if(m=n.existsSync(h),m)return {toCwd:h,toDst:a};if(m=n.existsSync(a),!m)throw new Error("relative srcpath does not exist");return {toCwd:a,toDst:t.relative(O,a)}}}c.exports={symlinkPaths:l,symlinkPathsSync:f};}),Ut=I((p,c)=>{var t=Q();function n(l,f,a){if(a=typeof f=="function"?f:a,f=typeof f=="function"?!1:f,f)return a(null,f);t.lstat(l,(r,m)=>{if(r)return a(null,"file");f=m&&m.isDirectory()?"dir":"file",a(null,f);});}function i(l,f){let a;if(f)return f;try{a=t.lstatSync(l);}catch{return "file"}return a&&a.isDirectory()?"dir":"file"}c.exports={symlinkType:n,symlinkTypeSync:i};}),qt=I((p,c)=>{var t=X().fromCallback,n=G("path"),i=nt(),l=Z(),f=l.mkdirs,a=l.mkdirsSync,r=Yt(),m=r.symlinkPaths,O=r.symlinkPathsSync,h=Ut(),D=h.symlinkType,P=h.symlinkTypeSync,o=et().pathExists,{areIdentical:u}=it();function b(s,y,d,k){k=typeof d=="function"?d:k,d=typeof d=="function"?!1:d,i.lstat(y,(S,v)=>{!S&&v.isSymbolicLink()?Promise.all([i.stat(s),i.stat(y)]).then(([g,j])=>{if(u(g,j))return k(null);x(s,y,d,k);}):x(s,y,d,k);});}function x(s,y,d,k){m(s,y,(S,v)=>{if(S)return k(S);s=v.toDst,D(v.toCwd,d,(g,j)=>{if(g)return k(g);let L=n.dirname(y);o(L,(E,C)=>{if(E)return k(E);if(C)return i.symlink(s,y,j,k);f(L,w=>{if(w)return k(w);i.symlink(s,y,j,k);});});});});}function e(s,y,d){let k;try{k=i.lstatSync(y);}catch{}if(k&&k.isSymbolicLink()){let g=i.statSync(s),j=i.statSync(y);if(u(g,j))return}let S=O(s,y);s=S.toDst,d=P(S.toCwd,d);let v=n.dirname(y);return i.existsSync(v)||a(v),i.symlinkSync(s,y,d)}c.exports={createSymlink:t(b),createSymlinkSync:e};}),Gt=I((p,c)=>{var{createFile:t,createFileSync:n}=Jt(),{createLink:i,createLinkSync:l}=At(),{createSymlink:f,createSymlinkSync:a}=qt();c.exports={createFile:t,createFileSync:n,ensureFile:t,ensureFileSync:n,createLink:i,createLinkSync:l,ensureLink:i,ensureLinkSync:l,createSymlink:f,createSymlinkSync:a,ensureSymlink:f,ensureSymlinkSync:a};}),yt=I((p,c)=>{function t(i,{EOL:l=`
20
- `,finalEOL:f=!0,replacer:a=null,spaces:r}={}){let m=f?l:"";return JSON.stringify(i,a,r).replace(/\n/g,l)+m}function n(i){return Buffer.isBuffer(i)&&(i=i.toString("utf8")),i.replace(/^\uFEFF/,"")}c.exports={stringify:t,stripBom:n};}),Vt=I((p,c)=>{var t;try{t=Q();}catch{t=G("fs");}var n=X(),{stringify:i,stripBom:l}=yt();async function f(P,o={}){typeof o=="string"&&(o={encoding:o});let u=o.fs||t,b="throws"in o?o.throws:!0,x=await n.fromCallback(u.readFile)(P,o);x=l(x);let e;try{e=JSON.parse(x,o?o.reviver:null);}catch(s){if(b)throw s.message=`${P}: ${s.message}`,s;return null}return e}var a=n.fromPromise(f);function r(P,o={}){typeof o=="string"&&(o={encoding:o});let u=o.fs||t,b="throws"in o?o.throws:!0;try{let x=u.readFileSync(P,o);return x=l(x),JSON.parse(x,o.reviver)}catch(x){if(b)throw x.message=`${P}: ${x.message}`,x;return null}}async function m(P,o,u={}){let b=u.fs||t,x=i(o,u);await n.fromCallback(b.writeFile)(P,x,u);}var O=n.fromPromise(m);function h(P,o,u={}){let b=u.fs||t,x=i(o,u);return b.writeFileSync(P,x,u)}var D={readFile:a,readFileSync:r,writeFile:O,writeFileSync:h};c.exports=D;}),Bt=I((p,c)=>{var t=Vt();c.exports={readJson:t.readFile,readJsonSync:t.readFileSync,writeJson:t.writeFile,writeJsonSync:t.writeFileSync};}),pt=I((p,c)=>{var t=X().fromCallback,n=Q(),i=G("path"),l=Z(),f=et().pathExists;function a(m,O,h,D){typeof h=="function"&&(D=h,h="utf8");let P=i.dirname(m);f(P,(o,u)=>{if(o)return D(o);if(u)return n.writeFile(m,O,h,D);l.mkdirs(P,b=>{if(b)return D(b);n.writeFile(m,O,h,D);});});}function r(m,...O){let h=i.dirname(m);if(n.existsSync(h))return n.writeFileSync(m,...O);l.mkdirsSync(h),n.writeFileSync(m,...O);}c.exports={outputFile:t(a),outputFileSync:r};}),Kt=I((p,c)=>{var{stringify:t}=yt(),{outputFile:n}=pt();async function i(l,f,a={}){let r=t(f,a);await n(l,r,a);}c.exports=i;}),Ht=I((p,c)=>{var{stringify:t}=yt(),{outputFileSync:n}=pt();function i(l,f,a){let r=t(f,a);n(l,r,a);}c.exports=i;}),zt=I((p,c)=>{var t=X().fromPromise,n=Bt();n.outputJson=t(Kt()),n.outputJsonSync=Ht(),n.outputJSON=n.outputJson,n.outputJSONSync=n.outputJsonSync,n.writeJSON=n.writeJson,n.writeJSONSync=n.writeJsonSync,n.readJSON=n.readJson,n.readJSONSync=n.readJsonSync,c.exports=n;}),Xt=I((p,c)=>{var t=Q(),n=G("path"),i=lt().copy,l=ct().remove,f=Z().mkdirp,a=et().pathExists,r=it();function m(o,u,b,x){typeof b=="function"&&(x=b,b={}),b=b||{};let e=b.overwrite||b.clobber||!1;r.checkPaths(o,u,"move",b,(s,y)=>{if(s)return x(s);let{srcStat:d,isChangingCase:k=!1}=y;r.checkParentPaths(o,d,u,"move",S=>{if(S)return x(S);if(O(u))return h(o,u,e,k,x);f(n.dirname(u),v=>v?x(v):h(o,u,e,k,x));});});}function O(o){let u=n.dirname(o);return n.parse(u).root===u}function h(o,u,b,x,e){if(x)return D(o,u,b,e);if(b)return l(u,s=>s?e(s):D(o,u,b,e));a(u,(s,y)=>s?e(s):y?e(new Error("dest already exists.")):D(o,u,b,e));}function D(o,u,b,x){t.rename(o,u,e=>e?e.code!=="EXDEV"?x(e):P(o,u,b,x):x());}function P(o,u,b,x){i(o,u,{overwrite:b,errorOnExist:!0,preserveTimestamps:!0},e=>e?x(e):l(o,x));}c.exports=m;}),Qt=I((p,c)=>{var t=Q(),n=G("path"),i=lt().copySync,l=ct().removeSync,f=Z().mkdirpSync,a=it();function r(P,o,u){u=u||{};let b=u.overwrite||u.clobber||!1,{srcStat:x,isChangingCase:e=!1}=a.checkPathsSync(P,o,"move",u);return a.checkParentPathsSync(P,x,o,"move"),m(o)||f(n.dirname(o)),O(P,o,b,e)}function m(P){let o=n.dirname(P);return n.parse(o).root===o}function O(P,o,u,b){if(b)return h(P,o,u);if(u)return l(o),h(P,o,u);if(t.existsSync(o))throw new Error("dest already exists.");return h(P,o,u)}function h(P,o,u){try{t.renameSync(P,o);}catch(b){if(b.code!=="EXDEV")throw b;return D(P,o,u)}}function D(P,o,u){return i(P,o,{overwrite:u,errorOnExist:!0,preserveTimestamps:!0}),l(P)}c.exports=r;}),Zt=I((p,c)=>{var t=X().fromCallback;c.exports={move:t(Xt()),moveSync:Qt()};}),te=I((p,c)=>{c.exports={...nt(),...lt(),...Wt(),...Gt(),...zt(),...Z(),...Zt(),...pt(),...et(),...ct()};}),{CHROMATIC_ARCHIVE_LOCATION:ee="test-results"}=process.env;function re(){return process.cwd()}function dt(){return ft__default.default.resolve(re(),ee,"chromatic-archives")}function ne(){return ft__default.default.resolve(dt(),"archive")}function ie(){let p=dt();if(!Ot__default.default.existsSync(p))throw new Error(`Chromatic archives directory cannot be found: ${p}
19
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:j,destStat:L}=u.checkPathsSync(S,v,"copy",g);if(u.checkParentPathsSync(S,j,v,"copy"),g.filter&&!g.filter(S,v))return;let E=n.dirname(v);return t.existsSync(E)||i(E),r(L,S,v,g)}function r(S,v,g,j){let L=(j.dereference?t.statSync:t.lstatSync)(v);if(L.isDirectory())return P(L,S,v,g,j);if(L.isFile()||L.isCharacterDevice()||L.isBlockDevice())return m(L,S,v,g,j);if(L.isSymbolicLink())return d(S,v,g,j);throw L.isSocket()?new Error(`Cannot copy a socket file: ${v}`):L.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${v}`):new Error(`Unknown file: ${v}`)}function m(S,v,g,j,L){return v?O(S,g,j,L):h(S,g,j,L)}function O(S,v,g,j){if(j.overwrite)return t.unlinkSync(g),h(S,v,g,j);if(j.errorOnExist)throw new Error(`'${g}' already exists`)}function h(S,v,g,j){return t.copyFileSync(v,g),j.preserveTimestamps&&C(S.mode,v,g),f(g,S.mode)}function C(S,v,g){return F(S)&&o(g,S),b(v,g)}function F(S){return (S&128)===0}function o(S,v){return f(S,v|128)}function f(S,v){return t.chmodSync(S,v)}function b(S,v){let g=t.statSync(S);return y(v,g.atime,g.mtime)}function P(S,v,g,j,L){return v?s(g,j,L):e(S.mode,g,j,L)}function e(S,v,g,j){return t.mkdirSync(g),s(v,g,j),f(g,S)}function s(S,v,g){t.readdirSync(S).forEach(j=>p(j,S,v,g));}function p(S,v,g,j){let L=n.join(v,S),E=n.join(g,S);if(j.filter&&!j.filter(L,E))return;let{destStat:D}=u.checkPathsSync(L,E,"copy",j);return r(D,L,E,j)}function d(S,v,g,j){let L=t.readlinkSync(v);if(j.dereference&&(L=n.resolve(process.cwd(),L)),S){let E;try{E=t.readlinkSync(g);}catch(D){if(D.code==="EINVAL"||D.code==="UNKNOWN")return t.symlinkSync(L,g);throw D}if(j.dereference&&(E=n.resolve(process.cwd(),E)),u.isSrcSubdir(L,E))throw new Error(`Cannot copy '${L}' to a subdirectory of itself, '${E}'.`);if(u.isSrcSubdir(E,L))throw new Error(`Cannot overwrite '${E}' with '${L}'.`);return k(L,g)}else return t.symlinkSync(L,g)}function k(S,v){return t.unlinkSync(v),t.symlinkSync(S,v)}c.exports=a;}),lt=$((l,c)=>{var t=X().fromCallback;c.exports={copy:t(Mt()),copySync:Wt()};}),ct=$((l,c)=>{var t=Q(),n=X().fromCallback;function i(u,a){t.rm(u,{recursive:!0,force:!0},a);}function y(u){t.rmSync(u,{recursive:!0,force:!0});}c.exports={remove:n(i),removeSync:y};}),Jt=$((l,c)=>{var t=X().fromPromise,n=nt(),i=G("path"),y=Z(),u=ct(),a=t(async function(m){let O;try{O=await n.readdir(m);}catch{return y.mkdirs(m)}return Promise.all(O.map(h=>u.remove(i.join(m,h))))});function r(m){let O;try{O=n.readdirSync(m);}catch{return y.mkdirsSync(m)}O.forEach(h=>{h=i.join(m,h),u.removeSync(h);});}c.exports={emptyDirSync:r,emptydirSync:r,emptyDir:a,emptydir:a};}),At=$((l,c)=>{var t=X().fromCallback,n=G("path"),i=Q(),y=Z();function u(r,m){function O(){i.writeFile(r,"",h=>{if(h)return m(h);m();});}i.stat(r,(h,C)=>{if(!h&&C.isFile())return m();let F=n.dirname(r);i.stat(F,(o,f)=>{if(o)return o.code==="ENOENT"?y.mkdirs(F,b=>{if(b)return m(b);O();}):m(o);f.isDirectory()?O():i.readdir(F,b=>{if(b)return m(b)});});});}function a(r){let m;try{m=i.statSync(r);}catch{}if(m&&m.isFile())return;let O=n.dirname(r);try{i.statSync(O).isDirectory()||i.readdirSync(O);}catch(h){if(h&&h.code==="ENOENT")y.mkdirsSync(O);else throw h}i.writeFileSync(r,"");}c.exports={createFile:t(u),createFileSync:a};}),Ut=$((l,c)=>{var t=X().fromCallback,n=G("path"),i=Q(),y=Z(),u=et().pathExists,{areIdentical:a}=it();function r(O,h,C){function F(o,f){i.link(o,f,b=>{if(b)return C(b);C(null);});}i.lstat(h,(o,f)=>{i.lstat(O,(b,P)=>{if(b)return b.message=b.message.replace("lstat","ensureLink"),C(b);if(f&&a(P,f))return C(null);let e=n.dirname(h);u(e,(s,p)=>{if(s)return C(s);if(p)return F(O,h);y.mkdirs(e,d=>{if(d)return C(d);F(O,h);});});});});}function m(O,h){let C;try{C=i.lstatSync(h);}catch{}try{let o=i.lstatSync(O);if(C&&a(o,C))return}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let F=n.dirname(h);return i.existsSync(F)||y.mkdirsSync(F),i.linkSync(O,h)}c.exports={createLink:t(r),createLinkSync:m};}),Yt=$((l,c)=>{var t=G("path"),n=Q(),i=et().pathExists;function y(a,r,m){if(t.isAbsolute(a))return n.lstat(a,O=>O?(O.message=O.message.replace("lstat","ensureSymlink"),m(O)):m(null,{toCwd:a,toDst:a}));{let O=t.dirname(r),h=t.join(O,a);return i(h,(C,F)=>C?m(C):F?m(null,{toCwd:h,toDst:a}):n.lstat(a,o=>o?(o.message=o.message.replace("lstat","ensureSymlink"),m(o)):m(null,{toCwd:a,toDst:t.relative(O,a)})))}}function u(a,r){let m;if(t.isAbsolute(a)){if(m=n.existsSync(a),!m)throw new Error("absolute srcpath does not exist");return {toCwd:a,toDst:a}}else {let O=t.dirname(r),h=t.join(O,a);if(m=n.existsSync(h),m)return {toCwd:h,toDst:a};if(m=n.existsSync(a),!m)throw new Error("relative srcpath does not exist");return {toCwd:a,toDst:t.relative(O,a)}}}c.exports={symlinkPaths:y,symlinkPathsSync:u};}),qt=$((l,c)=>{var t=Q();function n(y,u,a){if(a=typeof u=="function"?u:a,u=typeof u=="function"?!1:u,u)return a(null,u);t.lstat(y,(r,m)=>{if(r)return a(null,"file");u=m&&m.isDirectory()?"dir":"file",a(null,u);});}function i(y,u){let a;if(u)return u;try{a=t.lstatSync(y);}catch{return "file"}return a&&a.isDirectory()?"dir":"file"}c.exports={symlinkType:n,symlinkTypeSync:i};}),Gt=$((l,c)=>{var t=X().fromCallback,n=G("path"),i=nt(),y=Z(),u=y.mkdirs,a=y.mkdirsSync,r=Yt(),m=r.symlinkPaths,O=r.symlinkPathsSync,h=qt(),C=h.symlinkType,F=h.symlinkTypeSync,o=et().pathExists,{areIdentical:f}=it();function b(s,p,d,k){k=typeof d=="function"?d:k,d=typeof d=="function"?!1:d,i.lstat(p,(S,v)=>{!S&&v.isSymbolicLink()?Promise.all([i.stat(s),i.stat(p)]).then(([g,j])=>{if(f(g,j))return k(null);P(s,p,d,k);}):P(s,p,d,k);});}function P(s,p,d,k){m(s,p,(S,v)=>{if(S)return k(S);s=v.toDst,C(v.toCwd,d,(g,j)=>{if(g)return k(g);let L=n.dirname(p);o(L,(E,D)=>{if(E)return k(E);if(D)return i.symlink(s,p,j,k);u(L,w=>{if(w)return k(w);i.symlink(s,p,j,k);});});});});}function e(s,p,d){let k;try{k=i.lstatSync(p);}catch{}if(k&&k.isSymbolicLink()){let g=i.statSync(s),j=i.statSync(p);if(f(g,j))return}let S=O(s,p);s=S.toDst,d=F(S.toCwd,d);let v=n.dirname(p);return i.existsSync(v)||a(v),i.symlinkSync(s,p,d)}c.exports={createSymlink:t(b),createSymlinkSync:e};}),Vt=$((l,c)=>{var{createFile:t,createFileSync:n}=At(),{createLink:i,createLinkSync:y}=Ut(),{createSymlink:u,createSymlinkSync:a}=Gt();c.exports={createFile:t,createFileSync:n,ensureFile:t,ensureFileSync:n,createLink:i,createLinkSync:y,ensureLink:i,ensureLinkSync:y,createSymlink:u,createSymlinkSync:a,ensureSymlink:u,ensureSymlinkSync:a};}),yt=$((l,c)=>{function t(i,{EOL:y=`
20
+ `,finalEOL:u=!0,replacer:a=null,spaces:r}={}){let m=u?y:"";return JSON.stringify(i,a,r).replace(/\n/g,y)+m}function n(i){return Buffer.isBuffer(i)&&(i=i.toString("utf8")),i.replace(/^\uFEFF/,"")}c.exports={stringify:t,stripBom:n};}),Bt=$((l,c)=>{var t;try{t=Q();}catch{t=G("fs");}var n=X(),{stringify:i,stripBom:y}=yt();async function u(F,o={}){typeof o=="string"&&(o={encoding:o});let f=o.fs||t,b="throws"in o?o.throws:!0,P=await n.fromCallback(f.readFile)(F,o);P=y(P);let e;try{e=JSON.parse(P,o?o.reviver:null);}catch(s){if(b)throw s.message=`${F}: ${s.message}`,s;return null}return e}var a=n.fromPromise(u);function r(F,o={}){typeof o=="string"&&(o={encoding:o});let f=o.fs||t,b="throws"in o?o.throws:!0;try{let P=f.readFileSync(F,o);return P=y(P),JSON.parse(P,o.reviver)}catch(P){if(b)throw P.message=`${F}: ${P.message}`,P;return null}}async function m(F,o,f={}){let b=f.fs||t,P=i(o,f);await n.fromCallback(b.writeFile)(F,P,f);}var O=n.fromPromise(m);function h(F,o,f={}){let b=f.fs||t,P=i(o,f);return b.writeFileSync(F,P,f)}var C={readFile:a,readFileSync:r,writeFile:O,writeFileSync:h};c.exports=C;}),Kt=$((l,c)=>{var t=Bt();c.exports={readJson:t.readFile,readJsonSync:t.readFileSync,writeJson:t.writeFile,writeJsonSync:t.writeFileSync};}),pt=$((l,c)=>{var t=X().fromCallback,n=Q(),i=G("path"),y=Z(),u=et().pathExists;function a(m,O,h,C){typeof h=="function"&&(C=h,h="utf8");let F=i.dirname(m);u(F,(o,f)=>{if(o)return C(o);if(f)return n.writeFile(m,O,h,C);y.mkdirs(F,b=>{if(b)return C(b);n.writeFile(m,O,h,C);});});}function r(m,...O){let h=i.dirname(m);if(n.existsSync(h))return n.writeFileSync(m,...O);y.mkdirsSync(h),n.writeFileSync(m,...O);}c.exports={outputFile:t(a),outputFileSync:r};}),Ht=$((l,c)=>{var{stringify:t}=yt(),{outputFile:n}=pt();async function i(y,u,a={}){let r=t(u,a);await n(y,r,a);}c.exports=i;}),zt=$((l,c)=>{var{stringify:t}=yt(),{outputFileSync:n}=pt();function i(y,u,a){let r=t(u,a);n(y,r,a);}c.exports=i;}),Xt=$((l,c)=>{var t=X().fromPromise,n=Kt();n.outputJson=t(Ht()),n.outputJsonSync=zt(),n.outputJSON=n.outputJson,n.outputJSONSync=n.outputJsonSync,n.writeJSON=n.writeJson,n.writeJSONSync=n.writeJsonSync,n.readJSON=n.readJson,n.readJSONSync=n.readJsonSync,c.exports=n;}),Qt=$((l,c)=>{var t=Q(),n=G("path"),i=lt().copy,y=ct().remove,u=Z().mkdirp,a=et().pathExists,r=it();function m(o,f,b,P){typeof b=="function"&&(P=b,b={}),b=b||{};let e=b.overwrite||b.clobber||!1;r.checkPaths(o,f,"move",b,(s,p)=>{if(s)return P(s);let{srcStat:d,isChangingCase:k=!1}=p;r.checkParentPaths(o,d,f,"move",S=>{if(S)return P(S);if(O(f))return h(o,f,e,k,P);u(n.dirname(f),v=>v?P(v):h(o,f,e,k,P));});});}function O(o){let f=n.dirname(o);return n.parse(f).root===f}function h(o,f,b,P,e){if(P)return C(o,f,b,e);if(b)return y(f,s=>s?e(s):C(o,f,b,e));a(f,(s,p)=>s?e(s):p?e(new Error("dest already exists.")):C(o,f,b,e));}function C(o,f,b,P){t.rename(o,f,e=>e?e.code!=="EXDEV"?P(e):F(o,f,b,P):P());}function F(o,f,b,P){i(o,f,{overwrite:b,errorOnExist:!0,preserveTimestamps:!0},e=>e?P(e):y(o,P));}c.exports=m;}),Zt=$((l,c)=>{var t=Q(),n=G("path"),i=lt().copySync,y=ct().removeSync,u=Z().mkdirpSync,a=it();function r(F,o,f){f=f||{};let b=f.overwrite||f.clobber||!1,{srcStat:P,isChangingCase:e=!1}=a.checkPathsSync(F,o,"move",f);return a.checkParentPathsSync(F,P,o,"move"),m(o)||u(n.dirname(o)),O(F,o,b,e)}function m(F){let o=n.dirname(F);return n.parse(o).root===o}function O(F,o,f,b){if(b)return h(F,o,f);if(f)return y(o),h(F,o,f);if(t.existsSync(o))throw new Error("dest already exists.");return h(F,o,f)}function h(F,o,f){try{t.renameSync(F,o);}catch(b){if(b.code!=="EXDEV")throw b;return C(F,o,f)}}function C(F,o,f){return i(F,o,{overwrite:f,errorOnExist:!0,preserveTimestamps:!0}),y(F)}c.exports=r;}),te=$((l,c)=>{var t=X().fromCallback;c.exports={move:t(Qt()),moveSync:Zt()};}),ee=$((l,c)=>{c.exports={...nt(),...lt(),...Jt(),...Vt(),...Xt(),...Z(),...te(),...pt(),...et(),...ct()};});function re(){return process.cwd()}function ne(){let{CHROMATIC_ARCHIVE_LOCATION:l}=process.env;return l}function dt(l){let c=ne()||l;return ft__default.default.resolve(re(),c,"chromatic-archives")}function ie(l){return ft__default.default.resolve(dt(l),"archive")}function oe(l){let c=dt(l);if(!xt__default.default.existsSync(c))throw new Error(`Chromatic archives directory cannot be found: ${c}
21
21
 
22
- Please make sure that you have run your E2E tests, or have set the CHROMATIC_ARCHIVE_LOCATION env var if the output directory for the tests is not in the standard location.`)}var ht=jt(te());function mt(p){return `w${p.width}h${p.height}`}function oe(p){let c=p.match(/w(\d+)h(\d+)/);return {width:Number(c[1]),height:Number(c[2])}}var ce="snapshot.json";function se(p){let c=p.split(".");return c.slice(0,c.length-3).join(".")}function ae(p){let c=p.split("."),t=c[c.length-3];return oe(t)}async function ue(p){return (await promises.readdir(p)).filter(c=>c.endsWith(`.${ce}`))}var fe="stories.json";function le(p,c){let{stories:t}=p,n=t.map(i=>{let l=i.parameters.server.id,f=c[l];return {...i,parameters:{...i.parameters,chromatic:{...i.parameters.chromatic,modes:pe(f)},viewport:{viewports:de(f),defaultViewport:mt(me(f))}}}});return {...p,stories:n}}async function ye(p){return (await promises.readdir(p)).filter(c=>c.endsWith(`.${fe}`))}function pe(p){return p.reduce((c,t)=>{let n=mt(t);return c[n]={viewport:n},c},{})}function de(p){return p.reduce((c,t)=>{let n=mt(t);return c[n]={name:n,styles:{width:`${t.width}px`,height:`${t.height}px`}},c},{})}function me(p){let c=(t,n)=>t.width<n.width?1:t.width>n.width?-1:0;return p.sort(c)[0]}async function he(){let p=ne(),c=await ue(p),t=ve(c),n=dt(),i=(await ye(n)).map(l=>ft__default.default.resolve(n,l));await Promise.all(i.map(async l=>{let f=await(0, ht.readJSON)(l),a=le(f,t);await(0, ht.outputJSON)(l,a);}));}function ve(p){let c={};return p.forEach(t=>{let n=se(t),i=c[n]||[];i.push(ae(t)),c[n]=i;}),c}function bt(p,c){ie(),he().then(()=>{let t=ft.resolve(ft.dirname(G.resolve("storybook/package.json")),"./index.js");child_process.execFileSync("node",[t,"dev",...p,"-c",c],{stdio:"inherit"});});}var we=process.argv.slice(2),be=ft__default.default.resolve(__dirname,"../storybook-config");bt(we,be);
22
+ Please make sure that you have run your E2E tests, or have set the CHROMATIC_ARCHIVE_LOCATION env var if the output directory for the tests is not in the standard location.`)}var ht=Lt(ee());function mt(l){return `w${l.width}h${l.height}`}function ce(l){let c=l.match(/w(\d+)h(\d+)/);return {width:Number(c[1]),height:Number(c[2])}}var se="snapshot.json";function ae(l){let c=l.split(".");return c.slice(0,c.length-3).join(".")}function ue(l){let c=l.split("."),t=c[c.length-3];return ce(t)}async function fe(l){return (await promises.readdir(l)).filter(c=>c.endsWith(`.${se}`))}var le="stories.json";function ye(l,c){let{stories:t}=l,n=t.map(i=>{let y=i.parameters.server.id,u=c[y];return {...i,parameters:{...i.parameters,chromatic:{...i.parameters.chromatic,modes:de(u)},viewport:{viewports:me(u),defaultViewport:mt(he(u))}}}});return {...l,stories:n}}async function pe(l){return (await promises.readdir(l)).filter(c=>c.endsWith(`.${le}`))}function de(l){return l.reduce((c,t)=>{let n=mt(t);return c[n]={viewport:n},c},{})}function me(l){return l.reduce((c,t)=>{let n=mt(t);return c[n]={name:n,styles:{width:`${t.width}px`,height:`${t.height}px`}},c},{})}function he(l){let c=(t,n)=>t.width<n.width?1:t.width>n.width?-1:0;return l.sort(c)[0]}async function ve(l){let c=ie(l),t=await fe(c),n=Se(t),i=dt(l),y=(await pe(i)).map(u=>ft__default.default.resolve(i,u));await Promise.all(y.map(async u=>{let a=await(0, ht.readJSON)(u),r=ye(a,n);await(0, ht.outputJSON)(u,r);}));}function Se(l){let c={};return l.forEach(t=>{let n=ae(t),i=c[n]||[];i.push(ue(t)),c[n]=i;}),c}function bt(l,c,t){oe(t),ve(t).then(()=>{let n=ft.resolve(ft.dirname(G.resolve("storybook/package.json")),"./index.js");child_process.execFileSync("node",[n,"dev",...l,"-c",c],{stdio:"inherit"});});}var gt="test-archives";var be=process.argv.slice(2),ge=ft__default.default.resolve(__dirname,"../storybook-config");bt(be,ge,gt);
23
23
  //# sourceMappingURL=out.js.map
24
24
  //# sourceMappingURL=archive-storybook.js.map