-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlib.js
More file actions
2 lines (2 loc) · 53.7 KB
/
lib.js
File metadata and controls
2 lines (2 loc) · 53.7 KB
1
2
module.exports=function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var t={};return n.m=e,n.c=t,n.p="",n(0)}([function(e,n,t){"use strict";function r(e){const n=g.defer();E.join(process.env.DEPLOYMENT_SOURCE,process.env.DEPLOY_DIST_FOLDER);console.log("Running Webpack...");e({entry:E.join(process.env.DEPLOYMENT_SOURCE,process.env.WEBPACK_OUTPUT_FILE),target:"node",output:{path:E.join(process.env.DEPLOYMENT_SOURCE,process.env.DEPLOY_DIST_FOLDER),filename:process.env.WEBPACK_OUTPUT_FILE,library:"index",libraryTarget:"commonjs2"},node:{__filename:!1,__dirname:!1},plugins:[new e.optimize.UglifyJsPlugin({compress:{warnings:!1},output:{comments:!1}})],module:{loaders:[{test:/\.json$/,loader:"json-loader"}]}},function(e,t){try{}catch(n){"ENOENT"!==n.code&&(e=n)}e&&(console.log("Full Error"),console.log(JSON.stringify(e)),n.reject({success:!1,error:e}));var r=t.toJson();r.errors.length>0&&(console.log("JSonStats:"),console.log(JSON.stringify(r)),n.reject({success:!1,error:r.errors}));const o=r.modules.reduce(function(e,n){return n.identifier.indexOf(E.sep)>=0&&n.identifier.indexOf("node_modules")<0&&e.push(n.identifier),e},[]);r.warnings.length>0&&n.resolve({success:!0,warnings:r.warnings,webpackedFiles:o}),n.resolve({success:!0,webpackedFiles:o})});return n.promise}function o(e){function n(t,o){var i={};S.readdir(t,function(c,s){if(c)return o(c);var u=s.length;return u?void s.forEach(function(c){return r.indexOf(c)>=0||e.indexOf(E.resolve(t,c))>=0?void(--u||o(null,i)):(c=E.resolve(t,c),void S.stat(c,function(e,r){r&&r.isDirectory()?n(c,function(e,n){i=Object.assign(i,n),--u||o(e,i)}):(i[t]=i[t]?i[t]:[],i[t].push(c),--u||o(null,i))}))}):o(null,i)})}console.log("Start getFoldersToCopy");const t=g.defer(),r=JSON.parse(process.env.DEPLOY_EXCLUDE_FOLDERS);return n(process.env.DEPLOYMENT_SOURCE,function(e,n){e?t.reject({success:!1,action:"getFoldersToCopy",error:e}):t.resolve(n)}),t.promise}function i(e){console.log("Start copyFiles");var n=g.defer();return o(e).then(function(e){const t=process.env.DEPLOYMENT_SOURCE,r=E.join(process.env.DEPLOYMENT_SOURCE,process.env.DEPLOY_DIST_FOLDER);for(var o in e)if(e.hasOwnProperty(o)){for(var i=[],s=0;s<e[o].length;s++){var u=e[o][s];i.push(c(u,u.replace(t,r)))}g.all(i).then(function(e){n.resolve(!0)})}}),n.promise}function c(e,n){var t=g.defer();return S.readFile(e,function(e,r){e?t.reject({error:error.message,stack:error.stack}):(S.ensureDirSync(E.dirname(n)),S.writeFile(n,r,function(e){e?t.reject({error:e.message,stack:e.stack}):t.resolve({success:!0})}))}),t.promise}function s(){console.log("Validating and Defaulting ENV variables."),process.env.WEBPACK_OUTPUT_FILE=process.env.WEBPACK_OUTPUT_FILE?process.env.WEBPACK_OUTPUT_FILE:"azure.deps.js",process.env.DEPLOY_DIST_FOLDER=process.env.DEPLOY_DIST_FOLDER?process.env.DEPLOY_DIST_FOLDER:"dist";try{var e=JSON.parse(process.env.DEPLOY_EXCLUDE_FOLDERS);if(e.length<1)throw new Error("Default Not Set")}catch(e){console.log("WARNING: DEPLOY_EXCLUDE_FOLDERS is not set, or not set to an array. Values defaulted."),console.log('Enter a proper value in .deployment or as an ENV variable. e.g. [".git", ".deploy", ".idea", "node_modules", "dist", "package.json", ".deployment", ".gitignore", ".gitmodules", ".npmignore"]'),process.env.DEPLOY_EXCLUDE_FOLDERS='[".git", ".deploy", ".idea", "node_modules", "'+process.env.DEPLOY_DIST_FOLDER+'", "package.json", ".deployment", ".gitignore", ".gitmodules", ".npmignore"]'}}function u(){console.log("Start getFunctionFolders");var e=g.defer(),n=[];return S.readdir(process.env.DEPLOYMENT_SOURCE,function(t,r){if(t)e.reject({success:!1,error:t});else{for(var o=JSON.parse(process.env.DEPLOY_EXCLUDE_FOLDERS),i=0;i<r.length;i++)o.indexOf(r[i])<0&&S.statSync(E.join(process.env.DEPLOYMENT_SOURCE,r[i])).isDirectory()&&n.push(r[i]);e.resolve({success:!0,top_folders:n})}}),e.promise}function a(e){console.log("Start catalogDependencyFiles");const n=g.defer(),t=process.env.DEPLOYMENT_SOURCE,r=E.join(t,e,"index.js");return S.readFile(r,"utf8",function(e,t){e&&"ENOENT"==e.code?n.reject({success:!0,error:e}):e&&n.reject({success:!1,error:e}),f(r,t).then(p).then(m).then(function(e){n.resolve({success:!0,results:e})}).done(function(){},function(e){n.reject({success:!1,action:"createDependencyDone",error:e})})}),n.promise}function f(e,n){var t=g.defer(),r={};const o={__dirname:"'"+E.dirname(e)+"'"};for(var i=/require\s*\(['"]([^'"]+)['"]\)/g,c=i.exec(n);null!==c;){var s=c[1].search(/^[\.]+[\\\/]/)<0?E.normalize(c[1]):E.normalize(E.join(E.dirname(e),c[1]));r[s]={},r[s].find=c[0],r[s].files=[c[1]],r[s].replace="'"+s.replace(E.normalize(process.env.DEPLOYMENT_SOURCE)+E.sep,"")+"'",c=i.exec(n)}for(var u=/require\s*\(\s*\(*\s*path\.join\s*\(([^\)]+)\)\s*\)*\s*\)/g,a=u.exec(n);null!==a;){var f=a[1].split(",").map(function(e){var n=o[e]?e.replace(e,o[e]).trim():e.trim(),t=n.split("+").map(function(e){return/^'.+'$/.test(e.trim())?e.trim().replace(/^'/,"").replace(/'$/,""):/^".+"$/.test(e.trim())?e.trim().replace(/^"/,"").replace(/"$/,""):"*"}).join("");return t}).join(E.sep);f=E.normalize(f),r[f]={},r[f].find=a[0];var p="\\"===E.sep?/\//g:/\\/g,d=a[1].replace(/__dirname/g,"'"+E.dirname(e)+"'").split(/\s*,\s*/g).reduce(l,E.sep);d=d.split(/\s*\+\s*/g).reduce(l,"+").replace(p,E.sep).replace(E.sep+E.sep,E.sep),r[f].replace=d.replace(E.normalize(process.env.DEPLOYMENT_SOURCE)+E.sep,""),r[f].replace=/\.js(on)*['"]/i.test(r[f].replace)?r[f].replace:r[f].replace+" + '.js'",r[f].files=[],a=u.exec(n)}return t.resolve({success:!0,index:e,paths:r}),t.promise}function l(e,n,t,r){var o=/'[^']+'/,i=/"[^"]+"/,c=/^['"]/,s=/['"]$/,u=e[0],a="";if(o.test(e)&&s.test(e)&&c.test(n)&&(o.test(n)||i.test(n)))a=e.replace(c,"'").replace(s,"")+u+n.replace(c,"").replace(s,"'");else if(s.test(e)){var f="+"===u?"'"+u:u+"' + ";a=e.replace(s,f)+n.replace(/"/g,"'")}else a=e+u+n;return a=t+1===r.length?a.slice(2):a}function p(e){var n=g.defer(),t=[],r=e.paths;for(var o in r)if(r.hasOwnProperty(o)&&!(o.search(/[\\\/]/)<0)){var i=E.normalize(o),c="",s="";i.indexOf("*")<0?(c=E.dirname(i),s=E.basename(i)):(s=i.substr(0,i.indexOf("*")),c=s.substr(0,s.lastIndexOf(E.sep))),t[t.length]=r[o].filePromise=d(c,i)}return g.allSettled(t).then(function(t){for(var o in r)r.hasOwnProperty(o)&&r[o].filePromise&&(r[o].files=r[o].filePromise.valueOf(),delete r[o].filePromise);n.resolve({success:!0,action:"resolvePaths",index:e.index,paths:r})}).catch(function(e){n.reject({success:!1,action:"resolvePaths",error:e})}),n.promise}function d(e,n){function t(e,n,r){var o=[];S.readdir(e,function(i,c){if(i)return r(i);var s=c.length;return s?void c.forEach(function(i){i=E.resolve(e,i),S.stat(i,function(e,c){c&&c.isDirectory()?v(i,n,!0)?t(i,n,function(e,n){o=o.concat(n),--s||r(null,o)}):--s||r(null,o):(v(i,n,!1)&&o.push(i),--s||r(null,o))})}):r(null,o)})}const r=g.defer();return n.indexOf("*")<0?S.stat(n,function(e,t){e&&""!==E.extname(n)?r.resolve([]):e?S.stat(n+".js",function(e,t){r.resolve(e?[]:n+".js")}):t.isDirectory()?S.stat(E.join(n,"index.js"),function(e,t){r.resolve(e?[]:[E.join(n,"index.js")])}):r.resolve([n])}):t(e,n,function(t,o){t?r.reject({success:!1,action:"getFiles",dir:e,pattern:n,files:o,error:t}):r.resolve(o)}),r.promise}function v(e,n,t){for(var r=n.split("*"),o=e,i=0;i<r.length;i++)switch(i){case r.length-1:return!!(o.endsWith(r[i])||(o.match(new RegExp("\\"+E.sep,"g"))||[]).length<2);case 0:if(!o.startsWith(r[i]))return!1;o=o.replace(r[i],"");break;default:var c=o.indexOf(r[i]);if(c<0&&!t)return!1;if(c<0&&t){var s=r[i].substr(0,r[i].lastIndexOf(E.sep));if(""===s)return!0;var u=o.indexOf(s);return!(u<0)&&(u>=0&&o.substr(u+s.length).trim().length<1)}c>=0&&(o=o.substr(c+r[i].length))}}function y(e){console.log("start CreateDependencyFileJS");var n=g.defer(),t="\tglobal.azureDeps = (global.azureDeps) ? global.azureDeps : {};\n",r=[],o={};return e.forEach(function(i,c,s){if(i.value||!i.reason.success){i.reason||i.value||(console.log("Something really bad happened..."),console.log(JSON.stringify(e)),n.reject({success:!1,action:"createDepenencyValidate",fullResults:e,this:i})),r.push(i.value.results.index);var u=i.value.results.paths;Object.keys(u).forEach(function(e,i,a){u[e].files.forEach(function(e,u,f){if(!o[e]){var l=e.replace(E.normalize(process.env.DEPLOYMENT_SOURCE)+E.sep,"");t+='\tglobal.azureDeps["'+l.replace(/[\\]/g,"\\$&")+'"] =\trequire("'+e.replace(/[\\]/g,"\\$&")+'");\n',".js"===E.extname(l).toLowerCase()&&(t+="index"===E.basename(l,".js")?'\tglobal.azureDeps["'+E.dirname(l).replace(/[\\]/g,"\\$&")+'"] =\t global.azureDeps["'+l.replace(/[\\]/g,"\\$&")+'"];\n':'\tglobal.azureDeps["'+E.join(E.dirname(l),E.basename(l,".js")).replace(/[\\]/g,"\\$&")+'"] =\t global.azureDeps["'+l.replace(/[\\]/g,"\\$&")+'"];\n'),o[e]=!0}c+1===s.length&&i+1===a.length&&u+1===f.length&&n.resolve({success:!0,action:"createDependencyFileJS",js:t,indexes:r})})})}}),n.promise}function h(e){console.log("Start createDependencyFile");var n=g.defer(),t=E.join(process.env.DEPLOYMENT_SOURCE,process.env.WEBPACK_OUTPUT_FILE);return S.writeFile(t,e.js,function(r){r?n.reject({success:!1,action:"Write Dep File",file:t,error:r}):n.resolve({success:!0,indexes:e.indexes})}),n.promise}function m(e){console.log("Start updateIndex");const n=g.defer(),t=e.index,r=e.index.split(E.sep).slice(0,-2).concat([process.env.DEPLOY_DIST_FOLDER],e.index.split(E.sep).slice(-2)).join(E.sep);E.join(E.dirname(e.index),process.env.WEBPACK_OUTPUT_FILE);return S.readFile(t,"utf8",function(t,o){t&&n.reject({success:!1,error:t});for(var i in e.paths)if(e.paths.hasOwnProperty(i)){var c=e.paths[i],s=c.find.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&").replace(/['"]/g,"['\"]");o=o.replace(new RegExp(s,"g"),"global.azureDeps["+c.replace.replace(/[\\]/g,"\\$&")+"]")}var u=/^\s*['"]use strict['"];/g,a="'use strict';\n",f="require('"+E.join(process.env.DEPLOYMENT_TARGET,process.env.WEBPACK_OUTPUT_FILE).replace(/[\\]/g,"\\$&")+"');\n";o=u.test(o)?o.replace(u,a+f):f+o,S.ensureDir(E.dirname(r),function(t){t&&n.reject({success:!1,action:"UpdateIndex-ensureDir",index:r,error:t}),S.writeFile(r,o,function(t){t&&n.reject({success:!1,action:"UpdateIndex-writeIndex",index:r,error:t}),n.resolve({success:!0,index:e.index,paths:e.paths,newIndex:r})})})}),n.promise}const E=t(1),S=t(2),g=t(41);t(42).config({path:E.join(process.env.DEPLOYMENT_SOURCE,".deployment")}),e.exports.createDistribution=function(e){console.log("Start: createDistribution");var n=g.defer(),t=[];return s(),u().then(function(o){for(var c=o.top_folders,s=0;s<c.length;s++)console.log("Start Folder:",c[s]),t.push(a(c[s]));g.allSettled(t).then(y).then(h).then(function(t){r(e).then(function(e){var r=Array.from(new Set(t.indexes.concat(e.webpackedFiles)));i(r).then(function(e){n.resolve(e)},function(e){n.reject({success:!1,action:"copyDist",error:{message:err.message,object:e}})})}).catch(function(e){n.reject({success:!1,action:"webPackIt",error:{message:err.message,object:e}})})}).catch(function(e){n.reject({success:!1,action:"prepWork",error:{message:e.message,object:e}})})}),n.promise}},function(e,n){e.exports=require("path")},function(e,n,t){var r=t(3),o={},i=t(4);Object.keys(i).forEach(function(e){o[e]=i[e]});var c=o;r(c,t(13)),r(c,t(22)),r(c,t(18)),r(c,t(25)),r(c,t(27)),r(c,t(32)),r(c,t(33)),r(c,t(34)),r(c,t(40)),e.exports=c;var s={};Object.defineProperty(s,"spaces",{get:function(){return c.spaces},set:function(e){c.spaces=e}}),e.exports.jsonfile=s},function(e,n){function t(){var e=[].slice.call(arguments).filter(function(e){return e}),n=e.shift();return e.forEach(function(e){Object.keys(e).forEach(function(t){n[t]=e[t]})}),n}e.exports=t},function(e,n,t){function r(){}function o(e){function n(e,n,t){function r(e,n,t){return E(e,n,function(o){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?("function"==typeof t&&t.apply(this,arguments),c()):i([r,[e,n,t]])})}return"function"==typeof n&&(t=n,n=null),r(e,n,t)}function t(e,n,t,r){function o(e,n,t,r){return S(e,n,t,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?("function"==typeof r&&r.apply(this,arguments),c()):i([o,[e,n,t,r]])})}return"function"==typeof t&&(r=t,t=null),o(e,n,t,r)}function r(e,n,t,r){function o(e,n,t,r){return g(e,n,t,function(s){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?("function"==typeof r&&r.apply(this,arguments),c()):i([o,[e,n,t,r]])})}return"function"==typeof t&&(r=t,t=null),o(e,n,t,r)}function s(e,n,t){function r(e,n){n&&n.sort&&n.sort(),!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof t&&t.apply(this,arguments),c()):i([f,[o]])}var o=[e];return"function"!=typeof n?o.push(n):t=n,o.push(r),f(o)}function f(n){return w.apply(e,n)}function l(e,n){return this instanceof l?(k.apply(this,arguments),this):l.apply(Object.create(l.prototype),arguments)}function p(){var e=this;m(e.path,e.flags,e.mode,function(n,t){n?(e.autoClose&&e.destroy(),e.emit("error",n)):(e.fd=t,e.emit("open",t),e.read())})}function d(e,n){return this instanceof d?(O.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function v(){var e=this;m(e.path,e.flags,e.mode,function(n,t){n?(e.destroy(),e.emit("error",n)):(e.fd=t,e.emit("open",t))})}function y(e,n){return new l(e,n)}function h(e,n){return new d(e,n)}function m(e,n,t,r){function o(e,n,t,r){return j(e,n,t,function(s,u){!s||"EMFILE"!==s.code&&"ENFILE"!==s.code?("function"==typeof r&&r.apply(this,arguments),c()):i([o,[e,n,t,r]])})}return"function"==typeof t&&(r=t,t=null),o(e,n,t,r)}u(e),e.gracefulify=o,e.FileReadStream=l,e.FileWriteStream=d,e.createReadStream=y,e.createWriteStream=h;var E=e.readFile;e.readFile=n;var S=e.writeFile;e.writeFile=t;var g=e.appendFile;g&&(e.appendFile=r);var w=e.readdir;if(e.readdir=s,"v0.8"===process.version.substr(0,4)){var x=a(e);l=x.ReadStream,d=x.WriteStream}var k=e.ReadStream;l.prototype=Object.create(k.prototype),l.prototype.open=p;var O=e.WriteStream;d.prototype=Object.create(O.prototype),d.prototype.open=v,e.ReadStream=l,e.WriteStream=d;var j=e.open;return e.open=m,e}function i(e){p("ENQUEUE",e[0].name,e[1]),f.push(e)}function c(){var e=f.shift();e&&(p("RETRY",e[0].name,e[1]),e[0].apply(null,e[1]))}var s=t(5),u=t(6),a=t(9),f=[],l=t(11),p=r;l.debuglog?p=l.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(p=function(){var e=l.format.apply(l,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){p(f),t(12).equal(f.length,0)}),e.exports=o(t(7)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&(e.exports=o(s)),e.exports.close=s.close=function(e){return function(n,t){return e.call(s,n,function(e){e||c(),"function"==typeof t&&t.apply(this,arguments)})}}(s.close),e.exports.closeSync=s.closeSync=function(e){return function(n){var t=e.apply(s,arguments);return c(),t}}(s.closeSync)},function(e,n){e.exports=require("fs")},function(e,n,t){function r(e){v.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&o(e),e.lutimes||i(e),e.chown=u(e.chown),e.fchown=u(e.fchown),e.lchown=u(e.lchown),e.chmod=c(e.chmod),e.fchmod=c(e.fchmod),e.lchmod=c(e.lchmod),e.chownSync=a(e.chownSync),e.fchownSync=a(e.fchownSync),e.lchownSync=a(e.lchownSync),e.chmodSync=s(e.chmodSync),e.fchmodSync=s(e.fchmodSync),e.lchmodSync=s(e.lchmodSync),e.stat=f(e.stat),e.fstat=f(e.fstat),e.lstat=f(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.lchmod||(e.lchmod=function(e,n,t){t&&process.nextTick(t)},e.lchmodSync=function(){}),e.lchown||(e.lchown=function(e,n,t,r){r&&process.nextTick(r)},e.lchownSync=function(){}),"win32"===m&&(e.rename=function(n){return function(t,r,o){var i=Date.now(),c=0;n(t,r,function s(u){return u&&("EACCES"===u.code||"EPERM"===u.code)&&Date.now()-i<6e4?(setTimeout(function(){e.stat(r,function(e,i){e&&"ENOENT"===e.code?n(t,r,s):o(u)})},c),void(c<100&&(c+=10))):void(o&&o(u))})}}(e.rename)),e.read=function(n){return function(t,r,o,i,c,s){var u;if(s&&"function"==typeof s){var a=0;u=function(f,l,p){return f&&"EAGAIN"===f.code&&a<10?(a++,n.call(e,t,r,o,i,c,u)):void s.apply(this,arguments)}}return n.call(e,t,r,o,i,c,u)}}(e.read),e.readSync=function(n){return function(t,r,o,i,c){for(var s=0;;)try{return n.call(e,t,r,o,i,c)}catch(e){if("EAGAIN"===e.code&&s<10){s++;continue}throw e}}}(e.readSync)}function o(e){e.lchmod=function(n,t,r){e.open(n,v.O_WRONLY|v.O_SYMLINK,t,function(n,o){return n?void(r&&r(n)):void e.fchmod(o,t,function(n){e.close(o,function(e){r&&r(n||e)})})})},e.lchmodSync=function(n,t){var r,o=e.openSync(n,v.O_WRONLY|v.O_SYMLINK,t),i=!0;try{r=e.fchmodSync(o,t),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return r}}function i(e){v.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(n,t,r,o){e.open(n,v.O_SYMLINK,function(n,i){return n?void(o&&o(n)):void e.futimes(i,t,r,function(n){e.close(i,function(e){o&&o(n||e)})})})},e.lutimesSync=function(n,t,r){var o,i=e.openSync(n,v.O_SYMLINK),c=!0;try{o=e.futimesSync(i,t,r),c=!1}finally{if(c)try{e.closeSync(i)}catch(e){}else e.closeSync(i)}return o}):(e.lutimes=function(e,n,t,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}function c(e){return e?function(n,t,r){return e.call(d,n,t,function(e){p(e)&&(e=null),r&&r.apply(this,arguments)})}:e}function s(e){return e?function(n,t){try{return e.call(d,n,t)}catch(e){if(!p(e))throw e}}:e}function u(e){return e?function(n,t,r,o){return e.call(d,n,t,r,function(e){p(e)&&(e=null),o&&o.apply(this,arguments)})}:e}function a(e){return e?function(n,t,r){try{return e.call(d,n,t,r)}catch(e){if(!p(e))throw e}}:e}function f(e){return e?function(n,t){return e.call(d,n,function(e,n){return n?(n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296),void(t&&t.apply(this,arguments))):t.apply(this,arguments)})}:e}function l(e){return e?function(n){var t=e.call(d,n);return t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296),t}:e}function p(e){if(!e)return!0;if("ENOSYS"===e.code)return!0;var n=!process.getuid||0!==process.getuid();return!(!n||"EINVAL"!==e.code&&"EPERM"!==e.code)}var d=t(7),v=t(8),y=process.cwd,h=null,m=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return h||(h=y.call(process)),h};try{process.cwd()}catch(e){}var E=process.chdir;process.chdir=function(e){h=null,E.call(process,e)},e.exports=r},function(e,n,t){"use strict";function r(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var n={__proto__:e.__proto__};else var n=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}),n}var o=t(5);e.exports=r(o)},function(e,n){e.exports=require("constants")},function(e,n,t){function r(e){function n(t,r){if(!(this instanceof n))return new n(t,r);o.call(this);var i=this;this.path=t,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var c=Object.keys(r),s=0,u=c.length;s<u;s++){var a=c[s];this[a]=r[a]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}return null!==this.fd?void process.nextTick(function(){i._read()}):void e.open(this.path,this.flags,this.mode,function(e,n){return e?(i.emit("error",e),void(i.readable=!1)):(i.fd=n,i.emit("open",n),void i._read())})}function t(n,r){if(!(this instanceof t))return new t(n,r);o.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var i=Object.keys(r),c=0,s=i.length;c<s;c++){var u=i[c];this[u]=r[u]}if(void 0!==this.start){if("number"!=typeof this.start)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=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}return{ReadStream:n,WriteStream:t}}var o=t(10).Stream;e.exports=r},function(e,n){e.exports=require("stream")},function(e,n){e.exports=require("util")},function(e,n){e.exports=require("assert")},function(e,n,t){e.exports={copy:t(14)}},function(e,n,t){function r(e,n,t,r){"function"!=typeof t||r?("function"==typeof t||t instanceof RegExp)&&(t={filter:t}):(r=t,t={}),r=r||function(){},t=t||{},t.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\nsee https://github.com/jprichardson/node-fs-extra/issues/269");var u=process.cwd(),a=i.resolve(u,e),f=i.resolve(u,n);return a===f?r(new Error("Source and destination must not be the same.")):void o.lstat(e,function(u,a){if(u)return r(u);var f=null;if(a.isDirectory()){var l=n.split(i.sep);l.pop(),f=l.join(i.sep)}else f=i.dirname(n);o.exists(f,function(o){return o?c(e,n,t,r):void s.mkdirs(f,function(o){return o?r(o):void c(e,n,t,r)})})})}var o=t(4),i=t(1),c=t(15),s=t(18);e.exports=r},function(e,n,t){function r(e,n,t,r){function s(e){if(N++,O)if(O instanceof RegExp){if(console.warn("Warning: fs-extra: Passing a RegExp filter is deprecated, use a function"),!O.test(e))return g(!0)}else if("function"==typeof O&&!O(e))return g(!0);return u(e)}function u(e){var n=T?o.stat:o.lstat;R++,n(e,function(n,t){if(n)return S(n);var r={name:e,mode:t.mode,mtime:t.mtime,atime:t.atime,stats:t};return t.isDirectory()?p(r):t.isFile()||t.isCharacterDevice()||t.isBlockDevice()?a(r):t.isSymbolicLink()?y(e):void 0})}function a(e){var n=e.name.replace(x,k.replace("$","$$$$"));E(n,function(t){t?f(e,n):b?l(n,function(){f(e,n)}):D?S(new Error(n+" already exists")):g()})}function f(e,n){var t=o.createReadStream(e.name),r=o.createWriteStream(n,{mode:e.mode});t.on("error",S),r.on("error",S),j?j(t,r,e):r.on("open",function(){t.pipe(r)}),r.once("close",function(){o.chmod(n,e.mode,function(t){return t?S(t):void(F?c.utimesMillis(n,e.atime,e.mtime,function(e){return e?S(e):g()}):g())})})}function l(e,n){o.unlink(e,function(e){return e?S(e):n()})}function p(e){var n=e.name.replace(x,k.replace("$","$$$$"));E(n,function(t){return t?d(e,n):void v(e.name)})}function d(e,n){o.mkdir(n,e.mode,function(t){return t?S(t):void o.chmod(n,e.mode,function(n){return n?S(n):void v(e.name)})})}function v(e){o.readdir(e,function(n,t){return n?S(n):(t.forEach(function(n){s(i.join(e,n))}),g())})}function y(e){var n=e.replace(x,k);o.readlink(e,function(e,t){return e?S(e):void h(t,n)})}function h(e,n){T&&(e=i.resolve(w,e)),E(n,function(t){return t?m(e,n):void o.readlink(n,function(t,r){return t?S(t):(T&&(r=i.resolve(w,r)),r===e?g():l(n,function(){m(e,n)}))})})}function m(e,n){o.symlink(e,n,function(e){return e?S(e):g()})}function E(e,n){o.lstat(e,function(e){return n(e?"ENOENT"===e.code?!0:!1:!1)})}function S(e){if(!_&&void 0!==r)return _=!0,r(e)}function g(e){if(e||R--,P++,N===P&&0===R&&void 0!==r)return r(null)}r||(r=t,t={});var w=process.cwd(),x=i.resolve(w,e),k=i.resolve(w,n),O=t.filter,j=t.transform,b=t.overwrite;void 0===b&&(b=t.clobber),void 0===b&&(b=!0);var D=t.errorOnExist,T=t.dereference,F=t.preserveTimestamps===!0,N=0,P=0,R=0,_=!1;s(x)}var o=t(4),i=t(1),c=t(16);e.exports=r},function(e,n,t){function r(){var e=u.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));e=u.join(a.tmpdir(),e);var n=new Date(1435410243862);s.writeFileSync(e,"https://github.com/jprichardson/node-fs-extra/pull/141");var t=s.openSync(e,"r+");return s.futimesSync(t,n,n),s.closeSync(t),s.statSync(e).mtime>1435410243e3}function o(e){var n=u.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));n=u.join(a.tmpdir(),n);var t=new Date(1435410243862);s.writeFile(n,"https://github.com/jprichardson/node-fs-extra/pull/141",function(r){return r?e(r):void s.open(n,"r+",function(r,o){return r?e(r):void s.futimes(o,t,t,function(t){return t?e(t):void s.close(o,function(t){return t?e(t):void s.stat(n,function(n,t){return n?e(n):void e(null,t.mtime>1435410243e3)})})})})})}function i(e){if("number"==typeof e)return 1e3*Math.floor(e/1e3);if(e instanceof Date)return new Date(1e3*Math.floor(e.getTime()/1e3));throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}function c(e,n,t,r){s.open(e,"r+",function(e,o){return e?r(e):void s.futimes(o,n,t,function(e){s.close(o,function(n){r&&r(e||n)})})})}var s=t(4),u=t(1),a=t(17);e.exports={hasMillisRes:o,hasMillisResSync:r,timeRemoveMillis:i,utimesMillis:c}},function(e,n){e.exports=require("os")},function(e,n,t){e.exports={mkdirs:t(19),mkdirsSync:t(21),mkdirp:t(19),mkdirpSync:t(21),ensureDir:t(19),ensureDirSync:t(21)}},function(e,n,t){function r(e,n,t,u){if("function"==typeof n?(t=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&c(e)){var a=new Error(e+" contains invalid WIN32 path characters.");return a.code="EINVAL",t(a)}var f=n.mode,l=n.fs||o;void 0===f&&(f=s&~process.umask()),u||(u=null),t=t||function(){},e=i.resolve(e),l.mkdir(e,f,function(o){if(!o)return u=u||e,t(null,u);switch(o.code){case"ENOENT":if(i.dirname(e)===e)return t(o);r(i.dirname(e),n,function(o,i){o?t(o,i):r(e,n,t,i)});break;default:l.stat(e,function(e,n){e||!n.isDirectory()?t(o,u):t(null,u)})}})}var o=t(4),i=t(1),c=t(20).invalidWin32Path,s=parseInt("0777",8);e.exports=r},function(e,n,t){"use strict";function r(e){return e=i.normalize(i.resolve(e)).split(i.sep),e.length>0?e[0]:null}function o(e){var n=r(e);return e=e.replace(n,""),c.test(e)}var i=t(1),c=/[<>:"|?*]/;e.exports={getRootPath:r,invalidWin32Path:o}},function(e,n,t){function r(e,n,t){n&&"object"==typeof n||(n={mode:n});var u=n.mode,a=n.fs||o;if("win32"===process.platform&&c(e)){var f=new Error(e+" contains invalid WIN32 path characters.");throw f.code="EINVAL",f}void 0===u&&(u=s&~process.umask()),t||(t=null),e=i.resolve(e);try{a.mkdirSync(e,u),t=t||e}catch(o){switch(o.code){case"ENOENT":if(i.dirname(e)===e)throw o;t=r(i.dirname(e),n,t),r(e,n,t);break;default:var l;try{l=a.statSync(e)}catch(e){throw o}if(!l.isDirectory())throw o}}return t}var o=t(4),i=t(1),c=t(20).invalidWin32Path,s=parseInt("0777",8);e.exports=r},function(e,n,t){e.exports={copySync:t(23)}},function(e,n,t){function r(e,n,t){("function"==typeof t||t instanceof RegExp)&&(t={filter:t}),t=t||{},t.recursive=!!t.recursive,t.clobber=!("clobber"in t)||!!t.clobber,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.dereference="dereference"in t&&!!t.dereference,t.preserveTimestamps="preserveTimestamps"in t&&!!t.preserveTimestamps,t.filter=t.filter||function(){return!0},t.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\nsee https://github.com/jprichardson/node-fs-extra/issues/269");var u=t.recursive&&!t.dereference?o.lstatSync(e):o.statSync(e),a=i.dirname(n),f=o.existsSync(a),l=!1;if(t.filter instanceof RegExp?(console.warn("Warning: fs-extra: Passing a RegExp filter is deprecated, use a function"),l=t.filter.test(e)):"function"==typeof t.filter&&(l=t.filter(e)),u.isFile()&&l)f||s.mkdirsSync(a),c(e,n,{overwrite:t.overwrite,errorOnExist:t.errorOnExist,preserveTimestamps:t.preserveTimestamps});else if(u.isDirectory()&&l){o.existsSync(n)||s.mkdirsSync(n);var p=o.readdirSync(e);p.forEach(function(o){var c=t;c.recursive=!0,r(i.join(e,o),i.join(n,o),c)})}else if(t.recursive&&u.isSymbolicLink()&&l){var d=o.readlinkSync(e);o.symlinkSync(d,n)}}var o=t(4),i=t(1),c=t(24),s=t(18);e.exports=r},function(e,n,t){function r(e,n,t){var r=t.overwrite,s=t.errorOnExist,u=t.preserveTimestamps;if(o.existsSync(n)){if(!r){if(s)throw new Error(n+" already exists");return}o.unlinkSync(n)}for(var a=o.openSync(e,"r"),f=o.fstatSync(a),l=o.openSync(n,"w",f.mode),p=1,d=0;p>0;)p=o.readSync(a,c,0,i,d),o.writeSync(l,c,0,p),d+=p;u&&o.futimesSync(l,f.atime,f.mtime),o.closeSync(a),o.closeSync(l)}var o=t(4),i=65536,c=new Buffer(i);e.exports=r},function(e,n,t){function r(e){return i.sync(e,{disableGlob:!0})}function o(e,n){var t={disableGlob:!0};return n?i(e,t,n):i(e,t,function(){})}var i=t(26);e.exports={remove:o,removeSync:r}},function(e,n,t){function r(e){var n=["unlink","chmod","stat","lstat","rmdir","readdir"];n.forEach(function(n){e[n]=e[n]||y[n],n+="Sync",e[n]=e[n]||y[n]}),e.maxBusyTries=e.maxBusyTries||3}function o(e,n,t){"function"==typeof n&&(t=n,n={}),d(e,"rimraf: missing path"),d.equal(typeof e,"string","rimraf: path should be a string"),d.equal(typeof t,"function","rimraf: callback function required"),d(n,"rimraf: invalid options argument provided"),d.equal(typeof n,"object","rimraf: options should be object"),r(n);var o=0;i(e,n,function r(c){if(c){if(h&&("EBUSY"===c.code||"ENOTEMPTY"===c.code||"EPERM"===c.code)&&o<n.maxBusyTries){o++;var s=100*o;return setTimeout(function(){i(e,n,r)},s)}"ENOENT"===c.code&&(c=null)}t(c)})}function i(e,n,t){d(e),d(n),d("function"==typeof t),n.lstat(e,function(r,o){return r&&"ENOENT"===r.code?t(null):(r&&"EPERM"===r.code&&h&&c(e,n,r,t),o&&o.isDirectory()?u(e,n,r,t):void n.unlink(e,function(r){if(r){if("ENOENT"===r.code)return t(null);if("EPERM"===r.code)return h?c(e,n,r,t):u(e,n,r,t);if("EISDIR"===r.code)return u(e,n,r,t)}return t(r)}))})}function c(e,n,t,r){d(e),d(n),d("function"==typeof r),t&&d(t instanceof Error),n.chmod(e,666,function(o){o?r("ENOENT"===o.code?null:t):n.stat(e,function(o,i){o?r("ENOENT"===o.code?null:t):i.isDirectory()?u(e,n,t,r):n.unlink(e,r)})})}function s(e,n,t){d(e),d(n),t&&d(t instanceof Error);try{n.chmodSync(e,666)}catch(e){if("ENOENT"===e.code)return;throw t}try{var r=n.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw t}r.isDirectory()?l(e,n,t):n.unlinkSync(e)}function u(e,n,t,r){d(e),d(n),t&&d(t instanceof Error),d("function"==typeof r),n.rmdir(e,function(o){!o||"ENOTEMPTY"!==o.code&&"EEXIST"!==o.code&&"EPERM"!==o.code?r(o&&"ENOTDIR"===o.code?t:o):a(e,n,r)})}function a(e,n,t){d(e),d(n),d("function"==typeof t),n.readdir(e,function(r,i){if(r)return t(r);var c=i.length;if(0===c)return n.rmdir(e,t);var s;i.forEach(function(r){o(v.join(e,r),n,function(r){if(!s)return r?t(s=r):void(0===--c&&n.rmdir(e,t))})})})}function f(e,n){n=n||{},r(n),d(e,"rimraf: missing path"),d.equal(typeof e,"string","rimraf: path should be a string"),d(n,"rimraf: missing options"),d.equal(typeof n,"object","rimraf: options should be object");try{var t=n.lstatSync(e)}catch(t){if("ENOENT"===t.code)return;"EPERM"===t.code&&h&&s(e,n,t)}try{t&&t.isDirectory()?l(e,n,null):n.unlinkSync(e)}catch(t){if("ENOENT"===t.code)return;if("EPERM"===t.code)return h?s(e,n,t):l(e,n,t);if("EISDIR"!==t.code)throw t;l(e,n,t)}}function l(e,n,t){d(e),d(n),t&&d(t instanceof Error);try{n.rmdirSync(e)}catch(r){if("ENOENT"===r.code)return;if("ENOTDIR"===r.code)throw t;"ENOTEMPTY"!==r.code&&"EEXIST"!==r.code&&"EPERM"!==r.code||p(e,n)}}function p(e,n){d(e),d(n),n.readdirSync(e).forEach(function(t){f(v.join(e,t),n)}),n.rmdirSync(e,n)}e.exports=o,o.sync=f;var d=t(12),v=t(1),y=t(4),h="win32"===process.platform},function(e,n,t){var r=t(28);r.outputJsonSync=t(30),r.outputJson=t(31),r.outputJSONSync=t(30),r.outputJSON=t(31),e.exports=r},function(e,n,t){var r=t(29);e.exports={readJson:r.readFile,readJSON:r.readFile,readJsonSync:r.readFileSync,readJSONSync:r.readFileSync,writeJson:r.writeFile,writeJSON:r.writeFile,writeJsonSync:r.writeFileSync,writeJSONSync:r.writeFileSync,spaces:2}},function(e,n,t){function r(e,n,t){null==t&&(t=n,n={}),"string"==typeof n&&(n={encoding:n}),n=n||{};var r=n.fs||u,o=!0;"passParsingErrors"in n?o=n.passParsingErrors:"throws"in n&&(o=n.throws),r.readFile(e,n,function(r,i){if(r)return t(r);i=s(i);var c;try{c=JSON.parse(i,n?n.reviver:null)}catch(n){return o?(n.message=e+": "+n.message,t(n)):t(null,null)}t(null,c)})}function o(e,n){n=n||{},"string"==typeof n&&(n={encoding:n});var t=n.fs||u,r=!0;"passParsingErrors"in n?r=n.passParsingErrors:"throws"in n&&(r=n.throws);var o=t.readFileSync(e,n);o=s(o);try{return JSON.parse(o,n.reviver)}catch(n){if(r)throw n.message=e+": "+n.message,
n;return null}}function i(e,n,t,r){null==r&&(r=t,t={}),t=t||{};var o=t.fs||u,i="object"==typeof t&&null!==t&&"spaces"in t?t.spaces:this.spaces,c="";try{c=JSON.stringify(n,t?t.replacer:null,i)+"\n"}catch(e){if(r)return r(e,null)}o.writeFile(e,c,t,r)}function c(e,n,t){t=t||{};var r=t.fs||u,o="object"==typeof t&&null!==t&&"spaces"in t?t.spaces:this.spaces,i=JSON.stringify(n,t.replacer,o)+"\n";return r.writeFileSync(e,i,t)}function s(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var u;try{u=t(4)}catch(e){u=t(5)}var a={spaces:null,readFile:r,readFileSync:o,writeFile:i,writeFileSync:c};e.exports=a},function(e,n,t){function r(e,n,t){var r=i.dirname(e);o.existsSync(r)||s.mkdirsSync(r),c.writeJsonSync(e,n,t)}var o=t(4),i=t(1),c=t(28),s=t(18);e.exports=r},function(e,n,t){function r(e,n,t,r){"function"==typeof t&&(r=t,t={});var u=i.dirname(e);o.exists(u,function(o){return o?c.writeJson(e,n,t,r):void s.mkdirs(u,function(o){return o?r(o):void c.writeJson(e,n,t,r)})})}var o=t(4),i=t(1),c=t(28),s=t(18);e.exports=r},function(e,n,t){function r(e,n,t,i){function c(){l(a.dirname(n),function(e){return e?i(e):void u()})}function u(){d?s.rename(e,n,function(c){return c?"ENOTEMPTY"===c.code||"EEXIST"===c.code?void f(n,function(o){return o?i(o):(t.overwrite=!1,void r(e,n,t,i))}):"EPERM"===c.code?void setTimeout(function(){f(n,function(o){return o?i(o):(t.overwrite=!1,void r(e,n,t,i))})},200):"EXDEV"!==c.code?i(c):void o(e,n,d,i):i()}):s.link(e,n,function(t){return t?"EXDEV"===t.code||"EISDIR"===t.code||"EPERM"===t.code?void o(e,n,d,i):void i(t):void s.unlink(e,i)})}"function"==typeof t&&(i=t,t={});var p=!("mkdirp"in t)||t.mkdirp,d=t.overwrite||t.clobber||!1;p?c():u()}function o(e,n,t,r){s.stat(e,function(o,s){return o?void r(o):void(s.isDirectory()?c(e,n,t,r):i(e,n,t,r))})}function i(e,n,t,r){function o(){s.unlink(e,r)}var i=t?"w":"wx",u=s.createReadStream(e),a=s.createWriteStream(n,{flags:i});u.on("error",function(i){u.destroy(),a.destroy(),a.removeListener("close",o),s.unlink(n,function(){"EISDIR"===i.code||"EPERM"===i.code?c(e,n,t,r):r(i)})}),a.on("error",function(e){u.destroy(),a.destroy(),a.removeListener("close",o),r(e)}),a.once("close",o),u.pipe(a)}function c(e,n,t,r){function o(){u(e,n,i,function(n){return n?r(n):void f(e,r)})}var i={overwrite:!1};t?f(n,function(e){return e?r(e):void o()}):o()}var s=t(4),u=t(15),a=t(1),f=t(25).remove,l=t(18).mkdirs;e.exports={move:r}},function(e,n,t){function r(e,n){n=n||function(){},i.readdir(e,function(t,r){function o(){var e=r.pop();return e?void u.remove(e,function(e){return e?n(e):void o()}):n()}return t?s.mkdirs(e,n):(r=r.map(function(n){return c.join(e,n)}),void o())})}function o(e){var n;try{n=i.readdirSync(e)}catch(n){return s.mkdirsSync(e)}n.forEach(function(n){n=c.join(e,n),u.removeSync(n)})}var i=t(5),c=t(1),s=t(18),u=t(25);e.exports={emptyDirSync:o,emptydirSync:o,emptyDir:r,emptydir:r}},function(e,n,t){var r=t(35),o=t(36),i=t(37);e.exports={createFile:r.createFile,createFileSync:r.createFileSync,ensureFile:r.createFile,ensureFileSync:r.createFileSync,createLink:o.createLink,createLinkSync:o.createLinkSync,ensureLink:o.createLink,ensureLinkSync:o.createLinkSync,createSymlink:i.createSymlink,createSymlinkSync:i.createSymlinkSync,ensureSymlink:i.createSymlink,ensureSymlinkSync:i.createSymlinkSync}},function(e,n,t){function r(e,n){function t(){c.writeFile(e,"",function(e){return e?n(e):void n()})}c.exists(e,function(r){if(r)return n();var o=i.dirname(e);c.exists(o,function(e){return e?t():void s.mkdirs(o,function(e){return e?n(e):void t()})})})}function o(e){if(!c.existsSync(e)){var n=i.dirname(e);c.existsSync(n)||s.mkdirsSync(n),c.writeFileSync(e,"")}}var i=t(1),c=t(4),s=t(18);e.exports={createFile:r,createFileSync:o,ensureFile:r,ensureFileSync:o}},function(e,n,t){function r(e,n,t){function r(e,n){c.link(e,n,function(e){return e?t(e):void t(null)})}c.exists(n,function(o){return o?t(null):void c.lstat(e,function(o,u){if(o)return o.message=o.message.replace("lstat","ensureLink"),t(o);var a=i.dirname(n);c.exists(a,function(o){return o?r(e,n):void s.mkdirs(a,function(o){return o?t(o):void r(e,n)})})})})}function o(e,n,t){var r=c.existsSync(n);if(!r){try{c.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}var o=i.dirname(n),u=c.existsSync(o);return u?c.linkSync(e,n):(s.mkdirsSync(o),c.linkSync(e,n))}}var i=t(1),c=t(4),s=t(18);e.exports={createLink:r,createLinkSync:o,ensureLink:r,ensureLinkSync:o}},function(e,n,t){function r(e,n,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t,c.exists(n,function(o){return o?r(null):void l(e,n,function(o,s){return o?r(o):(e=s.toDst,void v(s.toCwd,t,function(t,o){if(t)return r(t);var s=i.dirname(n);c.exists(s,function(t){return t?c.symlink(e,n,o,r):void u(s,function(t){return t?r(t):void c.symlink(e,n,o,r)})})}))})})}function o(e,n,t,r){r="function"==typeof t?t:r,t="function"!=typeof t&&t;var o=c.existsSync(n);if(!o){var s=p(e,n);e=s.toDst,t=y(s.toCwd,t);var u=i.dirname(n),f=c.existsSync(u);return f?c.symlinkSync(e,n,t):(a(u),c.symlinkSync(e,n,t))}}var i=t(1),c=t(4),s=t(18),u=s.mkdirs,a=s.mkdirsSync,f=t(38),l=f.symlinkPaths,p=f.symlinkPathsSync,d=t(39),v=d.symlinkType,y=d.symlinkTypeSync;e.exports={createSymlink:r,createSymlinkSync:o,ensureSymlink:r,ensureSymlinkSync:o}},function(e,n,t){function r(e,n,t){if(i.isAbsolute(e))return c.lstat(e,function(n,r){return n?(n.message=n.message.replace("lstat","ensureSymlink"),t(n)):t(null,{toCwd:e,toDst:e})});var r=i.dirname(n),o=i.join(r,e);return c.exists(o,function(n){return n?t(null,{toCwd:o,toDst:e}):c.lstat(e,function(n,o){return n?(n.message=n.message.replace("lstat","ensureSymlink"),t(n)):t(null,{toCwd:e,toDst:i.relative(r,e)})})})}function o(e,n){var t;if(i.isAbsolute(e)){if(t=c.existsSync(e),!t)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}var r=i.dirname(n),o=i.join(r,e);if(t=c.existsSync(o))return{toCwd:o,toDst:e};if(t=c.existsSync(e),!t)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:i.relative(r,e)}}var i=t(1),c=t(4);e.exports={symlinkPaths:r,symlinkPathsSync:o}},function(e,n,t){function r(e,n,t){return t="function"==typeof n?n:t,(n="function"!=typeof n&&n)?t(null,n):void i.lstat(e,function(e,r){return e?t(null,"file"):(n=r&&r.isDirectory()?"dir":"file",void t(null,n))})}function o(e,n){if(n)return n;try{var t=i.lstatSync(e)}catch(e){return"file"}return t&&t.isDirectory()?"dir":"file"}var i=t(4);e.exports={symlinkType:r,symlinkTypeSync:o}},function(e,n,t){function r(e,n,t,r){"function"==typeof t&&(r=t,t="utf8");var o=i.dirname(e);c.exists(o,function(i){return i?c.writeFile(e,n,t,r):void s.mkdirs(o,function(o){return o?r(o):void c.writeFile(e,n,t,r)})})}function o(e,n,t){var r=i.dirname(e);return c.existsSync(r)?c.writeFileSync.apply(c,arguments):(s.mkdirsSync(r),void c.writeFileSync.apply(c,arguments))}var i=t(1),c=t(4),s=t(18);e.exports={outputFile:r,outputFileSync:o}},function(e,n,t){!function(n){"use strict";if("function"==typeof bootstrap)bootstrap("promise",n);else{e.exports=n()}}(function(){"use strict";function e(e){return function(){return G.apply(e,arguments)}}function n(e){return e===Object(e)}function t(e){return"[object StopIteration]"===ne(e)||e instanceof J}function r(e,n){if(W&&n.stack&&"object"==typeof e&&null!==e&&e.stack&&e.stack.indexOf(te)===-1){for(var t=[],r=n;r;r=r.source)r.stack&&t.unshift(r.stack);t.unshift(e.stack);var i=t.join("\n"+te+"\n");e.stack=o(i)}}function o(e){for(var n=e.split("\n"),t=[],r=0;r<n.length;++r){var o=n[r];s(o)||i(o)||!o||t.push(o)}return t.join("\n")}function i(e){return e.indexOf("(module.js:")!==-1||e.indexOf("(node.js:")!==-1}function c(e){var n=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);if(n)return[n[1],Number(n[2])];var t=/at ([^ ]+):(\d+):(?:\d+)$/.exec(e);if(t)return[t[1],Number(t[2])];var r=/.*@(.+):(\d+)$/.exec(e);return r?[r[1],Number(r[2])]:void 0}function s(e){var n=c(e);if(!n)return!1;var t=n[0],r=n[1];return t===$&&r>=B&&r<=se}function u(){if(W)try{throw new Error}catch(r){var e=r.stack.split("\n"),n=e[0].indexOf("@")>0?e[1]:e[2],t=c(n);if(!t)return;return $=t[0],t[1]}}function a(e,n,t){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(n+" is deprecated, use "+t+" instead.",new Error("").stack),e.apply(e,arguments)}}function f(e){return e instanceof v?e:E(e)?D(e):b(e)}function l(){function e(e){n=e,i.source=e,V(t,function(n,t){f.nextTick(function(){e.promiseDispatch.apply(e,t)})},void 0),t=void 0,r=void 0}var n,t=[],r=[],o=H(l.prototype),i=H(v.prototype);if(i.promiseDispatch=function(e,o,i){var c=K(arguments);t?(t.push(c),"when"===o&&i[1]&&r.push(i[1])):f.nextTick(function(){n.promiseDispatch.apply(n,c)})},i.valueOf=function(){if(t)return i;var e=h(n);return m(e)&&(n=e),e},i.inspect=function(){return n?n.inspect():{state:"pending"}},f.longStackSupport&&W)try{throw new Error}catch(e){i.stack=e.stack.substring(e.stack.indexOf("\n")+1)}return o.promise=i,o.resolve=function(t){n||e(f(t))},o.fulfill=function(t){n||e(b(t))},o.reject=function(t){n||e(j(t))},o.notify=function(e){n||V(r,function(n,t){f.nextTick(function(){t(e)})},void 0)},o}function p(e){if("function"!=typeof e)throw new TypeError("resolver must be a function.");var n=l();try{e(n.resolve,n.reject,n.notify)}catch(e){n.reject(e)}return n.promise}function d(e){return p(function(n,t){for(var r=0,o=e.length;r<o;r++)f(e[r]).then(n,t)})}function v(e,n,t){void 0===n&&(n=function(e){return j(new Error("Promise does not support operation: "+e))}),void 0===t&&(t=function(){return{state:"unknown"}});var r=H(v.prototype);if(r.promiseDispatch=function(t,o,i){var c;try{c=e[o]?e[o].apply(r,i):n.call(r,o,i)}catch(e){c=j(e)}t&&t(c)},r.inspect=t,t){var o=t();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var e=t();return"pending"===e.state||"rejected"===e.state?r:e.value}}return r}function y(e,n,t,r){return f(e).then(n,t,r)}function h(e){if(m(e)){var n=e.inspect();if("fulfilled"===n.state)return n.value}return e}function m(e){return e instanceof v}function E(e){return n(e)&&"function"==typeof e.then}function S(e){return m(e)&&"pending"===e.inspect().state}function g(e){return!m(e)||"fulfilled"===e.inspect().state}function w(e){return m(e)&&"rejected"===e.inspect().state}function x(){re.length=0,oe.length=0,ce||(ce=!0)}function k(e,n){ce&&("object"==typeof process&&"function"==typeof process.emit&&f.nextTick.runAfter(function(){X(oe,e)!==-1&&(process.emit("unhandledRejection",n,e),ie.push(e))}),oe.push(e),n&&"undefined"!=typeof n.stack?re.push(n.stack):re.push("(no stack) "+n))}function O(e){if(ce){var n=X(oe,e);n!==-1&&("object"==typeof process&&"function"==typeof process.emit&&f.nextTick.runAfter(function(){var t=X(ie,e);t!==-1&&(process.emit("rejectionHandled",re[n],e),ie.splice(t,1))}),oe.splice(n,1),re.splice(n,1))}}function j(e){var n=v({when:function(n){return n&&O(this),n?n(e):this}},function(){return this},function(){return{state:"rejected",reason:e}});return k(n,e),n}function b(e){return v({when:function(){return e},get:function(n){return e[n]},set:function(n,t){e[n]=t},delete:function(n){delete e[n]},post:function(n,t){return null===n||void 0===n?e.apply(void 0,t):e[n].apply(e,t)},apply:function(n,t){return e.apply(n,t)},keys:function(){return ee(e)}},void 0,function(){return{state:"fulfilled",value:e}})}function D(e){var n=l();return f.nextTick(function(){try{e.then(n.resolve,n.reject,n.notify)}catch(e){n.reject(e)}}),n.promise}function T(e){return v({isDef:function(){}},function(n,t){return L(e,n,t)},function(){return f(e).inspect()})}function F(e,n,t){return f(e).spread(n,t)}function N(e){return function(){function n(e,n){var c;if("undefined"==typeof StopIteration){try{c=r[e](n)}catch(e){return j(e)}return c.done?f(c.value):y(c.value,o,i)}try{c=r[e](n)}catch(e){return t(e)?f(e.value):j(e)}return y(c,o,i)}var r=e.apply(this,arguments),o=n.bind(n,"next"),i=n.bind(n,"throw");return o()}}function P(e){f.done(f.async(e)())}function R(e){throw new J(e)}function _(e){return function(){return F([this,I(arguments)],function(n,t){return e.apply(n,t)})}}function L(e,n,t){return f(e).dispatch(n,t)}function I(e){return y(e,function(e){var n=0,t=l();return V(e,function(r,o,i){var c;m(o)&&"fulfilled"===(c=o.inspect()).state?e[i]=c.value:(++n,y(o,function(r){e[i]=r,0===--n&&t.resolve(e)},t.reject,function(e){t.notify({index:i,value:e})}))},void 0),0===n&&t.resolve(e),t.promise})}function M(e){if(0===e.length)return f.resolve();var n=f.defer(),t=0;return V(e,function(r,o,i){function c(e){n.resolve(e)}function s(){t--,0===t&&n.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function u(e){n.notify({index:i,value:e})}var a=e[i];t++,y(a,c,s,u)},void 0),n.promise}function C(e){return y(e,function(e){return e=Q(e,f),y(I(Q(e,function(e){return y(e,z,z)})),function(){return e})})}function U(e){return f(e).allSettled()}function Y(e,n){return f(e).then(void 0,void 0,n)}function A(e,n){return f(e).nodeify(n)}var W=!1;try{throw new Error}catch(e){W=!!e.stack}var $,J,B=u(),z=function(){},q=function(){function e(){for(var e,r;t.next;)t=t.next,e=t.task,t.task=void 0,r=t.domain,r&&(t.domain=void 0,r.enter()),n(e,r);for(;s.length;)e=s.pop(),n(e);o=!1}function n(n,t){try{n()}catch(n){if(c)throw t&&t.exit(),setTimeout(e,0),t&&t.enter(),n;setTimeout(function(){throw n},0)}t&&t.exit()}var t={task:void 0,next:null},r=t,o=!1,i=void 0,c=!1,s=[];if(q=function(e){r=r.next={task:e,domain:c&&process.domain,next:null},o||(o=!0,i())},"object"==typeof process&&"[object process]"===process.toString()&&process.nextTick)c=!0,i=function(){process.nextTick(e)};else if("function"==typeof setImmediate)i="undefined"!=typeof window?setImmediate.bind(window,e):function(){setImmediate(e)};else if("undefined"!=typeof MessageChannel){var u=new MessageChannel;u.port1.onmessage=function(){i=a,u.port1.onmessage=e,e()};var a=function(){u.port2.postMessage(0)};i=function(){setTimeout(e,0),a()}}else i=function(){setTimeout(e,0)};return q.runAfter=function(e){s.push(e),o||(o=!0,i())},q}(),G=Function.call,K=e(Array.prototype.slice),V=e(Array.prototype.reduce||function(e,n){var t=0,r=this.length;if(1===arguments.length)for(;;){if(t in this){n=this[t++];break}if(++t>=r)throw new TypeError}for(;t<r;t++)t in this&&(n=e(n,this[t],t));return n}),X=e(Array.prototype.indexOf||function(e){for(var n=0;n<this.length;n++)if(this[n]===e)return n;return-1}),Q=e(Array.prototype.map||function(e,n){var t=this,r=[];return V(t,function(o,i,c){r.push(e.call(n,i,c,t))},void 0),r}),H=Object.create||function(e){function n(){}return n.prototype=e,new n},Z=e(Object.prototype.hasOwnProperty),ee=Object.keys||function(e){var n=[];for(var t in e)Z(e,t)&&n.push(t);return n},ne=e(Object.prototype.toString);J="undefined"!=typeof ReturnValue?ReturnValue:function(e){this.value=e};var te="From previous event:";f.resolve=f,f.nextTick=q,f.longStackSupport=!1,"object"==typeof process&&process&&process.env&&process.env.Q_DEBUG&&(f.longStackSupport=!0),f.defer=l,l.prototype.makeNodeResolver=function(){var e=this;return function(n,t){n?e.reject(n):arguments.length>2?e.resolve(K(arguments,1)):e.resolve(t)}},f.Promise=p,f.promise=p,p.race=d,p.all=I,p.reject=j,p.resolve=f,f.passByCopy=function(e){return e},v.prototype.passByCopy=function(){return this},f.join=function(e,n){return f(e).join(n)},v.prototype.join=function(e){return f([this,e]).spread(function(e,n){if(e===n)return e;throw new Error("Can't join: not the same: "+e+" "+n)})},f.race=d,v.prototype.race=function(){return this.then(f.race)},f.makePromise=v,v.prototype.toString=function(){return"[object Promise]"},v.prototype.then=function(e,n,t){function o(n){try{return"function"==typeof e?e(n):n}catch(e){return j(e)}}function i(e){if("function"==typeof n){r(e,s);try{return n(e)}catch(e){return j(e)}}return j(e)}function c(e){return"function"==typeof t?t(e):e}var s=this,u=l(),a=!1;return f.nextTick(function(){s.promiseDispatch(function(e){a||(a=!0,u.resolve(o(e)))},"when",[function(e){a||(a=!0,u.resolve(i(e)))}])}),s.promiseDispatch(void 0,"when",[void 0,function(e){var n,t=!1;try{n=c(e)}catch(e){if(t=!0,!f.onerror)throw e;f.onerror(e)}t||u.notify(n)}]),u.promise},f.tap=function(e,n){return f(e).tap(n)},v.prototype.tap=function(e){return e=f(e),this.then(function(n){return e.fcall(n).thenResolve(n)})},f.when=y,v.prototype.thenResolve=function(e){return this.then(function(){return e})},f.thenResolve=function(e,n){return f(e).thenResolve(n)},v.prototype.thenReject=function(e){return this.then(function(){throw e})},f.thenReject=function(e,n){return f(e).thenReject(n)},f.nearer=h,f.isPromise=m,f.isPromiseAlike=E,f.isPending=S,v.prototype.isPending=function(){return"pending"===this.inspect().state},f.isFulfilled=g,v.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},f.isRejected=w,v.prototype.isRejected=function(){return"rejected"===this.inspect().state};var re=[],oe=[],ie=[],ce=!0;f.resetUnhandledRejections=x,f.getUnhandledReasons=function(){return re.slice()},f.stopUnhandledRejectionTracking=function(){x(),ce=!1},x(),f.reject=j,f.fulfill=b,f.master=T,f.spread=F,v.prototype.spread=function(e,n){return this.all().then(function(n){return e.apply(void 0,n)},n)},f.async=N,f.spawn=P,f.return=R,f.promised=_,f.dispatch=L,v.prototype.dispatch=function(e,n){var t=this,r=l();return f.nextTick(function(){t.promiseDispatch(r.resolve,e,n)}),r.promise},f.get=function(e,n){return f(e).dispatch("get",[n])},v.prototype.get=function(e){return this.dispatch("get",[e])},f.set=function(e,n,t){return f(e).dispatch("set",[n,t])},v.prototype.set=function(e,n){return this.dispatch("set",[e,n])},f.del=f.delete=function(e,n){return f(e).dispatch("delete",[n])},v.prototype.del=v.prototype.delete=function(e){return this.dispatch("delete",[e])},f.mapply=f.post=function(e,n,t){return f(e).dispatch("post",[n,t])},v.prototype.mapply=v.prototype.post=function(e,n){return this.dispatch("post",[e,n])},f.send=f.mcall=f.invoke=function(e,n){return f(e).dispatch("post",[n,K(arguments,2)])},v.prototype.send=v.prototype.mcall=v.prototype.invoke=function(e){return this.dispatch("post",[e,K(arguments,1)])},f.fapply=function(e,n){return f(e).dispatch("apply",[void 0,n])},v.prototype.fapply=function(e){return this.dispatch("apply",[void 0,e])},f.try=f.fcall=function(e){return f(e).dispatch("apply",[void 0,K(arguments,1)])},v.prototype.fcall=function(){return this.dispatch("apply",[void 0,K(arguments)])},f.fbind=function(e){var n=f(e),t=K(arguments,1);return function(){return n.dispatch("apply",[this,t.concat(K(arguments))])}},v.prototype.fbind=function(){var e=this,n=K(arguments);return function(){return e.dispatch("apply",[this,n.concat(K(arguments))])}},f.keys=function(e){return f(e).dispatch("keys",[])},v.prototype.keys=function(){return this.dispatch("keys",[])},f.all=I,v.prototype.all=function(){return I(this)},f.any=M,v.prototype.any=function(){return M(this)},f.allResolved=a(C,"allResolved","allSettled"),v.prototype.allResolved=function(){return C(this)},f.allSettled=U,v.prototype.allSettled=function(){return this.then(function(e){return I(Q(e,function(e){function n(){return e.inspect()}return e=f(e),e.then(n,n)}))})},f.fail=f.catch=function(e,n){return f(e).then(void 0,n)},v.prototype.fail=v.prototype.catch=function(e){return this.then(void 0,e)},f.progress=Y,v.prototype.progress=function(e){return this.then(void 0,void 0,e)},f.fin=f.finally=function(e,n){return f(e).finally(n)},v.prototype.fin=v.prototype.finally=function(e){return e=f(e),this.then(function(n){return e.fcall().then(function(){return n})},function(n){return e.fcall().then(function(){throw n})})},f.done=function(e,n,t,r){return f(e).done(n,t,r)},v.prototype.done=function(e,n,t){var o=function(e){f.nextTick(function(){if(r(e,i),!f.onerror)throw e;f.onerror(e)})},i=e||n||t?this.then(e,n,t):this;"object"==typeof process&&process&&process.domain&&(o=process.domain.bind(o)),i.then(void 0,o)},f.timeout=function(e,n,t){return f(e).timeout(n,t)},v.prototype.timeout=function(e,n){var t=l(),r=setTimeout(function(){n&&"string"!=typeof n||(n=new Error(n||"Timed out after "+e+" ms"),n.code="ETIMEDOUT"),t.reject(n)},e);return this.then(function(e){clearTimeout(r),t.resolve(e)},function(e){clearTimeout(r),t.reject(e)},t.notify),t.promise},f.delay=function(e,n){return void 0===n&&(n=e,e=void 0),f(e).delay(n)},v.prototype.delay=function(e){return this.then(function(n){var t=l();return setTimeout(function(){t.resolve(n)},e),t.promise})},f.nfapply=function(e,n){return f(e).nfapply(n)},v.prototype.nfapply=function(e){var n=l(),t=K(e);return t.push(n.makeNodeResolver()),this.fapply(t).fail(n.reject),n.promise},f.nfcall=function(e){var n=K(arguments,1);return f(e).nfapply(n)},v.prototype.nfcall=function(){var e=K(arguments),n=l();return e.push(n.makeNodeResolver()),this.fapply(e).fail(n.reject),n.promise},f.nfbind=f.denodeify=function(e){var n=K(arguments,1);return function(){var t=n.concat(K(arguments)),r=l();return t.push(r.makeNodeResolver()),f(e).fapply(t).fail(r.reject),r.promise}},v.prototype.nfbind=v.prototype.denodeify=function(){var e=K(arguments);return e.unshift(this),f.denodeify.apply(void 0,e)},f.nbind=function(e,n){var t=K(arguments,2);return function(){function r(){return e.apply(n,arguments)}var o=t.concat(K(arguments)),i=l();return o.push(i.makeNodeResolver()),f(r).fapply(o).fail(i.reject),i.promise}},v.prototype.nbind=function(){var e=K(arguments,0);return e.unshift(this),f.nbind.apply(void 0,e)},f.nmapply=f.npost=function(e,n,t){return f(e).npost(n,t)},v.prototype.nmapply=v.prototype.npost=function(e,n){var t=K(n||[]),r=l();return t.push(r.makeNodeResolver()),this.dispatch("post",[e,t]).fail(r.reject),r.promise},f.nsend=f.nmcall=f.ninvoke=function(e,n){var t=K(arguments,2),r=l();return t.push(r.makeNodeResolver()),f(e).dispatch("post",[n,t]).fail(r.reject),r.promise},v.prototype.nsend=v.prototype.nmcall=v.prototype.ninvoke=function(e){var n=K(arguments,1),t=l();return n.push(t.makeNodeResolver()),this.dispatch("post",[e,n]).fail(t.reject),t.promise},f.nodeify=A,v.prototype.nodeify=function(e){return e?void this.then(function(n){f.nextTick(function(){e(null,n)})},function(n){f.nextTick(function(){e(n)})}):this},f.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var se=u();return f})},function(e,n,t){"use strict";function r(e){var n={};return e.toString().split("\n").forEach(function(e){var t=e.match(/^\s*([\w\.\-]+)\s*=\s*(.*)?\s*$/);if(null!=t){var r=t[1],o=t[2]?t[2]:"",i=o?o.length:0;i>0&&'"'===o.charAt(0)&&'"'===o.charAt(i-1)&&(o=o.replace(/\\n/gm,"\n")),o=o.replace(/(^['"]|['"]$)/g,"").trim(),n[r]=o}}),n}function o(e){var n=".env",t="utf8";e&&(e.path&&(n=e.path),e.encoding&&(t=e.encoding));try{var o=r(i.readFileSync(n,{encoding:t}));return Object.keys(o).forEach(function(e){process.env[e]=process.env[e]||o[e]}),{parsed:o}}catch(e){return{error:e}}}var i=t(5);e.exports.config=o,e.exports.load=o,e.exports.parse=r}]);