/**
 * Minified by jsDelivr using Terser v5.19.2.
 * Original file: /npm/aws-lambda-node-canvas@1.0.2/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var through=require("through2"),vinyl=require("vinyl-fs"),gutil=require("gulp-util"),PluginError=gutil.PluginError,path=require("path"),gulp=require("gulp");const fs=require("fs"),unzip=require("gulp-unzip");var GITHUB_URL="https://cdn.rawgit.com/WebSeed/node-canvas-aws-lambda-example/master/dist/lamdba.zip";const dependencyDirectory=path.resolve(__dirname,"dependencies");var DEPENDENCY_LOCATION=path.resolve(dependencyDirectory,"lambda-node-canvas-dependency"),https=require("https");const DOWNLOAD_ZIP_LOCATION=dependencyDirectory+path.sep+"lambda-node-canvas-dependency.zip";module.exports=function(e){if((e=e||{}).runtime){if("nodejs"===e.runtime||"nodejs4.3"===e.runtime){"nodejs"!==e.runtime&&(DEPENDENCY_LOCATION=path.resolve(dependencyDirectory,"lambda-node-canvas-dependency-4.3"));var n=function(e,n){console.log(DEPENDENCY_LOCATION),gulp.src(DEPENDENCY_LOCATION+path.sep+"**"+path.sep+"*",{dot:!0}).pipe(through.obj((function(n,o,r){e.push(n),r()}))).on("finish",(function(){console.log("finish"),n()}))};return through.obj((function(e,n,o){o(null,e)}),(function(e){var o=this;if(fs.existsSync(DEPENDENCY_LOCATION))n(o,e);else{var r=fs.createWriteStream(DOWNLOAD_ZIP_LOCATION);console.log("Dependency not available, Downloading dependency file "+GITHUB_URL),https.get(GITHUB_URL,(function(i){i.pipe(r),r.on("finish",(function(){console.log("Download Complete"),gulp.src(DOWNLOAD_ZIP_LOCATION,{dot:!0}).pipe(unzip({keepEmpty:!0})).pipe(gulp.dest(DEPENDENCY_LOCATION)).on("finish",(function(){n(o,e)}))}))}))}}))}console.error(new PluginError("aws-lambda-node-canvas","runtime should either be nodejs or nodejs4.3"))}else console.error(new PluginError("aws-lambda-node-canvas","runtime is mandatory"))};
//# sourceMappingURL=/sm/a834d4a5b8e63d34e82420b00f4f0f4da9acdf6324c49c685764fba723f3eb3b.map