Comparing version 0.9.1 to 0.9.2
@@ -19,3 +19,4 @@ #!/usr/bin/env node | ||
filename = 'Gearfile', | ||
existsSync = fs.existsSync || path.existsSync; // 0.6 compat | ||
existsSync = fs.existsSync, | ||
argv = require('minimist')(process.argv.slice(2)); | ||
@@ -31,7 +32,10 @@ var GearCLI = new Liftoff({ | ||
GearCLI.launch(function(env) { | ||
GearCLI.launch({ | ||
cwd: argv.cwd, | ||
configPath: argv.Gearfile | ||
}, function(env) { | ||
// Loads a local install of gear. Falls back to the global install. | ||
var gear = require(env.modulePath || '../index'); | ||
if(process.cwd !== env.cwd) { | ||
process.chdir(env.cwd); | ||
if(process.cwd() !== env.configBase) { | ||
process.chdir(env.configBase); | ||
} | ||
@@ -46,3 +50,3 @@ | ||
try { | ||
tasks = vm.runInNewContext('var tasks = ' + fs.readFileSync(filename) + '; tasks;', { | ||
tasks = vm.runInNewContext('var tasks = ' + fs.readFileSync(env.configPath) + '; tasks;', { | ||
require: require, | ||
@@ -69,5 +73,4 @@ process: process, | ||
function notify(msg) { | ||
console.error('gear: ', msg); | ||
} |
@@ -1,2 +0,9 @@ | ||
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n;"undefined"!=typeof window?n=window:"undefined"!=typeof global?n=global:"undefined"!=typeof self&&(n=self),n.Gear=t()}}(function(){var t;return function n(t,e,r){function i(a,u){if(!e[a]){if(!t[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var s=e[a]={exports:{}};t[a][0].call(s.exports,function(n){var e=t[a][1][n];return i(e?e:n)},s,s.exports,n,t,e,r)}return e[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,n,e){(function(n){var r=e.Blob=function a(t,n){function e(t,n){Object.keys(n).forEach(function(e){t[e]=n[e]})}t="undefined"==typeof t?[]:Array.prototype.concat(t),n=n||{};var r=t.length?t.shift():"",i={},o=this;r instanceof a&&(e(i,r),r=r.result),t.forEach(function(t){t instanceof a?(e(i,t),r+=t.result):r+=t}),e(i,n),Object.keys(i).forEach(function(t){"result"!==t&&Object.defineProperty(o,t,{enumerable:!0,value:i[t]})}),Object.defineProperty(this,"result",{value:r})};r.prototype.toString=function(){return this.result};var i={server:function(n,e,o,a){var u=t("fs");a?i.serverSync(n,e,o):u.readFile(n,"bin"===e?void 0:e,function(t,e){t?o(t):o(null,new r(e,{name:n}))})},serverSync:function(n,e,i){var o,a=t("fs");try{o=a.readFileSync(n,"bin"===e?void 0:e),i(null,new r(o,{name:n}))}catch(u){i(u)}},client:function(t,n,e){t in localStorage?e(null,new r(localStorage[t],{name:t})):e("localStorage has no item "+t)}};r.readFile=r.prototype.readFile=n.browser?i.client:i.server;var o={server:function(n,e,i,o){function a(t,n){c.writeFile(t,n.result,"bin"===i?void 0:i,function(e){o(e,new r(n,{name:t}))})}var u,c=t("fs"),s=t("path"),f=c.exists||s.exists,l=t("mkdirp").mkdirp,h=t("crypto"),p=s.resolve(s.dirname(n));n.indexOf("{checksum}")>-1&&(u=h.createHash("md5"),u.update(e.result),n=n.replace("{checksum}",u.digest("hex"))),f(p,function(t){t?a(n,e):l(p,"0755",function(t){t?o(t):a(n,e)})})},client:function(t,n,e,r){localStorage[t]=n.result,r(null,new n.constructor(n,{name:t}))}};r.writeFile=r.prototype.writeFile=n.browser?o.client:o.server}).call(this,t("FWaASH"))},{FWaASH:25,crypto:19,fs:14,mkdirp:26,path:24}],2:[function(t,n){n.exports={Registry:t("./registry").Registry,Blob:t("./blob").Blob,Queue:t("./queue").Queue,tasks:t("./tasks")}},{"./blob":1,"./queue":3,"./registry":4,"./tasks":7}],3:[function(t,n,e){function r(t,n){for(var e=[],r=0;r<Math.min(t.length,n.length);r++)e.push([t[r],n[r]]);return e}function i(t){return"undefined"==typeof t?[]:Array.prototype.concat(t)}var o=t("async"),a=t("./registry").Registry,u=t("./blob").Blob,c=e.Queue=function(t){var n=this;t=t||{},this._logger=t.logger||console,this._registry="string"==typeof t.registry?new a({module:t.registry}):t.registry||new a,this._clear(),this._registry.tasks.forEach(function(t){n[t]=n.task.bind(n,t)})};c.prototype._clear=function(){this._queue=[function(t){t(null,[])}]},c.prototype._log=function(t){this._logger.log(t)},c.prototype._dispatch=function(t,n,e,a){function c(n,e){n&&(n={task:t,error:n}),a(n,e)}var s=this._registry.task(t),f={2:"append",3:"map",4:"reduce"},l=s.type?s.type:f[s.length];switch(l){case"append":o.map(i(n),s.bind(this),function(t,n){c(t,e.concat(n))});break;case"prepend":o.map(i(n),s.bind(this),function(t,n){c(t,n.concat(e))});break;case"collect":s.call(this,n,e,c);break;case"slice":o.map(r(i(n),e),function(t,n){s.call(this,t[0],t[1],n)}.bind(this),c);break;case"each":o.forEach(e,s.bind(this,n),function(t){c(t,e)});break;case"map":o.map(e,s.bind(this,n),c);break;case"syncmap":o.mapSeries(e,s.bind(this,n),c);break;case"reduce":o.reduce(e,new u,s.bind(this,n),function(t,n){c(t,[n])});break;default:throw new Error('Task "'+t+'" has unknown type. Add a type property to the task function.')}},c.prototype.task=function(t,n){return this._queue.push(this._dispatch.bind(this,t,n)),this},c.prototype.run=function(t){var n=this;o.waterfall(this._queue,t||function(t){t&&n._log(t)})}},{"./blob":1,"./registry":4,async:13}],4:[function(t,n,e){(function(n,r){var i=t("fs"),o=t("path"),a=e.Registry=function(e){var i=this;this._tasks={},this.load(n.browser?{tasks:t("./tasks")}:{dirname:r+"/tasks"}),e&&this.load(e),Object.defineProperty(this,"tasks",{get:function(){return Object.keys(i._tasks)}})};a.prototype={load:function(t){t=t||{};var n=t.module,e=t.dirname,r=t.filename,i=t.tasks;if(n&&!this._loadModule(n))throw new Error("Module "+n+" doesn't exist");if(e&&!this._loadDir(e))throw new Error("Directory "+e+" doesn't exist");if(r&&!this._loadFile(r))throw new Error("File "+r+" doesn't exist");if(i&&!this._loadTasks(i))throw new Error("Failed to load tasks");return this},_loadModule:function(n){if(t)try{return this._loadTasks(t(n))}catch(e){}return this._loadDir(o.resolve("node_modules",n,"lib"))},_loadDir:function(t){if(!i.existsSync(t))return!1;var n=i.readdirSync(t),e=this;return n.forEach(function(n){var r=o.join(t,n);".js"===o.extname(r)&&e._loadFile(r)}),!0},_loadFile:function(n){return i.existsSync(n)?this._loadTasks(t(n)):!1},_loadTasks:function(t){var n;for(n in t)this._tasks[n]=t[n];return!0},task:function(t){if(!(t in this._tasks))throw new Error("Task "+t+" doesn't exist");return this._tasks[t]}}}).call(this,t("FWaASH"),"/")},{"./tasks":7,FWaASH:25,fs:14,path:24}],5:[function(t,n,e){e.concat=function(t,n,e,r){t=t||{},r(null,new e.constructor([n,t.callback?t.callback(e):e]))}},{}],6:[function(t,n,e){function r(){return function(t,n){n(null,new i(t))}}var i=t("../blob").Blob;e.append=e.load=r();var o=e.prepend=r();o.type="prepend";var a=e.test=function(t,n,e){t=t||{},e(t.callback?t.callback(n):null)};a.type="each";var u=e.get=function(t,n,e){e(null,n.slice(t,t+1))};u.type="collect";var c=e.log=function(t,n,e){this._log(t),e(null,n)};c.type="collect";var s=e.inspect=function(t,n,e){var r=this;n.forEach(function(t,n){var e={result:t.result};Object.keys(t).forEach(function(n){e[n]=t[n]}),r._log("blob "+(n+1)+": "+JSON.stringify(e,null," "))}),e(null,n)};s.type="collect",e.noop=function(t,n,e){e(null,n)}},{"../blob":1}],7:[function(t,n){function e(t){Object.keys(t).map(function(n){r[n]=t[n]})}var r={write:t("./write").write,tasks:t("./tasks").tasks,stamp:t("./stamp").stamp,replace:t("./replace").replace,concat:t("./concat").concat};e(t("./core")),e(t("./read")),n.exports=r},{"./concat":5,"./core":6,"./read":8,"./replace":9,"./stamp":10,"./tasks":11,"./write":12}],8:[function(t,n,e){function r(){return function(t,n){t="string"==typeof t?{name:t}:t;var e=t.encoding||"utf8";i.readFile(t.name,e,n,t.sync)}}var i=t("../blob").Blob;e.read=r();var o=e.readBefore=r();o.type="prepend"},{"../blob":1}],9:[function(t,n,e){e.replace=function(t,n,e){var r=n.result;Array.isArray(t)||(t=[t]),t.forEach(function(t){var n=t.replace||"",e=void 0!==t.flags?t.flags:"mg",i="string"==typeof t.regex?new RegExp(t.regex,e):t.regex;r=r.replace(i,n)}),e(null,new n.constructor(r,n))}},{}],10:[function(t,n,e){e.stamp=function(t,n,e){t=t||{},t.prefix=t.prefix||"",t.postfix=t.postfix||"";var r=t.callback?t.callback(n):n.result,i=t.prefix+r+t.postfix;e(null,new n.constructor(i,n))}},{}],11:[function(t,n,e){var r=t("async"),i=e.tasks=function(t,n,e){function i(t,e,r){return function(i,o){var a=r.length?[]:n;o=o||[],r.forEach(function(t){a=a.concat(o[t])}),f._dispatch(t,e,a,i)}}var o,a,u,c,s={},f=this;for(o in t)a=t[o].task,void 0===a?a=["noop"]:Array.isArray(a)||(a=[a]),u=t[o].requires,void 0===u?u=[]:Array.isArray(u)||(u=[u]),c=i(a[0],a[1],u),s[o]=u?u.concat(c):c;r.auto(s,function(t,n){return t?void e(t):void e(t,n&&n.join?n.join:[])})};i.type="collect"},{async:13}],12:[function(t,n,e){var r=e.write=function(t,n,e){t="string"==typeof t?{name:t}:t;var r=t.encoding||"utf8";n.writeFile(t.name,n,r,e)};r.type="slice"},{}],13:[function(n,e){(function(n){!function(){function r(t){var n=!1;return function(){if(n)throw new Error("Callback was already called.");n=!0,t.apply(i,arguments)}}var i,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){return i.async=o,a};var u=function(t,n){if(t.forEach)return t.forEach(n);for(var e=0;e<t.length;e+=1)n(t[e],e,t)},c=function(t,n){if(t.map)return t.map(n);var e=[];return u(t,function(t,r,i){e.push(n(t,r,i))}),e},s=function(t,n,e){return t.reduce?t.reduce(n,e):(u(t,function(t,r,i){e=n(e,t,r,i)}),e)},f=function(t){if(Object.keys)return Object.keys(t);var n=[];for(var e in t)t.hasOwnProperty(e)&&n.push(e);return n};"undefined"!=typeof n&&n.nextTick?(a.nextTick=n.nextTick,a.setImmediate="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:a.nextTick):"function"==typeof setImmediate?(a.nextTick=function(t){setImmediate(t)},a.setImmediate=a.nextTick):(a.nextTick=function(t){setTimeout(t,0)},a.setImmediate=a.nextTick),a.each=function(t,n,e){if(e=e||function(){},!t.length)return e();var i=0;u(t,function(o){n(o,r(function(n){n?(e(n),e=function(){}):(i+=1,i>=t.length&&e(null))}))})},a.forEach=a.each,a.eachSeries=function(t,n,e){if(e=e||function(){},!t.length)return e();var r=0,i=function(){n(t[r],function(n){n?(e(n),e=function(){}):(r+=1,r>=t.length?e(null):i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(t,n,e,r){var i=l(n);i.apply(null,[t,e,r])},a.forEachLimit=a.eachLimit;var l=function(t){return function(n,e,r){if(r=r||function(){},!n.length||0>=t)return r();var i=0,o=0,a=0;!function u(){if(i>=n.length)return r();for(;t>a&&o<n.length;)o+=1,a+=1,e(n[o-1],function(t){t?(r(t),r=function(){}):(i+=1,a-=1,i>=n.length?r():u())})}()}},h=function(t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[a.each].concat(n))}},p=function(t,n){return function(){var e=Array.prototype.slice.call(arguments);return n.apply(null,[l(t)].concat(e))}},d=function(t){return function(){var n=Array.prototype.slice.call(arguments);return t.apply(null,[a.eachSeries].concat(n))}},g=function(t,n,e,r){var i=[];n=c(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e,r){i[t.index]=r,n(e)})},function(t){r(t,i)})};a.map=h(g),a.mapSeries=d(g),a.mapLimit=function(t,n,e,r){return y(n)(t,e,r)};var y=function(t){return p(t,g)};a.reduce=function(t,n,e,r){a.eachSeries(t,function(t,r){e(n,t,function(t,e){n=e,r(t)})},function(t){r(t,n)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(t,n,e,r){var i=c(t,function(t){return t}).reverse();a.reduce(i,n,e,r)},a.foldr=a.reduceRight;var v=function(t,n,e,r){var i=[];n=c(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e){e&&i.push(t),n()})},function(){r(c(i.sort(function(t,n){return t.index-n.index}),function(t){return t.value}))})};a.filter=h(v),a.filterSeries=d(v),a.select=a.filter,a.selectSeries=a.filterSeries;var m=function(t,n,e,r){var i=[];n=c(n,function(t,n){return{index:n,value:t}}),t(n,function(t,n){e(t.value,function(e){e||i.push(t),n()})},function(){r(c(i.sort(function(t,n){return t.index-n.index}),function(t){return t.value}))})};a.reject=h(m),a.rejectSeries=d(m);var b=function(t,n,e,r){t(n,function(t,n){e(t,function(e){e?(r(t),r=function(){}):n()})},function(){r()})};a.detect=h(b),a.detectSeries=d(b),a.some=function(t,n,e){a.each(t,function(t,r){n(t,function(t){t&&(e(!0),e=function(){}),r()})},function(){e(!1)})},a.any=a.some,a.every=function(t,n,e){a.each(t,function(t,r){n(t,function(t){t||(e(!1),e=function(){}),r()})},function(){e(!0)})},a.all=a.every,a.sortBy=function(t,n,e){a.map(t,function(t,e){n(t,function(n,r){n?e(n):e(null,{value:t,criteria:r})})},function(t,n){if(t)return e(t);var r=function(t,n){var e=t.criteria,r=n.criteria;return r>e?-1:e>r?1:0};e(null,c(n.sort(r),function(t){return t.value}))})},a.auto=function(t,n){n=n||function(){};var e=f(t);if(!e.length)return n(null);var r={},i=[],o=function(t){i.unshift(t)},c=function(t){for(var n=0;n<i.length;n+=1)if(i[n]===t)return void i.splice(n,1)},l=function(){u(i.slice(0),function(t){t()})};o(function(){f(r).length===e.length&&(n(null,r),n=function(){})}),u(e,function(e){var i=t[e]instanceof Function?[t[e]]:t[e],h=function(t){var i=Array.prototype.slice.call(arguments,1);if(i.length<=1&&(i=i[0]),t){var o={};u(f(r),function(t){o[t]=r[t]}),o[e]=i,n(t,o),n=function(){}}else r[e]=i,a.setImmediate(l)},p=i.slice(0,Math.abs(i.length-1))||[],d=function(){return s(p,function(t,n){return t&&r.hasOwnProperty(n)},!0)&&!r.hasOwnProperty(e)};if(d())i[i.length-1](h,r);else{var g=function(){d()&&(c(g),i[i.length-1](h,r))};o(g)}})},a.waterfall=function(t,n){if(n=n||function(){},t.constructor!==Array){var e=new Error("First argument to waterfall must be an array of functions");return n(e)}if(!t.length)return n();var r=function(t){return function(e){if(e)n.apply(null,arguments),n=function(){};else{var i=Array.prototype.slice.call(arguments,1),o=t.next();i.push(o?r(o):n),a.setImmediate(function(){t.apply(null,i)})}}};r(a.iterator(t))()};var w=function(t,n,e){if(e=e||function(){},n.constructor===Array)t.map(n,function(t,n){t&&t(function(t){var e=Array.prototype.slice.call(arguments,1);e.length<=1&&(e=e[0]),n.call(null,t,e)})},e);else{var r={};t.each(f(n),function(t,e){n[t](function(n){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),r[t]=i,e(n)})},function(t){e(t,r)})}};a.parallel=function(t,n){w({map:a.map,each:a.each},t,n)},a.parallelLimit=function(t,n,e){w({map:y(n),each:l(n)},t,e)},a.series=function(t,n){if(n=n||function(){},t.constructor===Array)a.mapSeries(t,function(t,n){t&&t(function(t){var e=Array.prototype.slice.call(arguments,1);e.length<=1&&(e=e[0]),n.call(null,t,e)})},n);else{var e={};a.eachSeries(f(t),function(n,r){t[n](function(t){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),e[n]=i,r(t)})},function(t){n(t,e)})}},a.iterator=function(t){var n=function(e){var r=function(){return t.length&&t[e].apply(null,arguments),r.next()};return r.next=function(){return e<t.length-1?n(e+1):null},r};return n(0)},a.apply=function(t){var n=Array.prototype.slice.call(arguments,1);return function(){return t.apply(null,n.concat(Array.prototype.slice.call(arguments)))}};var E=function(t,n,e,r){var i=[];t(n,function(t,n){e(t,function(t,e){i=i.concat(e||[]),n(t)})},function(t){r(t,i)})};a.concat=h(E),a.concatSeries=d(E),a.whilst=function(t,n,e){t()?n(function(r){return r?e(r):void a.whilst(t,n,e)}):e()},a.doWhilst=function(t,n,e){t(function(r){return r?e(r):void(n()?a.doWhilst(t,n,e):e())})},a.until=function(t,n,e){t()?e():n(function(r){return r?e(r):void a.until(t,n,e)})},a.doUntil=function(t,n,e){t(function(r){return r?e(r):void(n()?e():a.doUntil(t,n,e))})},a.queue=function(t,n){function e(t,e,r,i){e.constructor!==Array&&(e=[e]),u(e,function(e){var o={data:e,callback:"function"==typeof i?i:null};r?t.tasks.unshift(o):t.tasks.push(o),t.saturated&&t.tasks.length===n&&t.saturated(),a.setImmediate(t.process)})}void 0===n&&(n=1);var i=0,o={tasks:[],concurrency:n,saturated:null,empty:null,drain:null,push:function(t,n){e(o,t,!1,n)},unshift:function(t,n){e(o,t,!0,n)},process:function(){if(i<o.concurrency&&o.tasks.length){var n=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var e=function(){i-=1,n.callback&&n.callback.apply(n,arguments),o.drain&&o.tasks.length+i===0&&o.drain(),o.process()},a=r(e);t(n.data,a)}},length:function(){return o.tasks.length},running:function(){return i}};return o},a.cargo=function(t,n){var e=!1,r=[],i={tasks:r,payload:n,saturated:null,empty:null,drain:null,push:function(t,e){t.constructor!==Array&&(t=[t]),u(t,function(t){r.push({data:t,callback:"function"==typeof e?e:null}),i.saturated&&r.length===n&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!e){if(0===r.length)return void(i.drain&&i.drain());var a="number"==typeof n?r.splice(0,n):r.splice(0),s=c(a,function(t){return t.data});i.empty&&i.empty(),e=!0,t(s,function(){e=!1;var t=arguments;u(a,function(n){n.callback&&n.callback.apply(null,t)}),o()})}},length:function(){return r.length},running:function(){return e}};return i};var k=function(t){return function(n){var e=Array.prototype.slice.call(arguments,1);n.apply(null,e.concat([function(n){var e=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(n?console.error&&console.error(n):console[t]&&u(e,function(n){console[t](n)}))}]))}};a.log=k("log"),a.dir=k("dir"),a.memoize=function(t,n){var e={},r={};n=n||function(t){return t};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),a=n.apply(null,i);a in e?o.apply(null,e[a]):a in r?r[a].push(o):(r[a]=[o],t.apply(null,i.concat([function(){e[a]=arguments;var t=r[a];delete r[a];for(var n=0,i=t.length;i>n;n++)t[n].apply(null,arguments)}])))};return i.memo=e,i.unmemoized=t,i},a.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},a.times=function(t,n,e){for(var r=[],i=0;t>i;i++)r.push(i);return a.map(r,n,e)},a.timesSeries=function(t,n,e){for(var r=[],i=0;t>i;i++)r.push(i);return a.mapSeries(r,n,e)},a.compose=function(){var t=Array.prototype.reverse.call(arguments);return function(){var n=this,e=Array.prototype.slice.call(arguments),r=e.pop();a.reduce(t,e,function(t,e,r){e.apply(n,t.concat([function(){var t=arguments[0],n=Array.prototype.slice.call(arguments,1);r(t,n)}]))},function(t,e){r.apply(n,[t].concat(e))})}};var A=function(t,n){var e=function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();return t(n,function(t,n){t.apply(e,r.concat([n]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return e.apply(this,r)}return e};a.applyEach=h(A),a.applyEachSeries=d(A),a.forever=function(t,n){function e(r){if(r){if(n)return n(r);throw r}t(e)}e()},"undefined"!=typeof t&&t.amd?t([],function(){return a}):"undefined"!=typeof e&&e.exports?e.exports=a:i.async=a}()}).call(this,n("FWaASH"))},{FWaASH:25}],14:[function(){},{}],15:[function(t,n,e){function r(t,n,e){if(!(this instanceof r))return new r(t,n,e);var i=typeof t;if("base64"===n&&"string"===i)for(t=L(t);t.length%4!==0;)t+="=";var o;if("number"===i)o=U(t);else if("string"===i)o=r.byteLength(t,n);else{if("object"!==i)throw new Error("First argument needs to be a number, array or string.");o=U(t.length)}var a;r._useTypedArrays?a=r._augment(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var u;if(r._useTypedArrays&&"number"==typeof t.byteLength)a._set(t);else if(F(t))for(u=0;o>u;u++)a[u]=r.isBuffer(t)?t.readUInt8(u):t[u];else if("string"===i)a.write(t,0,n);else if("number"===i&&!r._useTypedArrays&&!e)for(u=0;o>u;u++)a[u]=0;return a}function i(t,n,e,r){e=Number(e)||0;var i=t.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=n.length;P(o%2===0,"Invalid hex string"),r>o/2&&(r=o/2);for(var a=0;r>a;a++){var u=parseInt(n.substr(2*a,2),16);P(!isNaN(u),"Invalid hex string"),t[e+a]=u}return a}function o(t,n,e,r){var i=O(M(n),t,e,r);return i}function a(t,n,e,r){var i=O(C(n),t,e,r);return i}function u(t,n,e,r){return a(t,n,e,r)}function c(t,n,e,r){var i=O(D(n),t,e,r);return i}function s(t,n,e,r){var i=O(N(n),t,e,r);return i}function f(t,n,e){return z.fromByteArray(0===n&&e===t.length?t:t.slice(n,e))}function l(t,n,e){var r="",i="";e=Math.min(t.length,e);for(var o=n;e>o;o++)t[o]<=127?(r+=q(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+q(i)}function h(t,n,e){var r="";e=Math.min(t.length,e);for(var i=n;e>i;i++)r+=String.fromCharCode(t[i]);return r}function p(t,n,e){return h(t,n,e)}function d(t,n,e){var r=t.length;(!n||0>n)&&(n=0),(!e||0>e||e>r)&&(e=r);for(var i="",o=n;e>o;o++)i+=j(t[o]);return i}function g(t,n,e){for(var r=t.slice(n,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function y(t,n,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+1<t.length,"Trying to read beyond buffer length"));var i=t.length;if(!(n>=i)){var o;return e?(o=t[n],i>n+1&&(o|=t[n+1]<<8)):(o=t[n]<<8,i>n+1&&(o|=t[n+1])),o}}function v(t,n,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+3<t.length,"Trying to read beyond buffer length"));var i=t.length;if(!(n>=i)){var o;return e?(i>n+2&&(o=t[n+2]<<16),i>n+1&&(o|=t[n+1]<<8),o|=t[n],i>n+3&&(o+=t[n+3]<<24>>>0)):(i>n+1&&(o=t[n+1]<<16),i>n+2&&(o|=t[n+2]<<8),i>n+3&&(o|=t[n+3]),o+=t[n]<<24>>>0),o}}function m(t,n,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+1<t.length,"Trying to read beyond buffer length"));var i=t.length;if(!(n>=i)){var o=y(t,n,e,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(t,n,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==n&&null!==n,"missing offset"),P(n+3<t.length,"Trying to read beyond buffer length"));var i=t.length;if(!(n>=i)){var o=v(t,n,e,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function w(t,n,e,r){return r||(P("boolean"==typeof e,"missing or invalid endian"),P(n+3<t.length,"Trying to read beyond buffer length")),J.read(t,n,e,23,4)}function E(t,n,e,r){return r||(P("boolean"==typeof e,"missing or invalid endian"),P(n+7<t.length,"Trying to read beyond buffer length")),J.read(t,n,e,52,8)}function k(t,n,e,r,i){i||(P(void 0!==n&&null!==n,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+1<t.length,"trying to write beyond buffer length"),H(n,65535));var o=t.length;if(!(e>=o)){for(var a=0,u=Math.min(o-e,2);u>a;a++)t[e+a]=(n&255<<8*(r?a:1-a))>>>8*(r?a:1-a);return e+2}}function A(t,n,e,r,i){i||(P(void 0!==n&&null!==n,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+3<t.length,"trying to write beyond buffer length"),H(n,4294967295));var o=t.length;if(!(e>=o)){for(var a=0,u=Math.min(o-e,4);u>a;a++)t[e+a]=n>>>8*(r?a:3-a)&255;return e+4}}function I(t,n,e,r,i){i||(P(void 0!==n&&null!==n,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+1<t.length,"Trying to write beyond buffer length"),W(n,32767,-32768));var o=t.length;if(!(e>=o))return n>=0?k(t,n,e,r,i):k(t,65535+n+1,e,r,i),e+2}function B(t,n,e,r,i){i||(P(void 0!==n&&null!==n,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+3<t.length,"Trying to write beyond buffer length"),W(n,2147483647,-2147483648));var o=t.length;if(!(e>=o))return n>=0?A(t,n,e,r,i):A(t,4294967295+n+1,e,r,i),e+4}function S(t,n,e,r,i){i||(P(void 0!==n&&null!==n,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+3<t.length,"Trying to write beyond buffer length"),R(n,3.4028234663852886e38,-3.4028234663852886e38));var o=t.length;if(!(e>=o))return J.write(t,n,e,r,23,4),e+4}function x(t,n,e,r,i){i||(P(void 0!==n&&null!==n,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+7<t.length,"Trying to write beyond buffer length"),R(n,1.7976931348623157e308,-1.7976931348623157e308));var o=t.length;if(!(e>=o))return J.write(t,n,e,r,52,8),e+8}function L(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function _(t,n,e){return"number"!=typeof t?e:(t=~~t,t>=n?n:t>=0?t:(t+=n,t>=0?t:0))}function U(t){return t=~~Math.ceil(+t),0>t?0:t}function T(t){return(Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)})(t)}function F(t){return T(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function j(t){return 16>t?"0"+t.toString(16):t.toString(16)}function M(t){for(var n=[],e=0;e<t.length;e++){var r=t.charCodeAt(e);if(127>=r)n.push(r);else{var i=e;r>=55296&&57343>=r&&e++;for(var o=encodeURIComponent(t.slice(i,e+1)).substr(1).split("%"),a=0;a<o.length;a++)n.push(parseInt(o[a],16))}}return n}function C(t){for(var n=[],e=0;e<t.length;e++)n.push(255&t.charCodeAt(e));return n}function N(t){for(var n,e,r,i=[],o=0;o<t.length;o++)n=t.charCodeAt(o),e=n>>8,r=n%256,i.push(r),i.push(e);return i}function D(t){return z.toByteArray(t)}function O(t,n,e,r){for(var i=0;r>i&&!(i+e>=n.length||i>=t.length);i++)n[i+e]=t[i];return i}function q(t){try{return decodeURIComponent(t)}catch(n){return String.fromCharCode(65533)}}function H(t,n){P("number"==typeof t,"cannot write a non-number as a number"),P(t>=0,"specified a negative value for writing an unsigned value"),P(n>=t,"value is larger than maximum value for type"),P(Math.floor(t)===t,"value has a fractional component")}function W(t,n,e){P("number"==typeof t,"cannot write a non-number as a number"),P(n>=t,"value larger than maximum allowed value"),P(t>=e,"value smaller than minimum allowed value"),P(Math.floor(t)===t,"value has a fractional component")}function R(t,n,e){P("number"==typeof t,"cannot write a non-number as a number"),P(n>=t,"value larger than maximum allowed value"),P(t>=e,"value smaller than minimum allowed value")}function P(t,n){if(!t)throw new Error(n||"Failed assertion")}/*! | ||
!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.Gear=n()}}(function(){var n;return function t(n,e,r){function i(a,u){if(!e[a]){if(!n[a]){var c="function"==typeof require&&require;if(!u&&c)return c(a,!0);if(o)return o(a,!0);throw new Error("Cannot find module '"+a+"'")}var s=e[a]={exports:{}};n[a][0].call(s.exports,function(t){var e=n[a][1][t];return i(e?e:t)},s,s.exports,t,n,e,r)}return e[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(n,t){(function(e){function r(n){return localStorage[n]}function i(n){return JSON.parse(u(n)+"")}function o(n){return JSON.parse(a(u(n)+""))}function a(n){var t,e,r,i,o=/"|(\/\*)|(\*\/)|(\/\/)|\n|\r/g,a=!1,u=!1,c=!1,s=[],f=0,l=0;for(o.lastIndex=0;t=o.exec(n);)r=RegExp.leftContext,i=RegExp.rightContext,u||c||(e=r.substring(l),a||(e=e.replace(/(\n|\r|\s)*/g,"")),s[f++]=e),l=o.lastIndex,'"'!=t[0]||u||c?"/*"!=t[0]||a||u||c?"*/"!=t[0]||a||!u||c?"//"!=t[0]||a||u||c?"\n"!=t[0]&&"\r"!=t[0]||a||u||!c?u||c||/\n|\r|\s/.test(t[0])||(s[f++]=t[0]):c=!1:c=!0:u=!1:u=!0:(e=r.match(/(\\)*$/),a&&e&&e[0].length%2!==0||(a=!a),l--,i=n.substring(l));return s[f++]=i,s.join("")}var u=e.browser?r:n("fs").readFileSync;t.exports={readJSON:i,readJSONC:o}}).call(this,n("FWaASH"))},{FWaASH:26,fs:15}],2:[function(n,t,e){(function(t){var r=e.Blob=function a(n,t){function e(n,t){Object.keys(t).forEach(function(e){n[e]=t[e]})}n="undefined"==typeof n?[]:Array.prototype.concat(n),t=t||{};var r=n.length?n.shift():"",i={},o=this;r instanceof a&&(e(i,r),r=r.result),n.forEach(function(n){n instanceof a?(e(i,n),r+=n.result):r+=n}),e(i,t),Object.keys(i).forEach(function(n){"result"!==n&&Object.defineProperty(o,n,{enumerable:!0,value:i[n]})}),Object.defineProperty(this,"result",{value:r})};r.prototype.toString=function(){return this.result};var i={server:function(t,e,o,a){var u=n("fs");a?i.serverSync(t,e,o):u.readFile(t,"bin"===e?void 0:e,function(n,e){n?o(n):o(null,new r(e,{name:t}))})},serverSync:function(t,e,i){var o,a=n("fs");try{o=a.readFileSync(t,"bin"===e?void 0:e),i(null,new r(o,{name:t}))}catch(u){i(u)}},client:function(n,t,e){n in localStorage?e(null,new r(localStorage[n],{name:n})):e("localStorage has no item "+n)}};r.readFile=r.prototype.readFile=t.browser?i.client:i.server;var o={server:function(t,e,i,o){function a(n,t){c.writeFile(n,t.result,"bin"===i?void 0:i,function(e){o(e,new r(t,{name:n}))})}var u,c=n("fs"),s=n("path"),f=c.exists||s.exists,l=n("mkdirp").mkdirp,h=n("crypto"),p=s.resolve(s.dirname(t));t.indexOf("{checksum}")>-1&&(u=h.createHash("md5"),u.update(e.result),t=t.replace("{checksum}",u.digest("hex"))),f(p,function(n){n?a(t,e):l(p,"0755",function(n){n?o(n):a(t,e)})})},client:function(n,t,e,r){localStorage[n]=t.result,r(null,new t.constructor(t,{name:n}))}};r.writeFile=r.prototype.writeFile=t.browser?o.client:o.server}).call(this,n("FWaASH"))},{FWaASH:26,crypto:20,fs:15,mkdirp:27,path:25}],3:[function(n,t){t.exports={Registry:n("./registry").Registry,Blob:n("./blob").Blob,Queue:n("./queue").Queue,Util:n("./Util"),tasks:n("./tasks")}},{"./Util":1,"./blob":2,"./queue":4,"./registry":5,"./tasks":8}],4:[function(n,t,e){function r(n,t){for(var e=[],r=0;r<Math.min(n.length,t.length);r++)e.push([n[r],t[r]]);return e}function i(n){return"undefined"==typeof n?[]:Array.prototype.concat(n)}var o=n("async"),a=n("./registry").Registry,u=n("./blob").Blob,c=e.Queue=function(n){var t=this;n=n||{},this._logger=n.logger||console,this._registry="string"==typeof n.registry?new a({module:n.registry}):n.registry||new a,this._clear(),this._registry.tasks.forEach(function(n){t[n]=t.task.bind(t,n)})};c.prototype._clear=function(){this._queue=[function(n){n(null,[])}]},c.prototype._log=function(n){this._logger.log(n)},c.prototype._dispatch=function(n,t,e,a){function c(t,e){t&&(t={task:n,error:t}),a(t,e)}var s=this._registry.task(n),f={2:"append",3:"map",4:"reduce"},l=s.type?s.type:f[s.length];switch(l){case"append":o.map(i(t),s.bind(this),function(n,t){c(n,e.concat(t))});break;case"prepend":o.map(i(t),s.bind(this),function(n,t){c(n,t.concat(e))});break;case"collect":s.call(this,t,e,c);break;case"slice":o.map(r(i(t),e),function(n,t){s.call(this,n[0],n[1],t)}.bind(this),c);break;case"each":o.forEach(e,s.bind(this,t),function(n){c(n,e)});break;case"map":o.map(e,s.bind(this,t),c);break;case"syncmap":o.mapSeries(e,s.bind(this,t),c);break;case"reduce":o.reduce(e,new u,s.bind(this,t),function(n,t){c(n,[t])});break;default:throw new Error('Task "'+n+'" has unknown type. Add a type property to the task function.')}},c.prototype.task=function(n,t){return this._queue.push(this._dispatch.bind(this,n,t)),this},c.prototype.run=function(n){var t=this;o.waterfall(this._queue,n||function(n){n&&t._log(n)})}},{"./blob":2,"./registry":5,async:14}],5:[function(n,t,e){(function(t,r){var i=n("fs"),o=n("path"),a=e.Registry=function(e){var i=this;this._tasks={},this.load(t.browser?{tasks:n("./tasks")}:{dirname:r+"/tasks"}),e&&this.load(e),Object.defineProperty(this,"tasks",{get:function(){return Object.keys(i._tasks)}})};a.prototype={load:function(n){n=n||{};var t=n.module,e=n.dirname,r=n.filename,i=n.tasks;if(t&&!this._loadModule(t))throw new Error("Module "+t+" doesn't exist");if(e&&!this._loadDir(e))throw new Error("Directory "+e+" doesn't exist");if(r&&!this._loadFile(r))throw new Error("File "+r+" doesn't exist");if(i&&!this._loadTasks(i))throw new Error("Failed to load tasks");return this},_loadModule:function(t){if(n)try{return this._loadTasks(n(t))}catch(e){}return this._loadDir(o.resolve("node_modules",t,"lib"))},_loadDir:function(n){if(!i.existsSync(n))return!1;var t=i.readdirSync(n),e=this;return t.forEach(function(t){var r=o.join(n,t);".js"===o.extname(r)&&e._loadFile(r)}),!0},_loadFile:function(t){return i.existsSync(t)?this._loadTasks(n(t)):!1},_loadTasks:function(n){var t;for(t in n)this._tasks[t]=n[t];return!0},task:function(n){if(!(n in this._tasks))throw new Error("Task "+n+" doesn't exist");return this._tasks[n]}}}).call(this,n("FWaASH"),"/")},{"./tasks":8,FWaASH:26,fs:15,path:25}],6:[function(n,t,e){e.concat=function(n,t,e,r){n=n||{},r(null,new e.constructor([t,n.callback?n.callback(e):e]))}},{}],7:[function(n,t,e){function r(){return function(n,t){t(null,new i(n))}}var i=n("../blob").Blob;e.append=e.load=r();var o=e.prepend=r();o.type="prepend";var a=e.test=function(n,t,e){n=n||{},e(n.callback?n.callback(t):null)};a.type="each";var u=e.get=function(n,t,e){e(null,t.slice(n,n+1))};u.type="collect";var c=e.log=function(n,t,e){this._log(n),e(null,t)};c.type="collect";var s=e.inspect=function(n,t,e){var r=this;t.forEach(function(n,t){var e={result:n.result};Object.keys(n).forEach(function(t){e[t]=n[t]}),r._log("blob "+(t+1)+": "+JSON.stringify(e,null," "))}),e(null,t)};s.type="collect",e.noop=function(n,t,e){e(null,t)}},{"../blob":2}],8:[function(n,t){function e(n){Object.keys(n).map(function(t){r[t]=n[t]})}var r={write:n("./write").write,tasks:n("./tasks").tasks,stamp:n("./stamp").stamp,replace:n("./replace").replace,concat:n("./concat").concat};e(n("./core")),e(n("./read")),t.exports=r},{"./concat":6,"./core":7,"./read":9,"./replace":10,"./stamp":11,"./tasks":12,"./write":13}],9:[function(n,t,e){function r(){return function(n,t){n="string"==typeof n?{name:n}:n;var e=n.encoding||"utf8";i.readFile(n.name,e,t,n.sync)}}var i=n("../blob").Blob;e.read=r();var o=e.readBefore=r();o.type="prepend"},{"../blob":2}],10:[function(n,t,e){e.replace=function(n,t,e){var r=t.result;Array.isArray(n)||(n=[n]),n.forEach(function(n){var t=n.replace||"",e=void 0!==n.flags?n.flags:"mg",i="string"==typeof n.regex?new RegExp(n.regex,e):n.regex;r=r.replace(i,t)}),e(null,new t.constructor(r,t))}},{}],11:[function(n,t,e){e.stamp=function(n,t,e){n=n||{},n.prefix=n.prefix||"",n.postfix=n.postfix||"";var r=n.callback?n.callback(t):t.result,i=n.prefix+r+n.postfix;e(null,new t.constructor(i,t))}},{}],12:[function(n,t,e){var r=n("async"),i=e.tasks=function(n,t,e){function i(n,e,r){return function(i,o){var a=r.length?[]:t;o=o||[],r.forEach(function(n){a=a.concat(o[n])}),f._dispatch(n,e,a,i)}}var o,a,u,c,s={},f=this;for(o in n)a=n[o].task,void 0===a?a=["noop"]:Array.isArray(a)||(a=[a]),u=n[o].requires,void 0===u?u=[]:Array.isArray(u)||(u=[u]),c=i(a[0],a[1],u),s[o]=u?u.concat(c):c;r.auto(s,function(n,t){return n?void e(n):void e(n,t&&t.join?t.join:[])})};i.type="collect"},{async:14}],13:[function(n,t,e){var r=e.write=function(n,t,e){n="string"==typeof n?{name:n}:n;var r=n.encoding||"utf8";t.writeFile(n.name,t,r,e)};r.type="slice"},{}],14:[function(t,e){(function(t){/*! | ||
* async | ||
* https://github.com/caolan/async | ||
* | ||
* Copyright 2010-2014 Caolan McMahon | ||
* Released under the MIT license | ||
*/ | ||
!function(){function r(n){var t=!1;return function(){if(t)throw new Error("Callback was already called.");t=!0,n.apply(i,arguments)}}var i,o,a={};i=this,null!=i&&(o=i.async),a.noConflict=function(){return i.async=o,a};var u=Object.prototype.toString,c=Array.isArray||function(n){return"[object Array]"===u.call(n)},s=function(n,t){if(n.forEach)return n.forEach(t);for(var e=0;e<n.length;e+=1)t(n[e],e,n)},f=function(n,t){if(n.map)return n.map(t);var e=[];return s(n,function(n,r,i){e.push(t(n,r,i))}),e},l=function(n,t,e){return n.reduce?n.reduce(t,e):(s(n,function(n,r,i){e=t(e,n,r,i)}),e)},h=function(n){if(Object.keys)return Object.keys(n);var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t};"undefined"!=typeof t&&t.nextTick?(a.nextTick=t.nextTick,a.setImmediate="undefined"!=typeof setImmediate?function(n){setImmediate(n)}:a.nextTick):"function"==typeof setImmediate?(a.nextTick=function(n){setImmediate(n)},a.setImmediate=a.nextTick):(a.nextTick=function(n){setTimeout(n,0)},a.setImmediate=a.nextTick),a.each=function(n,t,e){function i(t){t?(e(t),e=function(){}):(o+=1,o>=n.length&&e())}if(e=e||function(){},!n.length)return e();var o=0;s(n,function(n){t(n,r(i))})},a.forEach=a.each,a.eachSeries=function(n,t,e){if(e=e||function(){},!n.length)return e();var r=0,i=function(){t(n[r],function(t){t?(e(t),e=function(){}):(r+=1,r>=n.length?e():i())})};i()},a.forEachSeries=a.eachSeries,a.eachLimit=function(n,t,e,r){var i=p(t);i.apply(null,[n,e,r])},a.forEachLimit=a.eachLimit;var p=function(n){return function(t,e,r){if(r=r||function(){},!t.length||0>=n)return r();var i=0,o=0,a=0;!function u(){if(i>=t.length)return r();for(;n>a&&o<t.length;)o+=1,a+=1,e(t[o-1],function(n){n?(r(n),r=function(){}):(i+=1,a-=1,i>=t.length?r():u())})}()}},d=function(n){return function(){var t=Array.prototype.slice.call(arguments);return n.apply(null,[a.each].concat(t))}},g=function(n,t){return function(){var e=Array.prototype.slice.call(arguments);return t.apply(null,[p(n)].concat(e))}},y=function(n){return function(){var t=Array.prototype.slice.call(arguments);return n.apply(null,[a.eachSeries].concat(t))}},v=function(n,t,e,r){if(t=f(t,function(n,t){return{index:t,value:n}}),r){var i=[];n(t,function(n,t){e(n.value,function(e,r){i[n.index]=r,t(e)})},function(n){r(n,i)})}else n(t,function(n,t){e(n.value,function(n){t(n)})})};a.map=d(v),a.mapSeries=y(v),a.mapLimit=function(n,t,e,r){return m(t)(n,e,r)};var m=function(n){return g(n,v)};a.reduce=function(n,t,e,r){a.eachSeries(n,function(n,r){e(t,n,function(n,e){t=e,r(n)})},function(n){r(n,t)})},a.inject=a.reduce,a.foldl=a.reduce,a.reduceRight=function(n,t,e,r){var i=f(n,function(n){return n}).reverse();a.reduce(i,t,e,r)},a.foldr=a.reduceRight;var b=function(n,t,e,r){var i=[];t=f(t,function(n,t){return{index:t,value:n}}),n(t,function(n,t){e(n.value,function(e){e&&i.push(n),t()})},function(){r(f(i.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})};a.filter=d(b),a.filterSeries=y(b),a.select=a.filter,a.selectSeries=a.filterSeries;var w=function(n,t,e,r){var i=[];t=f(t,function(n,t){return{index:t,value:n}}),n(t,function(n,t){e(n.value,function(e){e||i.push(n),t()})},function(){r(f(i.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})};a.reject=d(w),a.rejectSeries=y(w);var E=function(n,t,e,r){n(t,function(n,t){e(n,function(e){e?(r(n),r=function(){}):t()})},function(){r()})};a.detect=d(E),a.detectSeries=y(E),a.some=function(n,t,e){a.each(n,function(n,r){t(n,function(n){n&&(e(!0),e=function(){}),r()})},function(){e(!1)})},a.any=a.some,a.every=function(n,t,e){a.each(n,function(n,r){t(n,function(n){n||(e(!1),e=function(){}),r()})},function(){e(!0)})},a.all=a.every,a.sortBy=function(n,t,e){a.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){if(n)return e(n);var r=function(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0};e(null,f(t.sort(r),function(n){return n.value}))})},a.auto=function(n,t){t=t||function(){};var e=h(n),r=e.length;if(!r)return t();var i={},o=[],u=function(n){o.unshift(n)},f=function(n){for(var t=0;t<o.length;t+=1)if(o[t]===n)return void o.splice(t,1)},p=function(){r--,s(o.slice(0),function(n){n()})};u(function(){if(!r){var n=t;t=function(){},n(null,i)}}),s(e,function(e){var r=c(n[e])?n[e]:[n[e]],o=function(n){var r=Array.prototype.slice.call(arguments,1);if(r.length<=1&&(r=r[0]),n){var o={};s(h(i),function(n){o[n]=i[n]}),o[e]=r,t(n,o),t=function(){}}else i[e]=r,a.setImmediate(p)},d=r.slice(0,Math.abs(r.length-1))||[],g=function(){return l(d,function(n,t){return n&&i.hasOwnProperty(t)},!0)&&!i.hasOwnProperty(e)};if(g())r[r.length-1](o,i);else{var y=function(){g()&&(f(y),r[r.length-1](o,i))};u(y)}})},a.retry=function(n,t,e){var r=5,i=[];"function"==typeof n&&(e=t,t=n,n=r),n=parseInt(n,10)||r;var o=function(r,o){for(var u=function(n,t){return function(e){n(function(n,r){e(!n||t,{err:n,result:r})},o)}};n;)i.push(u(t,!(n-=1)));a.series(i,function(n,t){t=t[t.length-1],(r||e)(t.err,t.result)})};return e?o():o},a.waterfall=function(n,t){if(t=t||function(){},!c(n)){var e=new Error("First argument to waterfall must be an array of functions");return t(e)}if(!n.length)return t();var r=function(n){return function(e){if(e)t.apply(null,arguments),t=function(){};else{var i=Array.prototype.slice.call(arguments,1),o=n.next();i.push(o?r(o):t),a.setImmediate(function(){n.apply(null,i)})}}};r(a.iterator(n))()};var k=function(n,t,e){if(e=e||function(){},c(t))n.map(t,function(n,t){n&&n(function(n){var e=Array.prototype.slice.call(arguments,1);e.length<=1&&(e=e[0]),t.call(null,n,e)})},e);else{var r={};n.each(h(t),function(n,e){t[n](function(t){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),r[n]=i,e(t)})},function(n){e(n,r)})}};a.parallel=function(n,t){k({map:a.map,each:a.each},n,t)},a.parallelLimit=function(n,t,e){k({map:m(t),each:p(t)},n,e)},a.series=function(n,t){if(t=t||function(){},c(n))a.mapSeries(n,function(n,t){n&&n(function(n){var e=Array.prototype.slice.call(arguments,1);e.length<=1&&(e=e[0]),t.call(null,n,e)})},t);else{var e={};a.eachSeries(h(n),function(t,r){n[t](function(n){var i=Array.prototype.slice.call(arguments,1);i.length<=1&&(i=i[0]),e[t]=i,r(n)})},function(n){t(n,e)})}},a.iterator=function(n){var t=function(e){var r=function(){return n.length&&n[e].apply(null,arguments),r.next()};return r.next=function(){return e<n.length-1?t(e+1):null},r};return t(0)},a.apply=function(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t.concat(Array.prototype.slice.call(arguments)))}};var A=function(n,t,e,r){var i=[];n(t,function(n,t){e(n,function(n,e){i=i.concat(e||[]),t(n)})},function(n){r(n,i)})};a.concat=d(A),a.concatSeries=y(A),a.whilst=function(n,t,e){n()?t(function(r){return r?e(r):void a.whilst(n,t,e)}):e()},a.doWhilst=function(n,t,e){n(function(r){if(r)return e(r);var i=Array.prototype.slice.call(arguments,1);t.apply(null,i)?a.doWhilst(n,t,e):e()})},a.until=function(n,t,e){n()?e():t(function(r){return r?e(r):void a.until(n,t,e)})},a.doUntil=function(n,t,e){n(function(r){if(r)return e(r);var i=Array.prototype.slice.call(arguments,1);t.apply(null,i)?e():a.doUntil(n,t,e)})},a.queue=function(n,t){function e(n,t,e,r){return n.started||(n.started=!0),c(t)||(t=[t]),0==t.length?a.setImmediate(function(){n.drain&&n.drain()}):void s(t,function(t){var i={data:t,callback:"function"==typeof r?r:null};e?n.tasks.unshift(i):n.tasks.push(i),n.saturated&&n.tasks.length===n.concurrency&&n.saturated(),a.setImmediate(n.process)})}void 0===t&&(t=1);var i=0,o={tasks:[],concurrency:t,saturated:null,empty:null,drain:null,started:!1,paused:!1,push:function(n,t){e(o,n,!1,t)},kill:function(){o.drain=null,o.tasks=[]},unshift:function(n,t){e(o,n,!0,t)},process:function(){if(!o.paused&&i<o.concurrency&&o.tasks.length){var t=o.tasks.shift();o.empty&&0===o.tasks.length&&o.empty(),i+=1;var e=function(){i-=1,t.callback&&t.callback.apply(t,arguments),o.drain&&o.tasks.length+i===0&&o.drain(),o.process()},a=r(e);n(t.data,a)}},length:function(){return o.tasks.length},running:function(){return i},idle:function(){return o.tasks.length+i===0},pause:function(){o.paused!==!0&&(o.paused=!0,o.process())},resume:function(){o.paused!==!1&&(o.paused=!1,o.process())}};return o},a.cargo=function(n,t){var e=!1,r=[],i={tasks:r,payload:t,saturated:null,empty:null,drain:null,drained:!0,push:function(n,e){c(n)||(n=[n]),s(n,function(n){r.push({data:n,callback:"function"==typeof e?e:null}),i.drained=!1,i.saturated&&r.length===t&&i.saturated()}),a.setImmediate(i.process)},process:function o(){if(!e){if(0===r.length)return i.drain&&!i.drained&&i.drain(),void(i.drained=!0);var a="number"==typeof t?r.splice(0,t):r.splice(0,r.length),u=f(a,function(n){return n.data});i.empty&&i.empty(),e=!0,n(u,function(){e=!1;var n=arguments;s(a,function(t){t.callback&&t.callback.apply(null,n)}),o()})}},length:function(){return r.length},running:function(){return e}};return i};var I=function(n){return function(t){var e=Array.prototype.slice.call(arguments,1);t.apply(null,e.concat([function(t){var e=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(t?console.error&&console.error(t):console[n]&&s(e,function(t){console[n](t)}))}]))}};a.log=I("log"),a.dir=I("dir"),a.memoize=function(n,t){var e={},r={};t=t||function(n){return n};var i=function(){var i=Array.prototype.slice.call(arguments),o=i.pop(),u=t.apply(null,i);u in e?a.nextTick(function(){o.apply(null,e[u])}):u in r?r[u].push(o):(r[u]=[o],n.apply(null,i.concat([function(){e[u]=arguments;var n=r[u];delete r[u];for(var t=0,i=n.length;i>t;t++)n[t].apply(null,arguments)}])))};return i.memo=e,i.unmemoized=n,i},a.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},a.times=function(n,t,e){for(var r=[],i=0;n>i;i++)r.push(i);return a.map(r,t,e)},a.timesSeries=function(n,t,e){for(var r=[],i=0;n>i;i++)r.push(i);return a.mapSeries(r,t,e)},a.seq=function(){var n=arguments;return function(){var t=this,e=Array.prototype.slice.call(arguments),r=e.pop();a.reduce(n,e,function(n,e,r){e.apply(t,n.concat([function(){var n=arguments[0],t=Array.prototype.slice.call(arguments,1);r(n,t)}]))},function(n,e){r.apply(t,[n].concat(e))})}},a.compose=function(){return a.seq.apply(null,Array.prototype.reverse.call(arguments))};var S=function(n,t){var e=function(){var e=this,r=Array.prototype.slice.call(arguments),i=r.pop();return n(t,function(n,t){n.apply(e,r.concat([t]))},i)};if(arguments.length>2){var r=Array.prototype.slice.call(arguments,2);return e.apply(this,r)}return e};a.applyEach=d(S),a.applyEachSeries=y(S),a.forever=function(n,t){function e(r){if(r){if(t)return t(r);throw r}n(e)}e()},"undefined"!=typeof e&&e.exports?e.exports=a:"undefined"!=typeof n&&n.amd?n([],function(){return a}):i.async=a}()}).call(this,t("FWaASH"))},{FWaASH:26}],15:[function(){},{}],16:[function(n,t,e){function r(n,t,e){if(!(this instanceof r))return new r(n,t,e);var i=typeof n;if("base64"===t&&"string"===i)for(n=L(n);n.length%4!==0;)n+="=";var o;if("number"===i)o=U(n);else if("string"===i)o=r.byteLength(n,t);else{if("object"!==i)throw new Error("First argument needs to be a number, array or string.");o=U(n.length)}var a;r._useTypedArrays?a=r._augment(new Uint8Array(o)):(a=this,a.length=o,a._isBuffer=!0);var u;if(r._useTypedArrays&&"number"==typeof n.byteLength)a._set(n);else if(F(n))if(r.isBuffer(n))for(u=0;o>u;u++)a[u]=n.readUInt8(u);else for(u=0;o>u;u++)a[u]=(n[u]%256+256)%256;else if("string"===i)a.write(n,0,t);else if("number"===i&&!r._useTypedArrays&&!e)for(u=0;o>u;u++)a[u]=0;return a}function i(n,t,e,r){e=Number(e)||0;var i=n.length-e;r?(r=Number(r),r>i&&(r=i)):r=i;var o=t.length;P(o%2===0,"Invalid hex string"),r>o/2&&(r=o/2);for(var a=0;r>a;a++){var u=parseInt(t.substr(2*a,2),16);P(!isNaN(u),"Invalid hex string"),n[e+a]=u}return a}function o(n,t,e,r){var i=D(C(t),n,e,r);return i}function a(n,t,e,r){var i=D(M(t),n,e,r);return i}function u(n,t,e,r){return a(n,t,e,r)}function c(n,t,e,r){var i=D(O(t),n,e,r);return i}function s(n,t,e,r){var i=D(N(t),n,e,r);return i}function f(n,t,e){return J.fromByteArray(0===t&&e===n.length?n:n.slice(t,e))}function l(n,t,e){var r="",i="";e=Math.min(n.length,e);for(var o=t;e>o;o++)n[o]<=127?(r+=q(i)+String.fromCharCode(n[o]),i=""):i+="%"+n[o].toString(16);return r+q(i)}function h(n,t,e){var r="";e=Math.min(n.length,e);for(var i=t;e>i;i++)r+=String.fromCharCode(n[i]);return r}function p(n,t,e){return h(n,t,e)}function d(n,t,e){var r=n.length;(!t||0>t)&&(t=0),(!e||0>e||e>r)&&(e=r);for(var i="",o=t;e>o;o++)i+=j(n[o]);return i}function g(n,t,e){for(var r=n.slice(t,e),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function y(n,t,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+1<n.length,"Trying to read beyond buffer length"));var i=n.length;if(!(t>=i)){var o;return e?(o=n[t],i>t+1&&(o|=n[t+1]<<8)):(o=n[t]<<8,i>t+1&&(o|=n[t+1])),o}}function v(n,t,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+3<n.length,"Trying to read beyond buffer length"));var i=n.length;if(!(t>=i)){var o;return e?(i>t+2&&(o=n[t+2]<<16),i>t+1&&(o|=n[t+1]<<8),o|=n[t],i>t+3&&(o+=n[t+3]<<24>>>0)):(i>t+1&&(o=n[t+1]<<16),i>t+2&&(o|=n[t+2]<<8),i>t+3&&(o|=n[t+3]),o+=n[t]<<24>>>0),o}}function m(n,t,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+1<n.length,"Trying to read beyond buffer length"));var i=n.length;if(!(t>=i)){var o=y(n,t,e,!0),a=32768&o;return a?-1*(65535-o+1):o}}function b(n,t,e,r){r||(P("boolean"==typeof e,"missing or invalid endian"),P(void 0!==t&&null!==t,"missing offset"),P(t+3<n.length,"Trying to read beyond buffer length"));var i=n.length;if(!(t>=i)){var o=v(n,t,e,!0),a=2147483648&o;return a?-1*(4294967295-o+1):o}}function w(n,t,e,r){return r||(P("boolean"==typeof e,"missing or invalid endian"),P(t+3<n.length,"Trying to read beyond buffer length")),z.read(n,t,e,23,4)}function E(n,t,e,r){return r||(P("boolean"==typeof e,"missing or invalid endian"),P(t+7<n.length,"Trying to read beyond buffer length")),z.read(n,t,e,52,8)}function k(n,t,e,r,i){i||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+1<n.length,"trying to write beyond buffer length"),H(t,65535));var o=n.length;if(!(e>=o)){for(var a=0,u=Math.min(o-e,2);u>a;a++)n[e+a]=(t&255<<8*(r?a:1-a))>>>8*(r?a:1-a);return e+2}}function A(n,t,e,r,i){i||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+3<n.length,"trying to write beyond buffer length"),H(t,4294967295));var o=n.length;if(!(e>=o)){for(var a=0,u=Math.min(o-e,4);u>a;a++)n[e+a]=t>>>8*(r?a:3-a)&255;return e+4}}function I(n,t,e,r,i){i||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+1<n.length,"Trying to write beyond buffer length"),W(t,32767,-32768));var o=n.length;if(!(e>=o))return t>=0?k(n,t,e,r,i):k(n,65535+t+1,e,r,i),e+2}function S(n,t,e,r,i){i||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+3<n.length,"Trying to write beyond buffer length"),W(t,2147483647,-2147483648));var o=n.length;if(!(e>=o))return t>=0?A(n,t,e,r,i):A(n,4294967295+t+1,e,r,i),e+4}function B(n,t,e,r,i){i||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+3<n.length,"Trying to write beyond buffer length"),R(t,3.4028234663852886e38,-3.4028234663852886e38));var o=n.length;if(!(e>=o))return z.write(n,t,e,r,23,4),e+4}function x(n,t,e,r,i){i||(P(void 0!==t&&null!==t,"missing value"),P("boolean"==typeof r,"missing or invalid endian"),P(void 0!==e&&null!==e,"missing offset"),P(e+7<n.length,"Trying to write beyond buffer length"),R(t,1.7976931348623157e308,-1.7976931348623157e308));var o=n.length;if(!(e>=o))return z.write(n,t,e,r,52,8),e+8}function L(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function _(n,t,e){return"number"!=typeof n?e:(n=~~n,n>=t?t:n>=0?n:(n+=t,n>=0?n:0))}function U(n){return n=~~Math.ceil(+n),0>n?0:n}function T(n){return(Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)})(n)}function F(n){return T(n)||r.isBuffer(n)||n&&"object"==typeof n&&"number"==typeof n.length}function j(n){return 16>n?"0"+n.toString(16):n.toString(16)}function C(n){for(var t=[],e=0;e<n.length;e++){var r=n.charCodeAt(e);if(127>=r)t.push(r);else{var i=e;r>=55296&&57343>=r&&e++;for(var o=encodeURIComponent(n.slice(i,e+1)).substr(1).split("%"),a=0;a<o.length;a++)t.push(parseInt(o[a],16))}}return t}function M(n){for(var t=[],e=0;e<n.length;e++)t.push(255&n.charCodeAt(e));return t}function N(n){for(var t,e,r,i=[],o=0;o<n.length;o++)t=n.charCodeAt(o),e=t>>8,r=t%256,i.push(r),i.push(e);return i}function O(n){return J.toByteArray(n)}function D(n,t,e,r){for(var i=0;r>i&&!(i+e>=t.length||i>=n.length);i++)t[i+e]=n[i];return i}function q(n){try{return decodeURIComponent(n)}catch(t){return String.fromCharCode(65533)}}function H(n,t){P("number"==typeof n,"cannot write a non-number as a number"),P(n>=0,"specified a negative value for writing an unsigned value"),P(t>=n,"value is larger than maximum value for type"),P(Math.floor(n)===n,"value has a fractional component")}function W(n,t,e){P("number"==typeof n,"cannot write a non-number as a number"),P(t>=n,"value larger than maximum allowed value"),P(n>=e,"value smaller than minimum allowed value"),P(Math.floor(n)===n,"value has a fractional component")}function R(n,t,e){P("number"==typeof n,"cannot write a non-number as a number"),P(t>=n,"value larger than maximum allowed value"),P(n>=e,"value smaller than minimum allowed value")}function P(n,t){if(!n)throw new Error(t||"Failed assertion")}/*! | ||
* The buffer module from node.js, for the browser. | ||
@@ -7,2 +14,2 @@ * | ||
*/ | ||
var z=t("base64-js"),J=t("ieee754");e.Buffer=r,e.SlowBuffer=r,e.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){try{var t=new ArrayBuffer(0),n=new Uint8Array(t);return n.foo=function(){return 42},42===n.foo()&&"function"==typeof n.subarray}catch(e){return!1}}(),r.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(t){return!(null===t||void 0===t||!t._isBuffer)},r.byteLength=function(t,n){var e;switch(t=t.toString(),n||"utf8"){case"hex":e=t.length/2;break;case"utf8":case"utf-8":e=M(t).length;break;case"ascii":case"binary":case"raw":e=t.length;break;case"base64":e=D(t).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":e=2*t.length;break;default:throw new Error("Unknown encoding")}return e},r.concat=function(t,n){if(P(T(t),"Usage: Buffer.concat(list[, length])"),0===t.length)return new r(0);if(1===t.length)return t[0];var e;if(void 0===n)for(n=0,e=0;e<t.length;e++)n+=t[e].length;var i=new r(n),o=0;for(e=0;e<t.length;e++){var a=t[e];a.copy(i,o),o+=a.length}return i},r.compare=function(t,n){P(r.isBuffer(t)&&r.isBuffer(n),"Arguments must be Buffers");for(var e=t.length,i=n.length,o=0,a=Math.min(e,i);a>o&&t[o]===n[o];o++);return o!==a&&(e=t[o],i=n[o]),i>e?-1:e>i?1:0},r.prototype.write=function(t,n,e,r){if(isFinite(n))isFinite(e)||(r=e,e=void 0);else{var f=r;r=n,n=e,e=f}n=Number(n)||0;var l=this.length-n;e?(e=Number(e),e>l&&(e=l)):e=l,r=String(r||"utf8").toLowerCase();var h;switch(r){case"hex":h=i(this,t,n,e);break;case"utf8":case"utf-8":h=o(this,t,n,e);break;case"ascii":h=a(this,t,n,e);break;case"binary":h=u(this,t,n,e);break;case"base64":h=c(this,t,n,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=s(this,t,n,e);break;default:throw new Error("Unknown encoding")}return h},r.prototype.toString=function(t,n,e){var r=this;if(t=String(t||"utf8").toLowerCase(),n=Number(n)||0,e=void 0===e?r.length:Number(e),e===n)return"";var i;switch(t){case"hex":i=d(r,n,e);break;case"utf8":case"utf-8":i=l(r,n,e);break;case"ascii":i=h(r,n,e);break;case"binary":i=p(r,n,e);break;case"base64":i=f(r,n,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,n,e);break;default:throw new Error("Unknown encoding")}return i},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.equals=function(t){return P(r.isBuffer(t),"Argument must be a Buffer"),0===r.compare(this,t)},r.prototype.compare=function(t){return P(r.isBuffer(t),"Argument must be a Buffer"),r.compare(this,t)},r.prototype.copy=function(t,n,e,i){var o=this;if(e||(e=0),i||0===i||(i=this.length),n||(n=0),i!==e&&0!==t.length&&0!==o.length){P(i>=e,"sourceEnd < sourceStart"),P(n>=0&&n<t.length,"targetStart out of bounds"),P(e>=0&&e<o.length,"sourceStart out of bounds"),P(i>=0&&i<=o.length,"sourceEnd out of bounds"),i>this.length&&(i=this.length),t.length-n<i-e&&(i=t.length-n+e);var a=i-e;if(100>a||!r._useTypedArrays)for(var u=0;a>u;u++)t[u+n]=this[u+e];else t._set(this.subarray(e,e+a),n)}},r.prototype.slice=function(t,n){var e=this.length;if(t=_(t,e,0),n=_(n,e,e),r._useTypedArrays)return r._augment(this.subarray(t,n));for(var i=n-t,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+t];return o},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,n){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,n)},r.prototype.readUInt8=function(t,n){return n||(P(void 0!==t&&null!==t,"missing offset"),P(t<this.length,"Trying to read beyond buffer length")),t>=this.length?void 0:this[t]},r.prototype.readUInt16LE=function(t,n){return y(this,t,!0,n)},r.prototype.readUInt16BE=function(t,n){return y(this,t,!1,n)},r.prototype.readUInt32LE=function(t,n){return v(this,t,!0,n)},r.prototype.readUInt32BE=function(t,n){return v(this,t,!1,n)},r.prototype.readInt8=function(t,n){if(n||(P(void 0!==t&&null!==t,"missing offset"),P(t<this.length,"Trying to read beyond buffer length")),!(t>=this.length)){var e=128&this[t];return e?-1*(255-this[t]+1):this[t]}},r.prototype.readInt16LE=function(t,n){return m(this,t,!0,n)},r.prototype.readInt16BE=function(t,n){return m(this,t,!1,n)},r.prototype.readInt32LE=function(t,n){return b(this,t,!0,n)},r.prototype.readInt32BE=function(t,n){return b(this,t,!1,n)},r.prototype.readFloatLE=function(t,n){return w(this,t,!0,n)},r.prototype.readFloatBE=function(t,n){return w(this,t,!1,n)},r.prototype.readDoubleLE=function(t,n){return E(this,t,!0,n)},r.prototype.readDoubleBE=function(t,n){return E(this,t,!1,n)},r.prototype.writeUInt8=function(t,n,e){return e||(P(void 0!==t&&null!==t,"missing value"),P(void 0!==n&&null!==n,"missing offset"),P(n<this.length,"trying to write beyond buffer length"),H(t,255)),n>=this.length?void 0:(this[n]=t,n+1)},r.prototype.writeUInt16LE=function(t,n,e){return k(this,t,n,!0,e)},r.prototype.writeUInt16BE=function(t,n,e){return k(this,t,n,!1,e)},r.prototype.writeUInt32LE=function(t,n,e){return A(this,t,n,!0,e)},r.prototype.writeUInt32BE=function(t,n,e){return A(this,t,n,!1,e)},r.prototype.writeInt8=function(t,n,e){return e||(P(void 0!==t&&null!==t,"missing value"),P(void 0!==n&&null!==n,"missing offset"),P(n<this.length,"Trying to write beyond buffer length"),W(t,127,-128)),n>=this.length?void 0:(t>=0?this.writeUInt8(t,n,e):this.writeUInt8(255+t+1,n,e),n+1)},r.prototype.writeInt16LE=function(t,n,e){return I(this,t,n,!0,e)},r.prototype.writeInt16BE=function(t,n,e){return I(this,t,n,!1,e)},r.prototype.writeInt32LE=function(t,n,e){return B(this,t,n,!0,e)},r.prototype.writeInt32BE=function(t,n,e){return B(this,t,n,!1,e)},r.prototype.writeFloatLE=function(t,n,e){return S(this,t,n,!0,e)},r.prototype.writeFloatBE=function(t,n,e){return S(this,t,n,!1,e)},r.prototype.writeDoubleLE=function(t,n,e){return x(this,t,n,!0,e)},r.prototype.writeDoubleBE=function(t,n,e){return x(this,t,n,!1,e)},r.prototype.fill=function(t,n,e){if(t||(t=0),n||(n=0),e||(e=this.length),P(e>=n,"end < start"),e!==n&&0!==this.length){P(n>=0&&n<this.length,"start out of bounds"),P(e>=0&&e<=this.length,"end out of bounds");var r;if("number"==typeof t)for(r=n;e>r;r++)this[r]=t;else{var i=M(t.toString()),o=i.length;for(r=n;e>r;r++)this[r]=i[r%o]}return this}},r.prototype.inspect=function(){for(var t=[],n=this.length,r=0;n>r;r++)if(t[r]=j(this[r]),r===e.INSPECT_MAX_BYTES){t[r+1]="...";break}return"<Buffer "+t.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var t=new Uint8Array(this.length),n=0,e=t.length;e>n;n+=1)t[n]=this[n];return t.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var Q=r.prototype;r._augment=function(t){return t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=Q.get,t.set=Q.set,t.write=Q.write,t.toString=Q.toString,t.toLocaleString=Q.toString,t.toJSON=Q.toJSON,t.equals=Q.equals,t.compare=Q.compare,t.copy=Q.copy,t.slice=Q.slice,t.readUInt8=Q.readUInt8,t.readUInt16LE=Q.readUInt16LE,t.readUInt16BE=Q.readUInt16BE,t.readUInt32LE=Q.readUInt32LE,t.readUInt32BE=Q.readUInt32BE,t.readInt8=Q.readInt8,t.readInt16LE=Q.readInt16LE,t.readInt16BE=Q.readInt16BE,t.readInt32LE=Q.readInt32LE,t.readInt32BE=Q.readInt32BE,t.readFloatLE=Q.readFloatLE,t.readFloatBE=Q.readFloatBE,t.readDoubleLE=Q.readDoubleLE,t.readDoubleBE=Q.readDoubleBE,t.writeUInt8=Q.writeUInt8,t.writeUInt16LE=Q.writeUInt16LE,t.writeUInt16BE=Q.writeUInt16BE,t.writeUInt32LE=Q.writeUInt32LE,t.writeUInt32BE=Q.writeUInt32BE,t.writeInt8=Q.writeInt8,t.writeInt16LE=Q.writeInt16LE,t.writeInt16BE=Q.writeInt16BE,t.writeInt32LE=Q.writeInt32LE,t.writeInt32BE=Q.writeInt32BE,t.writeFloatLE=Q.writeFloatLE,t.writeFloatBE=Q.writeFloatBE,t.writeDoubleLE=Q.writeDoubleLE,t.writeDoubleBE=Q.writeDoubleBE,t.fill=Q.fill,t.inspect=Q.inspect,t.toArrayBuffer=Q.toArrayBuffer,t}},{"base64-js":16,ieee754:17}],16:[function(t,n){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(){"use strict";function t(t){var n=t.charCodeAt(0);return n===a?62:n===u?63:c>n?-1:c+10>n?n-c+26+26:f+26>n?n-f:s+26>n?n-s+26:void 0}function r(n){function e(t){s[l++]=t}var r,i,a,u,c,s;if(n.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=n.length;c="="===n.charAt(f-2)?2:"="===n.charAt(f-1)?1:0,s=new o(3*n.length/4-c),a=c>0?n.length-4:n.length;var l=0;for(r=0,i=0;a>r;r+=4,i+=3)u=t(n.charAt(r))<<18|t(n.charAt(r+1))<<12|t(n.charAt(r+2))<<6|t(n.charAt(r+3)),e((16711680&u)>>16),e((65280&u)>>8),e(255&u);return 2===c?(u=t(n.charAt(r))<<2|t(n.charAt(r+1))>>4,e(255&u)):1===c&&(u=t(n.charAt(r))<<10|t(n.charAt(r+1))<<4|t(n.charAt(r+2))>>2,e(u>>8&255),e(255&u)),s}function i(t){function n(t){return e.charAt(t)}function r(t){return n(t>>18&63)+n(t>>12&63)+n(t>>6&63)+n(63&t)}var i,o,a,u=t.length%3,c="";for(i=0,a=t.length-u;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],c+=r(o);switch(u){case 1:o=t[t.length-1],c+=n(o>>2),c+=n(o<<4&63),c+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],c+=n(o>>10),c+=n(o>>4&63),c+=n(o<<2&63),c+="="}return c}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a=("0".charCodeAt(0),"+".charCodeAt(0)),u="/".charCodeAt(0),c="0".charCodeAt(0),s="a".charCodeAt(0),f="A".charCodeAt(0);n.exports.toByteArray=r,n.exports.fromByteArray=i}()},{}],17:[function(t,n,e){e.read=function(t,n,e,r,i){var o,a,u=8*i-r-1,c=(1<<u)-1,s=c>>1,f=-7,l=e?i-1:0,h=e?-1:1,p=t[n+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+t[n+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+t[n+l],l+=h,f-=8);if(0===o)o=1-s;else{if(o===c)return a?0/0:1/0*(p?-1:1);a+=Math.pow(2,r),o-=s}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(t,n,e,r,i,o){var a,u,c,s=8*o-i-1,f=(1<<s)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=0>n||0===n&&0>1/n?1:0;for(n=Math.abs(n),isNaN(n)||1/0===n?(u=isNaN(n)?1:0,a=f):(a=Math.floor(Math.log(n)/Math.LN2),n*(c=Math.pow(2,-a))<1&&(a--,c*=2),n+=a+l>=1?h/c:h*Math.pow(2,1-l),n*c>=2&&(a++,c/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(n*c-1)*Math.pow(2,i),a+=l):(u=n*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;t[e+p]=255&u,p+=d,u/=256,i-=8);for(a=a<<i|u,s+=i;s>0;t[e+p]=255&a,p+=d,a/=256,s-=8);t[e+p-d]|=128*g}},{}],18:[function(t,n){function e(t,n){if(t.length%a!==0){var e=t.length+(a-t.length%a);t=o.concat([t,u],e)}for(var r=[],i=n?t.readInt32BE:t.readInt32LE,c=0;c<t.length;c+=a)r.push(i.call(t,c));return r}function r(t,n,e){for(var r=new o(n),i=e?r.writeInt32BE:r.writeInt32LE,a=0;a<t.length;a++)i.call(r,t[a],4*a,!0);return r}function i(t,n,i,a){o.isBuffer(t)||(t=new o(t));var u=n(e(t,a),t.length*c);return r(u,i,a)}var o=t("buffer").Buffer,a=4,u=new o(a);u.fill(0);var c=8;n.exports={hash:i}},{buffer:15}],19:[function(t,n,e){function r(t,n,e){u.isBuffer(n)||(n=new u(n)),u.isBuffer(e)||(e=new u(e)),n.length>p?n=t(n):n.length<p&&(n=u.concat([n,d],p));for(var r=new u(p),i=new u(p),o=0;p>o;o++)r[o]=54^n[o],i[o]=92^n[o];var a=t(u.concat([r,e]));return t(u.concat([i,a]))}function i(t,n){t=t||"sha1";var e=h[t],i=[],a=0;return e||o("algorithm:",t,"is not yet supported"),{update:function(t){return u.isBuffer(t)||(t=new u(t)),i.push(t),a+=t.length,this},digest:function(t){var o=u.concat(i),a=n?r(e,n,o):e(o);return i=null,t?a.toString(t):a}}}function o(){var t=[].slice.call(arguments).join(" ");throw new Error([t,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function a(t,n){for(var e in t)n(t[e],e)}var u=t("buffer").Buffer,c=t("./sha"),s=t("./sha256"),f=t("./rng"),l=t("./md5"),h={sha1:c,sha256:s,md5:l},p=64,d=new u(p);d.fill(0),e.createHash=function(t){return i(t)},e.createHmac=function(t,n){return i(t,n)},e.randomBytes=function(t,n){if(!n||!n.call)return new u(f(t));try{n.call(this,void 0,new u(f(t)))}catch(e){n(e)}},a(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(t){e[t]=function(){o("sorry,",t,"is not implemented yet")}})},{"./md5":20,"./rng":21,"./sha":22,"./sha256":23,buffer:15}],20:[function(t,n){function e(t,n){t[n>>5]|=128<<n%32,t[(n+64>>>9<<4)+14]=n;for(var e=1732584193,r=-271733879,s=-1732584194,f=271733878,l=0;l<t.length;l+=16){var h=e,p=r,d=s,g=f;e=i(e,r,s,f,t[l+0],7,-680876936),f=i(f,e,r,s,t[l+1],12,-389564586),s=i(s,f,e,r,t[l+2],17,606105819),r=i(r,s,f,e,t[l+3],22,-1044525330),e=i(e,r,s,f,t[l+4],7,-176418897),f=i(f,e,r,s,t[l+5],12,1200080426),s=i(s,f,e,r,t[l+6],17,-1473231341),r=i(r,s,f,e,t[l+7],22,-45705983),e=i(e,r,s,f,t[l+8],7,1770035416),f=i(f,e,r,s,t[l+9],12,-1958414417),s=i(s,f,e,r,t[l+10],17,-42063),r=i(r,s,f,e,t[l+11],22,-1990404162),e=i(e,r,s,f,t[l+12],7,1804603682),f=i(f,e,r,s,t[l+13],12,-40341101),s=i(s,f,e,r,t[l+14],17,-1502002290),r=i(r,s,f,e,t[l+15],22,1236535329),e=o(e,r,s,f,t[l+1],5,-165796510),f=o(f,e,r,s,t[l+6],9,-1069501632),s=o(s,f,e,r,t[l+11],14,643717713),r=o(r,s,f,e,t[l+0],20,-373897302),e=o(e,r,s,f,t[l+5],5,-701558691),f=o(f,e,r,s,t[l+10],9,38016083),s=o(s,f,e,r,t[l+15],14,-660478335),r=o(r,s,f,e,t[l+4],20,-405537848),e=o(e,r,s,f,t[l+9],5,568446438),f=o(f,e,r,s,t[l+14],9,-1019803690),s=o(s,f,e,r,t[l+3],14,-187363961),r=o(r,s,f,e,t[l+8],20,1163531501),e=o(e,r,s,f,t[l+13],5,-1444681467),f=o(f,e,r,s,t[l+2],9,-51403784),s=o(s,f,e,r,t[l+7],14,1735328473),r=o(r,s,f,e,t[l+12],20,-1926607734),e=a(e,r,s,f,t[l+5],4,-378558),f=a(f,e,r,s,t[l+8],11,-2022574463),s=a(s,f,e,r,t[l+11],16,1839030562),r=a(r,s,f,e,t[l+14],23,-35309556),e=a(e,r,s,f,t[l+1],4,-1530992060),f=a(f,e,r,s,t[l+4],11,1272893353),s=a(s,f,e,r,t[l+7],16,-155497632),r=a(r,s,f,e,t[l+10],23,-1094730640),e=a(e,r,s,f,t[l+13],4,681279174),f=a(f,e,r,s,t[l+0],11,-358537222),s=a(s,f,e,r,t[l+3],16,-722521979),r=a(r,s,f,e,t[l+6],23,76029189),e=a(e,r,s,f,t[l+9],4,-640364487),f=a(f,e,r,s,t[l+12],11,-421815835),s=a(s,f,e,r,t[l+15],16,530742520),r=a(r,s,f,e,t[l+2],23,-995338651),e=u(e,r,s,f,t[l+0],6,-198630844),f=u(f,e,r,s,t[l+7],10,1126891415),s=u(s,f,e,r,t[l+14],15,-1416354905),r=u(r,s,f,e,t[l+5],21,-57434055),e=u(e,r,s,f,t[l+12],6,1700485571),f=u(f,e,r,s,t[l+3],10,-1894986606),s=u(s,f,e,r,t[l+10],15,-1051523),r=u(r,s,f,e,t[l+1],21,-2054922799),e=u(e,r,s,f,t[l+8],6,1873313359),f=u(f,e,r,s,t[l+15],10,-30611744),s=u(s,f,e,r,t[l+6],15,-1560198380),r=u(r,s,f,e,t[l+13],21,1309151649),e=u(e,r,s,f,t[l+4],6,-145523070),f=u(f,e,r,s,t[l+11],10,-1120210379),s=u(s,f,e,r,t[l+2],15,718787259),r=u(r,s,f,e,t[l+9],21,-343485551),e=c(e,h),r=c(r,p),s=c(s,d),f=c(f,g)}return Array(e,r,s,f)}function r(t,n,e,r,i,o){return c(s(c(c(n,t),c(r,o)),i),e)}function i(t,n,e,i,o,a,u){return r(n&e|~n&i,t,n,o,a,u)}function o(t,n,e,i,o,a,u){return r(n&i|e&~i,t,n,o,a,u)}function a(t,n,e,i,o,a,u){return r(n^e^i,t,n,o,a,u)}function u(t,n,e,i,o,a,u){return r(e^(n|~i),t,n,o,a,u)}function c(t,n){var e=(65535&t)+(65535&n),r=(t>>16)+(n>>16)+(e>>16);return r<<16|65535&e}function s(t,n){return t<<n|t>>>32-n}var f=t("./helpers");n.exports=function(t){return f.hash(t,e,16)}},{"./helpers":18}],21:[function(t,n){!function(){var t,e,r=this;t=function(t){for(var n,n,e=new Array(t),r=0;t>r;r++)0==(3&r)&&(n=4294967296*Math.random()),e[r]=n>>>((3&r)<<3)&255;return e},r.crypto&&crypto.getRandomValues&&(e=function(t){var n=new Uint8Array(t);return crypto.getRandomValues(n),n}),n.exports=e||t}()},{}],22:[function(t,n){function e(t,n){t[n>>5]|=128<<24-n%32,t[(n+64>>9<<4)+15]=n;for(var e=Array(80),u=1732584193,c=-271733879,s=-1732584194,f=271733878,l=-1009589776,h=0;h<t.length;h+=16){for(var p=u,d=c,g=s,y=f,v=l,m=0;80>m;m++){e[m]=16>m?t[h+m]:a(e[m-3]^e[m-8]^e[m-14]^e[m-16],1);var b=o(o(a(u,5),r(m,c,s,f)),o(o(l,e[m]),i(m)));l=f,f=s,s=a(c,30),c=u,u=b}u=o(u,p),c=o(c,d),s=o(s,g),f=o(f,y),l=o(l,v)}return Array(u,c,s,f,l)}function r(t,n,e,r){return 20>t?n&e|~n&r:40>t?n^e^r:60>t?n&e|n&r|e&r:n^e^r}function i(t){return 20>t?1518500249:40>t?1859775393:60>t?-1894007588:-899497514}function o(t,n){var e=(65535&t)+(65535&n),r=(t>>16)+(n>>16)+(e>>16);return r<<16|65535&e}function a(t,n){return t<<n|t>>>32-n}var u=t("./helpers");n.exports=function(t){return u.hash(t,e,20,!0)}},{"./helpers":18}],23:[function(t,n){var e=t("./helpers"),r=function(t,n){var e=(65535&t)+(65535&n),r=(t>>16)+(n>>16)+(e>>16);return r<<16|65535&e},i=function(t,n){return t>>>n|t<<32-n},o=function(t,n){return t>>>n},a=function(t,n,e){return t&n^~t&e},u=function(t,n,e){return t&n^t&e^n&e},c=function(t){return i(t,2)^i(t,13)^i(t,22)},s=function(t){return i(t,6)^i(t,11)^i(t,25)},f=function(t){return i(t,7)^i(t,18)^o(t,3)},l=function(t){return i(t,17)^i(t,19)^o(t,10)},h=function(t,n){var e,i,o,h,p,d,g,y,v,m,b,w,E=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),k=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),A=new Array(64);t[n>>5]|=128<<24-n%32,t[(n+64>>9<<4)+15]=n;for(var v=0;v<t.length;v+=16){e=k[0],i=k[1],o=k[2],h=k[3],p=k[4],d=k[5],g=k[6],y=k[7];for(var m=0;64>m;m++)A[m]=16>m?t[m+v]:r(r(r(l(A[m-2]),A[m-7]),f(A[m-15])),A[m-16]),b=r(r(r(r(y,s(p)),a(p,d,g)),E[m]),A[m]),w=r(c(e),u(e,i,o)),y=g,g=d,d=p,p=r(h,b),h=o,o=i,i=e,e=r(b,w);k[0]=r(e,k[0]),k[1]=r(i,k[1]),k[2]=r(o,k[2]),k[3]=r(h,k[3]),k[4]=r(p,k[4]),k[5]=r(d,k[5]),k[6]=r(g,k[6]),k[7]=r(y,k[7])}return k};n.exports=function(t){return e.hash(t,h,32,!0)}},{"./helpers":18}],24:[function(t,n,e){(function(t){function n(t,n){for(var e=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),e++):e&&(t.splice(r,1),e--)}if(n)for(;e--;e)t.unshift("..");return t}function r(t,n){if(t.filter)return t.filter(n);for(var e=[],r=0;r<t.length;r++)n(t[r],r,t)&&e.push(t[r]);return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return i.exec(t).slice(1)};e.resolve=function(){for(var e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,i="/"===a.charAt(0))}return e=n(r(e.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(t){var i=e.isAbsolute(t),o="/"===a(t,-1);return t=n(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(r(t,function(t){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function r(t){for(var n=0;n<t.length&&""===t[n];n++);for(var e=t.length-1;e>=0&&""===t[e];e--);return n>e?[]:t.slice(n,e-n+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var i=r(t.split("/")),o=r(n.split("/")),a=Math.min(i.length,o.length),u=a,c=0;a>c;c++)if(i[c]!==o[c]){u=c;break}for(var s=[],c=u;c<i.length;c++)s.push("..");return s=s.concat(o.slice(u)),s.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(t){var n=o(t),e=n[0],r=n[1];return e||r?(r&&(r=r.substr(0,r.length-1)),e+r):"."},e.basename=function(t,n){var e=o(t)[2];return n&&e.substr(-1*n.length)===n&&(e=e.substr(0,e.length-n.length)),e},e.extname=function(t){return o(t)[3]};var a="b"==="ab".substr(-1)?function(t,n,e){return t.substr(n,e)}:function(t,n,e){return 0>n&&(n=t.length+n),t.substr(n,e)}}).call(this,t("FWaASH"))},{FWaASH:25}],25:[function(t,n){function e(){}var r=n.exports={};r.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};if(n){var e=[];return window.addEventListener("message",function(t){var n=t.source;if((n===window||null===n)&&"process-tick"===t.data&&(t.stopPropagation(),e.length>0)){var r=e.shift();r()}},!0),function(t){e.push(t),window.postMessage("process-tick","*")}}return function(t){setTimeout(t,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],26:[function(t,n){(function(e){function r(t,n,a,u){("function"==typeof n||void 0===n)&&(a=n,n=511&~e.umask()),u||(u=null);var c=a||function(){};"string"==typeof n&&(n=parseInt(n,8)),t=i.resolve(t),o.mkdir(t,n,function(e){if(!e)return u=u||t,c(null,u);switch(e.code){case"ENOENT":r(i.dirname(t),n,function(e,i){e?c(e,i):r(t,n,c,i)});break;default:o.stat(t,function(t,n){t||!n.isDirectory()?c(e,u):c(null,u)})}})}var i=t("path"),o=t("fs");n.exports=r.mkdirp=r.mkdirP=r,r.sync=function a(t,n,r){void 0===n&&(n=511&~e.umask()),r||(r=null),"string"==typeof n&&(n=parseInt(n,8)),t=i.resolve(t);try{o.mkdirSync(t,n),r=r||t}catch(u){switch(u.code){case"ENOENT":r=a(i.dirname(t),n,r),a(t,n,r);break;default:var c;try{c=o.statSync(t)}catch(s){throw u}if(!c.isDirectory())throw u}}return r}}).call(this,t("FWaASH"))},{FWaASH:25,fs:14,path:24}]},{},[2])(2)}); | ||
var J=n("base64-js"),z=n("ieee754");e.Buffer=r,e.SlowBuffer=r,e.INSPECT_MAX_BYTES=50,r.poolSize=8192,r._useTypedArrays=function(){try{var n=new ArrayBuffer(0),t=new Uint8Array(n);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(e){return!1}}(),r.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.isBuffer=function(n){return!(null===n||void 0===n||!n._isBuffer)},r.byteLength=function(n,t){var e;switch(n=n.toString(),t||"utf8"){case"hex":e=n.length/2;break;case"utf8":case"utf-8":e=C(n).length;break;case"ascii":case"binary":case"raw":e=n.length;break;case"base64":e=O(n).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":e=2*n.length;break;default:throw new Error("Unknown encoding")}return e},r.concat=function(n,t){if(P(T(n),"Usage: Buffer.concat(list[, length])"),0===n.length)return new r(0);if(1===n.length)return n[0];var e;if(void 0===t)for(t=0,e=0;e<n.length;e++)t+=n[e].length;var i=new r(t),o=0;for(e=0;e<n.length;e++){var a=n[e];a.copy(i,o),o+=a.length}return i},r.compare=function(n,t){P(r.isBuffer(n)&&r.isBuffer(t),"Arguments must be Buffers");for(var e=n.length,i=t.length,o=0,a=Math.min(e,i);a>o&&n[o]===t[o];o++);return o!==a&&(e=n[o],i=t[o]),i>e?-1:e>i?1:0},r.prototype.write=function(n,t,e,r){if(isFinite(t))isFinite(e)||(r=e,e=void 0);else{var f=r;r=t,t=e,e=f}t=Number(t)||0;var l=this.length-t;e?(e=Number(e),e>l&&(e=l)):e=l,r=String(r||"utf8").toLowerCase();var h;switch(r){case"hex":h=i(this,n,t,e);break;case"utf8":case"utf-8":h=o(this,n,t,e);break;case"ascii":h=a(this,n,t,e);break;case"binary":h=u(this,n,t,e);break;case"base64":h=c(this,n,t,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=s(this,n,t,e);break;default:throw new Error("Unknown encoding")}return h},r.prototype.toString=function(n,t,e){var r=this;if(n=String(n||"utf8").toLowerCase(),t=Number(t)||0,e=void 0===e?r.length:Number(e),e===t)return"";var i;switch(n){case"hex":i=d(r,t,e);break;case"utf8":case"utf-8":i=l(r,t,e);break;case"ascii":i=h(r,t,e);break;case"binary":i=p(r,t,e);break;case"base64":i=f(r,t,e);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":i=g(r,t,e);break;default:throw new Error("Unknown encoding")}return i},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.equals=function(n){return P(r.isBuffer(n),"Argument must be a Buffer"),0===r.compare(this,n)},r.prototype.compare=function(n){return P(r.isBuffer(n),"Argument must be a Buffer"),r.compare(this,n)},r.prototype.copy=function(n,t,e,i){var o=this;if(e||(e=0),i||0===i||(i=this.length),t||(t=0),i!==e&&0!==n.length&&0!==o.length){P(i>=e,"sourceEnd < sourceStart"),P(t>=0&&t<n.length,"targetStart out of bounds"),P(e>=0&&e<o.length,"sourceStart out of bounds"),P(i>=0&&i<=o.length,"sourceEnd out of bounds"),i>this.length&&(i=this.length),n.length-t<i-e&&(i=n.length-t+e);var a=i-e;if(100>a||!r._useTypedArrays)for(var u=0;a>u;u++)n[u+t]=this[u+e];else n._set(this.subarray(e,e+a),t)}},r.prototype.slice=function(n,t){var e=this.length;if(n=_(n,e,0),t=_(t,e,e),r._useTypedArrays)return r._augment(this.subarray(n,t));for(var i=t-n,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+n];return o},r.prototype.get=function(n){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(n)},r.prototype.set=function(n,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(n,t)},r.prototype.readUInt8=function(n,t){return t||(P(void 0!==n&&null!==n,"missing offset"),P(n<this.length,"Trying to read beyond buffer length")),n>=this.length?void 0:this[n]},r.prototype.readUInt16LE=function(n,t){return y(this,n,!0,t)},r.prototype.readUInt16BE=function(n,t){return y(this,n,!1,t)},r.prototype.readUInt32LE=function(n,t){return v(this,n,!0,t)},r.prototype.readUInt32BE=function(n,t){return v(this,n,!1,t)},r.prototype.readInt8=function(n,t){if(t||(P(void 0!==n&&null!==n,"missing offset"),P(n<this.length,"Trying to read beyond buffer length")),!(n>=this.length)){var e=128&this[n];return e?-1*(255-this[n]+1):this[n]}},r.prototype.readInt16LE=function(n,t){return m(this,n,!0,t)},r.prototype.readInt16BE=function(n,t){return m(this,n,!1,t)},r.prototype.readInt32LE=function(n,t){return b(this,n,!0,t)},r.prototype.readInt32BE=function(n,t){return b(this,n,!1,t)},r.prototype.readFloatLE=function(n,t){return w(this,n,!0,t)},r.prototype.readFloatBE=function(n,t){return w(this,n,!1,t)},r.prototype.readDoubleLE=function(n,t){return E(this,n,!0,t)},r.prototype.readDoubleBE=function(n,t){return E(this,n,!1,t)},r.prototype.writeUInt8=function(n,t,e){return e||(P(void 0!==n&&null!==n,"missing value"),P(void 0!==t&&null!==t,"missing offset"),P(t<this.length,"trying to write beyond buffer length"),H(n,255)),t>=this.length?void 0:(this[t]=n,t+1)},r.prototype.writeUInt16LE=function(n,t,e){return k(this,n,t,!0,e)},r.prototype.writeUInt16BE=function(n,t,e){return k(this,n,t,!1,e)},r.prototype.writeUInt32LE=function(n,t,e){return A(this,n,t,!0,e)},r.prototype.writeUInt32BE=function(n,t,e){return A(this,n,t,!1,e)},r.prototype.writeInt8=function(n,t,e){return e||(P(void 0!==n&&null!==n,"missing value"),P(void 0!==t&&null!==t,"missing offset"),P(t<this.length,"Trying to write beyond buffer length"),W(n,127,-128)),t>=this.length?void 0:(n>=0?this.writeUInt8(n,t,e):this.writeUInt8(255+n+1,t,e),t+1)},r.prototype.writeInt16LE=function(n,t,e){return I(this,n,t,!0,e)},r.prototype.writeInt16BE=function(n,t,e){return I(this,n,t,!1,e)},r.prototype.writeInt32LE=function(n,t,e){return S(this,n,t,!0,e)},r.prototype.writeInt32BE=function(n,t,e){return S(this,n,t,!1,e)},r.prototype.writeFloatLE=function(n,t,e){return B(this,n,t,!0,e)},r.prototype.writeFloatBE=function(n,t,e){return B(this,n,t,!1,e)},r.prototype.writeDoubleLE=function(n,t,e){return x(this,n,t,!0,e)},r.prototype.writeDoubleBE=function(n,t,e){return x(this,n,t,!1,e)},r.prototype.fill=function(n,t,e){if(n||(n=0),t||(t=0),e||(e=this.length),P(e>=t,"end < start"),e!==t&&0!==this.length){P(t>=0&&t<this.length,"start out of bounds"),P(e>=0&&e<=this.length,"end out of bounds");var r;if("number"==typeof n)for(r=t;e>r;r++)this[r]=n;else{var i=C(n.toString()),o=i.length;for(r=t;e>r;r++)this[r]=i[r%o]}return this}},r.prototype.inspect=function(){for(var n=[],t=this.length,r=0;t>r;r++)if(n[r]=j(this[r]),r===e.INSPECT_MAX_BYTES){n[r+1]="...";break}return"<Buffer "+n.join(" ")+">"},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r._useTypedArrays)return new r(this).buffer;for(var n=new Uint8Array(this.length),t=0,e=n.length;e>t;t+=1)n[t]=this[t];return n.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var Q=r.prototype;r._augment=function(n){return n._isBuffer=!0,n._get=n.get,n._set=n.set,n.get=Q.get,n.set=Q.set,n.write=Q.write,n.toString=Q.toString,n.toLocaleString=Q.toString,n.toJSON=Q.toJSON,n.equals=Q.equals,n.compare=Q.compare,n.copy=Q.copy,n.slice=Q.slice,n.readUInt8=Q.readUInt8,n.readUInt16LE=Q.readUInt16LE,n.readUInt16BE=Q.readUInt16BE,n.readUInt32LE=Q.readUInt32LE,n.readUInt32BE=Q.readUInt32BE,n.readInt8=Q.readInt8,n.readInt16LE=Q.readInt16LE,n.readInt16BE=Q.readInt16BE,n.readInt32LE=Q.readInt32LE,n.readInt32BE=Q.readInt32BE,n.readFloatLE=Q.readFloatLE,n.readFloatBE=Q.readFloatBE,n.readDoubleLE=Q.readDoubleLE,n.readDoubleBE=Q.readDoubleBE,n.writeUInt8=Q.writeUInt8,n.writeUInt16LE=Q.writeUInt16LE,n.writeUInt16BE=Q.writeUInt16BE,n.writeUInt32LE=Q.writeUInt32LE,n.writeUInt32BE=Q.writeUInt32BE,n.writeInt8=Q.writeInt8,n.writeInt16LE=Q.writeInt16LE,n.writeInt16BE=Q.writeInt16BE,n.writeInt32LE=Q.writeInt32LE,n.writeInt32BE=Q.writeInt32BE,n.writeFloatLE=Q.writeFloatLE,n.writeFloatBE=Q.writeFloatBE,n.writeDoubleLE=Q.writeDoubleLE,n.writeDoubleBE=Q.writeDoubleBE,n.fill=Q.fill,n.inspect=Q.inspect,n.toArrayBuffer=Q.toArrayBuffer,n}},{"base64-js":17,ieee754:18}],17:[function(n,t,e){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(n){"use strict";function t(n){var t=n.charCodeAt(0);return t===a?62:t===u?63:c>t?-1:c+10>t?t-c+26+26:f+26>t?t-f:s+26>t?t-s+26:void 0}function e(n){function e(n){s[l++]=n}var r,i,a,u,c,s;if(n.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=n.length;c="="===n.charAt(f-2)?2:"="===n.charAt(f-1)?1:0,s=new o(3*n.length/4-c),a=c>0?n.length-4:n.length;var l=0;for(r=0,i=0;a>r;r+=4,i+=3)u=t(n.charAt(r))<<18|t(n.charAt(r+1))<<12|t(n.charAt(r+2))<<6|t(n.charAt(r+3)),e((16711680&u)>>16),e((65280&u)>>8),e(255&u);return 2===c?(u=t(n.charAt(r))<<2|t(n.charAt(r+1))>>4,e(255&u)):1===c&&(u=t(n.charAt(r))<<10|t(n.charAt(r+1))<<4|t(n.charAt(r+2))>>2,e(u>>8&255),e(255&u)),s}function i(n){function t(n){return r.charAt(n)}function e(n){return t(n>>18&63)+t(n>>12&63)+t(n>>6&63)+t(63&n)}var i,o,a,u=n.length%3,c="";for(i=0,a=n.length-u;a>i;i+=3)o=(n[i]<<16)+(n[i+1]<<8)+n[i+2],c+=e(o);switch(u){case 1:o=n[n.length-1],c+=t(o>>2),c+=t(o<<4&63),c+="==";break;case 2:o=(n[n.length-2]<<8)+n[n.length-1],c+=t(o>>10),c+=t(o>>4&63),c+=t(o<<2&63),c+="="}return c}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),u="/".charCodeAt(0),c="0".charCodeAt(0),s="a".charCodeAt(0),f="A".charCodeAt(0);n.toByteArray=e,n.fromByteArray=i}("undefined"==typeof e?this.base64js={}:e)},{}],18:[function(n,t,e){e.read=function(n,t,e,r,i){var o,a,u=8*i-r-1,c=(1<<u)-1,s=c>>1,f=-7,l=e?i-1:0,h=e?-1:1,p=n[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=u;f>0;o=256*o+n[t+l],l+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=r;f>0;a=256*a+n[t+l],l+=h,f-=8);if(0===o)o=1-s;else{if(o===c)return a?0/0:1/0*(p?-1:1);a+=Math.pow(2,r),o-=s}return(p?-1:1)*a*Math.pow(2,o-r)},e.write=function(n,t,e,r,i,o){var a,u,c,s=8*o-i-1,f=(1<<s)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(u=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),t+=a+l>=1?h/c:h*Math.pow(2,1-l),t*c>=2&&(a++,c/=2),a+l>=f?(u=0,a=f):a+l>=1?(u=(t*c-1)*Math.pow(2,i),a+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));i>=8;n[e+p]=255&u,p+=d,u/=256,i-=8);for(a=a<<i|u,s+=i;s>0;n[e+p]=255&a,p+=d,a/=256,s-=8);n[e+p-d]|=128*g}},{}],19:[function(n,t){function e(n,t){if(n.length%a!==0){var e=n.length+(a-n.length%a);n=o.concat([n,u],e)}for(var r=[],i=t?n.readInt32BE:n.readInt32LE,c=0;c<n.length;c+=a)r.push(i.call(n,c));return r}function r(n,t,e){for(var r=new o(t),i=e?r.writeInt32BE:r.writeInt32LE,a=0;a<n.length;a++)i.call(r,n[a],4*a,!0);return r}function i(n,t,i,a){o.isBuffer(n)||(n=new o(n));var u=t(e(n,a),n.length*c);return r(u,i,a)}var o=n("buffer").Buffer,a=4,u=new o(a);u.fill(0);var c=8;t.exports={hash:i}},{buffer:16}],20:[function(n,t,e){function r(n,t,e){u.isBuffer(t)||(t=new u(t)),u.isBuffer(e)||(e=new u(e)),t.length>p?t=n(t):t.length<p&&(t=u.concat([t,d],p));for(var r=new u(p),i=new u(p),o=0;p>o;o++)r[o]=54^t[o],i[o]=92^t[o];var a=n(u.concat([r,e]));return n(u.concat([i,a]))}function i(n,t){n=n||"sha1";var e=h[n],i=[],a=0;return e||o("algorithm:",n,"is not yet supported"),{update:function(n){return u.isBuffer(n)||(n=new u(n)),i.push(n),a+=n.length,this},digest:function(n){var o=u.concat(i),a=t?r(e,t,o):e(o);return i=null,n?a.toString(n):a}}}function o(){var n=[].slice.call(arguments).join(" ");throw new Error([n,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join("\n"))}function a(n,t){for(var e in n)t(n[e],e)}var u=n("buffer").Buffer,c=n("./sha"),s=n("./sha256"),f=n("./rng"),l=n("./md5"),h={sha1:c,sha256:s,md5:l},p=64,d=new u(p);d.fill(0),e.createHash=function(n){return i(n)},e.createHmac=function(n,t){return i(n,t)},e.randomBytes=function(n,t){if(!t||!t.call)return new u(f(n));try{t.call(this,void 0,new u(f(n)))}catch(e){t(e)}},a(["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],function(n){e[n]=function(){o("sorry,",n,"is not implemented yet")}})},{"./md5":21,"./rng":22,"./sha":23,"./sha256":24,buffer:16}],21:[function(n,t){function e(n,t){n[t>>5]|=128<<t%32,n[(t+64>>>9<<4)+14]=t;for(var e=1732584193,r=-271733879,s=-1732584194,f=271733878,l=0;l<n.length;l+=16){var h=e,p=r,d=s,g=f;e=i(e,r,s,f,n[l+0],7,-680876936),f=i(f,e,r,s,n[l+1],12,-389564586),s=i(s,f,e,r,n[l+2],17,606105819),r=i(r,s,f,e,n[l+3],22,-1044525330),e=i(e,r,s,f,n[l+4],7,-176418897),f=i(f,e,r,s,n[l+5],12,1200080426),s=i(s,f,e,r,n[l+6],17,-1473231341),r=i(r,s,f,e,n[l+7],22,-45705983),e=i(e,r,s,f,n[l+8],7,1770035416),f=i(f,e,r,s,n[l+9],12,-1958414417),s=i(s,f,e,r,n[l+10],17,-42063),r=i(r,s,f,e,n[l+11],22,-1990404162),e=i(e,r,s,f,n[l+12],7,1804603682),f=i(f,e,r,s,n[l+13],12,-40341101),s=i(s,f,e,r,n[l+14],17,-1502002290),r=i(r,s,f,e,n[l+15],22,1236535329),e=o(e,r,s,f,n[l+1],5,-165796510),f=o(f,e,r,s,n[l+6],9,-1069501632),s=o(s,f,e,r,n[l+11],14,643717713),r=o(r,s,f,e,n[l+0],20,-373897302),e=o(e,r,s,f,n[l+5],5,-701558691),f=o(f,e,r,s,n[l+10],9,38016083),s=o(s,f,e,r,n[l+15],14,-660478335),r=o(r,s,f,e,n[l+4],20,-405537848),e=o(e,r,s,f,n[l+9],5,568446438),f=o(f,e,r,s,n[l+14],9,-1019803690),s=o(s,f,e,r,n[l+3],14,-187363961),r=o(r,s,f,e,n[l+8],20,1163531501),e=o(e,r,s,f,n[l+13],5,-1444681467),f=o(f,e,r,s,n[l+2],9,-51403784),s=o(s,f,e,r,n[l+7],14,1735328473),r=o(r,s,f,e,n[l+12],20,-1926607734),e=a(e,r,s,f,n[l+5],4,-378558),f=a(f,e,r,s,n[l+8],11,-2022574463),s=a(s,f,e,r,n[l+11],16,1839030562),r=a(r,s,f,e,n[l+14],23,-35309556),e=a(e,r,s,f,n[l+1],4,-1530992060),f=a(f,e,r,s,n[l+4],11,1272893353),s=a(s,f,e,r,n[l+7],16,-155497632),r=a(r,s,f,e,n[l+10],23,-1094730640),e=a(e,r,s,f,n[l+13],4,681279174),f=a(f,e,r,s,n[l+0],11,-358537222),s=a(s,f,e,r,n[l+3],16,-722521979),r=a(r,s,f,e,n[l+6],23,76029189),e=a(e,r,s,f,n[l+9],4,-640364487),f=a(f,e,r,s,n[l+12],11,-421815835),s=a(s,f,e,r,n[l+15],16,530742520),r=a(r,s,f,e,n[l+2],23,-995338651),e=u(e,r,s,f,n[l+0],6,-198630844),f=u(f,e,r,s,n[l+7],10,1126891415),s=u(s,f,e,r,n[l+14],15,-1416354905),r=u(r,s,f,e,n[l+5],21,-57434055),e=u(e,r,s,f,n[l+12],6,1700485571),f=u(f,e,r,s,n[l+3],10,-1894986606),s=u(s,f,e,r,n[l+10],15,-1051523),r=u(r,s,f,e,n[l+1],21,-2054922799),e=u(e,r,s,f,n[l+8],6,1873313359),f=u(f,e,r,s,n[l+15],10,-30611744),s=u(s,f,e,r,n[l+6],15,-1560198380),r=u(r,s,f,e,n[l+13],21,1309151649),e=u(e,r,s,f,n[l+4],6,-145523070),f=u(f,e,r,s,n[l+11],10,-1120210379),s=u(s,f,e,r,n[l+2],15,718787259),r=u(r,s,f,e,n[l+9],21,-343485551),e=c(e,h),r=c(r,p),s=c(s,d),f=c(f,g)}return Array(e,r,s,f)}function r(n,t,e,r,i,o){return c(s(c(c(t,n),c(r,o)),i),e)}function i(n,t,e,i,o,a,u){return r(t&e|~t&i,n,t,o,a,u)}function o(n,t,e,i,o,a,u){return r(t&i|e&~i,n,t,o,a,u)}function a(n,t,e,i,o,a,u){return r(t^e^i,n,t,o,a,u)}function u(n,t,e,i,o,a,u){return r(e^(t|~i),n,t,o,a,u)}function c(n,t){var e=(65535&n)+(65535&t),r=(n>>16)+(t>>16)+(e>>16);return r<<16|65535&e}function s(n,t){return n<<t|n>>>32-t}var f=n("./helpers");t.exports=function(n){return f.hash(n,e,16)}},{"./helpers":19}],22:[function(n,t){!function(){var n,e,r=this;n=function(n){for(var t,t,e=new Array(n),r=0;n>r;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e},r.crypto&&crypto.getRandomValues&&(e=function(n){var t=new Uint8Array(n);return crypto.getRandomValues(t),t}),t.exports=e||n}()},{}],23:[function(n,t){function e(n,t){n[t>>5]|=128<<24-t%32,n[(t+64>>9<<4)+15]=t;for(var e=Array(80),u=1732584193,c=-271733879,s=-1732584194,f=271733878,l=-1009589776,h=0;h<n.length;h+=16){for(var p=u,d=c,g=s,y=f,v=l,m=0;80>m;m++){e[m]=16>m?n[h+m]:a(e[m-3]^e[m-8]^e[m-14]^e[m-16],1);var b=o(o(a(u,5),r(m,c,s,f)),o(o(l,e[m]),i(m)));l=f,f=s,s=a(c,30),c=u,u=b}u=o(u,p),c=o(c,d),s=o(s,g),f=o(f,y),l=o(l,v)}return Array(u,c,s,f,l)}function r(n,t,e,r){return 20>n?t&e|~t&r:40>n?t^e^r:60>n?t&e|t&r|e&r:t^e^r}function i(n){return 20>n?1518500249:40>n?1859775393:60>n?-1894007588:-899497514}function o(n,t){var e=(65535&n)+(65535&t),r=(n>>16)+(t>>16)+(e>>16);return r<<16|65535&e}function a(n,t){return n<<t|n>>>32-t}var u=n("./helpers");t.exports=function(n){return u.hash(n,e,20,!0)}},{"./helpers":19}],24:[function(n,t){var e=n("./helpers"),r=function(n,t){var e=(65535&n)+(65535&t),r=(n>>16)+(t>>16)+(e>>16);return r<<16|65535&e},i=function(n,t){return n>>>t|n<<32-t},o=function(n,t){return n>>>t},a=function(n,t,e){return n&t^~n&e},u=function(n,t,e){return n&t^n&e^t&e},c=function(n){return i(n,2)^i(n,13)^i(n,22)},s=function(n){return i(n,6)^i(n,11)^i(n,25)},f=function(n){return i(n,7)^i(n,18)^o(n,3)},l=function(n){return i(n,17)^i(n,19)^o(n,10)},h=function(n,t){var e,i,o,h,p,d,g,y,v,m,b,w,E=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),k=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),A=new Array(64);n[t>>5]|=128<<24-t%32,n[(t+64>>9<<4)+15]=t;for(var v=0;v<n.length;v+=16){e=k[0],i=k[1],o=k[2],h=k[3],p=k[4],d=k[5],g=k[6],y=k[7];for(var m=0;64>m;m++)A[m]=16>m?n[m+v]:r(r(r(l(A[m-2]),A[m-7]),f(A[m-15])),A[m-16]),b=r(r(r(r(y,s(p)),a(p,d,g)),E[m]),A[m]),w=r(c(e),u(e,i,o)),y=g,g=d,d=p,p=r(h,b),h=o,o=i,i=e,e=r(b,w);k[0]=r(e,k[0]),k[1]=r(i,k[1]),k[2]=r(o,k[2]),k[3]=r(h,k[3]),k[4]=r(p,k[4]),k[5]=r(d,k[5]),k[6]=r(g,k[6]),k[7]=r(y,k[7])}return k};t.exports=function(n){return e.hash(n,h,32,!0)}},{"./helpers":19}],25:[function(n,t,e){(function(n){function t(n,t){for(var e=0,r=n.length-1;r>=0;r--){var i=n[r];"."===i?n.splice(r,1):".."===i?(n.splice(r,1),e++):e&&(n.splice(r,1),e--)}if(t)for(;e--;e)n.unshift("..");return n}function r(n,t){if(n.filter)return n.filter(t);for(var e=[],r=0;r<n.length;r++)t(n[r],r,n)&&e.push(n[r]);return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(n){return i.exec(n).slice(1)};e.resolve=function(){for(var e="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:n.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,i="/"===a.charAt(0))}return e=t(r(e.split("/"),function(n){return!!n}),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(n){var i=e.isAbsolute(n),o="/"===a(n,-1);return n=t(r(n.split("/"),function(n){return!!n}),!i).join("/"),n||i||(n="."),n&&o&&(n+="/"),(i?"/":"")+n},e.isAbsolute=function(n){return"/"===n.charAt(0)},e.join=function(){var n=Array.prototype.slice.call(arguments,0);return e.normalize(r(n,function(n){if("string"!=typeof n)throw new TypeError("Arguments to path.join must be strings");return n}).join("/"))},e.relative=function(n,t){function r(n){for(var t=0;t<n.length&&""===n[t];t++);for(var e=n.length-1;e>=0&&""===n[e];e--);return t>e?[]:n.slice(t,e-t+1)}n=e.resolve(n).substr(1),t=e.resolve(t).substr(1);for(var i=r(n.split("/")),o=r(t.split("/")),a=Math.min(i.length,o.length),u=a,c=0;a>c;c++)if(i[c]!==o[c]){u=c;break}for(var s=[],c=u;c<i.length;c++)s.push("..");return s=s.concat(o.slice(u)),s.join("/")},e.sep="/",e.delimiter=":",e.dirname=function(n){var t=o(n),e=t[0],r=t[1];return e||r?(r&&(r=r.substr(0,r.length-1)),e+r):"."},e.basename=function(n,t){var e=o(n)[2];return t&&e.substr(-1*t.length)===t&&(e=e.substr(0,e.length-t.length)),e},e.extname=function(n){return o(n)[3]};var a="b"==="ab".substr(-1)?function(n,t,e){return n.substr(t,e)}:function(n,t,e){return 0>t&&(t=n.length+t),n.substr(t,e)}}).call(this,n("FWaASH"))},{FWaASH:26}],26:[function(n,t){function e(){}var r=t.exports={};r.nextTick=function(){var n="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(n)return function(n){return window.setImmediate(n)};if(t){var e=[];return window.addEventListener("message",function(n){var t=n.source;if((t===window||null===t)&&"process-tick"===n.data&&(n.stopPropagation(),e.length>0)){var r=e.shift();r()}},!0),function(n){e.push(n),window.postMessage("process-tick","*")}}return function(n){setTimeout(n,0)}}(),r.title="browser",r.browser=!0,r.env={},r.argv=[],r.on=e,r.addListener=e,r.once=e,r.off=e,r.removeListener=e,r.removeAllListeners=e,r.emit=e,r.binding=function(){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(){throw new Error("process.chdir is not supported")}},{}],27:[function(n,t){(function(e){function r(n,t,a,u){"function"==typeof t?(a=t,t={}):t&&"object"==typeof t||(t={mode:t});var c=t.mode,s=t.fs||o;void 0===c&&(c=511&~e.umask()),u||(u=null);var f=a||function(){};n=i.resolve(n),s.mkdir(n,c,function(e){if(!e)return u=u||n,f(null,u);switch(e.code){case"ENOENT":r(i.dirname(n),t,function(e,i){e?f(e,i):r(n,t,f,i)});break;default:s.stat(n,function(n,t){n||!t.isDirectory()?f(e,u):f(null,u)})}})}var i=n("path"),o=n("fs");t.exports=r.mkdirp=r.mkdirP=r,r.sync=function a(n,t,r){t&&"object"==typeof t||(t={mode:t});var u=t.mode,c=t.fs||o;void 0===u&&(u=511&~e.umask()),r||(r=null),n=i.resolve(n);try{c.mkdirSync(n,u),r=r||n}catch(s){switch(s.code){case"ENOENT":r=a(i.dirname(n),t,r),a(n,t,r);break;default:var f;try{f=c.statSync(n)}catch(l){throw s}if(!f.isDirectory())throw s}}return r}}).call(this,n("FWaASH"))},{FWaASH:26,fs:15,path:25}]},{},[3])(3)}); |
@@ -12,1 +12,2 @@ /* | ||
exports.Blob = require(lib + 'blob').Blob; | ||
exports.file = require(lib + 'blob').file; |
@@ -5,3 +5,4 @@ module.exports = { | ||
Queue: require('./queue').Queue, | ||
Util: require('./Util'), | ||
tasks: require('./tasks') | ||
}; |
{ | ||
"name": "gear", | ||
"version": "0.9.1", | ||
"version": "0.9.2", | ||
"description": "Gear.js - Build System for Node.js and the Browser", | ||
@@ -17,5 +17,6 @@ "author": "Stephen Murphy <stephen@hypernaut.com>", | ||
"dependencies": { | ||
"async": "0.2.x", | ||
"mkdirp": "0.3.x", | ||
"liftoff": "0.10.x" | ||
"async": "0.8.x", | ||
"mkdirp": "0.5.x", | ||
"liftoff": "0.11.x", | ||
"minimist": "0.1.x" | ||
}, | ||
@@ -22,0 +23,0 @@ "devDependencies": { |
@@ -13,26 +13,26 @@ var lib = process.env.GEAR_COVER ? '../lib-cov/' : '../lib/', | ||
var registry = new Registry(); | ||
registry.load({module: 'gear-lib'}); | ||
registry.tasks.should.include('csslint'); | ||
registry.tasks.should.include('jslint'); | ||
registry.tasks.should.include('s3'); | ||
registry.tasks.should.include('glob'); | ||
registry.tasks.should.containEql('csslint'); | ||
registry.tasks.should.containEql('jslint'); | ||
registry.tasks.should.containEql('s3'); | ||
registry.tasks.should.containEql('glob'); | ||
}); | ||
it('should load directories', function() { | ||
var registry = new Registry(); | ||
registry.load({dirname: fixtures.dirname}); | ||
registry.tasks.should.include('fooga'); | ||
registry.tasks.should.containEql('fooga'); | ||
}); | ||
it('should load files', function() { | ||
var registry = new Registry(); | ||
registry.load({filename: fixtures.filename}); | ||
registry.tasks.should.include('fooga'); | ||
registry.tasks.should.containEql('fooga'); | ||
}); | ||
@@ -42,3 +42,3 @@ | ||
var registry = new Registry(); | ||
registry.load({ | ||
@@ -45,0 +45,0 @@ tasks : { |
Sorry, the diff of this file is too big to display
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
547713
43
7621
4
52
+ Addedminimist@0.1.x
+ Addedasync@0.8.0(transitive)
+ Addedliftoff@0.11.3(transitive)
+ Addedminimist@0.1.01.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedresolve@0.7.4(transitive)
- Removedasync@0.2.10(transitive)
- Removedliftoff@0.10.0(transitive)
- Removedminimist@0.0.10(transitive)
- Removedmkdirp@0.3.5(transitive)
- Removedresolve@0.6.3(transitive)
Updatedasync@0.8.x
Updatedliftoff@0.11.x
Updatedmkdirp@0.5.x