diff --git a/.gitignore b/.gitignore index 9f905346..2184b05d 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ test/core/modules/test_outputs test/core/modules/test_outputs/* node_modules/ node_modules/* +test_outputs \ No newline at end of file diff --git a/dist/image-sequencer.js b/dist/image-sequencer.js index 46354ef9..61238429 100644 --- a/dist/image-sequencer.js +++ b/dist/image-sequencer.js @@ -6007,7 +6007,7 @@ module.exports = ret; },{"./es5":13}]},{},[4])(4) }); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) -},{"_process":117,"timers":142}],4:[function(require,module,exports){ +},{"_process":118,"timers":172}],4:[function(require,module,exports){ },{}],5:[function(require,module,exports){ (function (process){ @@ -6318,7 +6318,7 @@ var extractCodes = exports.extractCodes = function (buf) { } }).call(this,require('_process')) -},{"./lib/encode":6,"_process":117,"stream":139,"tty":143}],6:[function(require,module,exports){ +},{"./lib/encode":6,"_process":118,"stream":169,"tty":173}],6:[function(require,module,exports){ (function (Buffer){ var encode = module.exports = function (xs) { function bytes (s) { @@ -6340,7 +6340,7 @@ var ord = encode.ord = function ord (c) { }; }).call(this,require("buffer").Buffer) -},{"buffer":47}],7:[function(require,module,exports){ +},{"buffer":48}],7:[function(require,module,exports){ (function (Buffer){ /**! * contentstream - index.js @@ -6389,7 +6389,7 @@ ContentStream.prototype._read = function (n) { }; }).call(this,require("buffer").Buffer) -},{"buffer":47,"readable-stream":13,"util":150}],8:[function(require,module,exports){ +},{"buffer":48,"readable-stream":13,"util":180}],8:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -6482,7 +6482,7 @@ function forEach (xs, f) { } }).call(this,require('_process')) -},{"./_stream_readable":10,"./_stream_writable":12,"_process":117,"core-util-is":14,"inherits":70}],9:[function(require,module,exports){ +},{"./_stream_readable":10,"./_stream_writable":12,"_process":118,"core-util-is":14,"inherits":71}],9:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -6530,7 +6530,7 @@ PassThrough.prototype._transform = function(chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":11,"core-util-is":14,"inherits":70}],10:[function(require,module,exports){ +},{"./_stream_transform":11,"core-util-is":14,"inherits":71}],10:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -7516,7 +7516,7 @@ function indexOf (xs, x) { } }).call(this,require('_process')) -},{"_process":117,"buffer":47,"core-util-is":14,"events":48,"inherits":70,"isarray":73,"stream":139,"string_decoder/":140}],11:[function(require,module,exports){ +},{"_process":118,"buffer":48,"core-util-is":14,"events":49,"inherits":71,"isarray":74,"stream":169,"string_decoder/":170}],11:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -7728,7 +7728,7 @@ function done(stream, er) { return stream.push(null); } -},{"./_stream_duplex":8,"core-util-is":14,"inherits":70}],12:[function(require,module,exports){ +},{"./_stream_duplex":8,"core-util-is":14,"inherits":71}],12:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -8118,7 +8118,7 @@ function endWritable(stream, state, cb) { } }).call(this,require('_process')) -},{"./_stream_duplex":8,"_process":117,"buffer":47,"core-util-is":14,"inherits":70,"stream":139}],13:[function(require,module,exports){ +},{"./_stream_duplex":8,"_process":118,"buffer":48,"core-util-is":14,"inherits":71,"stream":169}],13:[function(require,module,exports){ (function (process){ var Stream = require('stream'); // hack to fix a circular dependency issue when used with browserify exports = module.exports = require('./lib/_stream_readable.js'); @@ -8133,7 +8133,7 @@ if (!process.browser && process.env.READABLE_STREAM === 'disable') { } }).call(this,require('_process')) -},{"./lib/_stream_duplex.js":8,"./lib/_stream_passthrough.js":9,"./lib/_stream_readable.js":10,"./lib/_stream_transform.js":11,"./lib/_stream_writable.js":12,"_process":117,"stream":139}],14:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":8,"./lib/_stream_passthrough.js":9,"./lib/_stream_readable.js":10,"./lib/_stream_transform.js":11,"./lib/_stream_writable.js":12,"_process":118,"stream":169}],14:[function(require,module,exports){ (function (Buffer){ // Copyright Joyent, Inc. and other Node contributors. // @@ -8244,7 +8244,7 @@ function objectToString(o) { } }).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":72}],15:[function(require,module,exports){ +},{"../../is-buffer/index.js":73}],15:[function(require,module,exports){ "use strict" var createThunk = require("./lib/thunk.js") @@ -8715,7 +8715,7 @@ function generateCWiseOp(proc, typesig) { } module.exports = generateCWiseOp -},{"uniq":146}],17:[function(require,module,exports){ +},{"uniq":176}],17:[function(require,module,exports){ "use strict" // The function below is called when constructing a cwise function object, and does the following: @@ -8875,7 +8875,174 @@ function dataUriToBuffer (uri) { } }).call(this,require("buffer").Buffer) -},{"buffer":47}],20:[function(require,module,exports){ +},{"buffer":48}],20:[function(require,module,exports){ +'use strict'; + +/****************************************************************************** + * Created 2008-08-19. + * + * Dijkstra path-finding functions. Adapted from the Dijkstar Python project. + * + * Copyright (C) 2008 + * Wyatt Baldwin + * All rights reserved + * + * Licensed under the MIT license. + * + * http://www.opensource.org/licenses/mit-license.php + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + *****************************************************************************/ +var dijkstra = { + single_source_shortest_paths: function(graph, s, d) { + // Predecessor map for each node that has been encountered. + // node ID => predecessor node ID + var predecessors = {}; + + // Costs of shortest paths from s to all nodes encountered. + // node ID => cost + var costs = {}; + costs[s] = 0; + + // Costs of shortest paths from s to all nodes encountered; differs from + // `costs` in that it provides easy access to the node that currently has + // the known shortest path from s. + // XXX: Do we actually need both `costs` and `open`? + var open = dijkstra.PriorityQueue.make(); + open.push(s, 0); + + var closest, + u, v, + cost_of_s_to_u, + adjacent_nodes, + cost_of_e, + cost_of_s_to_u_plus_cost_of_e, + cost_of_s_to_v, + first_visit; + while (!open.empty()) { + // In the nodes remaining in graph that have a known cost from s, + // find the node, u, that currently has the shortest path from s. + closest = open.pop(); + u = closest.value; + cost_of_s_to_u = closest.cost; + + // Get nodes adjacent to u... + adjacent_nodes = graph[u] || {}; + + // ...and explore the edges that connect u to those nodes, updating + // the cost of the shortest paths to any or all of those nodes as + // necessary. v is the node across the current edge from u. + for (v in adjacent_nodes) { + if (adjacent_nodes.hasOwnProperty(v)) { + // Get the cost of the edge running from u to v. + cost_of_e = adjacent_nodes[v]; + + // Cost of s to u plus the cost of u to v across e--this is *a* + // cost from s to v that may or may not be less than the current + // known cost to v. + cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e; + + // If we haven't visited v yet OR if the current known cost from s to + // v is greater than the new cost we just found (cost of s to u plus + // cost of u to v across e), update v's cost in the cost list and + // update v's predecessor in the predecessor list (it's now u). + cost_of_s_to_v = costs[v]; + first_visit = (typeof costs[v] === 'undefined'); + if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) { + costs[v] = cost_of_s_to_u_plus_cost_of_e; + open.push(v, cost_of_s_to_u_plus_cost_of_e); + predecessors[v] = u; + } + } + } + } + + if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') { + var msg = ['Could not find a path from ', s, ' to ', d, '.'].join(''); + throw new Error(msg); + } + + return predecessors; + }, + + extract_shortest_path_from_predecessor_list: function(predecessors, d) { + var nodes = []; + var u = d; + var predecessor; + while (u) { + nodes.push(u); + predecessor = predecessors[u]; + u = predecessors[u]; + } + nodes.reverse(); + return nodes; + }, + + find_path: function(graph, s, d) { + var predecessors = dijkstra.single_source_shortest_paths(graph, s, d); + return dijkstra.extract_shortest_path_from_predecessor_list( + predecessors, d); + }, + + /** + * A very naive priority queue implementation. + */ + PriorityQueue: { + make: function (opts) { + var T = dijkstra.PriorityQueue, + t = {}, + key; + opts = opts || {}; + for (key in T) { + if (T.hasOwnProperty(key)) { + t[key] = T[key]; + } + } + t.queue = []; + t.sorter = opts.sorter || T.default_sorter; + return t; + }, + + default_sorter: function (a, b) { + return a.cost - b.cost; + }, + + /** + * Add a new item to the queue and ensure the highest priority element + * is at the front of the queue. + */ + push: function (value, cost) { + var item = {value: value, cost: cost}; + this.queue.push(item); + this.queue.sort(this.sorter); + }, + + /** + * Return the highest priority element in the queue. + */ + pop: function () { + return this.queue.shift(); + }, + + empty: function () { + return this.queue.length === 0; + } + } +}; + + +// node.js module exports +if (typeof module !== 'undefined') { + module.exports = dijkstra; +} + +},{}],21:[function(require,module,exports){ "use strict" function dupe_array(count, value, i) { @@ -8925,7 +9092,7 @@ function dupe(count, value) { } module.exports = dupe -},{}],21:[function(require,module,exports){ +},{}],22:[function(require,module,exports){ var FisheyeGl = function FisheyeGl(options){ // Defaults: @@ -9233,7 +9400,7 @@ if (typeof(document) != 'undefined') else module.exports = FisheyeGl; -},{"./shaders":22}],22:[function(require,module,exports){ +},{"./shaders":23}],23:[function(require,module,exports){ module.exports = { fragment: require('./shaders/fragment.glfs'), fragment2: require('./shaders/fragment2.glfs'), @@ -9243,7 +9410,7 @@ module.exports = { vertex: require('./shaders/vertex.glvs') }; -},{"./shaders/fragment.glfs":23,"./shaders/fragment2.glfs":24,"./shaders/fragment3.glfs":25,"./shaders/method1.glfs":26,"./shaders/method2.glfs":27,"./shaders/vertex.glvs":28}],23:[function(require,module,exports){ +},{"./shaders/fragment.glfs":24,"./shaders/fragment2.glfs":25,"./shaders/fragment3.glfs":26,"./shaders/method1.glfs":27,"./shaders/method2.glfs":28,"./shaders/vertex.glvs":29}],24:[function(require,module,exports){ module.exports = "\ #ifdef GL_ES\n\ precision highp float;\n\ @@ -9271,7 +9438,7 @@ void main(void){\n\ gl_FragColor = texture;\n\ }\n\ "; -},{}],24:[function(require,module,exports){ +},{}],25:[function(require,module,exports){ module.exports = "\ #ifdef GL_ES\n\ precision highp float;\n\ @@ -9304,7 +9471,7 @@ void main(void){\n\ gl_FragColor = texture;\n\ }\n\ "; -},{}],25:[function(require,module,exports){ +},{}],26:[function(require,module,exports){ module.exports = "\ #ifdef GL_ES\n\ precision highp float;\n\ @@ -9335,7 +9502,7 @@ void main(void){\n\ gl_FragColor = texture;\n\ }\n\ "; -},{}],26:[function(require,module,exports){ +},{}],27:[function(require,module,exports){ module.exports = "\ #ifdef GL_ES\n\ precision highp float;\n\ @@ -9367,7 +9534,7 @@ void main(void){\n\ gl_FragColor = texture;\n\ }\n\ "; -},{}],27:[function(require,module,exports){ +},{}],28:[function(require,module,exports){ module.exports = "\ #ifdef GL_ES\n\ precision highp float;\n\ @@ -9399,7 +9566,7 @@ void main(void){\n\ gl_FragColor = texture;\n\ }\n\ "; -},{}],28:[function(require,module,exports){ +},{}],29:[function(require,module,exports){ module.exports = "\ #ifdef GL_ES\n\ precision highp float;\n\ @@ -9414,7 +9581,7 @@ void main(void){\n\ gl_Position = vec4(vPosition,1.0);\n\ }\n\ "; -},{}],29:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ (function (Buffer,process){ 'use strict' @@ -9552,7 +9719,7 @@ module.exports = function getPixels(url, type, cb) { } } }).call(this,{"isBuffer":require("../is-buffer/index.js")},require('_process')) -},{"../is-buffer/index.js":72,"_process":117,"data-uri-to-buffer":30,"ndarray":84,"ndarray-pack":82,"omggif":93,"path":95,"through":141}],30:[function(require,module,exports){ +},{"../is-buffer/index.js":73,"_process":118,"data-uri-to-buffer":31,"ndarray":85,"ndarray-pack":83,"omggif":94,"path":96,"through":171}],31:[function(require,module,exports){ (function (Buffer){ /** @@ -9610,7 +9777,7 @@ function dataUriToBuffer (uri) { } }).call(this,require("buffer").Buffer) -},{"buffer":47}],31:[function(require,module,exports){ +},{"buffer":48}],32:[function(require,module,exports){ (function (Buffer){ /* GIFEncoder.js @@ -10083,7 +10250,7 @@ GIFEncoder.ByteCapacitor = ByteCapacitor; module.exports = GIFEncoder; }).call(this,require("buffer").Buffer) -},{"./LZWEncoder.js":32,"./TypedNeuQuant.js":33,"assert":40,"buffer":47,"events":48,"readable-stream":39,"util":150}],32:[function(require,module,exports){ +},{"./LZWEncoder.js":33,"./TypedNeuQuant.js":34,"assert":41,"buffer":48,"events":49,"readable-stream":40,"util":180}],33:[function(require,module,exports){ /* LZWEncoder.js @@ -10297,7 +10464,7 @@ function LZWEncoder(width, height, pixels, colorDepth) { module.exports = LZWEncoder; -},{}],33:[function(require,module,exports){ +},{}],34:[function(require,module,exports){ /* NeuQuant Neural-Net Quantization Algorithm * ------------------------------------------ * @@ -10730,11 +10897,11 @@ function NeuQuant(pixels, samplefac) { module.exports = NeuQuant; -},{}],34:[function(require,module,exports){ +},{}],35:[function(require,module,exports){ arguments[4][8][0].apply(exports,arguments) -},{"./_stream_readable":36,"./_stream_writable":38,"_process":117,"core-util-is":14,"dup":8,"inherits":70}],35:[function(require,module,exports){ +},{"./_stream_readable":37,"./_stream_writable":39,"_process":118,"core-util-is":14,"dup":8,"inherits":71}],36:[function(require,module,exports){ arguments[4][9][0].apply(exports,arguments) -},{"./_stream_transform":37,"core-util-is":14,"dup":9,"inherits":70}],36:[function(require,module,exports){ +},{"./_stream_transform":38,"core-util-is":14,"dup":9,"inherits":71}],37:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -11689,7 +11856,7 @@ function indexOf (xs, x) { } }).call(this,require('_process')) -},{"./_stream_duplex":34,"_process":117,"buffer":47,"core-util-is":14,"events":48,"inherits":70,"isarray":73,"stream":139,"string_decoder/":140,"util":4}],37:[function(require,module,exports){ +},{"./_stream_duplex":35,"_process":118,"buffer":48,"core-util-is":14,"events":49,"inherits":71,"isarray":74,"stream":169,"string_decoder/":170,"util":4}],38:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -11900,7 +12067,7 @@ function done(stream, er) { return stream.push(null); } -},{"./_stream_duplex":34,"core-util-is":14,"inherits":70}],38:[function(require,module,exports){ +},{"./_stream_duplex":35,"core-util-is":14,"inherits":71}],39:[function(require,module,exports){ (function (process){ // Copyright Joyent, Inc. and other Node contributors. // @@ -12381,7 +12548,7 @@ function endWritable(stream, state, cb) { } }).call(this,require('_process')) -},{"./_stream_duplex":34,"_process":117,"buffer":47,"core-util-is":14,"inherits":70,"stream":139}],39:[function(require,module,exports){ +},{"./_stream_duplex":35,"_process":118,"buffer":48,"core-util-is":14,"inherits":71,"stream":169}],40:[function(require,module,exports){ (function (process){ exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = require('stream'); @@ -12395,7 +12562,7 @@ if (!process.browser && process.env.READABLE_STREAM === 'disable') { } }).call(this,require('_process')) -},{"./lib/_stream_duplex.js":34,"./lib/_stream_passthrough.js":35,"./lib/_stream_readable.js":36,"./lib/_stream_transform.js":37,"./lib/_stream_writable.js":38,"_process":117,"stream":139}],40:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":35,"./lib/_stream_passthrough.js":36,"./lib/_stream_readable.js":37,"./lib/_stream_transform.js":38,"./lib/_stream_writable.js":39,"_process":118,"stream":169}],41:[function(require,module,exports){ (function (global){ 'use strict'; @@ -12889,7 +13056,7 @@ var objectKeys = Object.keys || function (obj) { }; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"util/":43}],41:[function(require,module,exports){ +},{"util/":44}],42:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -12914,14 +13081,14 @@ if (typeof Object.create === 'function') { } } -},{}],42:[function(require,module,exports){ +},{}],43:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],43:[function(require,module,exports){ +},{}],44:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // @@ -13511,7 +13678,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":42,"_process":117,"inherits":41}],44:[function(require,module,exports){ +},{"./support/isBuffer":43,"_process":118,"inherits":42}],45:[function(require,module,exports){ (function (process,Buffer){ 'use strict'; /* eslint camelcase: "off" */ @@ -13923,7 +14090,7 @@ Zlib.prototype._reset = function () { exports.Zlib = Zlib; }).call(this,require('_process'),require("buffer").Buffer) -},{"_process":117,"assert":40,"buffer":47,"pako/lib/zlib/constants":51,"pako/lib/zlib/deflate.js":53,"pako/lib/zlib/inflate.js":55,"pako/lib/zlib/zstream":59}],45:[function(require,module,exports){ +},{"_process":118,"assert":41,"buffer":48,"pako/lib/zlib/constants":52,"pako/lib/zlib/deflate.js":54,"pako/lib/zlib/inflate.js":56,"pako/lib/zlib/zstream":60}],46:[function(require,module,exports){ (function (process){ 'use strict'; @@ -14535,9 +14702,9 @@ util.inherits(DeflateRaw, Zlib); util.inherits(InflateRaw, Zlib); util.inherits(Unzip, Zlib); }).call(this,require('_process')) -},{"./binding":44,"_process":117,"assert":40,"buffer":47,"stream":139,"util":150}],46:[function(require,module,exports){ +},{"./binding":45,"_process":118,"assert":41,"buffer":48,"stream":169,"util":180}],47:[function(require,module,exports){ arguments[4][4][0].apply(exports,arguments) -},{"dup":4}],47:[function(require,module,exports){ +},{"dup":4}],48:[function(require,module,exports){ /*! * The buffer module from node.js, for the browser. * @@ -16253,7 +16420,7 @@ function numberIsNaN (obj) { return obj !== obj // eslint-disable-line no-self-compare } -},{"base64-js":1,"ieee754":60}],48:[function(require,module,exports){ +},{"base64-js":1,"ieee754":61}],49:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -16778,7 +16945,7 @@ function functionBindPolyfill(context) { }; } -},{}],49:[function(require,module,exports){ +},{}],50:[function(require,module,exports){ 'use strict'; @@ -16885,7 +17052,7 @@ exports.setTyped = function (on) { exports.setTyped(TYPED_OK); -},{}],50:[function(require,module,exports){ +},{}],51:[function(require,module,exports){ 'use strict'; // Note: adler32 takes 12% for level 0 and 2% for level 6. @@ -16938,7 +17105,7 @@ function adler32(adler, buf, len, pos) { module.exports = adler32; -},{}],51:[function(require,module,exports){ +},{}],52:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -17008,7 +17175,7 @@ module.exports = { //Z_NULL: null // Use -1 or null inline, depending on var type }; -},{}],52:[function(require,module,exports){ +},{}],53:[function(require,module,exports){ 'use strict'; // Note: we can't get significant speed boost here. @@ -17069,7 +17236,7 @@ function crc32(crc, buf, len, pos) { module.exports = crc32; -},{}],53:[function(require,module,exports){ +},{}],54:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -18945,7 +19112,7 @@ exports.deflatePrime = deflatePrime; exports.deflateTune = deflateTune; */ -},{"../utils/common":49,"./adler32":50,"./crc32":52,"./messages":57,"./trees":58}],54:[function(require,module,exports){ +},{"../utils/common":50,"./adler32":51,"./crc32":53,"./messages":58,"./trees":59}],55:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -19292,7 +19459,7 @@ module.exports = function inflate_fast(strm, start) { return; }; -},{}],55:[function(require,module,exports){ +},{}],56:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -20850,7 +21017,7 @@ exports.inflateSyncPoint = inflateSyncPoint; exports.inflateUndermine = inflateUndermine; */ -},{"../utils/common":49,"./adler32":50,"./crc32":52,"./inffast":54,"./inftrees":56}],56:[function(require,module,exports){ +},{"../utils/common":50,"./adler32":51,"./crc32":53,"./inffast":55,"./inftrees":57}],57:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -21195,7 +21362,7 @@ module.exports = function inflate_table(type, lens, lens_index, codes, table, ta return 0; }; -},{"../utils/common":49}],57:[function(require,module,exports){ +},{"../utils/common":50}],58:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -21229,7 +21396,7 @@ module.exports = { '-6': 'incompatible version' /* Z_VERSION_ERROR (-6) */ }; -},{}],58:[function(require,module,exports){ +},{}],59:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -22451,7 +22618,7 @@ exports._tr_flush_block = _tr_flush_block; exports._tr_tally = _tr_tally; exports._tr_align = _tr_align; -},{"../utils/common":49}],59:[function(require,module,exports){ +},{"../utils/common":50}],60:[function(require,module,exports){ 'use strict'; // (C) 1995-2013 Jean-loup Gailly and Mark Adler @@ -22500,7 +22667,7 @@ function ZStream() { module.exports = ZStream; -},{}],60:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = (nBytes * 8) - mLen - 1 @@ -22586,7 +22753,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],61:[function(require,module,exports){ +},{}],62:[function(require,module,exports){ /* * Invert the image */ @@ -22638,7 +22805,7 @@ var info = { } } module.exports = [Invert,info]; -},{}],62:[function(require,module,exports){ +},{}],63:[function(require,module,exports){ /** * Copyright (c) 2015 Guyon Roche * @@ -22671,7 +22838,7 @@ var main = module.exports = { _.extend(main, require("./lib/enums")); -},{"./lib/bitmap":63,"./lib/enums":64,"underscore":145}],63:[function(require,module,exports){ +},{"./lib/bitmap":64,"./lib/enums":65,"underscore":175}],64:[function(require,module,exports){ (function (Buffer){ /** * Copyright (c) 2015 Guyon Roche @@ -23266,7 +23433,7 @@ Bitmap.prototype = { } } }).call(this,require("buffer").Buffer) -},{"./enums":64,"./resize":65,"./utils":66,"bluebird":3,"buffer":47,"fs":46,"jpeg-js":67,"node-png":92,"underscore":145}],64:[function(require,module,exports){ +},{"./enums":65,"./resize":66,"./utils":67,"bluebird":3,"buffer":48,"fs":47,"jpeg-js":68,"node-png":93,"underscore":175}],65:[function(require,module,exports){ /** * Copyright (c) 2015 Guyon Roche * @@ -23297,7 +23464,7 @@ module.exports = { PNG: 2 } }; -},{}],65:[function(require,module,exports){ +},{}],66:[function(require,module,exports){ (function (Buffer){ /** * Copyright (c) 2015 Guyon Roche @@ -23591,7 +23758,7 @@ module.exports = { } } }).call(this,require("buffer").Buffer) -},{"./bitmap":63,"bluebird":3,"buffer":47,"underscore":145}],66:[function(require,module,exports){ +},{"./bitmap":64,"bluebird":3,"buffer":48,"underscore":175}],67:[function(require,module,exports){ /** * Copyright (c) 2015 Guyon Roche * @@ -23634,7 +23801,7 @@ var utils = module.exports = { } } } -},{"bluebird":3,"fs":46,"underscore":145}],67:[function(require,module,exports){ +},{"bluebird":3,"fs":47,"underscore":175}],68:[function(require,module,exports){ var encode = require('./lib/encoder'), decode = require('./lib/decoder'); @@ -23643,7 +23810,7 @@ module.exports = { decode: decode }; -},{"./lib/decoder":68,"./lib/encoder":69}],68:[function(require,module,exports){ +},{"./lib/decoder":69,"./lib/encoder":70}],69:[function(require,module,exports){ (function (Buffer){ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ @@ -24633,7 +24800,7 @@ function decode(jpegData) { } }).call(this,require("buffer").Buffer) -},{"buffer":47}],69:[function(require,module,exports){ +},{"buffer":48}],70:[function(require,module,exports){ (function (Buffer){ /* Copyright (c) 2008, Adobe Systems Incorporated @@ -25403,9 +25570,9 @@ function getImageDataFromImage(idOrElement){ } }).call(this,require("buffer").Buffer) -},{"buffer":47}],70:[function(require,module,exports){ -arguments[4][41][0].apply(exports,arguments) -},{"dup":41}],71:[function(require,module,exports){ +},{"buffer":48}],71:[function(require,module,exports){ +arguments[4][42][0].apply(exports,arguments) +},{"dup":42}],72:[function(require,module,exports){ "use strict" function iota(n) { @@ -25417,7 +25584,7 @@ function iota(n) { } module.exports = iota -},{}],72:[function(require,module,exports){ +},{}],73:[function(require,module,exports){ /*! * Determine if an object is a Buffer * @@ -25440,12 +25607,12 @@ function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -},{}],73:[function(require,module,exports){ +},{}],74:[function(require,module,exports){ module.exports = Array.isArray || function (arr) { return Object.prototype.toString.call(arr) == '[object Array]'; }; -},{}],74:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -35488,7 +35655,7 @@ exports.locate = locate; /***/ }) /******/ ])["default"]; }); -},{}],75:[function(require,module,exports){ +},{}],76:[function(require,module,exports){ (function (global){ /** * @license @@ -52599,7 +52766,7 @@ exports.locate = locate; }.call(this)); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],76:[function(require,module,exports){ +},{}],77:[function(require,module,exports){ (function (process){ var path = require('path'); var fs = require('fs'); @@ -52711,9 +52878,9 @@ mime.charsets = { module.exports = mime; }).call(this,require('_process')) -},{"./types.json":77,"_process":117,"fs":46,"path":95}],77:[function(require,module,exports){ +},{"./types.json":78,"_process":118,"fs":47,"path":96}],78:[function(require,module,exports){ module.exports={"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomsvc+xml":["atomsvc"],"application/bdoc":["bdoc"],"application/ccxml+xml":["ccxml"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/font-tdpfr":["pfr"],"application/font-woff":[],"application/font-woff2":[],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/prs.cww":["cww"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":[],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":[],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":[],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":[],"application/x-msdownload":["com","bat"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["wmf","emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":[],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"application/xaml+xml":["xaml"],"application/xcap-diff+xml":["xdf"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":[],"audio/adpcm":["adp"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mp3":[],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/wav":["wav"],"audio/wave":[],"audio/webm":["weba"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":[],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":[],"audio/x-wav":[],"audio/xm":["xm"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/apng":["apng"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/g3fax":["g3"],"image/gif":["gif"],"image/ief":["ief"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/ktx":["ktx"],"image/png":["png"],"image/prs.btif":["btif"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/tiff":["tiff","tif"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":[],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/webp":["webp"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":[],"image/x-pcx":["pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/rfc822":["eml","mime"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.vtu":["vtu"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["x3db","x3dbz"],"model/x3d+vrml":["x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/hjson":["hjson"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/prs.lines.tag":["dsc"],"text/richtext":["rtx"],"text/rtf":[],"text/sgml":["sgml","sgm"],"text/slim":["slim","slm"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/vtt":["vtt"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":[],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"text/xml":[],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/jpeg":["jpgv"],"video/jpm":["jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/webm":["webm"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]} -},{}],78:[function(require,module,exports){ +},{}],79:[function(require,module,exports){ 'use strict' var ops = require('ndarray-ops') @@ -52796,7 +52963,7 @@ function ndfft(dir, x, y) { } module.exports = ndfft -},{"./lib/fft-matrix.js":79,"ndarray":84,"ndarray-ops":81,"typedarray-pool":144}],79:[function(require,module,exports){ +},{"./lib/fft-matrix.js":80,"ndarray":85,"ndarray-ops":82,"typedarray-pool":174}],80:[function(require,module,exports){ var bits = require('bit-twiddle') function fft(dir, nrows, ncols, buffer, x_ptr, y_ptr, scratch_ptr) { @@ -53015,7 +53182,7 @@ function fftBluestein(dir, nrows, ncols, buffer, x_ptr, y_ptr, scratch_ptr) { } } -},{"bit-twiddle":2}],80:[function(require,module,exports){ +},{"bit-twiddle":2}],81:[function(require,module,exports){ "use strict" module.exports = gaussBlur @@ -53061,7 +53228,7 @@ function gaussBlur(arr, sigma, wrap) { pool.freeDouble(im) return arr } -},{"cwise/lib/wrapper":18,"dup":20,"ndarray":84,"ndarray-fft":78,"ndarray-ops":81,"next-pow-2":85,"typedarray-pool":144}],81:[function(require,module,exports){ +},{"cwise/lib/wrapper":18,"dup":21,"ndarray":85,"ndarray-fft":79,"ndarray-ops":82,"next-pow-2":86,"typedarray-pool":174}],82:[function(require,module,exports){ "use strict" var compile = require("cwise-compiler") @@ -53524,7 +53691,7 @@ exports.equals = compile({ -},{"cwise-compiler":15}],82:[function(require,module,exports){ +},{"cwise-compiler":15}],83:[function(require,module,exports){ "use strict" var ndarray = require("ndarray") @@ -53547,10 +53714,10 @@ module.exports = function convert(arr, result) { return result } -},{"./doConvert.js":83,"ndarray":84}],83:[function(require,module,exports){ +},{"./doConvert.js":84,"ndarray":85}],84:[function(require,module,exports){ module.exports=require('cwise-compiler')({"args":["array","scalar","index"],"pre":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"body":{"body":"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}","args":[{"name":"_inline_1_arg0_","lvalue":true,"rvalue":false,"count":1},{"name":"_inline_1_arg1_","lvalue":false,"rvalue":true,"count":1},{"name":"_inline_1_arg2_","lvalue":false,"rvalue":true,"count":4}],"thisVars":[],"localVars":["_inline_1_i","_inline_1_v"]},"post":{"body":"{}","args":[],"thisVars":[],"localVars":[]},"funcName":"convert","blockSize":64}) -},{"cwise-compiler":15}],84:[function(require,module,exports){ +},{"cwise-compiler":15}],85:[function(require,module,exports){ var iota = require("iota-array") var isBuffer = require("is-buffer") @@ -53895,7 +54062,7 @@ function wrappedNDArrayCtor(data, shape, stride, offset) { module.exports = wrappedNDArrayCtor -},{"iota-array":71,"is-buffer":72}],85:[function(require,module,exports){ +},{"iota-array":72,"is-buffer":73}],86:[function(require,module,exports){ module.exports = function(v) { v += v === 0 --v @@ -53907,7 +54074,7 @@ module.exports = function(v) { return v + 1 } -},{}],86:[function(require,module,exports){ +},{}],87:[function(require,module,exports){ (function (process,Buffer){ // Copyright (c) 2012 Kuba Niegowski // @@ -54111,7 +54278,7 @@ ChunkStream.prototype._process = function() { }; }).call(this,require('_process'),require("buffer").Buffer) -},{"_process":117,"buffer":47,"stream":139,"util":150}],87:[function(require,module,exports){ +},{"_process":118,"buffer":48,"stream":169,"util":180}],88:[function(require,module,exports){ // Copyright (c) 2012 Kuba Niegowski // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -54151,7 +54318,7 @@ module.exports = { COLOR_ALPHA: 4 }; -},{}],88:[function(require,module,exports){ +},{}],89:[function(require,module,exports){ // Copyright (c) 2012 Kuba Niegowski // // Permission is hereby granted, free of charge, to any person obtaining a copy @@ -54232,7 +54399,7 @@ for (var i = 0; i < 256; i++) { crcTable[i] = c; } -},{"stream":139,"util":150}],89:[function(require,module,exports){ +},{"stream":169,"util":180}],90:[function(require,module,exports){ (function (Buffer){ // Copyright (c) 2012 Kuba Niegowski // @@ -54550,7 +54717,7 @@ var PaethPredictor = function(left, above, upLeft) { }; }).call(this,require("buffer").Buffer) -},{"./chunkstream":86,"buffer":47,"util":150,"zlib":45}],90:[function(require,module,exports){ +},{"./chunkstream":87,"buffer":48,"util":180,"zlib":46}],91:[function(require,module,exports){ (function (Buffer){ // Copyright (c) 2012 Kuba Niegowski // @@ -54664,7 +54831,7 @@ Packer.prototype._packIEND = function() { }; }).call(this,require("buffer").Buffer) -},{"./constants":87,"./crc":88,"./filter":89,"buffer":47,"stream":139,"util":150,"zlib":45}],91:[function(require,module,exports){ +},{"./constants":88,"./crc":89,"./filter":90,"buffer":48,"stream":169,"util":180,"zlib":46}],92:[function(require,module,exports){ (function (Buffer){ // Copyright (c) 2012 Kuba Niegowski // @@ -55027,7 +55194,7 @@ Parser.prototype._reverseFiltered = function(data, width, height) { }; }).call(this,require("buffer").Buffer) -},{"./chunkstream":86,"./constants":87,"./crc":88,"./filter":89,"buffer":47,"util":150,"zlib":45}],92:[function(require,module,exports){ +},{"./chunkstream":87,"./constants":88,"./crc":89,"./filter":90,"buffer":48,"util":180,"zlib":46}],93:[function(require,module,exports){ (function (process,Buffer){ // Copyright (c) 2012 Kuba Niegowski // @@ -55180,7 +55347,7 @@ PNG.prototype.bitblt = function(dst, sx, sy, w, h, dx, dy) { }; }).call(this,require('_process'),require("buffer").Buffer) -},{"./packer":90,"./parser":91,"_process":117,"buffer":47,"stream":139,"util":150}],93:[function(require,module,exports){ +},{"./packer":91,"./parser":92,"_process":118,"buffer":48,"stream":169,"util":180}],94:[function(require,module,exports){ // (c) Dean McNamee , 2013. // // https://github.com/deanm/omggif @@ -55989,7 +56156,7 @@ function GifReaderLZWOutputIndexStream(code_stream, p, output, output_length) { // CommonJS. try { exports.GifWriter = GifWriter; exports.GifReader = GifReader } catch(e) {} -},{}],94:[function(require,module,exports){ +},{}],95:[function(require,module,exports){ (function (process){ /** * Pace @@ -56263,7 +56430,7 @@ function formatNumber(number, decimals, dec_point, thousands_sep) { } }).call(this,require('_process')) -},{"_process":117,"charm":5}],95:[function(require,module,exports){ +},{"_process":118,"charm":5}],96:[function(require,module,exports){ (function (process){ // .dirname, .basename, and .extname methods are extracted from Node.js v8.11.1, // backported and transplited with Babel, with backwards-compat fixes @@ -56569,7 +56736,7 @@ var substr = 'ab'.substr(-1) === 'b' ; }).call(this,require('_process')) -},{"_process":117}],96:[function(require,module,exports){ +},{"_process":118}],97:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -56765,7 +56932,7 @@ exports.dataToBitMap = function(data, bitmapInfo) { }; }).call(this,require("buffer").Buffer) -},{"./interlace":106,"buffer":47}],97:[function(require,module,exports){ +},{"./interlace":107,"buffer":48}],98:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -56833,7 +57000,7 @@ module.exports = function(data, width, height, options) { }; }).call(this,require("buffer").Buffer) -},{"./constants":99,"buffer":47}],98:[function(require,module,exports){ +},{"./constants":100,"buffer":48}],99:[function(require,module,exports){ (function (process,Buffer){ 'use strict'; @@ -57046,7 +57213,7 @@ ChunkStream.prototype._process = function() { }; }).call(this,require('_process'),require("buffer").Buffer) -},{"_process":117,"buffer":47,"stream":139,"util":150}],99:[function(require,module,exports){ +},{"_process":118,"buffer":48,"stream":169,"util":180}],100:[function(require,module,exports){ 'use strict'; @@ -57082,7 +57249,7 @@ module.exports = { GAMMA_DIVISION: 100000 }; -},{}],100:[function(require,module,exports){ +},{}],101:[function(require,module,exports){ 'use strict'; var crcTable = []; @@ -57128,7 +57295,7 @@ CrcCalculator.crc32 = function(buf) { return crc ^ -1; }; -},{}],101:[function(require,module,exports){ +},{}],102:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57315,7 +57482,7 @@ module.exports = function(pxData, width, height, options, bpp) { }; }).call(this,require("buffer").Buffer) -},{"./paeth-predictor":110,"buffer":47}],102:[function(require,module,exports){ +},{"./paeth-predictor":111,"buffer":48}],103:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57344,7 +57511,7 @@ var FilterAsync = module.exports = function(bitmapInfo) { util.inherits(FilterAsync, ChunkStream); }).call(this,require("buffer").Buffer) -},{"./chunkstream":98,"./filter-parse":104,"buffer":47,"util":150}],103:[function(require,module,exports){ +},{"./chunkstream":99,"./filter-parse":105,"buffer":48,"util":180}],104:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57371,7 +57538,7 @@ exports.process = function(inBuffer, bitmapInfo) { return Buffer.concat(outBuffers); }; }).call(this,require("buffer").Buffer) -},{"./filter-parse":104,"./sync-reader":116,"buffer":47}],104:[function(require,module,exports){ +},{"./filter-parse":105,"./sync-reader":117,"buffer":48}],105:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57546,7 +57713,7 @@ Filter.prototype._reverseFilterLine = function(rawData) { }; }).call(this,require("buffer").Buffer) -},{"./interlace":106,"./paeth-predictor":110,"buffer":47}],105:[function(require,module,exports){ +},{"./interlace":107,"./paeth-predictor":111,"buffer":48}],106:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57639,7 +57806,7 @@ module.exports = function(indata, imageData) { }; }).call(this,require("buffer").Buffer) -},{"buffer":47}],106:[function(require,module,exports){ +},{"buffer":48}],107:[function(require,module,exports){ 'use strict'; // Adam 7 @@ -57727,7 +57894,7 @@ exports.getInterlaceIterator = function(width) { return (outerX * 4) + (outerY * width * 4); }; }; -},{}],107:[function(require,module,exports){ +},{}],108:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57776,7 +57943,7 @@ PackerAsync.prototype.pack = function(data, width, height, gamma) { }; }).call(this,require("buffer").Buffer) -},{"./constants":99,"./packer":109,"buffer":47,"stream":139,"util":150}],108:[function(require,module,exports){ +},{"./constants":100,"./packer":110,"buffer":48,"stream":169,"util":180}],109:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57828,7 +57995,7 @@ module.exports = function(metaData, opt) { }; }).call(this,require("buffer").Buffer) -},{"./constants":99,"./packer":109,"buffer":47,"zlib":45}],109:[function(require,module,exports){ +},{"./constants":100,"./packer":110,"buffer":48,"zlib":46}],110:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57923,7 +58090,7 @@ Packer.prototype.packIEND = function() { return this._packChunk(constants.TYPE_IEND, null); }; }).call(this,require("buffer").Buffer) -},{"./bitpacker":97,"./constants":99,"./crc":100,"./filter-pack":101,"buffer":47,"zlib":45}],110:[function(require,module,exports){ +},{"./bitpacker":98,"./constants":100,"./crc":101,"./filter-pack":102,"buffer":48,"zlib":46}],111:[function(require,module,exports){ 'use strict'; module.exports = function paethPredictor(left, above, upLeft) { @@ -57941,7 +58108,7 @@ module.exports = function paethPredictor(left, above, upLeft) { } return upLeft; }; -},{}],111:[function(require,module,exports){ +},{}],112:[function(require,module,exports){ 'use strict'; var util = require('util'); @@ -58053,7 +58220,7 @@ ParserAsync.prototype._complete = function(filteredData) { this.emit('parsed', normalisedBitmapData); }; -},{"./bitmapper":96,"./chunkstream":98,"./filter-parse-async":102,"./format-normaliser":105,"./parser":113,"util":150,"zlib":45}],112:[function(require,module,exports){ +},{"./bitmapper":97,"./chunkstream":99,"./filter-parse-async":103,"./format-normaliser":106,"./parser":114,"util":180,"zlib":46}],113:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -58148,7 +58315,7 @@ module.exports = function(buffer, options) { }; }).call(this,require("buffer").Buffer) -},{"./bitmapper":96,"./filter-parse-sync":103,"./format-normaliser":105,"./parser":113,"./sync-reader":116,"buffer":47,"zlib":45}],113:[function(require,module,exports){ +},{"./bitmapper":97,"./filter-parse-sync":104,"./format-normaliser":106,"./parser":114,"./sync-reader":117,"buffer":48,"zlib":46}],114:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -58442,7 +58609,7 @@ Parser.prototype._parseIEND = function(data) { }; }).call(this,require("buffer").Buffer) -},{"./constants":99,"./crc":100,"buffer":47}],114:[function(require,module,exports){ +},{"./constants":100,"./crc":101,"buffer":48}],115:[function(require,module,exports){ 'use strict'; @@ -58460,7 +58627,7 @@ exports.write = function(png) { return pack(png); }; -},{"./packer-sync":108,"./parser-sync":112}],115:[function(require,module,exports){ +},{"./packer-sync":109,"./parser-sync":113}],116:[function(require,module,exports){ (function (process,Buffer){ 'use strict'; @@ -58627,7 +58794,7 @@ PNG.prototype.adjustGamma = function() { }; }).call(this,require('_process'),require("buffer").Buffer) -},{"./packer-async":107,"./parser-async":111,"./png-sync":114,"_process":117,"buffer":47,"stream":139,"util":150}],116:[function(require,module,exports){ +},{"./packer-async":108,"./parser-async":112,"./png-sync":115,"_process":118,"buffer":48,"stream":169,"util":180}],117:[function(require,module,exports){ 'use strict'; var SyncReader = module.exports = function(buffer) { @@ -58680,7 +58847,7 @@ SyncReader.prototype.process = function() { }; -},{}],117:[function(require,module,exports){ +},{}],118:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -58866,10 +59033,3209 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],118:[function(require,module,exports){ +},{}],119:[function(require,module,exports){ + +var canPromise = require('./can-promise') + +var QRCode = require('./core/qrcode') +var CanvasRenderer = require('./renderer/canvas') +var SvgRenderer = require('./renderer/svg-tag.js') + +function renderCanvas (renderFunc, canvas, text, opts, cb) { + var args = [].slice.call(arguments, 1) + var argsNum = args.length + var isLastArgCb = typeof args[argsNum - 1] === 'function' + + if (!isLastArgCb && !canPromise()) { + throw new Error('Callback required as last argument') + } + + if (isLastArgCb) { + if (argsNum < 2) { + throw new Error('Too few arguments provided') + } + + if (argsNum === 2) { + cb = text + text = canvas + canvas = opts = undefined + } else if (argsNum === 3) { + if (canvas.getContext && typeof cb === 'undefined') { + cb = opts + opts = undefined + } else { + cb = opts + opts = text + text = canvas + canvas = undefined + } + } + } else { + if (argsNum < 1) { + throw new Error('Too few arguments provided') + } + + if (argsNum === 1) { + text = canvas + canvas = opts = undefined + } else if (argsNum === 2 && !canvas.getContext) { + opts = text + text = canvas + canvas = undefined + } + + return new Promise(function (resolve, reject) { + try { + var data = QRCode.create(text, opts) + resolve(renderFunc(data, canvas, opts)) + } catch (e) { + reject(e) + } + }) + } + + try { + var data = QRCode.create(text, opts) + cb(null, renderFunc(data, canvas, opts)) + } catch (e) { + cb(e) + } +} + +exports.create = QRCode.create +exports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render) +exports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL) + +// only svg for now. +exports.toString = renderCanvas.bind(null, function (data, _, opts) { + return SvgRenderer.render(data, opts) +}) + +},{"./can-promise":120,"./core/qrcode":136,"./renderer/canvas":143,"./renderer/svg-tag.js":144}],120:[function(require,module,exports){ +// can-promise has a crash in some versions of react native that dont have +// standard global objects +// https://github.com/soldair/node-qrcode/issues/157 + +module.exports = function () { + return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then +} + +},{}],121:[function(require,module,exports){ +/** + * Alignment pattern are fixed reference pattern in defined positions + * in a matrix symbology, which enables the decode software to re-synchronise + * the coordinate mapping of the image modules in the event of moderate amounts + * of distortion of the image. + * + * Alignment patterns are present only in QR Code symbols of version 2 or larger + * and their number depends on the symbol version. + */ + +var getSymbolSize = require('./utils').getSymbolSize + +/** + * Calculate the row/column coordinates of the center module of each alignment pattern + * for the specified QR Code version. + * + * The alignment patterns are positioned symmetrically on either side of the diagonal + * running from the top left corner of the symbol to the bottom right corner. + * + * Since positions are simmetrical only half of the coordinates are returned. + * Each item of the array will represent in turn the x and y coordinate. + * @see {@link getPositions} + * + * @param {Number} version QR Code version + * @return {Array} Array of coordinate + */ +exports.getRowColCoords = function getRowColCoords (version) { + if (version === 1) return [] + + var posCount = Math.floor(version / 7) + 2 + var size = getSymbolSize(version) + var intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2 + var positions = [size - 7] // Last coord is always (size - 7) + + for (var i = 1; i < posCount - 1; i++) { + positions[i] = positions[i - 1] - intervals + } + + positions.push(6) // First coord is always 6 + + return positions.reverse() +} + +/** + * Returns an array containing the positions of each alignment pattern. + * Each array's element represent the center point of the pattern as (x, y) coordinates + * + * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords} + * and filtering out the items that overlaps with finder pattern + * + * @example + * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38. + * The alignment patterns, therefore, are to be centered on (row, column) + * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38). + * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns + * and are not therefore used for alignment patterns. + * + * var pos = getPositions(7) + * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]] + * + * @param {Number} version QR Code version + * @return {Array} Array of coordinates + */ +exports.getPositions = function getPositions (version) { + var coords = [] + var pos = exports.getRowColCoords(version) + var posLength = pos.length + + for (var i = 0; i < posLength; i++) { + for (var j = 0; j < posLength; j++) { + // Skip if position is occupied by finder patterns + if ((i === 0 && j === 0) || // top-left + (i === 0 && j === posLength - 1) || // bottom-left + (i === posLength - 1 && j === 0)) { // top-right + continue + } + + coords.push([pos[i], pos[j]]) + } + } + + return coords +} + +},{"./utils":140}],122:[function(require,module,exports){ +var Mode = require('./mode') + +/** + * Array of characters available in alphanumeric mode + * + * As per QR Code specification, to each character + * is assigned a value from 0 to 44 which in this case coincides + * with the array index + * + * @type {Array} + */ +var ALPHA_NUM_CHARS = [ + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + ' ', '$', '%', '*', '+', '-', '.', '/', ':' +] + +function AlphanumericData (data) { + this.mode = Mode.ALPHANUMERIC + this.data = data +} + +AlphanumericData.getBitsLength = function getBitsLength (length) { + return 11 * Math.floor(length / 2) + 6 * (length % 2) +} + +AlphanumericData.prototype.getLength = function getLength () { + return this.data.length +} + +AlphanumericData.prototype.getBitsLength = function getBitsLength () { + return AlphanumericData.getBitsLength(this.data.length) +} + +AlphanumericData.prototype.write = function write (bitBuffer) { + var i + + // Input data characters are divided into groups of two characters + // and encoded as 11-bit binary codes. + for (i = 0; i + 2 <= this.data.length; i += 2) { + // The character value of the first character is multiplied by 45 + var value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45 + + // The character value of the second digit is added to the product + value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1]) + + // The sum is then stored as 11-bit binary number + bitBuffer.put(value, 11) + } + + // If the number of input data characters is not a multiple of two, + // the character value of the final character is encoded as a 6-bit binary number. + if (this.data.length % 2) { + bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6) + } +} + +module.exports = AlphanumericData + +},{"./mode":133}],123:[function(require,module,exports){ +function BitBuffer () { + this.buffer = [] + this.length = 0 +} + +BitBuffer.prototype = { + + get: function (index) { + var bufIndex = Math.floor(index / 8) + return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1 + }, + + put: function (num, length) { + for (var i = 0; i < length; i++) { + this.putBit(((num >>> (length - i - 1)) & 1) === 1) + } + }, + + getLengthInBits: function () { + return this.length + }, + + putBit: function (bit) { + var bufIndex = Math.floor(this.length / 8) + if (this.buffer.length <= bufIndex) { + this.buffer.push(0) + } + + if (bit) { + this.buffer[bufIndex] |= (0x80 >>> (this.length % 8)) + } + + this.length++ + } +} + +module.exports = BitBuffer + +},{}],124:[function(require,module,exports){ +var Buffer = require('../utils/buffer') + +/** + * Helper class to handle QR Code symbol modules + * + * @param {Number} size Symbol size + */ +function BitMatrix (size) { + if (!size || size < 1) { + throw new Error('BitMatrix size must be defined and greater than 0') + } + + this.size = size + this.data = new Buffer(size * size) + this.data.fill(0) + this.reservedBit = new Buffer(size * size) + this.reservedBit.fill(0) +} + +/** + * Set bit value at specified location + * If reserved flag is set, this bit will be ignored during masking process + * + * @param {Number} row + * @param {Number} col + * @param {Boolean} value + * @param {Boolean} reserved + */ +BitMatrix.prototype.set = function (row, col, value, reserved) { + var index = row * this.size + col + this.data[index] = value + if (reserved) this.reservedBit[index] = true +} + +/** + * Returns bit value at specified location + * + * @param {Number} row + * @param {Number} col + * @return {Boolean} + */ +BitMatrix.prototype.get = function (row, col) { + return this.data[row * this.size + col] +} + +/** + * Applies xor operator at specified location + * (used during masking process) + * + * @param {Number} row + * @param {Number} col + * @param {Boolean} value + */ +BitMatrix.prototype.xor = function (row, col, value) { + this.data[row * this.size + col] ^= value +} + +/** + * Check if bit at specified location is reserved + * + * @param {Number} row + * @param {Number} col + * @return {Boolean} + */ +BitMatrix.prototype.isReserved = function (row, col) { + return this.reservedBit[row * this.size + col] +} + +module.exports = BitMatrix + +},{"../utils/buffer":146}],125:[function(require,module,exports){ +var Buffer = require('../utils/buffer') +var Mode = require('./mode') + +function ByteData (data) { + this.mode = Mode.BYTE + this.data = new Buffer(data) +} + +ByteData.getBitsLength = function getBitsLength (length) { + return length * 8 +} + +ByteData.prototype.getLength = function getLength () { + return this.data.length +} + +ByteData.prototype.getBitsLength = function getBitsLength () { + return ByteData.getBitsLength(this.data.length) +} + +ByteData.prototype.write = function (bitBuffer) { + for (var i = 0, l = this.data.length; i < l; i++) { + bitBuffer.put(this.data[i], 8) + } +} + +module.exports = ByteData + +},{"../utils/buffer":146,"./mode":133}],126:[function(require,module,exports){ +var ECLevel = require('./error-correction-level') + +var EC_BLOCKS_TABLE = [ +// L M Q H + 1, 1, 1, 1, + 1, 1, 1, 1, + 1, 1, 2, 2, + 1, 2, 2, 4, + 1, 2, 4, 4, + 2, 4, 4, 4, + 2, 4, 6, 5, + 2, 4, 6, 6, + 2, 5, 8, 8, + 4, 5, 8, 8, + 4, 5, 8, 11, + 4, 8, 10, 11, + 4, 9, 12, 16, + 4, 9, 16, 16, + 6, 10, 12, 18, + 6, 10, 17, 16, + 6, 11, 16, 19, + 6, 13, 18, 21, + 7, 14, 21, 25, + 8, 16, 20, 25, + 8, 17, 23, 25, + 9, 17, 23, 34, + 9, 18, 25, 30, + 10, 20, 27, 32, + 12, 21, 29, 35, + 12, 23, 34, 37, + 12, 25, 34, 40, + 13, 26, 35, 42, + 14, 28, 38, 45, + 15, 29, 40, 48, + 16, 31, 43, 51, + 17, 33, 45, 54, + 18, 35, 48, 57, + 19, 37, 51, 60, + 19, 38, 53, 63, + 20, 40, 56, 66, + 21, 43, 59, 70, + 22, 45, 62, 74, + 24, 47, 65, 77, + 25, 49, 68, 81 +] + +var EC_CODEWORDS_TABLE = [ +// L M Q H + 7, 10, 13, 17, + 10, 16, 22, 28, + 15, 26, 36, 44, + 20, 36, 52, 64, + 26, 48, 72, 88, + 36, 64, 96, 112, + 40, 72, 108, 130, + 48, 88, 132, 156, + 60, 110, 160, 192, + 72, 130, 192, 224, + 80, 150, 224, 264, + 96, 176, 260, 308, + 104, 198, 288, 352, + 120, 216, 320, 384, + 132, 240, 360, 432, + 144, 280, 408, 480, + 168, 308, 448, 532, + 180, 338, 504, 588, + 196, 364, 546, 650, + 224, 416, 600, 700, + 224, 442, 644, 750, + 252, 476, 690, 816, + 270, 504, 750, 900, + 300, 560, 810, 960, + 312, 588, 870, 1050, + 336, 644, 952, 1110, + 360, 700, 1020, 1200, + 390, 728, 1050, 1260, + 420, 784, 1140, 1350, + 450, 812, 1200, 1440, + 480, 868, 1290, 1530, + 510, 924, 1350, 1620, + 540, 980, 1440, 1710, + 570, 1036, 1530, 1800, + 570, 1064, 1590, 1890, + 600, 1120, 1680, 1980, + 630, 1204, 1770, 2100, + 660, 1260, 1860, 2220, + 720, 1316, 1950, 2310, + 750, 1372, 2040, 2430 +] + +/** + * Returns the number of error correction block that the QR Code should contain + * for the specified version and error correction level. + * + * @param {Number} version QR Code version + * @param {Number} errorCorrectionLevel Error correction level + * @return {Number} Number of error correction blocks + */ +exports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) { + switch (errorCorrectionLevel) { + case ECLevel.L: + return EC_BLOCKS_TABLE[(version - 1) * 4 + 0] + case ECLevel.M: + return EC_BLOCKS_TABLE[(version - 1) * 4 + 1] + case ECLevel.Q: + return EC_BLOCKS_TABLE[(version - 1) * 4 + 2] + case ECLevel.H: + return EC_BLOCKS_TABLE[(version - 1) * 4 + 3] + default: + return undefined + } +} + +/** + * Returns the number of error correction codewords to use for the specified + * version and error correction level. + * + * @param {Number} version QR Code version + * @param {Number} errorCorrectionLevel Error correction level + * @return {Number} Number of error correction codewords + */ +exports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) { + switch (errorCorrectionLevel) { + case ECLevel.L: + return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0] + case ECLevel.M: + return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1] + case ECLevel.Q: + return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2] + case ECLevel.H: + return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3] + default: + return undefined + } +} + +},{"./error-correction-level":127}],127:[function(require,module,exports){ +exports.L = { bit: 1 } +exports.M = { bit: 0 } +exports.Q = { bit: 3 } +exports.H = { bit: 2 } + +function fromString (string) { + if (typeof string !== 'string') { + throw new Error('Param is not a string') + } + + var lcStr = string.toLowerCase() + + switch (lcStr) { + case 'l': + case 'low': + return exports.L + + case 'm': + case 'medium': + return exports.M + + case 'q': + case 'quartile': + return exports.Q + + case 'h': + case 'high': + return exports.H + + default: + throw new Error('Unknown EC Level: ' + string) + } +} + +exports.isValid = function isValid (level) { + return level && typeof level.bit !== 'undefined' && + level.bit >= 0 && level.bit < 4 +} + +exports.from = function from (value, defaultValue) { + if (exports.isValid(value)) { + return value + } + + try { + return fromString(value) + } catch (e) { + return defaultValue + } +} + +},{}],128:[function(require,module,exports){ +var getSymbolSize = require('./utils').getSymbolSize +var FINDER_PATTERN_SIZE = 7 + +/** + * Returns an array containing the positions of each finder pattern. + * Each array's element represent the top-left point of the pattern as (x, y) coordinates + * + * @param {Number} version QR Code version + * @return {Array} Array of coordinates + */ +exports.getPositions = function getPositions (version) { + var size = getSymbolSize(version) + + return [ + // top-left + [0, 0], + // top-right + [size - FINDER_PATTERN_SIZE, 0], + // bottom-left + [0, size - FINDER_PATTERN_SIZE] + ] +} + +},{"./utils":140}],129:[function(require,module,exports){ +var Utils = require('./utils') + +var G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0) +var G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1) +var G15_BCH = Utils.getBCHDigit(G15) + +/** + * Returns format information with relative error correction bits + * + * The format information is a 15-bit sequence containing 5 data bits, + * with 10 error correction bits calculated using the (15, 5) BCH code. + * + * @param {Number} errorCorrectionLevel Error correction level + * @param {Number} mask Mask pattern + * @return {Number} Encoded format information bits + */ +exports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) { + var data = ((errorCorrectionLevel.bit << 3) | mask) + var d = data << 10 + + while (Utils.getBCHDigit(d) - G15_BCH >= 0) { + d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH)) + } + + // xor final data with mask pattern in order to ensure that + // no combination of Error Correction Level and data mask pattern + // will result in an all-zero data string + return ((data << 10) | d) ^ G15_MASK +} + +},{"./utils":140}],130:[function(require,module,exports){ +var Buffer = require('../utils/buffer') + +if(Buffer.alloc) { + var EXP_TABLE = Buffer.alloc(512) + var LOG_TABLE = Buffer.alloc(256) +} else { + var EXP_TABLE = new Buffer(512) + var LOG_TABLE = new Buffer(256) +} +/** + * Precompute the log and anti-log tables for faster computation later + * + * For each possible value in the galois field 2^8, we will pre-compute + * the logarithm and anti-logarithm (exponential) of this value + * + * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields} + */ +;(function initTables () { + var x = 1 + for (var i = 0; i < 255; i++) { + EXP_TABLE[i] = x + LOG_TABLE[x] = i + + x <<= 1 // multiply by 2 + + // The QR code specification says to use byte-wise modulo 100011101 arithmetic. + // This means that when a number is 256 or larger, it should be XORed with 0x11D. + if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256) + x ^= 0x11D + } + } + + // Optimization: double the size of the anti-log table so that we don't need to mod 255 to + // stay inside the bounds (because we will mainly use this table for the multiplication of + // two GF numbers, no more). + // @see {@link mul} + for (i = 255; i < 512; i++) { + EXP_TABLE[i] = EXP_TABLE[i - 255] + } +}()) + +/** + * Returns log value of n inside Galois Field + * + * @param {Number} n + * @return {Number} + */ +exports.log = function log (n) { + if (n < 1) throw new Error('log(' + n + ')') + return LOG_TABLE[n] +} + +/** + * Returns anti-log value of n inside Galois Field + * + * @param {Number} n + * @return {Number} + */ +exports.exp = function exp (n) { + return EXP_TABLE[n] +} + +/** + * Multiplies two number inside Galois Field + * + * @param {Number} x + * @param {Number} y + * @return {Number} + */ +exports.mul = function mul (x, y) { + if (x === 0 || y === 0) return 0 + + // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized + // @see {@link initTables} + return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]] +} + +},{"../utils/buffer":146}],131:[function(require,module,exports){ +var Mode = require('./mode') +var Utils = require('./utils') + +function KanjiData (data) { + this.mode = Mode.KANJI + this.data = data +} + +KanjiData.getBitsLength = function getBitsLength (length) { + return length * 13 +} + +KanjiData.prototype.getLength = function getLength () { + return this.data.length +} + +KanjiData.prototype.getBitsLength = function getBitsLength () { + return KanjiData.getBitsLength(this.data.length) +} + +KanjiData.prototype.write = function (bitBuffer) { + var i + + // In the Shift JIS system, Kanji characters are represented by a two byte combination. + // These byte values are shifted from the JIS X 0208 values. + // JIS X 0208 gives details of the shift coded representation. + for (i = 0; i < this.data.length; i++) { + var value = Utils.toSJIS(this.data[i]) + + // For characters with Shift JIS values from 0x8140 to 0x9FFC: + if (value >= 0x8140 && value <= 0x9FFC) { + // Subtract 0x8140 from Shift JIS value + value -= 0x8140 + + // For characters with Shift JIS values from 0xE040 to 0xEBBF + } else if (value >= 0xE040 && value <= 0xEBBF) { + // Subtract 0xC140 from Shift JIS value + value -= 0xC140 + } else { + throw new Error( + 'Invalid SJIS character: ' + this.data[i] + '\n' + + 'Make sure your charset is UTF-8') + } + + // Multiply most significant byte of result by 0xC0 + // and add least significant byte to product + value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff) + + // Convert result to a 13-bit binary string + bitBuffer.put(value, 13) + } +} + +module.exports = KanjiData + +},{"./mode":133,"./utils":140}],132:[function(require,module,exports){ +/** + * Data mask pattern reference + * @type {Object} + */ +exports.Patterns = { + PATTERN000: 0, + PATTERN001: 1, + PATTERN010: 2, + PATTERN011: 3, + PATTERN100: 4, + PATTERN101: 5, + PATTERN110: 6, + PATTERN111: 7 +} + +/** + * Weighted penalty scores for the undesirable features + * @type {Object} + */ +var PenaltyScores = { + N1: 3, + N2: 3, + N3: 40, + N4: 10 +} + +/** + * Check if mask pattern value is valid + * + * @param {Number} mask Mask pattern + * @return {Boolean} true if valid, false otherwise + */ +exports.isValid = function isValid (mask) { + return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7 +} + +/** + * Returns mask pattern from a value. + * If value is not valid, returns undefined + * + * @param {Number|String} value Mask pattern value + * @return {Number} Valid mask pattern or undefined + */ +exports.from = function from (value) { + return exports.isValid(value) ? parseInt(value, 10) : undefined +} + +/** +* Find adjacent modules in row/column with the same color +* and assign a penalty value. +* +* Points: N1 + i +* i is the amount by which the number of adjacent modules of the same color exceeds 5 +*/ +exports.getPenaltyN1 = function getPenaltyN1 (data) { + var size = data.size + var points = 0 + var sameCountCol = 0 + var sameCountRow = 0 + var lastCol = null + var lastRow = null + + for (var row = 0; row < size; row++) { + sameCountCol = sameCountRow = 0 + lastCol = lastRow = null + + for (var col = 0; col < size; col++) { + var module = data.get(row, col) + if (module === lastCol) { + sameCountCol++ + } else { + if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5) + lastCol = module + sameCountCol = 1 + } + + module = data.get(col, row) + if (module === lastRow) { + sameCountRow++ + } else { + if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5) + lastRow = module + sameCountRow = 1 + } + } + + if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5) + if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5) + } + + return points +} + +/** + * Find 2x2 blocks with the same color and assign a penalty value + * + * Points: N2 * (m - 1) * (n - 1) + */ +exports.getPenaltyN2 = function getPenaltyN2 (data) { + var size = data.size + var points = 0 + + for (var row = 0; row < size - 1; row++) { + for (var col = 0; col < size - 1; col++) { + var last = data.get(row, col) + + data.get(row, col + 1) + + data.get(row + 1, col) + + data.get(row + 1, col + 1) + + if (last === 4 || last === 0) points++ + } + } + + return points * PenaltyScores.N2 +} + +/** + * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column, + * preceded or followed by light area 4 modules wide + * + * Points: N3 * number of pattern found + */ +exports.getPenaltyN3 = function getPenaltyN3 (data) { + var size = data.size + var points = 0 + var bitsCol = 0 + var bitsRow = 0 + + for (var row = 0; row < size; row++) { + bitsCol = bitsRow = 0 + for (var col = 0; col < size; col++) { + bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col) + if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++ + + bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row) + if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++ + } + } + + return points * PenaltyScores.N3 +} + +/** + * Calculate proportion of dark modules in entire symbol + * + * Points: N4 * k + * + * k is the rating of the deviation of the proportion of dark modules + * in the symbol from 50% in steps of 5% + */ +exports.getPenaltyN4 = function getPenaltyN4 (data) { + var darkCount = 0 + var modulesCount = data.data.length + + for (var i = 0; i < modulesCount; i++) darkCount += data.data[i] + + var k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10) + + return k * PenaltyScores.N4 +} + +/** + * Return mask value at given position + * + * @param {Number} maskPattern Pattern reference value + * @param {Number} i Row + * @param {Number} j Column + * @return {Boolean} Mask value + */ +function getMaskAt (maskPattern, i, j) { + switch (maskPattern) { + case exports.Patterns.PATTERN000: return (i + j) % 2 === 0 + case exports.Patterns.PATTERN001: return i % 2 === 0 + case exports.Patterns.PATTERN010: return j % 3 === 0 + case exports.Patterns.PATTERN011: return (i + j) % 3 === 0 + case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0 + case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0 + case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0 + case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0 + + default: throw new Error('bad maskPattern:' + maskPattern) + } +} + +/** + * Apply a mask pattern to a BitMatrix + * + * @param {Number} pattern Pattern reference number + * @param {BitMatrix} data BitMatrix data + */ +exports.applyMask = function applyMask (pattern, data) { + var size = data.size + + for (var col = 0; col < size; col++) { + for (var row = 0; row < size; row++) { + if (data.isReserved(row, col)) continue + data.xor(row, col, getMaskAt(pattern, row, col)) + } + } +} + +/** + * Returns the best mask pattern for data + * + * @param {BitMatrix} data + * @return {Number} Mask pattern reference number + */ +exports.getBestMask = function getBestMask (data, setupFormatFunc) { + var numPatterns = Object.keys(exports.Patterns).length + var bestPattern = 0 + var lowerPenalty = Infinity + + for (var p = 0; p < numPatterns; p++) { + setupFormatFunc(p) + exports.applyMask(p, data) + + // Calculate penalty + var penalty = + exports.getPenaltyN1(data) + + exports.getPenaltyN2(data) + + exports.getPenaltyN3(data) + + exports.getPenaltyN4(data) + + // Undo previously applied mask + exports.applyMask(p, data) + + if (penalty < lowerPenalty) { + lowerPenalty = penalty + bestPattern = p + } + } + + return bestPattern +} + +},{}],133:[function(require,module,exports){ +var VersionCheck = require('./version-check') +var Regex = require('./regex') + +/** + * Numeric mode encodes data from the decimal digit set (0 - 9) + * (byte values 30HEX to 39HEX). + * Normally, 3 data characters are represented by 10 bits. + * + * @type {Object} + */ +exports.NUMERIC = { + id: 'Numeric', + bit: 1 << 0, + ccBits: [10, 12, 14] +} + +/** + * Alphanumeric mode encodes data from a set of 45 characters, + * i.e. 10 numeric digits (0 - 9), + * 26 alphabetic characters (A - Z), + * and 9 symbols (SP, $, %, *, +, -, ., /, :). + * Normally, two input characters are represented by 11 bits. + * + * @type {Object} + */ +exports.ALPHANUMERIC = { + id: 'Alphanumeric', + bit: 1 << 1, + ccBits: [9, 11, 13] +} + +/** + * In byte mode, data is encoded at 8 bits per character. + * + * @type {Object} + */ +exports.BYTE = { + id: 'Byte', + bit: 1 << 2, + ccBits: [8, 16, 16] +} + +/** + * The Kanji mode efficiently encodes Kanji characters in accordance with + * the Shift JIS system based on JIS X 0208. + * The Shift JIS values are shifted from the JIS X 0208 values. + * JIS X 0208 gives details of the shift coded representation. + * Each two-byte character value is compacted to a 13-bit binary codeword. + * + * @type {Object} + */ +exports.KANJI = { + id: 'Kanji', + bit: 1 << 3, + ccBits: [8, 10, 12] +} + +/** + * Mixed mode will contain a sequences of data in a combination of any of + * the modes described above + * + * @type {Object} + */ +exports.MIXED = { + bit: -1 +} + +/** + * Returns the number of bits needed to store the data length + * according to QR Code specifications. + * + * @param {Mode} mode Data mode + * @param {Number} version QR Code version + * @return {Number} Number of bits + */ +exports.getCharCountIndicator = function getCharCountIndicator (mode, version) { + if (!mode.ccBits) throw new Error('Invalid mode: ' + mode) + + if (!VersionCheck.isValid(version)) { + throw new Error('Invalid version: ' + version) + } + + if (version >= 1 && version < 10) return mode.ccBits[0] + else if (version < 27) return mode.ccBits[1] + return mode.ccBits[2] +} + +/** + * Returns the most efficient mode to store the specified data + * + * @param {String} dataStr Input data string + * @return {Mode} Best mode + */ +exports.getBestModeForData = function getBestModeForData (dataStr) { + if (Regex.testNumeric(dataStr)) return exports.NUMERIC + else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC + else if (Regex.testKanji(dataStr)) return exports.KANJI + else return exports.BYTE +} + +/** + * Return mode name as string + * + * @param {Mode} mode Mode object + * @returns {String} Mode name + */ +exports.toString = function toString (mode) { + if (mode && mode.id) return mode.id + throw new Error('Invalid mode') +} + +/** + * Check if input param is a valid mode object + * + * @param {Mode} mode Mode object + * @returns {Boolean} True if valid mode, false otherwise + */ +exports.isValid = function isValid (mode) { + return mode && mode.bit && mode.ccBits +} + +/** + * Get mode object from its name + * + * @param {String} string Mode name + * @returns {Mode} Mode object + */ +function fromString (string) { + if (typeof string !== 'string') { + throw new Error('Param is not a string') + } + + var lcStr = string.toLowerCase() + + switch (lcStr) { + case 'numeric': + return exports.NUMERIC + case 'alphanumeric': + return exports.ALPHANUMERIC + case 'kanji': + return exports.KANJI + case 'byte': + return exports.BYTE + default: + throw new Error('Unknown mode: ' + string) + } +} + +/** + * Returns mode from a value. + * If value is not a valid mode, returns defaultValue + * + * @param {Mode|String} value Encoding mode + * @param {Mode} defaultValue Fallback value + * @return {Mode} Encoding mode + */ +exports.from = function from (value, defaultValue) { + if (exports.isValid(value)) { + return value + } + + try { + return fromString(value) + } catch (e) { + return defaultValue + } +} + +},{"./regex":138,"./version-check":141}],134:[function(require,module,exports){ +var Mode = require('./mode') + +function NumericData (data) { + this.mode = Mode.NUMERIC + this.data = data.toString() +} + +NumericData.getBitsLength = function getBitsLength (length) { + return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0) +} + +NumericData.prototype.getLength = function getLength () { + return this.data.length +} + +NumericData.prototype.getBitsLength = function getBitsLength () { + return NumericData.getBitsLength(this.data.length) +} + +NumericData.prototype.write = function write (bitBuffer) { + var i, group, value + + // The input data string is divided into groups of three digits, + // and each group is converted to its 10-bit binary equivalent. + for (i = 0; i + 3 <= this.data.length; i += 3) { + group = this.data.substr(i, 3) + value = parseInt(group, 10) + + bitBuffer.put(value, 10) + } + + // If the number of input digits is not an exact multiple of three, + // the final one or two digits are converted to 4 or 7 bits respectively. + var remainingNum = this.data.length - i + if (remainingNum > 0) { + group = this.data.substr(i) + value = parseInt(group, 10) + + bitBuffer.put(value, remainingNum * 3 + 1) + } +} + +module.exports = NumericData + +},{"./mode":133}],135:[function(require,module,exports){ +var Buffer = require('../utils/buffer') +var GF = require('./galois-field') + +/** + * Multiplies two polynomials inside Galois Field + * + * @param {Buffer} p1 Polynomial + * @param {Buffer} p2 Polynomial + * @return {Buffer} Product of p1 and p2 + */ +exports.mul = function mul (p1, p2) { + var coeff = new Buffer(p1.length + p2.length - 1) + coeff.fill(0) + + for (var i = 0; i < p1.length; i++) { + for (var j = 0; j < p2.length; j++) { + coeff[i + j] ^= GF.mul(p1[i], p2[j]) + } + } + + return coeff +} + +/** + * Calculate the remainder of polynomials division + * + * @param {Buffer} divident Polynomial + * @param {Buffer} divisor Polynomial + * @return {Buffer} Remainder + */ +exports.mod = function mod (divident, divisor) { + var result = new Buffer(divident) + + while ((result.length - divisor.length) >= 0) { + var coeff = result[0] + + for (var i = 0; i < divisor.length; i++) { + result[i] ^= GF.mul(divisor[i], coeff) + } + + // remove all zeros from buffer head + var offset = 0 + while (offset < result.length && result[offset] === 0) offset++ + result = result.slice(offset) + } + + return result +} + +/** + * Generate an irreducible generator polynomial of specified degree + * (used by Reed-Solomon encoder) + * + * @param {Number} degree Degree of the generator polynomial + * @return {Buffer} Buffer containing polynomial coefficients + */ +exports.generateECPolynomial = function generateECPolynomial (degree) { + var poly = new Buffer([1]) + for (var i = 0; i < degree; i++) { + poly = exports.mul(poly, [1, GF.exp(i)]) + } + + return poly +} + +},{"../utils/buffer":146,"./galois-field":130}],136:[function(require,module,exports){ +var Buffer = require('../utils/buffer') +var Utils = require('./utils') +var ECLevel = require('./error-correction-level') +var BitBuffer = require('./bit-buffer') +var BitMatrix = require('./bit-matrix') +var AlignmentPattern = require('./alignment-pattern') +var FinderPattern = require('./finder-pattern') +var MaskPattern = require('./mask-pattern') +var ECCode = require('./error-correction-code') +var ReedSolomonEncoder = require('./reed-solomon-encoder') +var Version = require('./version') +var FormatInfo = require('./format-info') +var Mode = require('./mode') +var Segments = require('./segments') +var isArray = require('isarray') + +/** + * QRCode for JavaScript + * + * modified by Ryan Day for nodejs support + * Copyright (c) 2011 Ryan Day + * + * Licensed under the MIT license: + * http://www.opensource.org/licenses/mit-license.php + * +//--------------------------------------------------------------------- +// QRCode for JavaScript +// +// Copyright (c) 2009 Kazuhiko Arase +// +// URL: http://www.d-project.com/ +// +// Licensed under the MIT license: +// http://www.opensource.org/licenses/mit-license.php +// +// The word "QR Code" is registered trademark of +// DENSO WAVE INCORPORATED +// http://www.denso-wave.com/qrcode/faqpatent-e.html +// +//--------------------------------------------------------------------- +*/ + +/** + * Add finder patterns bits to matrix + * + * @param {BitMatrix} matrix Modules matrix + * @param {Number} version QR Code version + */ +function setupFinderPattern (matrix, version) { + var size = matrix.size + var pos = FinderPattern.getPositions(version) + + for (var i = 0; i < pos.length; i++) { + var row = pos[i][0] + var col = pos[i][1] + + for (var r = -1; r <= 7; r++) { + if (row + r <= -1 || size <= row + r) continue + + for (var c = -1; c <= 7; c++) { + if (col + c <= -1 || size <= col + c) continue + + if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) || + (c >= 0 && c <= 6 && (r === 0 || r === 6)) || + (r >= 2 && r <= 4 && c >= 2 && c <= 4)) { + matrix.set(row + r, col + c, true, true) + } else { + matrix.set(row + r, col + c, false, true) + } + } + } + } +} + +/** + * Add timing pattern bits to matrix + * + * Note: this function must be called before {@link setupAlignmentPattern} + * + * @param {BitMatrix} matrix Modules matrix + */ +function setupTimingPattern (matrix) { + var size = matrix.size + + for (var r = 8; r < size - 8; r++) { + var value = r % 2 === 0 + matrix.set(r, 6, value, true) + matrix.set(6, r, value, true) + } +} + +/** + * Add alignment patterns bits to matrix + * + * Note: this function must be called after {@link setupTimingPattern} + * + * @param {BitMatrix} matrix Modules matrix + * @param {Number} version QR Code version + */ +function setupAlignmentPattern (matrix, version) { + var pos = AlignmentPattern.getPositions(version) + + for (var i = 0; i < pos.length; i++) { + var row = pos[i][0] + var col = pos[i][1] + + for (var r = -2; r <= 2; r++) { + for (var c = -2; c <= 2; c++) { + if (r === -2 || r === 2 || c === -2 || c === 2 || + (r === 0 && c === 0)) { + matrix.set(row + r, col + c, true, true) + } else { + matrix.set(row + r, col + c, false, true) + } + } + } + } +} + +/** + * Add version info bits to matrix + * + * @param {BitMatrix} matrix Modules matrix + * @param {Number} version QR Code version + */ +function setupVersionInfo (matrix, version) { + var size = matrix.size + var bits = Version.getEncodedBits(version) + var row, col, mod + + for (var i = 0; i < 18; i++) { + row = Math.floor(i / 3) + col = i % 3 + size - 8 - 3 + mod = ((bits >> i) & 1) === 1 + + matrix.set(row, col, mod, true) + matrix.set(col, row, mod, true) + } +} + +/** + * Add format info bits to matrix + * + * @param {BitMatrix} matrix Modules matrix + * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level + * @param {Number} maskPattern Mask pattern reference value + */ +function setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) { + var size = matrix.size + var bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern) + var i, mod + + for (i = 0; i < 15; i++) { + mod = ((bits >> i) & 1) === 1 + + // vertical + if (i < 6) { + matrix.set(i, 8, mod, true) + } else if (i < 8) { + matrix.set(i + 1, 8, mod, true) + } else { + matrix.set(size - 15 + i, 8, mod, true) + } + + // horizontal + if (i < 8) { + matrix.set(8, size - i - 1, mod, true) + } else if (i < 9) { + matrix.set(8, 15 - i - 1 + 1, mod, true) + } else { + matrix.set(8, 15 - i - 1, mod, true) + } + } + + // fixed module + matrix.set(size - 8, 8, 1, true) +} + +/** + * Add encoded data bits to matrix + * + * @param {BitMatrix} matrix Modules matrix + * @param {Buffer} data Data codewords + */ +function setupData (matrix, data) { + var size = matrix.size + var inc = -1 + var row = size - 1 + var bitIndex = 7 + var byteIndex = 0 + + for (var col = size - 1; col > 0; col -= 2) { + if (col === 6) col-- + + while (true) { + for (var c = 0; c < 2; c++) { + if (!matrix.isReserved(row, col - c)) { + var dark = false + + if (byteIndex < data.length) { + dark = (((data[byteIndex] >>> bitIndex) & 1) === 1) + } + + matrix.set(row, col - c, dark) + bitIndex-- + + if (bitIndex === -1) { + byteIndex++ + bitIndex = 7 + } + } + } + + row += inc + + if (row < 0 || size <= row) { + row -= inc + inc = -inc + break + } + } + } +} + +/** + * Create encoded codewords from data input + * + * @param {Number} version QR Code version + * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level + * @param {ByteData} data Data input + * @return {Buffer} Buffer containing encoded codewords + */ +function createData (version, errorCorrectionLevel, segments) { + // Prepare data buffer + var buffer = new BitBuffer() + + segments.forEach(function (data) { + // prefix data with mode indicator (4 bits) + buffer.put(data.mode.bit, 4) + + // Prefix data with character count indicator. + // The character count indicator is a string of bits that represents the + // number of characters that are being encoded. + // The character count indicator must be placed after the mode indicator + // and must be a certain number of bits long, depending on the QR version + // and data mode + // @see {@link Mode.getCharCountIndicator}. + buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version)) + + // add binary data sequence to buffer + data.write(buffer) + }) + + // Calculate required number of bits + var totalCodewords = Utils.getSymbolTotalCodewords(version) + var ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel) + var dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8 + + // Add a terminator. + // If the bit string is shorter than the total number of required bits, + // a terminator of up to four 0s must be added to the right side of the string. + // If the bit string is more than four bits shorter than the required number of bits, + // add four 0s to the end. + if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) { + buffer.put(0, 4) + } + + // If the bit string is fewer than four bits shorter, add only the number of 0s that + // are needed to reach the required number of bits. + + // After adding the terminator, if the number of bits in the string is not a multiple of 8, + // pad the string on the right with 0s to make the string's length a multiple of 8. + while (buffer.getLengthInBits() % 8 !== 0) { + buffer.putBit(0) + } + + // Add pad bytes if the string is still shorter than the total number of required bits. + // Extend the buffer to fill the data capacity of the symbol corresponding to + // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC) + // and 00010001 (0x11) alternately. + var remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8 + for (var i = 0; i < remainingByte; i++) { + buffer.put(i % 2 ? 0x11 : 0xEC, 8) + } + + return createCodewords(buffer, version, errorCorrectionLevel) +} + +/** + * Encode input data with Reed-Solomon and return codewords with + * relative error correction bits + * + * @param {BitBuffer} bitBuffer Data to encode + * @param {Number} version QR Code version + * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level + * @return {Buffer} Buffer containing encoded codewords + */ +function createCodewords (bitBuffer, version, errorCorrectionLevel) { + // Total codewords for this QR code version (Data + Error correction) + var totalCodewords = Utils.getSymbolTotalCodewords(version) + + // Total number of error correction codewords + var ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel) + + // Total number of data codewords + var dataTotalCodewords = totalCodewords - ecTotalCodewords + + // Total number of blocks + var ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel) + + // Calculate how many blocks each group should contain + var blocksInGroup2 = totalCodewords % ecTotalBlocks + var blocksInGroup1 = ecTotalBlocks - blocksInGroup2 + + var totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks) + + var dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks) + var dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1 + + // Number of EC codewords is the same for both groups + var ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1 + + // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount + var rs = new ReedSolomonEncoder(ecCount) + + var offset = 0 + var dcData = new Array(ecTotalBlocks) + var ecData = new Array(ecTotalBlocks) + var maxDataSize = 0 + var buffer = new Buffer(bitBuffer.buffer) + + // Divide the buffer into the required number of blocks + for (var b = 0; b < ecTotalBlocks; b++) { + var dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2 + + // extract a block of data from buffer + dcData[b] = buffer.slice(offset, offset + dataSize) + + // Calculate EC codewords for this data block + ecData[b] = rs.encode(dcData[b]) + + offset += dataSize + maxDataSize = Math.max(maxDataSize, dataSize) + } + + // Create final data + // Interleave the data and error correction codewords from each block + var data = new Buffer(totalCodewords) + var index = 0 + var i, r + + // Add data codewords + for (i = 0; i < maxDataSize; i++) { + for (r = 0; r < ecTotalBlocks; r++) { + if (i < dcData[r].length) { + data[index++] = dcData[r][i] + } + } + } + + // Apped EC codewords + for (i = 0; i < ecCount; i++) { + for (r = 0; r < ecTotalBlocks; r++) { + data[index++] = ecData[r][i] + } + } + + return data +} + +/** + * Build QR Code symbol + * + * @param {String} data Input string + * @param {Number} version QR Code version + * @param {ErrorCorretionLevel} errorCorrectionLevel Error level + * @param {MaskPattern} maskPattern Mask pattern + * @return {Object} Object containing symbol data + */ +function createSymbol (data, version, errorCorrectionLevel, maskPattern) { + var segments + + if (isArray(data)) { + segments = Segments.fromArray(data) + } else if (typeof data === 'string') { + var estimatedVersion = version + + if (!estimatedVersion) { + var rawSegments = Segments.rawSplit(data) + + // Estimate best version that can contain raw splitted segments + estimatedVersion = Version.getBestVersionForData(rawSegments, + errorCorrectionLevel) + } + + // Build optimized segments + // If estimated version is undefined, try with the highest version + segments = Segments.fromString(data, estimatedVersion || 40) + } else { + throw new Error('Invalid data') + } + + // Get the min version that can contain data + var bestVersion = Version.getBestVersionForData(segments, + errorCorrectionLevel) + + // If no version is found, data cannot be stored + if (!bestVersion) { + throw new Error('The amount of data is too big to be stored in a QR Code') + } + + // If not specified, use min version as default + if (!version) { + version = bestVersion + + // Check if the specified version can contain the data + } else if (version < bestVersion) { + throw new Error('\n' + + 'The chosen QR Code version cannot contain this amount of data.\n' + + 'Minimum version required to store current data is: ' + bestVersion + '.\n' + ) + } + + var dataBits = createData(version, errorCorrectionLevel, segments) + + // Allocate matrix buffer + var moduleCount = Utils.getSymbolSize(version) + var modules = new BitMatrix(moduleCount) + + // Add function modules + setupFinderPattern(modules, version) + setupTimingPattern(modules) + setupAlignmentPattern(modules, version) + + // Add temporary dummy bits for format info just to set them as reserved. + // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask} + // since the masking operation must be performed only on the encoding region. + // These blocks will be replaced with correct values later in code. + setupFormatInfo(modules, errorCorrectionLevel, 0) + + if (version >= 7) { + setupVersionInfo(modules, version) + } + + // Add data codewords + setupData(modules, dataBits) + + if (isNaN(maskPattern)) { + // Find best mask pattern + maskPattern = MaskPattern.getBestMask(modules, + setupFormatInfo.bind(null, modules, errorCorrectionLevel)) + } + + // Apply mask pattern + MaskPattern.applyMask(maskPattern, modules) + + // Replace format info bits with correct values + setupFormatInfo(modules, errorCorrectionLevel, maskPattern) + + return { + modules: modules, + version: version, + errorCorrectionLevel: errorCorrectionLevel, + maskPattern: maskPattern, + segments: segments + } +} + +/** + * QR Code + * + * @param {String | Array} data Input data + * @param {Object} options Optional configurations + * @param {Number} options.version QR Code version + * @param {String} options.errorCorrectionLevel Error correction level + * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis + */ +exports.create = function create (data, options) { + if (typeof data === 'undefined' || data === '') { + throw new Error('No input text') + } + + var errorCorrectionLevel = ECLevel.M + var version + var mask + + if (typeof options !== 'undefined') { + // Use higher error correction level as default + errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M) + version = Version.from(options.version) + mask = MaskPattern.from(options.maskPattern) + + if (options.toSJISFunc) { + Utils.setToSJISFunction(options.toSJISFunc) + } + } + + return createSymbol(data, version, errorCorrectionLevel, mask) +} + +},{"../utils/buffer":146,"./alignment-pattern":121,"./bit-buffer":123,"./bit-matrix":124,"./error-correction-code":126,"./error-correction-level":127,"./finder-pattern":128,"./format-info":129,"./mask-pattern":132,"./mode":133,"./reed-solomon-encoder":137,"./segments":139,"./utils":140,"./version":142,"isarray":147}],137:[function(require,module,exports){ +var Buffer = require('../utils/buffer') +var Polynomial = require('./polynomial') + +function ReedSolomonEncoder (degree) { + this.genPoly = undefined + this.degree = degree + + if (this.degree) this.initialize(this.degree) +} + +/** + * Initialize the encoder. + * The input param should correspond to the number of error correction codewords. + * + * @param {Number} degree + */ +ReedSolomonEncoder.prototype.initialize = function initialize (degree) { + // create an irreducible generator polynomial + this.degree = degree + this.genPoly = Polynomial.generateECPolynomial(this.degree) +} + +/** + * Encodes a chunk of data + * + * @param {Buffer} data Buffer containing input data + * @return {Buffer} Buffer containing encoded data + */ +ReedSolomonEncoder.prototype.encode = function encode (data) { + if (!this.genPoly) { + throw new Error('Encoder not initialized') + } + + // Calculate EC for this data block + // extends data size to data+genPoly size + var pad = new Buffer(this.degree) + pad.fill(0) + var paddedData = Buffer.concat([data, pad], data.length + this.degree) + + // The error correction codewords are the remainder after dividing the data codewords + // by a generator polynomial + var remainder = Polynomial.mod(paddedData, this.genPoly) + + // return EC data blocks (last n byte, where n is the degree of genPoly) + // If coefficients number in remainder are less than genPoly degree, + // pad with 0s to the left to reach the needed number of coefficients + var start = this.degree - remainder.length + if (start > 0) { + var buff = new Buffer(this.degree) + buff.fill(0) + remainder.copy(buff, start) + + return buff + } + + return remainder +} + +module.exports = ReedSolomonEncoder + +},{"../utils/buffer":146,"./polynomial":135}],138:[function(require,module,exports){ +var numeric = '[0-9]+' +var alphanumeric = '[A-Z $%*+\\-./:]+' +var kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' + + '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' + + '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' + + '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+' +kanji = kanji.replace(/u/g, '\\u') + +var byte = '(?:(?![A-Z0-9 $%*+\\-./:]|' + kanji + ')(?:.|[\r\n]))+' + +exports.KANJI = new RegExp(kanji, 'g') +exports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\-./:]+', 'g') +exports.BYTE = new RegExp(byte, 'g') +exports.NUMERIC = new RegExp(numeric, 'g') +exports.ALPHANUMERIC = new RegExp(alphanumeric, 'g') + +var TEST_KANJI = new RegExp('^' + kanji + '$') +var TEST_NUMERIC = new RegExp('^' + numeric + '$') +var TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\-./:]+$') + +exports.testKanji = function testKanji (str) { + return TEST_KANJI.test(str) +} + +exports.testNumeric = function testNumeric (str) { + return TEST_NUMERIC.test(str) +} + +exports.testAlphanumeric = function testAlphanumeric (str) { + return TEST_ALPHANUMERIC.test(str) +} + +},{}],139:[function(require,module,exports){ +var Mode = require('./mode') +var NumericData = require('./numeric-data') +var AlphanumericData = require('./alphanumeric-data') +var ByteData = require('./byte-data') +var KanjiData = require('./kanji-data') +var Regex = require('./regex') +var Utils = require('./utils') +var dijkstra = require('dijkstrajs') + +/** + * Returns UTF8 byte length + * + * @param {String} str Input string + * @return {Number} Number of byte + */ +function getStringByteLength (str) { + return unescape(encodeURIComponent(str)).length +} + +/** + * Get a list of segments of the specified mode + * from a string + * + * @param {Mode} mode Segment mode + * @param {String} str String to process + * @return {Array} Array of object with segments data + */ +function getSegments (regex, mode, str) { + var segments = [] + var result + + while ((result = regex.exec(str)) !== null) { + segments.push({ + data: result[0], + index: result.index, + mode: mode, + length: result[0].length + }) + } + + return segments +} + +/** + * Extracts a series of segments with the appropriate + * modes from a string + * + * @param {String} dataStr Input string + * @return {Array} Array of object with segments data + */ +function getSegmentsFromString (dataStr) { + var numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr) + var alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr) + var byteSegs + var kanjiSegs + + if (Utils.isKanjiModeEnabled()) { + byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr) + kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr) + } else { + byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr) + kanjiSegs = [] + } + + var segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs) + + return segs + .sort(function (s1, s2) { + return s1.index - s2.index + }) + .map(function (obj) { + return { + data: obj.data, + mode: obj.mode, + length: obj.length + } + }) +} + +/** + * Returns how many bits are needed to encode a string of + * specified length with the specified mode + * + * @param {Number} length String length + * @param {Mode} mode Segment mode + * @return {Number} Bit length + */ +function getSegmentBitsLength (length, mode) { + switch (mode) { + case Mode.NUMERIC: + return NumericData.getBitsLength(length) + case Mode.ALPHANUMERIC: + return AlphanumericData.getBitsLength(length) + case Mode.KANJI: + return KanjiData.getBitsLength(length) + case Mode.BYTE: + return ByteData.getBitsLength(length) + } +} + +/** + * Merges adjacent segments which have the same mode + * + * @param {Array} segs Array of object with segments data + * @return {Array} Array of object with segments data + */ +function mergeSegments (segs) { + return segs.reduce(function (acc, curr) { + var prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null + if (prevSeg && prevSeg.mode === curr.mode) { + acc[acc.length - 1].data += curr.data + return acc + } + + acc.push(curr) + return acc + }, []) +} + +/** + * Generates a list of all possible nodes combination which + * will be used to build a segments graph. + * + * Nodes are divided by groups. Each group will contain a list of all the modes + * in which is possible to encode the given text. + * + * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte. + * The group for '12345' will contain then 3 objects, one for each + * possible encoding mode. + * + * Each node represents a possible segment. + * + * @param {Array} segs Array of object with segments data + * @return {Array} Array of object with segments data + */ +function buildNodes (segs) { + var nodes = [] + for (var i = 0; i < segs.length; i++) { + var seg = segs[i] + + switch (seg.mode) { + case Mode.NUMERIC: + nodes.push([seg, + { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length }, + { data: seg.data, mode: Mode.BYTE, length: seg.length } + ]) + break + case Mode.ALPHANUMERIC: + nodes.push([seg, + { data: seg.data, mode: Mode.BYTE, length: seg.length } + ]) + break + case Mode.KANJI: + nodes.push([seg, + { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) } + ]) + break + case Mode.BYTE: + nodes.push([ + { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) } + ]) + } + } + + return nodes +} + +/** + * Builds a graph from a list of nodes. + * All segments in each node group will be connected with all the segments of + * the next group and so on. + * + * At each connection will be assigned a weight depending on the + * segment's byte length. + * + * @param {Array} nodes Array of object with segments data + * @param {Number} version QR Code version + * @return {Object} Graph of all possible segments + */ +function buildGraph (nodes, version) { + var table = {} + var graph = {'start': {}} + var prevNodeIds = ['start'] + + for (var i = 0; i < nodes.length; i++) { + var nodeGroup = nodes[i] + var currentNodeIds = [] + + for (var j = 0; j < nodeGroup.length; j++) { + var node = nodeGroup[j] + var key = '' + i + j + + currentNodeIds.push(key) + table[key] = { node: node, lastCount: 0 } + graph[key] = {} + + for (var n = 0; n < prevNodeIds.length; n++) { + var prevNodeId = prevNodeIds[n] + + if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) { + graph[prevNodeId][key] = + getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) - + getSegmentBitsLength(table[prevNodeId].lastCount, node.mode) + + table[prevNodeId].lastCount += node.length + } else { + if (table[prevNodeId]) table[prevNodeId].lastCount = node.length + + graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) + + 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost + } + } + } + + prevNodeIds = currentNodeIds + } + + for (n = 0; n < prevNodeIds.length; n++) { + graph[prevNodeIds[n]]['end'] = 0 + } + + return { map: graph, table: table } +} + +/** + * Builds a segment from a specified data and mode. + * If a mode is not specified, the more suitable will be used. + * + * @param {String} data Input data + * @param {Mode | String} modesHint Data mode + * @return {Segment} Segment + */ +function buildSingleSegment (data, modesHint) { + var mode + var bestMode = Mode.getBestModeForData(data) + + mode = Mode.from(modesHint, bestMode) + + // Make sure data can be encoded + if (mode !== Mode.BYTE && mode.bit < bestMode.bit) { + throw new Error('"' + data + '"' + + ' cannot be encoded with mode ' + Mode.toString(mode) + + '.\n Suggested mode is: ' + Mode.toString(bestMode)) + } + + // Use Mode.BYTE if Kanji support is disabled + if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) { + mode = Mode.BYTE + } + + switch (mode) { + case Mode.NUMERIC: + return new NumericData(data) + + case Mode.ALPHANUMERIC: + return new AlphanumericData(data) + + case Mode.KANJI: + return new KanjiData(data) + + case Mode.BYTE: + return new ByteData(data) + } +} + +/** + * Builds a list of segments from an array. + * Array can contain Strings or Objects with segment's info. + * + * For each item which is a string, will be generated a segment with the given + * string and the more appropriate encoding mode. + * + * For each item which is an object, will be generated a segment with the given + * data and mode. + * Objects must contain at least the property "data". + * If property "mode" is not present, the more suitable mode will be used. + * + * @param {Array} array Array of objects with segments data + * @return {Array} Array of Segments + */ +exports.fromArray = function fromArray (array) { + return array.reduce(function (acc, seg) { + if (typeof seg === 'string') { + acc.push(buildSingleSegment(seg, null)) + } else if (seg.data) { + acc.push(buildSingleSegment(seg.data, seg.mode)) + } + + return acc + }, []) +} + +/** + * Builds an optimized sequence of segments from a string, + * which will produce the shortest possible bitstream. + * + * @param {String} data Input string + * @param {Number} version QR Code version + * @return {Array} Array of segments + */ +exports.fromString = function fromString (data, version) { + var segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled()) + + var nodes = buildNodes(segs) + var graph = buildGraph(nodes, version) + var path = dijkstra.find_path(graph.map, 'start', 'end') + + var optimizedSegs = [] + for (var i = 1; i < path.length - 1; i++) { + optimizedSegs.push(graph.table[path[i]].node) + } + + return exports.fromArray(mergeSegments(optimizedSegs)) +} + +/** + * Splits a string in various segments with the modes which + * best represent their content. + * The produced segments are far from being optimized. + * The output of this function is only used to estimate a QR Code version + * which may contain the data. + * + * @param {string} data Input string + * @return {Array} Array of segments + */ +exports.rawSplit = function rawSplit (data) { + return exports.fromArray( + getSegmentsFromString(data, Utils.isKanjiModeEnabled()) + ) +} + +},{"./alphanumeric-data":122,"./byte-data":125,"./kanji-data":131,"./mode":133,"./numeric-data":134,"./regex":138,"./utils":140,"dijkstrajs":20}],140:[function(require,module,exports){ +var toSJISFunction +var CODEWORDS_COUNT = [ + 0, // Not used + 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, + 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, + 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, + 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706 +] + +/** + * Returns the QR Code size for the specified version + * + * @param {Number} version QR Code version + * @return {Number} size of QR code + */ +exports.getSymbolSize = function getSymbolSize (version) { + if (!version) throw new Error('"version" cannot be null or undefined') + if (version < 1 || version > 40) throw new Error('"version" should be in range from 1 to 40') + return version * 4 + 17 +} + +/** + * Returns the total number of codewords used to store data and EC information. + * + * @param {Number} version QR Code version + * @return {Number} Data length in bits + */ +exports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) { + return CODEWORDS_COUNT[version] +} + +/** + * Encode data with Bose-Chaudhuri-Hocquenghem + * + * @param {Number} data Value to encode + * @return {Number} Encoded value + */ +exports.getBCHDigit = function (data) { + var digit = 0 + + while (data !== 0) { + digit++ + data >>>= 1 + } + + return digit +} + +exports.setToSJISFunction = function setToSJISFunction (f) { + if (typeof f !== 'function') { + throw new Error('"toSJISFunc" is not a valid function.') + } + + toSJISFunction = f +} + +exports.isKanjiModeEnabled = function () { + return typeof toSJISFunction !== 'undefined' +} + +exports.toSJIS = function toSJIS (kanji) { + return toSJISFunction(kanji) +} + +},{}],141:[function(require,module,exports){ +/** + * Check if QR Code version is valid + * + * @param {Number} version QR Code version + * @return {Boolean} true if valid version, false otherwise + */ +exports.isValid = function isValid (version) { + return !isNaN(version) && version >= 1 && version <= 40 +} + +},{}],142:[function(require,module,exports){ +var Utils = require('./utils') +var ECCode = require('./error-correction-code') +var ECLevel = require('./error-correction-level') +var Mode = require('./mode') +var VersionCheck = require('./version-check') +var isArray = require('isarray') + +// Generator polynomial used to encode version information +var G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0) +var G18_BCH = Utils.getBCHDigit(G18) + +function getBestVersionForDataLength (mode, length, errorCorrectionLevel) { + for (var currentVersion = 1; currentVersion <= 40; currentVersion++) { + if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) { + return currentVersion + } + } + + return undefined +} + +function getReservedBitsCount (mode, version) { + // Character count indicator + mode indicator bits + return Mode.getCharCountIndicator(mode, version) + 4 +} + +function getTotalBitsFromDataArray (segments, version) { + var totalBits = 0 + + segments.forEach(function (data) { + var reservedBits = getReservedBitsCount(data.mode, version) + totalBits += reservedBits + data.getBitsLength() + }) + + return totalBits +} + +function getBestVersionForMixedData (segments, errorCorrectionLevel) { + for (var currentVersion = 1; currentVersion <= 40; currentVersion++) { + var length = getTotalBitsFromDataArray(segments, currentVersion) + if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) { + return currentVersion + } + } + + return undefined +} + +/** + * Returns version number from a value. + * If value is not a valid version, returns defaultValue + * + * @param {Number|String} value QR Code version + * @param {Number} defaultValue Fallback value + * @return {Number} QR Code version number + */ +exports.from = function from (value, defaultValue) { + if (VersionCheck.isValid(value)) { + return parseInt(value, 10) + } + + return defaultValue +} + +/** + * Returns how much data can be stored with the specified QR code version + * and error correction level + * + * @param {Number} version QR Code version (1-40) + * @param {Number} errorCorrectionLevel Error correction level + * @param {Mode} mode Data mode + * @return {Number} Quantity of storable data + */ +exports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) { + if (!VersionCheck.isValid(version)) { + throw new Error('Invalid QR Code version') + } + + // Use Byte mode as default + if (typeof mode === 'undefined') mode = Mode.BYTE + + // Total codewords for this QR code version (Data + Error correction) + var totalCodewords = Utils.getSymbolTotalCodewords(version) + + // Total number of error correction codewords + var ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel) + + // Total number of data codewords + var dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8 + + if (mode === Mode.MIXED) return dataTotalCodewordsBits + + var usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version) + + // Return max number of storable codewords + switch (mode) { + case Mode.NUMERIC: + return Math.floor((usableBits / 10) * 3) + + case Mode.ALPHANUMERIC: + return Math.floor((usableBits / 11) * 2) + + case Mode.KANJI: + return Math.floor(usableBits / 13) + + case Mode.BYTE: + default: + return Math.floor(usableBits / 8) + } +} + +/** + * Returns the minimum version needed to contain the amount of data + * + * @param {Segment} data Segment of data + * @param {Number} [errorCorrectionLevel=H] Error correction level + * @param {Mode} mode Data mode + * @return {Number} QR Code version + */ +exports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) { + var seg + + var ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M) + + if (isArray(data)) { + if (data.length > 1) { + return getBestVersionForMixedData(data, ecl) + } + + if (data.length === 0) { + return 1 + } + + seg = data[0] + } else { + seg = data + } + + return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl) +} + +/** + * Returns version information with relative error correction bits + * + * The version information is included in QR Code symbols of version 7 or larger. + * It consists of an 18-bit sequence containing 6 data bits, + * with 12 error correction bits calculated using the (18, 6) Golay code. + * + * @param {Number} version QR Code version + * @return {Number} Encoded version info bits + */ +exports.getEncodedBits = function getEncodedBits (version) { + if (!VersionCheck.isValid(version) || version < 7) { + throw new Error('Invalid QR Code version') + } + + var d = version << 12 + + while (Utils.getBCHDigit(d) - G18_BCH >= 0) { + d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH)) + } + + return (version << 12) | d +} + +},{"./error-correction-code":126,"./error-correction-level":127,"./mode":133,"./utils":140,"./version-check":141,"isarray":147}],143:[function(require,module,exports){ +var Utils = require('./utils') + +function clearCanvas (ctx, canvas, size) { + ctx.clearRect(0, 0, canvas.width, canvas.height) + + if (!canvas.style) canvas.style = {} + canvas.height = size + canvas.width = size + canvas.style.height = size + 'px' + canvas.style.width = size + 'px' +} + +function getCanvasElement () { + try { + return document.createElement('canvas') + } catch (e) { + throw new Error('You need to specify a canvas element') + } +} + +exports.render = function render (qrData, canvas, options) { + var opts = options + var canvasEl = canvas + + if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) { + opts = canvas + canvas = undefined + } + + if (!canvas) { + canvasEl = getCanvasElement() + } + + opts = Utils.getOptions(opts) + var size = Utils.getImageWidth(qrData.modules.size, opts) + + var ctx = canvasEl.getContext('2d') + var image = ctx.createImageData(size, size) + Utils.qrToImageData(image.data, qrData, opts) + + clearCanvas(ctx, canvasEl, size) + ctx.putImageData(image, 0, 0) + + return canvasEl +} + +exports.renderToDataURL = function renderToDataURL (qrData, canvas, options) { + var opts = options + + if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) { + opts = canvas + canvas = undefined + } + + if (!opts) opts = {} + + var canvasEl = exports.render(qrData, canvas, opts) + + var type = opts.type || 'image/png' + var rendererOpts = opts.rendererOpts || {} + + return canvasEl.toDataURL(type, rendererOpts.quality) +} + +},{"./utils":145}],144:[function(require,module,exports){ +var Utils = require('./utils') + +function getColorAttrib (color, attrib) { + var alpha = color.a / 255 + var str = attrib + '="' + color.hex + '"' + + return alpha < 1 + ? str + ' ' + attrib + '-opacity="' + alpha.toFixed(2).slice(1) + '"' + : str +} + +function svgCmd (cmd, x, y) { + var str = cmd + x + if (typeof y !== 'undefined') str += ' ' + y + + return str +} + +function qrToPath (data, size, margin) { + var path = '' + var moveBy = 0 + var newRow = false + var lineLength = 0 + + for (var i = 0; i < data.length; i++) { + var col = Math.floor(i % size) + var row = Math.floor(i / size) + + if (!col && !newRow) newRow = true + + if (data[i]) { + lineLength++ + + if (!(i > 0 && col > 0 && data[i - 1])) { + path += newRow + ? svgCmd('M', col + margin, 0.5 + row + margin) + : svgCmd('m', moveBy, 0) + + moveBy = 0 + newRow = false + } + + if (!(col + 1 < size && data[i + 1])) { + path += svgCmd('h', lineLength) + lineLength = 0 + } + } else { + moveBy++ + } + } + + return path +} + +exports.render = function render (qrData, options, cb) { + var opts = Utils.getOptions(options) + var size = qrData.modules.size + var data = qrData.modules.data + var qrcodesize = size + opts.margin * 2 + + var bg = !opts.color.light.a + ? '' + : '' + + var path = + '' + + var viewBox = 'viewBox="' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '"' + + var width = !opts.width ? '' : 'width="' + opts.width + '" height="' + opts.width + '" ' + + var svgTag = '' + bg + path + '\n' + + if (typeof cb === 'function') { + cb(null, svgTag) + } + + return svgTag +} + +},{"./utils":145}],145:[function(require,module,exports){ +function hex2rgba (hex) { + if (typeof hex !== 'string') { + throw new Error('Color should be defined as hex string') + } + + var hexCode = hex.slice().replace('#', '').split('') + if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) { + throw new Error('Invalid hex color: ' + hex) + } + + // Convert from short to long form (fff -> ffffff) + if (hexCode.length === 3 || hexCode.length === 4) { + hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) { + return [c, c] + })) + } + + // Add default alpha value + if (hexCode.length === 6) hexCode.push('F', 'F') + + var hexValue = parseInt(hexCode.join(''), 16) + + return { + r: (hexValue >> 24) & 255, + g: (hexValue >> 16) & 255, + b: (hexValue >> 8) & 255, + a: hexValue & 255, + hex: '#' + hexCode.slice(0, 6).join('') + } +} + +exports.getOptions = function getOptions (options) { + if (!options) options = {} + if (!options.color) options.color = {} + + var margin = typeof options.margin === 'undefined' || + options.margin === null || + options.margin < 0 ? 4 : options.margin + + var width = options.width && options.width >= 21 ? options.width : undefined + var scale = options.scale || 4 + + return { + width: width, + scale: width ? 4 : scale, + margin: margin, + color: { + dark: hex2rgba(options.color.dark || '#000000ff'), + light: hex2rgba(options.color.light || '#ffffffff') + }, + type: options.type, + rendererOpts: options.rendererOpts || {} + } +} + +exports.getScale = function getScale (qrSize, opts) { + return opts.width && opts.width >= qrSize + opts.margin * 2 + ? opts.width / (qrSize + opts.margin * 2) + : opts.scale +} + +exports.getImageWidth = function getImageWidth (qrSize, opts) { + var scale = exports.getScale(qrSize, opts) + return Math.floor((qrSize + opts.margin * 2) * scale) +} + +exports.qrToImageData = function qrToImageData (imgData, qr, opts) { + var size = qr.modules.size + var data = qr.modules.data + var scale = exports.getScale(size, opts) + var symbolSize = Math.floor((size + opts.margin * 2) * scale) + var scaledMargin = opts.margin * scale + var palette = [opts.color.light, opts.color.dark] + + for (var i = 0; i < symbolSize; i++) { + for (var j = 0; j < symbolSize; j++) { + var posDst = (i * symbolSize + j) * 4 + var pxColor = opts.color.light + + if (i >= scaledMargin && j >= scaledMargin && + i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) { + var iSrc = Math.floor((i - scaledMargin) / scale) + var jSrc = Math.floor((j - scaledMargin) / scale) + pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0] + } + + imgData[posDst++] = pxColor.r + imgData[posDst++] = pxColor.g + imgData[posDst++] = pxColor.b + imgData[posDst] = pxColor.a + } + } +} + +},{}],146:[function(require,module,exports){ +/** + * Implementation of a subset of node.js Buffer methods for the browser. + * Based on https://github.com/feross/buffer + */ + +/* eslint-disable no-proto */ + +'use strict' + +var isArray = require('isarray') + +function typedArraySupport () { + // Can typed array instances be augmented? + try { + var arr = new Uint8Array(1) + arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }} + return arr.foo() === 42 + } catch (e) { + return false + } +} + +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +var K_MAX_LENGTH = Buffer.TYPED_ARRAY_SUPPORT + ? 0x7fffffff + : 0x3fffffff + +function Buffer (arg, offset, length) { + if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { + return new Buffer(arg, offset, length) + } + + if (typeof arg === 'number') { + return allocUnsafe(this, arg) + } + + return from(this, arg, offset, length) +} + +if (Buffer.TYPED_ARRAY_SUPPORT) { + Buffer.prototype.__proto__ = Uint8Array.prototype + Buffer.__proto__ = Uint8Array + + // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97 + if (typeof Symbol !== 'undefined' && Symbol.species && + Buffer[Symbol.species] === Buffer) { + Object.defineProperty(Buffer, Symbol.species, { + value: null, + configurable: true, + enumerable: false, + writable: false + }) + } +} + +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 +} + +function isnan (val) { + return val !== val // eslint-disable-line no-self-compare +} + +function createBuffer (that, length) { + var buf + if (Buffer.TYPED_ARRAY_SUPPORT) { + buf = new Uint8Array(length) + buf.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + buf = that + if (buf === null) { + buf = new Buffer(length) + } + buf.length = length + } + + return buf +} + +function allocUnsafe (that, size) { + var buf = createBuffer(that, size < 0 ? 0 : checked(size) | 0) + + if (!Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < size; ++i) { + buf[i] = 0 + } + } + + return buf +} + +function fromString (that, string) { + var length = byteLength(string) | 0 + var buf = createBuffer(that, length) + + var actual = buf.write(string) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } + + return buf +} + +function fromArrayLike (that, array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0 + var buf = createBuffer(that, length) + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf +} + +function fromArrayBuffer (that, array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('\'offset\' is out of bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('\'length\' is out of bounds') + } + + var buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } + + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Return an augmented `Uint8Array` instance, for best performance + buf.__proto__ = Buffer.prototype + } else { + // Fallback: Return an object instance of the Buffer class + buf = fromArrayLike(that, buf) + } + + return buf +} + +function fromObject (that, obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0 + var buf = createBuffer(that, len) + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len) + return buf + } + + if (obj) { + if ((typeof ArrayBuffer !== 'undefined' && + obj.buffer instanceof ArrayBuffer) || 'length' in obj) { + if (typeof obj.length !== 'number' || isnan(obj.length)) { + return createBuffer(that, 0) + } + return fromArrayLike(that, obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(that, obj.data) + } + } + + throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.') +} + +function utf8ToBytes (string, units) { + units = units || Infinity + var codePoint + var length = string.length + var leadSurrogate = null + var bytes = [] + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function byteLength (string) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && + (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + string = '' + string + } + + var len = string.length + if (len === 0) return 0 + + return utf8ToBytes(string).length +} + +function blitBuffer (src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function from (that, value, offset, length) { + if (typeof value === 'number') { + throw new TypeError('"value" argument must not be a number') + } + + if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) { + return fromArrayBuffer(that, value, offset, length) + } + + if (typeof value === 'string') { + return fromString(that, value, offset) + } + + return fromObject(that, value) +} + +Buffer.prototype.write = function write (string, offset, length) { + // Buffer#write(string) + if (offset === undefined) { + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + length = this.length + offset = 0 + // Buffer#write(string, offset[, length]) + } else if (isFinite(offset)) { + offset = offset | 0 + if (isFinite(length)) { + length = length | 0 + } else { + length = undefined + } + } + + var remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + return utf8Write(this, string, offset, length) +} + +Buffer.prototype.slice = function slice (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + var newBuf + if (Buffer.TYPED_ARRAY_SUPPORT) { + newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + newBuf.__proto__ = Buffer.prototype + } else { + var sliceLen = end - start + newBuf = new Buffer(sliceLen, undefined) + for (var i = 0; i < sliceLen; ++i) { + newBuf[i] = this[i + start] + } + } + + return newBuf +} + +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + var len = end - start + var i + + if (this === target && start < targetStart && targetStart < end) { + // descending copy from end + for (i = len - 1; i >= 0; --i) { + target[i + targetStart] = this[i + start] + } + } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + // ascending copy from start + for (i = 0; i < len; ++i) { + target[i + targetStart] = this[i + start] + } + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, start + len), + targetStart + ) + } + + return len +} + +Buffer.prototype.fill = function fill (val, start, end) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + start = 0 + end = this.length + } else if (typeof end === 'string') { + end = this.length + } + if (val.length === 1) { + var code = val.charCodeAt(0) + if (code < 256) { + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + var i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + var bytes = Buffer.isBuffer(val) + ? val + : new Buffer(val) + var len = bytes.length + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +Buffer.concat = function concat (list, length) { + if (!isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return createBuffer(null, 0) + } + + var i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + var buffer = allocUnsafe(null, length) + var pos = 0 + for (i = 0; i < list.length; ++i) { + var buf = list[i] + if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + buf.copy(buffer, pos) + pos += buf.length + } + return buffer +} + +Buffer.byteLength = byteLength + +Buffer.prototype._isBuffer = true +Buffer.isBuffer = function isBuffer (b) { + return !!(b != null && b._isBuffer) +} + +module.exports = Buffer + +},{"isarray":147}],147:[function(require,module,exports){ +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + +},{}],148:[function(require,module,exports){ module.exports = require('./lib/_stream_duplex.js'); -},{"./lib/_stream_duplex.js":119}],119:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":149}],149:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59001,7 +62367,7 @@ Duplex.prototype._destroy = function (err, cb) { pna.nextTick(cb, err); }; -},{"./_stream_readable":121,"./_stream_writable":123,"core-util-is":14,"inherits":70,"process-nextick-args":128}],120:[function(require,module,exports){ +},{"./_stream_readable":151,"./_stream_writable":153,"core-util-is":14,"inherits":71,"process-nextick-args":158}],150:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -59049,7 +62415,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":122,"core-util-is":14,"inherits":70}],121:[function(require,module,exports){ +},{"./_stream_transform":152,"core-util-is":14,"inherits":71}],151:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // @@ -60071,7 +63437,7 @@ function indexOf(xs, x) { return -1; } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./_stream_duplex":119,"./internal/streams/BufferList":124,"./internal/streams/destroy":125,"./internal/streams/stream":126,"_process":117,"core-util-is":14,"events":48,"inherits":70,"isarray":127,"process-nextick-args":128,"safe-buffer":134,"string_decoder/":129,"util":4}],122:[function(require,module,exports){ +},{"./_stream_duplex":149,"./internal/streams/BufferList":154,"./internal/streams/destroy":155,"./internal/streams/stream":156,"_process":118,"core-util-is":14,"events":49,"inherits":71,"isarray":157,"process-nextick-args":158,"safe-buffer":164,"string_decoder/":159,"util":4}],152:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -60286,7 +63652,7 @@ function done(stream, er, data) { return stream.push(null); } -},{"./_stream_duplex":119,"core-util-is":14,"inherits":70}],123:[function(require,module,exports){ +},{"./_stream_duplex":149,"core-util-is":14,"inherits":71}],153:[function(require,module,exports){ (function (process,global,setImmediate){ // Copyright Joyent, Inc. and other Node contributors. // @@ -60976,7 +64342,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("timers").setImmediate) -},{"./_stream_duplex":119,"./internal/streams/destroy":125,"./internal/streams/stream":126,"_process":117,"core-util-is":14,"inherits":70,"process-nextick-args":128,"safe-buffer":134,"timers":142,"util-deprecate":148}],124:[function(require,module,exports){ +},{"./_stream_duplex":149,"./internal/streams/destroy":155,"./internal/streams/stream":156,"_process":118,"core-util-is":14,"inherits":71,"process-nextick-args":158,"safe-buffer":164,"timers":172,"util-deprecate":178}],154:[function(require,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -61056,7 +64422,7 @@ if (util && util.inspect && util.inspect.custom) { return this.constructor.name + ' ' + obj; }; } -},{"safe-buffer":134,"util":4}],125:[function(require,module,exports){ +},{"safe-buffer":164,"util":4}],155:[function(require,module,exports){ 'use strict'; /**/ @@ -61131,17 +64497,12 @@ module.exports = { destroy: destroy, undestroy: undestroy }; -},{"process-nextick-args":128}],126:[function(require,module,exports){ +},{"process-nextick-args":158}],156:[function(require,module,exports){ module.exports = require('events').EventEmitter; -},{"events":48}],127:[function(require,module,exports){ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; - -},{}],128:[function(require,module,exports){ +},{"events":49}],157:[function(require,module,exports){ +arguments[4][147][0].apply(exports,arguments) +},{"dup":147}],158:[function(require,module,exports){ (function (process){ 'use strict'; @@ -61189,7 +64550,7 @@ function nextTick(fn, arg1, arg2, arg3) { }).call(this,require('_process')) -},{"_process":117}],129:[function(require,module,exports){ +},{"_process":118}],159:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -61486,10 +64847,10 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":134}],130:[function(require,module,exports){ +},{"safe-buffer":164}],160:[function(require,module,exports){ module.exports = require('./readable').PassThrough -},{"./readable":131}],131:[function(require,module,exports){ +},{"./readable":161}],161:[function(require,module,exports){ exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; @@ -61498,13 +64859,13 @@ exports.Duplex = require('./lib/_stream_duplex.js'); exports.Transform = require('./lib/_stream_transform.js'); exports.PassThrough = require('./lib/_stream_passthrough.js'); -},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123}],132:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":149,"./lib/_stream_passthrough.js":150,"./lib/_stream_readable.js":151,"./lib/_stream_transform.js":152,"./lib/_stream_writable.js":153}],162:[function(require,module,exports){ module.exports = require('./readable').Transform -},{"./readable":131}],133:[function(require,module,exports){ +},{"./readable":161}],163:[function(require,module,exports){ module.exports = require('./lib/_stream_writable.js'); -},{"./lib/_stream_writable.js":123}],134:[function(require,module,exports){ +},{"./lib/_stream_writable.js":153}],164:[function(require,module,exports){ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') var Buffer = buffer.Buffer @@ -61568,9 +64929,9 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":47}],135:[function(require,module,exports){ -arguments[4][67][0].apply(exports,arguments) -},{"./lib/decoder":136,"./lib/encoder":137,"dup":67}],136:[function(require,module,exports){ +},{"buffer":48}],165:[function(require,module,exports){ +arguments[4][68][0].apply(exports,arguments) +},{"./lib/decoder":166,"./lib/encoder":167,"dup":68}],166:[function(require,module,exports){ (function (Buffer){ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ @@ -62553,9 +65914,9 @@ function decode(jpegData) { } }).call(this,require("buffer").Buffer) -},{"buffer":47}],137:[function(require,module,exports){ -arguments[4][69][0].apply(exports,arguments) -},{"buffer":47,"dup":69}],138:[function(require,module,exports){ +},{"buffer":48}],167:[function(require,module,exports){ +arguments[4][70][0].apply(exports,arguments) +},{"buffer":48,"dup":70}],168:[function(require,module,exports){ (function (Buffer){ 'use strict' @@ -62700,7 +66061,7 @@ module.exports = function savePixels (array, type, options) { } }).call(this,require("buffer").Buffer) -},{"buffer":47,"contentstream":7,"gif-encoder":31,"jpeg-js":135,"ndarray":84,"ndarray-ops":81,"pngjs-nozlib":115,"through":141}],139:[function(require,module,exports){ +},{"buffer":48,"contentstream":7,"gif-encoder":32,"jpeg-js":165,"ndarray":85,"ndarray-ops":82,"pngjs-nozlib":116,"through":171}],169:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -62829,7 +66190,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":48,"inherits":70,"readable-stream/duplex.js":118,"readable-stream/passthrough.js":130,"readable-stream/readable.js":131,"readable-stream/transform.js":132,"readable-stream/writable.js":133}],140:[function(require,module,exports){ +},{"events":49,"inherits":71,"readable-stream/duplex.js":148,"readable-stream/passthrough.js":160,"readable-stream/readable.js":161,"readable-stream/transform.js":162,"readable-stream/writable.js":163}],170:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -63052,7 +66413,7 @@ function base64DetectIncompleteChar(buffer) { this.charLength = this.charReceived ? 3 : 0; } -},{"buffer":47}],141:[function(require,module,exports){ +},{"buffer":48}],171:[function(require,module,exports){ (function (process){ var Stream = require('stream') @@ -63164,7 +66525,7 @@ function through (write, end, opts) { }).call(this,require('_process')) -},{"_process":117,"stream":139}],142:[function(require,module,exports){ +},{"_process":118,"stream":169}],172:[function(require,module,exports){ (function (setImmediate,clearImmediate){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; @@ -63243,7 +66604,7 @@ exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : delete immediateIds[id]; }; }).call(this,require("timers").setImmediate,require("timers").clearImmediate) -},{"process/browser.js":117,"timers":142}],143:[function(require,module,exports){ +},{"process/browser.js":118,"timers":172}],173:[function(require,module,exports){ exports.isatty = function () { return false; }; function ReadStream() { @@ -63256,7 +66617,7 @@ function WriteStream() { } exports.WriteStream = WriteStream; -},{}],144:[function(require,module,exports){ +},{}],174:[function(require,module,exports){ (function (global,Buffer){ 'use strict' @@ -63473,7 +66834,7 @@ exports.clearCache = function clearCache() { } } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"bit-twiddle":2,"buffer":47,"dup":20}],145:[function(require,module,exports){ +},{"bit-twiddle":2,"buffer":48,"dup":21}],175:[function(require,module,exports){ // Underscore.js 1.4.4 // http://underscorejs.org // (c) 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. @@ -64701,7 +68062,7 @@ exports.clearCache = function clearCache() { }).call(this); -},{}],146:[function(require,module,exports){ +},{}],176:[function(require,module,exports){ "use strict" function unique_pred(list, compare) { @@ -64760,7 +68121,7 @@ function unique(list, compare, sorted) { module.exports = unique -},{}],147:[function(require,module,exports){ +},{}],177:[function(require,module,exports){ var mime = require('mime'); var fs = require('fs'); @@ -64770,7 +68131,7 @@ module.exports = function urifyNode (file) { return 'data:' + type + ';base64,' + data; }; -},{"fs":46,"mime":76}],148:[function(require,module,exports){ +},{"fs":47,"mime":77}],178:[function(require,module,exports){ (function (global){ /** @@ -64841,5108 +68202,5240 @@ function config (name) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],149:[function(require,module,exports){ -arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],150:[function(require,module,exports){ +},{}],179:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"./support/isBuffer":149,"_process":117,"dup":43,"inherits":70}],151:[function(require,module,exports){ -// add steps to the sequencer -function AddStep(_sequencer, image, name, o) { - return require('./InsertStep')(_sequencer,image,-1,name,o); -} -module.exports = AddStep; - -},{"./InsertStep":155}],152:[function(require,module,exports){ -var fs = require('fs'); -var getDirectories = function(rootDir, cb) { - fs.readdir(rootDir, function(err, files) { - var dirs = []; - if (typeof (files) == "undefined" || files.length == 0) { - cb(dirs); - return []; - } - for (var index = 0; index < files.length; ++index) { - var file = files[index]; - if (file[0] !== '.') { - var filePath = rootDir + '/' + file; - fs.stat(filePath, function(err, stat) { - if (stat.isDirectory()) { - dirs.push(this.file); - } - if (files.length === (this.index + 1)) { - return cb(dirs); - } - }.bind({ index: index, file: file })); - } - } - }); -} - -module.exports = function ExportBin(dir = "./output/", ref, basic, filename) { - - // If user did not give an output filename so we can continue without doing anything - dir = (dir[dir.length - 1] == "/") ? dir : dir + "/"; - if (ref.options.inBrowser) return false; - fs.access(dir, function(err) { - if (err) console.error(err) - }); - if (filename && basic) { - for (var image in ref.images) { - var steps = ref.images[image].steps; - var datauri = steps.slice(-1)[0].output.src; - var ext = steps.slice(-1)[0].output.format; - var buffer = require('data-uri-to-buffer')(datauri); - fs.writeFile(dir + filename, buffer, function() { }); - } - } - else { - getDirectories(dir, function(dirs) { - var num = 1; - for (var d in dirs) { - if (dirs[d].match(/^sequencer(.*)$/) == null) continue; - var n = parseInt(dirs[d].match(/^sequencer(.*)$/)[1]); - num = (n >= num) ? (n + 1) : num; - } - fs.mkdir(dir + 'sequencer' + num, function() { - var root = dir + 'sequencer' + num + '/'; - for (var image in ref.images) { - var steps = ref.images[image].steps; - if (basic) { - var datauri = steps.slice(-1)[0].output.src; - var ext = steps.slice(-1)[0].output.format; - var buffer = require('data-uri-to-buffer')(datauri); - fs.writeFile(root + image + "_" + (steps.length - 1) + "." + ext, buffer, function() { }); - } - else { - for (var i in steps) { - var datauri = steps[i].output.src; - var ext = steps[i].output.format; - var buffer = require('data-uri-to-buffer')(datauri); - fs.writeFile(root + image + "_" + i + "." + ext, buffer, function() { }); - } - } - } - }); - }); - } -} - -},{"data-uri-to-buffer":19,"fs":46}],153:[function(require,module,exports){ -function objTypeOf(object){ - return Object.prototype.toString.call(object).split(" ")[1].slice(0,-1) -} - -function getPrimitive(object){ - return (objTypeOf(object)=='Array')?object[0]:object; -} - -function makeArray(input) { - return (objTypeOf(input)=="Array")?input:[input]; -} - -function copy(a) { - if (!typeof(a) == "object") return a; - if (objTypeOf(a) == "Array") return a.slice(); - if (objTypeOf(a) == "Object") { - var b = {}; - for (var v in a) { - b[v] = copy(a[v]); - } - return b; - } - return a; -} - -function formatInput(args,format,images) { - images = []; - for (var image in this.images) { - images.push(image); - } - var json_q = {}; - var format_i = format; - if (format == "+") - format = ['o_string_a', 'string_a', 'o_object']; - else if (format == "-") - format = ['o_string_a', 'number_a']; - else if (format == "^") - format = ['o_string_a', 'number', 'string', 'o_object']; - else if (format == "r") - format = ['o_string_a', 'o_number']; - else if (format == "l") - format = ['o_string','string','o_function']; - - /* - formats: - addSteps :: o_image_a, name_a, o_o - o_string_a, string_a, o_object => { image: [{name,o}] } - removeSteps :: o_image_a, index_a - o_string_a, number_a => { image: [index] } - insertSteps :: o_image_a, index, name, o_o - o_string_a, number, string, o_object => { image: [{index,name,o}] } - run :: o_image_a, o_from - o_string_a, o_number => { image: index } - loadImages :: image, src, o_function - string, string, o_function => { images: [{image:src}], callback } - - optionals: - image: o_string_a - options: o_object - from: o_number - callback: o_function - */ - - if(format[format.length-1] == "o_object") { - if(objTypeOf(args[args.length-1]) != "Object") - args.push({}); - } - else if (format[format.length-1] == "o_number") { - if(typeof(args[args.length-1]) != "number" && objTypeOf(args[0])!="Object") - args.push(1); - } - else if (format[format.length-1] == "o_function") { - if(objTypeOf(args[args.length-1]) != "Function" && objTypeOf(args[0])!="Object") - args.push(function(){}); - } - - if(format[0] == "o_string_a") { - if(args.length == format.length - 1) { - var insert = false; - for (var i in args) { - if (format[parseInt(i)+1].includes( typeof(getPrimitive(args[i])) )){ - insert = true; - } - else {insert = false; break;} - } - if(insert) - args.splice(0,0,copy(images)); - } - } - else if (format[0] == "o_string" && format_i == "l" && args.length == 2) { - if (typeof(args[0]) == "string") { - var identifier = "image"; - var number = 1; - while (this.images.hasOwnProperty(identifier+number)) number++; - args.splice(0,0,identifier+number); - } - } - - if(args.length == format.length) { - for (var i in format) { - if (format[i].substr(format[i].length-2,2)=="_a") - args[i] = makeArray(args[i]); - } - } - - if (args.length == 1) { - json_q = copy(args[0]); - if(!(format_i == "r" || format_i == "l")) { - for (var img in json_q) - json_q[img] = makeArray(json_q[img]); - } - } - else if (format_i == "r") { - for (var img in args[0]) json_q[args[0][img]] = args[1]; - } - else if (format_i == "l") { - json_q = { - images: {}, - callback: args[2] - } - json_q.images[args[0]] = args[1]; - } - else { - for (var img in args[0]) { - var image = args[0][img]; - json_q[image] = []; - - if(format_i == "+") { - for(var s in args[1]) { - json_q[image].push({ - name: args[1][s], - o: args[2] - }); - } - } - - if(format_i == "-") { - json_q[image] = args[1]; - } - - if(format_i == "^") { - var size = this.images[image].steps.length; - var index = args[1]; - index = (index==size)?index:index%size; - if (index<0) index += size+1; - json_q[image].push({ - index: index, - name: args[2], - o: args[3] - }); - } - - } - } - - if(format_i == "l") { - json_q.loadedimages = []; - for (var i in json_q.images) json_q.loadedimages.push(i); - } - - return json_q; - -} -module.exports = formatInput; - -},{}],154:[function(require,module,exports){ -if (typeof window !== 'undefined') { isBrowser = true } -else { var isBrowser = false } -require('./util/getStep.js'); - -ImageSequencer = function ImageSequencer(options) { - - var sequencer = (this.name == "ImageSequencer") ? this : this.sequencer; - options = options || {}; - options.inBrowser = options.inBrowser === undefined ? isBrowser : options.inBrowser; - options.sequencerCounter = 0; - - function objTypeOf(object) { - return Object.prototype.toString.call(object).split(" ")[1].slice(0, -1) - } - - function log(color, msg) { - if (options.ui != "none") { - if (arguments.length == 1) console.log(arguments[0]); - else if (arguments.length == 2) console.log(color, msg); - } - } - - function copy(a) { - if (!typeof (a) == "object") return a; - if (objTypeOf(a) == "Array") return a.slice(); - if (objTypeOf(a) == "Object") { - var b = {}; - for (var v in a) { - b[v] = copy(a[v]); - } - return b; - } - return a; - } - - function makeArray(input) { - return (objTypeOf(input) == "Array") ? input : [input]; - } - - var image, - steps = [], - modules = require('./Modules'), - sequences = require('./SavedSequences.json'), - formatInput = require('./FormatInput'), - images = {}, - inputlog = [], - events = require('./ui/UserInterface')(), - fs = require('fs'); - - - - if (options.inBrowser) { - for (o in sequencer) { - modules[o] = sequencer[o]; - } - sequences = JSON.parse(window.localStorage.getItem('sequences')); - if (!sequences) { - sequences = {}; - window.localStorage.setItem('sequences', JSON.stringify(sequences)); - } - } - - // if in browser, prompt for an image - // if (options.imageSelect || options.inBrowser) addStep('image-select'); - // else if (options.imageUrl) loadImage(imageUrl); - - function addSteps() { - var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; - var args = (this.name == "ImageSequencer") ? [] : [this.images]; - var json_q = {}; - for (var arg in arguments) { args.push(copy(arguments[arg])); } - json_q = formatInput.call(this_, args, "+"); - - inputlog.push({ method: "addSteps", json_q: copy(json_q) }); - - for (var i in json_q) - for (var j in json_q[i]) - require("./AddStep")(this_, i, json_q[i][j].name, json_q[i][j].o); - - return this; - } - - function removeStep(image, index) { - //remove the step from images[image].steps and redraw remaining images - if (index > 0) { - thisStep = images[image].steps[index]; - thisStep.UI.onRemove(thisStep.options.step); - images[image].steps.splice(index, 1); - } - //tell the UI a step has been removed - } - - function removeSteps(image, index) { - var run = {}, indices; - var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; - var args = (this.name == "ImageSequencer") ? [] : [this.images]; - for (var arg in arguments) args.push(copy(arguments[arg])); - - var json_q = formatInput.call(this_, args, "-"); - inputlog.push({ method: "removeSteps", json_q: copy(json_q) }); - - for (var img in json_q) { - indices = json_q[img].sort(function(a, b) { return b - a }); - run[img] = indices[indices.length - 1]; - for (var i in indices) - removeStep(img, indices[i]); - } - // this.run(run); // This is creating problems - return this; - } - - function insertSteps(image, index, name, o) { - var run = {}; - var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; - var args = (this.name == "ImageSequencer") ? [] : [this.images]; - for (var arg in arguments) args.push(arguments[arg]); - - var json_q = formatInput.call(this_, args, "^"); - inputlog.push({ method: "insertSteps", json_q: copy(json_q) }); - - for (var img in json_q) { - var details = json_q[img]; - details = details.sort(function(a, b) { return b.index - a.index }); - for (var i in details) - require("./InsertStep")(this_, img, details[i].index, details[i].name, details[i].o); - run[img] = details[details.length - 1].index; - } - // this.run(run); // This is Creating issues - return this; - } - - // Config is an object which contains the runtime configuration like progress bar - // information and index from which the sequencer should run - function run(config, t_image, t_from) { - var progressObj, index = 0; - config = config || { mode: 'no-arg' }; - if (config.index) index = config.index; - - if (config.mode != 'test') { - if (config.mode != "no-arg" && typeof config != 'function') { - if (config.progressObj) progressObj = config.progressObj; - delete arguments['0']; - } - } - else { - arguments['0'] = config.mode; - } - - var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; - var args = (this.name == "ImageSequencer") ? [] : [this.images]; - for (var arg in arguments) args.push(copy(arguments[arg])); - - var callback = function() { }; - for (var arg in args) - if (objTypeOf(args[arg]) == "Function") - callback = args.splice(arg, 1)[0]; - - var json_q = formatInput.call(this_, args, "r"); - - require('./Run')(this_, json_q, callback, index, progressObj); - - return true; - } - - function loadImages() { - var args = []; - var sequencer = this; - for (var arg in arguments) args.push(copy(arguments[arg])); - var json_q = formatInput.call(this, args, "l"); - - inputlog.push({ method: "loadImages", json_q: copy(json_q) }); - var loadedimages = this.copy(json_q.loadedimages); - - var ret = { - name: "ImageSequencer Wrapper", - sequencer: this, - addSteps: this.addSteps, - removeSteps: this.removeSteps, - insertSteps: this.insertSteps, - run: this.run, - UI: this.UI, - setUI: this.setUI, - images: loadedimages - }; - - function load(i) { - if (i == loadedimages.length) { - json_q.callback.call(ret); - return; - } - var img = loadedimages[i]; - require('./ui/LoadImage')(sequencer, img, json_q.images[img], function() { - load(++i); - }); - } - - load(0); - } - - function replaceImage(selector, steps, options) { - options = options || {}; - options.callback = options.callback || function() { }; - return require('./ReplaceImage')(this, selector, steps, options); - } - - //returns the steps added - function getSteps(){ - var steps; - if(arguments[0]) - steps= this.images.test.steps; - else - steps = this.images.image1.steps; - return [...steps]; - } - - function setUI(UI) { - this.events = require('./ui/UserInterface')(UI); - } - - var exportBin = function(dir, basic, filename) { - return require('./ExportBin')(dir, this, basic, filename); - } - - function modulesInfo(name) { - var modulesdata = {} - if (name == "load-image") return {}; - if (arguments.length == 0) { - for (var modulename in this.modules) { - modulesdata[modulename] = modules[modulename][1]; - } - for (var sequencename in this.sequences) { - modulesdata[sequencename] = { name: sequencename, steps: this.sequences[sequencename] }; - } - } - else { - if (modules[name]) - modulesdata = modules[name][1]; - else - modulesdata = { 'inputs': sequences[name]['options'] }; - } - return modulesdata; - } - - // Genates a CLI string for the current sequence - function toCliString() { - var cliStringSteps = `"`, cliOptions = {}; - for (var step in this.steps) { - if (this.steps[step].options.name !== "load-image") - cliStringSteps += `${this.steps[step].options.name} `; - for (var inp in modulesInfo(this.steps[step].options.name).inputs) { - cliOptions[inp] = this.steps[step].options[inp]; - } - } - cliStringSteps = cliStringSteps.substr(0, cliStringSteps.length - 1) + `"`; - return `sequencer -i [PATH] -s ${cliStringSteps} -d '${JSON.stringify(cliOptions)}'` - } - - // Strigifies the current sequence - function toString(step) { - if (step) { - return stepToString(step); - } else { - return copy(this.images.image1.steps).map(stepToString).slice(1).join(','); - } - } - - // Stringifies one step of the sequence - function stepToString(step) { - let inputs = modulesInfo(step.options.name).inputs || {}, op = {}; - - for (let input in inputs) { - - if (!!step.options[input] && step.options[input] != inputs[input].default) { - op[input] = step.options[input]; - op[input] = encodeURIComponent(op[input]); - } - - } - - var configurations = Object.keys(op).map(key => key + ':' + op[key]).join('|'); - return `${step.options.name}{${configurations}}`; - } - - // exports the current sequence as an array of JSON steps - function toJSON() { - return this.stringToJSON(this.toString()); - } - - // Coverts stringified sequence into an array of JSON steps - function stringToJSON(str) { - let steps; - if (str.includes(',')) - steps = str.split(','); - else - steps = [str]; - return steps.map(stringToJSONstep); - } - - // Converts one stringified step into JSON - function stringToJSONstep(str) { - var bracesStrings; - if (str.includes('{')) - if (str.includes('(') && str.indexOf('(') < str.indexOf('{')) - bracesStrings = ['(', ')']; - else - bracesStrings = ['{', '}']; - else - bracesStrings = ['(', ')']; - - if (str.indexOf(bracesStrings[0]) === -1) { // if there are no settings specified - var moduleName = str.substr(0); - stepSettings = ""; - } else { - var moduleName = str.substr(0, str.indexOf(bracesStrings[0])); - stepSettings = str.slice(str.indexOf(bracesStrings[0]) + 1, -1); - } - - stepSettings = stepSettings.split('|').reduce(function formatSettings(accumulator, current, i) { - var settingName = current.substr(0, current.indexOf(':')), - settingValue = current.substr(current.indexOf(':') + 1); - settingValue = settingValue.replace(/^\(/, '').replace(/\)$/, ''); // strip () at start/end - settingValue = settingValue.replace(/^\{/, '').replace(/\}$/, ''); // strip {} at start/end - settingValue = decodeURIComponent(settingValue); - current = [ - settingName, - settingValue - ]; - if (!!settingName) accumulator[settingName] = settingValue; - return accumulator; - }, {}); - - return { - name: moduleName, - options: stepSettings - } - } - - // imports a string into the sequencer steps - function importString(str) { - let sequencer = this; - if (this.name != "ImageSequencer") - sequencer = this.sequencer; - var stepsFromString = stringToJSON(str); - stepsFromString.forEach(function eachStep(stepObj) { - sequencer.addSteps(stepObj.name, stepObj.options); - }); - } - - // imports a array of JSON steps into the sequencer steps - function importJSON(obj) { - let sequencer = this; - if (this.name != "ImageSequencer") - sequencer = this.sequencer; - obj.forEach(function eachStep(stepObj) { - sequencer.addSteps(stepObj.name, stepObj.options); - }); - } - - function loadNewModule(name, options) { - - if (!options) { - return this; - - } else if (Array.isArray(options)) { - // contains the array of module and info - this.modules[name] = options; - - } else if (options.func && options.info) { - // passed in options object - this.modules[name] = [ - options.func, options.info - ]; - - } else if (options.path && !this.inBrowser) { - // load from path(only in node) - const module = [ - require(`${options.path}/Module.js`), - require(`${options.path}/info.json`) - ]; - this.modules[name] = module; - } - return this; - } - - function saveNewModule(name, path) { - if (options.inBrowser) { - // Not for browser context - return; - } - var mods = fs.readFileSync('./src/Modules.js').toString(); - mods = mods.substr(0, mods.length - 1) + " '" + name + "': require('" + path + "'),\n}"; - fs.writeFileSync('./src/Modules.js', mods); - } - - function saveSequence(name, sequenceString) { - const sequence = stringToJSON(sequenceString); - // Save the given sequence string as a module - if (options.inBrowser) { - // Inside the browser we save the meta-modules using the Web Storage API - var sequences = JSON.parse(window.localStorage.getItem('sequences')); - sequences[name] = sequence; - window.localStorage.setItem('sequences', JSON.stringify(sequences)); - } - else { - // In node we save the sequences in the json file SavedSequences.json - var sequences = require('./SavedSequences.json'); - sequences[name] = sequence; - fs.writeFileSync('./src/SavedSequences.json', JSON.stringify(sequences)); - } - } - - function loadModules() { - // This function loads the modules and saved sequences - this.modules = require('./Modules'); - if (options.inBrowser) - this.sequences = JSON.parse(window.localStorage.getItem('sequences')); - else - this.sequences = require('./SavedSequences.json'); - } - - return { - //literals and objects - name: "ImageSequencer", - options: options, - inputlog: inputlog, - modules: modules, - sequences: sequences, - images: images, - events: events, - - //user functions - loadImages: loadImages, - loadImage: loadImages, - addSteps: addSteps, - removeSteps: removeSteps, - insertSteps: insertSteps, - replaceImage: replaceImage, - run: run, - setUI: setUI, - exportBin: exportBin, - modulesInfo: modulesInfo, - toCliString: toCliString, - toString: toString, - stepToString: stepToString, - toJSON: toJSON, - stringToJSON: stringToJSON, - stringToJSONstep: stringToJSONstep, - importString: importString, - importJSON: importJSON, - loadNewModule: loadNewModule, - saveNewModule: saveNewModule, - createMetaModule: require('./util/createMetaModule'), - saveSequence: saveSequence, - loadModules: loadModules, - getSteps:getSteps, - - //other functions - log: log, - objTypeOf: objTypeOf, - copy: copy, - - setInputStep: require('./ui/SetInputStep')(sequencer) - } - -} -module.exports = ImageSequencer; - -},{"./AddStep":151,"./ExportBin":152,"./FormatInput":153,"./InsertStep":155,"./Modules":156,"./ReplaceImage":157,"./Run":158,"./SavedSequences.json":160,"./ui/LoadImage":265,"./ui/SetInputStep":266,"./ui/UserInterface":267,"./util/createMetaModule":270,"./util/getStep.js":272,"fs":46}],155:[function(require,module,exports){ -const getStepUtils = require('./util/getStep.js'); - -// insert one or more steps at a given index in the sequencer -function InsertStep(ref, image, index, name, o) { - if (ref.sequences[name]) { - return ref.importJSON(ref.sequences[name]); - } - - function insertStep(image, index, name, o_) { - if (ref.modules[name]) var moduleInfo = ref.modules[name][1]; - else { - console.log('Module ' + name + ' not found.'); - } - - var o = ref.copy(o_); - o.number = ref.options.sequencerCounter++; //Gives a Unique ID to each step - o.name = o_.name || name || moduleInfo.name; - o.description = o_.description || moduleInfo.description; - o.selector = o_.selector || 'ismod-' + name; - o.container = o_.container || ref.options.selector; - o.image = image; - o.inBrowser = ref.options.inBrowser; - - if (index == -1) index = ref.images[image].steps.length; - - o.step = { - name: o.name, - description: o.description, - ID: o.number, - imageName: o.image, - inBrowser: ref.options.inBrowser, - ui: ref.options.ui, - options: o - }; - var UI = ref.events; - - // define the expandSteps function for sequencer - ref.modules[name].expandSteps = function expandSteps(stepsArray) { - for (var i in stepsArray) { - let step = stepsArray[i]; - ref.insertSteps(index + Number.parseInt(i), step['name'], step['options']); - // ref.addSteps(step['name'], step['options']); - } - } - - // Tell UI that a step has been set up. - o = o || {}; - - if (!ref.modules[name][1].length) { - UI.onSetup(o.step, { index: index }); - ref.images[image].steps.splice(index, 0, ref.modules[name][0](o, UI)); - } else { - ref.modules[name][0](o, UI); - } - - return true; - } - - insertStep(image, index, name, o); - ref.steps = ref.images[image].steps; - -} -module.exports = InsertStep; - -},{"./util/getStep.js":272}],156:[function(require,module,exports){ -/* -* Core modules and their info files -*/ -module.exports = { - 'average': require('./modules/Average'), - 'blend': require('./modules/Blend'), - 'blur': require('./modules/Blur'), - 'brightness': require('./modules/Brightness'), - 'channel': require('./modules/Channel'), - 'colorbar': require('./modules/Colorbar'), - 'colormap': require('./modules/Colormap'), - 'contrast': require('./modules/Contrast'), - 'convolution': require('./modules/Convolution'), - 'crop': require('./modules/Crop'), - 'decode-qr': require('./modules/DecodeQr'), - 'dither': require('./modules/Dither'), - 'draw-rectangle': require('./modules/DrawRectangle'), - 'dynamic': require('./modules/Dynamic'), - 'edge-detect': require('./modules/EdgeDetect'), - 'fisheye-gl': require('./modules/FisheyeGl'), - 'histogram': require('./modules/Histogram'), - 'gamma-correction': require('./modules/GammaCorrection'), - 'gradient': require('./modules/Gradient'), - 'import-image': require('./modules/ImportImage'), - 'invert': require('image-sequencer-invert'), - 'ndvi': require('./modules/Ndvi'), - 'ndvi-colormap': require('./modules/NdviColormap'), - 'paint-bucket': require('./modules/PaintBucket'), - 'overlay': require('./modules/Overlay'), - 'resize': require('./modules/Resize'), - 'rotate': require('./modules/Rotate'), - 'saturation': require('./modules/Saturation'), - 'threshold': require('./modules/Threshold'), - 'tint': require('./modules/Tint'), - 'white-balance': require('./modules/WhiteBalance') -} - -},{"./modules/Average":162,"./modules/Blend":165,"./modules/Blur":169,"./modules/Brightness":172,"./modules/Channel":175,"./modules/Colorbar":178,"./modules/Colormap":182,"./modules/Contrast":186,"./modules/Convolution":190,"./modules/Crop":195,"./modules/DecodeQr":198,"./modules/Dither":202,"./modules/DrawRectangle":206,"./modules/Dynamic":209,"./modules/EdgeDetect":213,"./modules/FisheyeGl":216,"./modules/GammaCorrection":219,"./modules/Gradient":222,"./modules/Histogram":225,"./modules/ImportImage":229,"./modules/Ndvi":236,"./modules/NdviColormap":232,"./modules/Overlay":239,"./modules/PaintBucket":243,"./modules/Resize":246,"./modules/Rotate":249,"./modules/Saturation":252,"./modules/Threshold":256,"./modules/Tint":259,"./modules/WhiteBalance":262,"image-sequencer-invert":61}],157:[function(require,module,exports){ -// Uses a given image as input and replaces it with the output. -// Works only in the browser. -function ReplaceImage(ref,selector,steps,options) { - if(!ref.options.inBrowser) return false; // This isn't for Node.js - var tempSequencer = ImageSequencer({ui: false}); - var this_ = ref; - if (window.hasOwnProperty('$')) var input = $(selector); - else var input = document.querySelectorAll(selector); - var images = []; - for (var i = 0; i < input.length; i++) { - if (input[i] instanceof HTMLImageElement) images.push(input[i]); - } - - function replaceImage (img, steps) { - var url = img.src; - // refactor to filetypeFromUrl() - var ext = url.split('?')[0].split('.').pop(); - - var xmlHTTP = new XMLHttpRequest(); - xmlHTTP.open('GET', url, true); - xmlHTTP.responseType = 'arraybuffer'; - xmlHTTP.onload = function(e) { - var arr = new Uint8Array(this.response); - - // in chunks to avoid "RangeError: Maximum call stack exceeded" - // https://github.com/publiclab/image-sequencer/issues/241 - // https://stackoverflow.com/a/20048852/1116657 - var raw = ''; - var i,j,subArray,chunk = 5000; - for (i=0,j=arr.length; i= ref.images[image].steps.length) return { options: { name: undefined } }; - else return ref.images[image].steps.slice(i + offset)[0]; - }; - step.getIndex = function getIndex() { - return i; - } - - for (var util in getStepUtils) { - if (getStepUtils.hasOwnProperty(util)) { - step[util] = getStepUtils[util]; - } - } - - // Tell UI that a step is being drawn. - step.UI.onDraw(step.options.step); - - // provides a set of standard tools for each step - var inputForNextStep = require('./RunToolkit')(ref.copy(input)); - - step.draw( - inputForNextStep, - function onEachStep() { - - // This output is accessible by UI - ref.images[image].steps[i].options.step.output = ref.images[image].steps[i].output.src; - - // Tell UI that step has been drawn. - ref.images[image].steps[i].UI.onComplete(ref.images[image].steps[i].options.step); - - drawStep(drawarray, ++pos); - }, - progressObj - ); - } - } - - function drawSteps(json_q) { - var drawarray = []; - for (var image in json_q) { - var no_steps = ref.images[image].steps.length; - var init = json_q[image]; - for (var i = 0; i < no_steps - init; i++) { - drawarray.push({ image: image, i: init + i }); - } - } - drawStep(drawarray, ind); - } - - function filter(json_q) { - for (var image in json_q) { - if (json_q[image] == 0 && ref.images[image].steps.length == 1) - delete json_q[image]; - else if (json_q[image] == 0) json_q[image]++; - } - for (var image in json_q) { - var prevstep = ref.images[image].steps[json_q[image] - 1]; - while ( - typeof prevstep == "undefined" || - typeof prevstep.output == "undefined" - ) { - prevstep = ref.images[image].steps[--json_q[image] - 1]; - } - } - return json_q; - } - - var json_q = filter(json_q); - return drawSteps(json_q); -} -module.exports = Run; - -},{"./RunToolkit":159,"./util/getStep.js":272}],159:[function(require,module,exports){ -const getPixels = require('get-pixels'); -const pixelManipulation = require('./modules/_nomodule/PixelManipulation'); -const lodash = require('lodash'); -const dataUriToBuffer = require('data-uri-to-buffer'); -const savePixels = require('save-pixels'); - -module.exports = function(input) { - input.getPixels = getPixels; - input.pixelManipulation = pixelManipulation; - input.lodash = lodash; - input.dataUriToBuffer = dataUriToBuffer; - input.savePixels = savePixels; - return input; +},{"dup":43}],180:[function(require,module,exports){ +arguments[4][44][0].apply(exports,arguments) +},{"./support/isBuffer":179,"_process":118,"dup":44,"inherits":71}],181:[function(require,module,exports){ +// add steps to the sequencer +function AddStep(_sequencer, image, name, o) { + return require('./InsertStep')(_sequencer,image,-1,name,o); } -},{"./modules/_nomodule/PixelManipulation":264,"data-uri-to-buffer":19,"get-pixels":29,"lodash":75,"save-pixels":138}],160:[function(require,module,exports){ -module.exports={"sample":[{"name":"invert","options":{}},{"name":"channel","options":{"channel":"red"}},{"name":"blur","options":{"blur":"5"}}]} -},{}],161:[function(require,module,exports){ -/* -* Average all pixel colors -*/ -module.exports = function Average(options, UI) { - - var output; - - options.step.metadata = options.step.metadata || {}; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - // do the averaging - function extraManipulation(pixels) { - var i = 0, sum = [0, 0, 0, 0]; - while (i < pixels.data.length) { - sum[0] += pixels.data[i++]; - sum[1] += pixels.data[i++]; - sum[2] += pixels.data[i++]; - sum[3] += pixels.data[i++]; - } - - let divisor = pixels.data.length / 4; - - sum[0] = Math.floor(sum[0] / divisor); - sum[1] = Math.floor(sum[1] / divisor); - sum[2] = Math.floor(sum[2] / divisor); - sum[3] = Math.floor(sum[3] / divisor); - - i = 0 - while (i < pixels.data.length) { - pixels.data[i++] = sum[0]; - pixels.data[i++] = sum[1]; - pixels.data[i++] = sum[2]; - pixels.data[i++] = sum[3]; - } - - // report back and store average in metadata: - options.step.metadata.averages = sum; - - // TODO: refactor into a new "display()" method as per https://github.com/publiclab/image-sequencer/issues/242 - if (options.step.inBrowser && options.step.ui) $(options.step.ui).find('.details').append("

Averages (r, g, b, a): " + sum.join(', ') + "

"); - return pixels; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { - src: datauri, - format: mimetype - }; - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = AddStep; -},{"../_nomodule/PixelManipulation.js":264}],162:[function(require,module,exports){ -module.exports = [ - require('./Module'), - require('./info.json') -] -},{"./Module":161,"./info.json":163}],163:[function(require,module,exports){ -module.exports={ - "name": "Average", - "description": "Average all pixel color", - "inputs": { - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} - -},{}],164:[function(require,module,exports){ -module.exports = function Dynamic(options, UI, util) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - options.func = options.func || defaults.blend; - options.offset = options.offset || defaults.offset; - - var output; - - // This function is called on every draw. - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - // convert to runnable code: - if (typeof options.func === "string") eval('options.func = ' + options.func); - - var getPixels = require('get-pixels'); - - // convert offset as string to int - if (typeof options.offset === "string") options.offset = parseInt(options.offset); - - // save first image's pixels - var priorStep = this.getStep(options.offset); - - if (priorStep.output === undefined) { - this.output = input; - UI.notify('Offset Unavailable', 'offset-notification'); - callback(); - } - - getPixels(priorStep.output.src, function(err, pixels) { - options.firstImagePixels = pixels; - - function changePixel(r2, g2, b2, a2, x, y) { - // blend! - let p = options.firstImagePixels; - return options.func( - r2, g2, b2, a2, - p.get(x, y, 0), - p.get(x, y, 1), - p.get(x, y, 2), - p.get(x, y, 3) - ) - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - // run PixelManipulatin on second image's pixels - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - }); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} - -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":166,"get-pixels":29}],165:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":164,"./info.json":166,"dup":162}],166:[function(require,module,exports){ -module.exports={ - "name": "Blend", - "description": "Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!", - "inputs": { - "offset": { - "type": "integer", - "desc": "Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.", - "default": -2 - }, - "blend": { - "type": "input", - "desc": "Function to use to blend the two images.", - "default": "function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} - -},{}],167:[function(require,module,exports){ -module.exports = exports = function(pixels, blur) { - let kernel = kernelGenerator(blur, 1), oldpix = require('lodash').cloneDeep(pixels); - kernel = flipKernel(kernel); - - for (let i = 0; i < pixels.shape[0]; i++) { - for (let j = 0; j < pixels.shape[1]; j++) { - let neighboutPos = getNeighbouringPixelPositions([i, j]); - let acc = [0.0, 0.0, 0.0, 0.0]; - for (let a = 0; a < kernel.length; a++) { - for (let b = 0; b < kernel.length; b++) { - acc[0] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 0) * kernel[a][b]); - acc[1] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 1) * kernel[a][b]); - acc[2] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 2) * kernel[a][b]); - acc[3] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 3) * kernel[a][b]); - } - } - pixels.set(i, j, 0, acc[0]); - pixels.set(i, j, 1, acc[1]); - pixels.set(i, j, 2, acc[2]); - } - } - return pixels; - - - - //Generates a 3x3 Gaussian kernel - function kernelGenerator(sigma, size) { - - /* - Trying out a variable radius kernel not working as of now - */ - // const coeff = (1.0/(2.0*Math.PI*sigma*sigma)) - // const expCoeff = -1 * (1.0/2.0 * sigma * sigma) - // let e = Math.E - // let result = [] - // for(let i = -1 * size;i<=size;i++){ - // let arr = [] - // for(let j= -1 * size;j<=size;j++){ - // arr.push(coeff * Math.pow(e,expCoeff * ((i * i) + (j*j)))) - // } - // result.push(arr) - // } - // let sum = result.reduce((sum,val)=>{ - // return val.reduce((sumInner,valInner)=>{ - // return sumInner+valInner - // }) - // }) - // result = result.map(arr=>arr.map(val=>(val + 0.0)/(sum + 0.0))) - - // return result - - return [ - [2.0 / 159.0, 4.0 / 159.0, 5.0 / 159.0, 4.0 / 159.0, 2.0 / 159.0], - [4.0 / 159.0, 9.0 / 159.0, 12.0 / 159.0, 9.0 / 159.0, 4.0 / 159.0], - [5.0 / 159.0, 12.0 / 159.0, 15.0 / 159.0, 12.0 / 159.0, 5.0 / 159.0], - [4.0 / 159.0, 9.0 / 159.0, 12.0 / 159.0, 9.0 / 159.0, 4.0 / 159.0], - [2.0 / 159.0, 4.0 / 159.0, 5.0 / 159.0, 4.0 / 159.0, 2.0 / 159.0] - ]; - } - function getNeighbouringPixelPositions(pixelPosition) { - let x = pixelPosition[0], y = pixelPosition[1], result = []; - - for (let i = -2; i <= 2; i++) { - let arr = []; - for (let j = -2; j <= 2; j++) - arr.push([x + i, y + j]); - - result.push(arr); - } - return result; - } - - function flipKernel(kernel) { - let result = []; - for (let i = kernel.length - 1; i >= 0; i--) { - let arr = []; - for (let j = kernel[i].length - 1; j >= 0; j--) { - arr.push(kernel[i][j]); - } - result.push(arr); - } - return result; - } +},{"./InsertStep":185}],182:[function(require,module,exports){ +var fs = require('fs'); +var getDirectories = function(rootDir, cb) { + fs.readdir(rootDir, function(err, files) { + var dirs = []; + if (typeof (files) == "undefined" || files.length == 0) { + cb(dirs); + return []; + } + for (var index = 0; index < files.length; ++index) { + var file = files[index]; + if (file[0] !== '.') { + var filePath = rootDir + '/' + file; + fs.stat(filePath, function(err, stat) { + if (stat.isDirectory()) { + dirs.push(this.file); + } + if (files.length === (this.index + 1)) { + return cb(dirs); + } + }.bind({ index: index, file: file })); + } + } + }); } -},{"lodash":75}],168:[function(require,module,exports){ -/* -* Blur an Image -*/ -module.exports = function Blur(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.blur = options.blur || defaults.blur; - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function extraManipulation(pixels) { - pixels = require('./Blur')(pixels, options.blur); - return pixels; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Blur":167,"./info.json":170}],169:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":168,"./info.json":170,"dup":162}],170:[function(require,module,exports){ -module.exports={ - "name": "Blur", - "description": "Applies a Gaussian blur given by the intensity value", - "inputs": { - "blur": { - "type": "range", - "desc": "Amount of gaussian blur(Less blur gives more detail, typically 0-5)", - "default": "2", - "min": "0", - "max": "5", - "step": "0.25" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +module.exports = function ExportBin(dir = "./output/", ref, basic, filename) { -},{}],171:[function(require,module,exports){ -/* -* Changes the Image Brightness -*/ -module.exports = function Brightness(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - var output; - - - - function draw(input, callback, progressObj) { - - options.brightness = parseInt(options.brightness) || defaults.brightness; - - progressObj.stop(true); - progressObj.overrideFlag = true; - - /* - In this case progress is handled by changepixel internally otherwise progressObj - needs to be overriden and used - For eg. progressObj = new SomeProgressModule() - */ - - var step = this, val = (options.brightness) / 100.0;; - - function changePixel(r, g, b, a) { - - r = Math.min(val * r, 255); - g = Math.min(val * g, 255); - b = Math.min(val * b, 255); - return [r, g, b, a]; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} - -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":173}],172:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":171,"./info.json":173,"dup":162}],173:[function(require,module,exports){ -module.exports={ - "name": "Brightness", - "description": "Change the brightness of the image by given percent value", - "inputs": { - "brightness": { - "type": "range", - "desc": "% brightness for the new image", - "default": "175", - "min": "0", - "max": "200", - "step": "1" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} - -},{}],174:[function(require,module,exports){ -/* - * Display only one color channel - */ -module.exports = function Channel(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - options.channel = options.channel || defaults.channel; - - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function changePixel(r, g, b, a) { - if (options.channel === "red") return [r, 0, 0, a]; - if (options.channel === "green") return [0, g, 0, a]; - if (options.channel === "blue") return [0, 0, b, a]; - } - - function output(image, datauri, mimetype) { - - // This output is accesible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - - return { - options: options, - //setup: setup, // optional - draw: draw, - output: output, - UI: UI - } -} - -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":176}],175:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":174,"./info.json":176,"dup":162}],176:[function(require,module,exports){ -module.exports={ - "name": "Channel", - "description": "Displays only one color channel of an image -- default is green", - "inputs": { - "channel": { - "type": "select", - "desc": "Color channel", - "default": "green", - "values": ["red", "green", "blue"] - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} - -},{}],177:[function(require,module,exports){ -module.exports = require('../../util/createMetaModule.js')( - function mapFunction(options) { - - // return steps with options: - return [ - { 'name': 'gradient', 'options': {} }, - { 'name': 'colormap', 'options': { colormap: options.colormap } }, - { 'name': 'crop', 'options': { 'y': 0, 'h': options.h } }, - { 'name': 'overlay', 'options': { 'x': options.x, 'y': options.y, 'offset': -4 } } - ]; - }, { - infoJson: require('./info.json') - } -)[0]; - -},{"../../util/createMetaModule.js":270,"./info.json":179}],178:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":177,"./info.json":179,"dup":162}],179:[function(require,module,exports){ -module.exports={ - "name": "Colorbar", - "description": "Generates a colorbar to lay over the image", - "inputs": { - "colormap": { - "type": "select", - "desc": "Name of the Colormap", - "default": "default", - "values": [ - "default", - "greyscale", - "stretched", - "fastie" - ] - }, - "x": { - "type": "integer", - "desc": "X-position of the image on which the new image is overlayed", - "default": 0 - }, - "y": { - "type": "integer", - "desc": "Y-position of the image on which the new image is overlayed", - "default": 0 - }, - "h": { - "type": "iinteger", - "desc": "height of the colorbar", - "default": 10 - } - }, - "docs-link": "https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" + // If user did not give an output filename so we can continue without doing anything + dir = (dir[dir.length - 1] == "/") ? dir : dir + "/"; + if (ref.options.inBrowser) return false; + fs.access(dir, function(err) { + if (err) console.error(err) + }); + if (filename && basic) { + for (var image in ref.images) { + var steps = ref.images[image].steps; + var datauri = steps.slice(-1)[0].output.src; + var ext = steps.slice(-1)[0].output.format; + var buffer = require('data-uri-to-buffer')(datauri); + fs.writeFile(dir + filename, buffer, function() { }); + } + } + else { + getDirectories(dir, function(dirs) { + var num = 1; + for (var d in dirs) { + if (dirs[d].match(/^sequencer(.*)$/) == null) continue; + var n = parseInt(dirs[d].match(/^sequencer(.*)$/)[1]); + num = (n >= num) ? (n + 1) : num; + } + fs.mkdir(dir + 'sequencer' + num, function() { + var root = dir + 'sequencer' + num + '/'; + for (var image in ref.images) { + var steps = ref.images[image].steps; + if (basic) { + var datauri = steps.slice(-1)[0].output.src; + var ext = steps.slice(-1)[0].output.format; + var buffer = require('data-uri-to-buffer')(datauri); + fs.writeFile(root + image + "_" + (steps.length - 1) + "." + ext, buffer, function() { }); + } + else { + for (var i in steps) { + var datauri = steps[i].output.src; + var ext = steps[i].output.format; + var buffer = require('data-uri-to-buffer')(datauri); + fs.writeFile(root + image + "_" + i + "." + ext, buffer, function() { }); + } + } + } + }); + }); + } } -},{}],180:[function(require,module,exports){ -/* - * Accepts a value from 0-255 and returns the new color-mapped pixel - * from a lookup table, which can be specified as an array of [begin, end] - * gradients, where begin and end are represented as [r, g, b] colors. In - * combination, a lookup table which maps values from 0 - 255 smoothly from black to white looks like: - * [ - * [0, [0, 0, 0], [255, 255, 255]], - * [1, [255, 255, 255], [255, 255, 255]] - * ] - * - * Adapted from bgamari's work in Infragram: https://github.com/p-v-o-s/infragram-js/commit/346c97576a07b71a55671d17e0153b7df74e803b - */ - -module.exports = function Colormap(value, options) { - options.colormap = options.colormap || colormaps.default; - // if a lookup table is provided as an array: - if(typeof(options.colormap) == "object") - colormapFunction = colormap(options.colormap); - // if a stored colormap is named with a string like "fastie": - else if(colormaps.hasOwnProperty(options.colormap)) - colormapFunction = colormaps[options.colormap]; - else colormapFunction = colormaps.default; - return colormapFunction(value / 255.00); -} - -function colormap(segments) { - return function(x) { - var i, result, x0, x1, xstart, y0, y1, _i, _j, _len, _ref, _ref1, _ref2, _ref3; - _ref = [0, 0], y0 = _ref[0], y1 = _ref[1]; - _ref1 = [segments[0][0], 1], x0 = _ref1[0], x1 = _ref1[1]; - if (x < x0) { - return y0; - } - for (i = _i = 0, _len = segments.length; _i < _len; i = ++_i) { - _ref2 = segments[i], xstart = _ref2[0], y0 = _ref2[1], y1 = _ref2[2]; - x0 = xstart; - if (i === segments.length - 1) { - x1 = 1; - break; - } - x1 = segments[i + 1][0]; - if ((xstart <= x && x < x1)) { - break; - } - } - result = []; - for (i = _j = 0, _ref3 = y0.length; 0 <= _ref3 ? _j < _ref3 : _j > _ref3; i = 0 <= _ref3 ? ++_j : --_j) { - result[i] = (x - x0) / (x1 - x0) * (y1[i] - y0[i]) + y0[i]; - } - return result; - }; -}; - -var colormaps = { - greyscale: colormap([ - [0, [0, 0, 0], [255, 255, 255] ], - [1, [255, 255, 255], [255, 255, 255] ] - ]), - - bluwhtgrngis: colormap([ - [0, [6,23,86], [6,25, 84] ], - [0.0625, [6,25,84], [6,25, 84] ],//1 - [0.125, [6,25,84], [6,25, 84] ],//2 - [0.1875, [6,25,84], [6,25, 84] ], - [0.25, [6,25,84], [6,25,84] ], - [0.3125, [6,25,84], [9,24, 84] ],//5 - [0.3438, [9,24, 84], [119,120,162] ],//5 - [0.375, [119,129,162],[249,250,251] ], //6 - [0.406, [249,250,251],[255,255,255] ], //6.5 - [0.4375, [255,255,255],[255,255,255] ], //7 white - [0.50, [255,255,255],[214,205,191] ],//8 - [0.52, [214,205,191],[178,175,96] ],//8.2 - [0.5625, [178,175,96], [151,176,53] ],//9 - [0.593, [151,176,53], [146,188,12] ],//9.5 - [0.625, [146,188,12], [96,161,1] ], //10 - [0.6875, [96,161,1], [30,127,3] ],//11 - [0.75, [30,127,3], [0,99,1] ],//12 - [0.8125, [0,99,1], [0,74,1] ],//13 - [0.875, [0,74,1], [0,52, 0] ],//14 - [0.9375, [0,52, 0], [0,34,0] ], //15 - [0.968, [0,34,0], [68,70,67] ] //16 - ]), - - - brntogrn: colormap([ - [0, [110,12,3], [118,6,1] ], - [0.0625, [118,6,1], [141,19,6] ], - [0.125, [141,19,6], [165,35,13] ], - [0.1875, [165,35,13], [177,59,25] ], - [0.2188, [177,59,25], [192,91,36] ], - [0.25, [192,91,36], [214, 145, 76] ], - [0.3125, [214,145,76], [230,183,134] ], - [0.375, [230,183,134],[243, 224, 194]], - [0.4375, [243,224,194],[250,252,229] ], - [0.50, [250,252,229],[217,235,185] ], - [0.5625, [217,235,185],[184,218,143] ], - [0.625, [184,218,143],[141,202,89] ], - [0.6875, [141,202,89], [80,176,61] ], - [0.75, [80,176,61], [0, 147, 32] ], - [0.8125, [0,147,32], [1, 122, 22] ], - [0.875, [1,122,22], [0, 114, 19] ], - [0.90, [0,114,19], [0,105,18] ], - [0.9375, [0,105,18], [7,70,14] ] - - ]), - - - blutoredjet: colormap([ - [0, [0,0,140], [1,1,186] ], - [0.0625, [1,1,186], [0,1,248] ], - [0.125, [0,1,248], [0,70,254] ], - [0.1875, [0,70,254], [0,130,255] ], - [0.25, [0,130,255], [2,160,255] ], - [0.2813, [2,160,255], [0,187,255] ], //inset - [0.3125, [0,187,255], [6,250,255] ], - // [0.348, [0,218,255], [8,252,251] ],//inset - [0.375, [8,252,251], [27,254,228] ], - [0.406, [27,254,228], [70,255,187] ], //insert - [0.4375, [70,255,187], [104,254,151]], - [0.47, [104,254,151],[132,255,19] ],//insert - [0.50, [132,255,19], [195,255,60] ], - [0.5625, [195,255,60], [231,254,25] ], - [0.5976, [231,254,25], [253,246,1] ],//insert - [0.625, [253,246,1], [252,210,1] ], //yellow - [0.657, [252,210,1], [255,183,0] ],//insert - [0.6875, [255,183,0], [255,125,2] ], - [0.75, [255,125,2], [255,65, 1] ], - [0.8125, [255,65, 1], [247, 1, 1] ], - [0.875, [247,1,1], [200, 1, 3] ], - [0.9375, [200,1,3], [122, 3, 2] ] - - ]), - - - colors16: colormap([ - [0, [0,0,0], [0,0,0] ], - [0.0625, [3,1,172], [3,1,172] ], - [0.125, [3,1,222], [3,1, 222] ], - [0.1875, [0,111,255], [0,111,255] ], - [0.25, [3,172,255], [3,172,255] ], - [0.3125, [1,226,255], [1,226,255] ], - [0.375, [2,255,0], [2,255,0] ], - [0.4375, [198,254,0], [190,254,0] ], - [0.50, [252,255,0], [252,255,0] ], - [0.5625, [255,223,3], [255,223,3] ], - [0.625, [255,143,3], [255,143,3] ], - [0.6875, [255,95,3], [255,95,3] ], - [0.75, [242,0,1], [242,0,1] ], - [0.8125, [245,0,170], [245,0,170] ], - [0.875, [223,180,225], [223,180,225] ], - [0.9375, [255,255,255], [255,255, 255]] - - ]), - - default: colormap([ - [0, [45,1,121], [25,1,137] ], - [0.125, [25,1,137], [0,6,156] ], - [0.1875, [0,6,156], [7,41,172] ], - [0.25, [7,41,172], [22,84,187] ], - [0.3125, [22,84,187], [25,125,194] ], - [0.375, [25,125,194], [26,177,197] ], - [0.4375, [26,177,197], [23,199,193] ], - [0.47, [23,199,193], [25, 200,170] ], - [0.50, [25, 200,170], [21,209,27] ], - [0.5625, [21,209,27], [108,215,18] ], - [0.625, [108,215,18], [166,218,19] ], - [0.6875, [166,218,19], [206,221,20] ], - [0.75, [206,221,20], [222,213,19 ] ], - [0.7813, [222,213,19], [222, 191, 19]], - [0.8125, [222, 191, 19], [227,133,17] ], - [0.875, [227,133,17], [231,83,16] ], - [0.9375, [231,83,16], [220,61,48] ] - - ]), - - - fastie: colormap([ - [0, [255, 255, 255], [0, 0, 0] ], - [0.167, [0, 0, 0], [255, 255, 255] ], - [0.33, [255, 255, 255], [0, 0, 0] ], - [0.5, [0, 0, 0], [140, 140, 255] ], - [0.55, [140, 140, 255], [0, 255, 0] ], - [0.63, [0, 255, 0], [255, 255, 0] ], - [0.75, [255, 255, 0], [255, 0, 0] ], - [0.95, [255, 0, 0], [255, 0, 255] ] - ]), - - - stretched: colormap([ - [0, [0, 0, 255], [0, 0, 255] ], - [0.1, [0, 0, 255], [38, 195, 195] ], - [0.5, [0, 150, 0], [255, 255, 0] ], - [0.7, [255, 255, 0], [255, 50, 50] ], - [0.9, [255, 50, 50], [255, 50, 50] ] - ]) - -} -},{}],181:[function(require,module,exports){ -module.exports = function Colormap(options, UI) { - - var output; - - // This function is called on every draw. - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function changePixel(r, g, b, a) { - var combined = (r + g + b) / 3.000; - var res = require('./Colormap')(combined, options); - return [res[0], res[1], res[2], 255]; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} -},{"../_nomodule/PixelManipulation.js":264,"./Colormap":180}],182:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":181,"./info.json":183,"dup":162}],183:[function(require,module,exports){ -module.exports={ - "name": "Colormap", - "description": "Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.", - "inputs": { - "colormap": { - "type": "select", - "desc": "Name of the Colormap", - "default": "default", - "values": ["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"] - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +},{"data-uri-to-buffer":19,"fs":47}],183:[function(require,module,exports){ +function objTypeOf(object){ + return Object.prototype.toString.call(object).split(" ")[1].slice(0,-1) +} + +function getPrimitive(object){ + return (objTypeOf(object)=='Array')?object[0]:object; +} + +function makeArray(input) { + return (objTypeOf(input)=="Array")?input:[input]; +} + +function copy(a) { + if (!typeof(a) == "object") return a; + if (objTypeOf(a) == "Array") return a.slice(); + if (objTypeOf(a) == "Object") { + var b = {}; + for (var v in a) { + b[v] = copy(a[v]); + } + return b; + } + return a; +} + +function formatInput(args,format,images) { + images = []; + for (var image in this.images) { + images.push(image); + } + var json_q = {}; + var format_i = format; + if (format == "+") + format = ['o_string_a', 'string_a', 'o_object']; + else if (format == "-") + format = ['o_string_a', 'number_a']; + else if (format == "^") + format = ['o_string_a', 'number', 'string', 'o_object']; + else if (format == "r") + format = ['o_string_a', 'o_number']; + else if (format == "l") + format = ['o_string','string','o_function']; + + /* + formats: + addSteps :: o_image_a, name_a, o_o + o_string_a, string_a, o_object => { image: [{name,o}] } + removeSteps :: o_image_a, index_a + o_string_a, number_a => { image: [index] } + insertSteps :: o_image_a, index, name, o_o + o_string_a, number, string, o_object => { image: [{index,name,o}] } + run :: o_image_a, o_from + o_string_a, o_number => { image: index } + loadImages :: image, src, o_function + string, string, o_function => { images: [{image:src}], callback } + + optionals: + image: o_string_a + options: o_object + from: o_number + callback: o_function + */ + + if(format[format.length-1] == "o_object") { + if(objTypeOf(args[args.length-1]) != "Object") + args.push({}); + } + else if (format[format.length-1] == "o_number") { + if(typeof(args[args.length-1]) != "number" && objTypeOf(args[0])!="Object") + args.push(1); + } + else if (format[format.length-1] == "o_function") { + if(objTypeOf(args[args.length-1]) != "Function" && objTypeOf(args[0])!="Object") + args.push(function(){}); + } + + if(format[0] == "o_string_a") { + if(args.length == format.length - 1) { + var insert = false; + for (var i in args) { + if (format[parseInt(i)+1].includes( typeof(getPrimitive(args[i])) )){ + insert = true; + } + else {insert = false; break;} + } + if(insert) + args.splice(0,0,copy(images)); + } + } + else if (format[0] == "o_string" && format_i == "l" && args.length == 2) { + if (typeof(args[0]) == "string") { + var identifier = "image"; + var number = 1; + while (this.images.hasOwnProperty(identifier+number)) number++; + args.splice(0,0,identifier+number); + } + } + + if(args.length == format.length) { + for (var i in format) { + if (format[i].substr(format[i].length-2,2)=="_a") + args[i] = makeArray(args[i]); + } + } + + if (args.length == 1) { + json_q = copy(args[0]); + if(!(format_i == "r" || format_i == "l")) { + for (var img in json_q) + json_q[img] = makeArray(json_q[img]); + } + } + else if (format_i == "r") { + for (var img in args[0]) json_q[args[0][img]] = args[1]; + } + else if (format_i == "l") { + json_q = { + images: {}, + callback: args[2] + } + json_q.images[args[0]] = args[1]; + } + else { + for (var img in args[0]) { + var image = args[0][img]; + json_q[image] = []; + + if(format_i == "+") { + for(var s in args[1]) { + json_q[image].push({ + name: args[1][s], + o: args[2] + }); + } + } + + if(format_i == "-") { + json_q[image] = args[1]; + } + + if(format_i == "^") { + var size = this.images[image].steps.length; + var index = args[1]; + index = (index==size)?index:index%size; + if (index<0) index += size+1; + json_q[image].push({ + index: index, + name: args[2], + o: args[3] + }); + } + + } + } + + if(format_i == "l") { + json_q.loadedimages = []; + for (var i in json_q.images) json_q.loadedimages.push(i); + } + + return json_q; + +} +module.exports = formatInput; },{}],184:[function(require,module,exports){ -var _ = require('lodash'); - -module.exports = exports = function(pixels, contrast) { - let oldpix = _.cloneDeep(pixels); - contrast = Number(contrast) - if (contrast < -100) contrast = -100; - if (contrast > 100) contrast = 100; - contrast = (100.0 + contrast) / 100.0; - contrast *= contrast; - - for (let i = 0; i < pixels.shape[0]; i++) { - for (let j = 0; j < pixels.shape[1]; j++) { - var r = oldpix.get(i, j, 0) / 255.0; - r -= 0.5; - r *= contrast; - r += 0.5; - r *= 255; - if (r < 0) r = 0; - if (r > 255) r = 255; - - - var g = oldpix.get(i, j, 1) / 255.0; - g -= 0.5; - g *= contrast; - g += 0.5; - g *= 255; - if (g < 0) g = 0; - if (g > 255) g = 255; - - - var b = oldpix.get(i, j, 2) / 255.0; - b -= 0.5; - b *= contrast; - b += 0.5; - b *= 255; - if (b < 0) b = 0; - if (b > 255) b = 255; - - - pixels.set(i, j, 0, r); - pixels.set(i, j, 1, g); - pixels.set(i, j, 2, b); - - } - } - return pixels; -} -},{"lodash":75}],185:[function(require,module,exports){ -// /* -// * Changes the Image Contrast -// */ - -module.exports = function Contrast(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.contrast = options.contrast || defaults.contrast; - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function extraManipulation(pixels) { - pixels = require('./Contrast')(pixels, options.contrast) - return pixels - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +if (typeof window !== 'undefined') { isBrowser = true } +else { var isBrowser = false } +require('./util/getStep.js'); -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Contrast":184,"./info.json":187}],186:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":185,"./info.json":187,"dup":162}],187:[function(require,module,exports){ -module.exports={ - "name": "Contrast", - "description": "Change the contrast of the image by given value", - "inputs": { - "contrast": { - "type": "range", - "desc": "contrast for the new image, typically -100 to 100", - "default": "70", - "min": "-100", - "max": "100", - "step": "1" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +ImageSequencer = function ImageSequencer(options) { + + var sequencer = (this.name == "ImageSequencer") ? this : this.sequencer; + options = options || {}; + options.inBrowser = options.inBrowser === undefined ? isBrowser : options.inBrowser; + options.sequencerCounter = 0; + + function objTypeOf(object) { + return Object.prototype.toString.call(object).split(" ")[1].slice(0, -1) + } + + function log(color, msg) { + if (options.ui != "none") { + if (arguments.length == 1) console.log(arguments[0]); + else if (arguments.length == 2) console.log(color, msg); + } + } + + function copy(a) { + if (!typeof (a) == "object") return a; + if (objTypeOf(a) == "Array") return a.slice(); + if (objTypeOf(a) == "Object") { + var b = {}; + for (var v in a) { + b[v] = copy(a[v]); + } + return b; + } + return a; + } + + function makeArray(input) { + return (objTypeOf(input) == "Array") ? input : [input]; + } + + var image, + steps = [], + modules = require('./Modules'), + sequences = require('./SavedSequences.json'), + formatInput = require('./FormatInput'), + images = {}, + inputlog = [], + events = require('./ui/UserInterface')(), + fs = require('fs'); + + + + if (options.inBrowser) { + for (o in sequencer) { + modules[o] = sequencer[o]; + } + sequences = JSON.parse(window.localStorage.getItem('sequences')); + if (!sequences) { + sequences = {}; + window.localStorage.setItem('sequences', JSON.stringify(sequences)); + } + } + + // if in browser, prompt for an image + // if (options.imageSelect || options.inBrowser) addStep('image-select'); + // else if (options.imageUrl) loadImage(imageUrl); + + function addSteps() { + var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; + var args = (this.name == "ImageSequencer") ? [] : [this.images]; + var json_q = {}; + for (var arg in arguments) { args.push(copy(arguments[arg])); } + json_q = formatInput.call(this_, args, "+"); + + inputlog.push({ method: "addSteps", json_q: copy(json_q) }); + + for (var i in json_q) + for (var j in json_q[i]) + require("./AddStep")(this_, i, json_q[i][j].name, json_q[i][j].o); + + return this; + } + + function removeStep(image, index) { + //remove the step from images[image].steps and redraw remaining images + if (index > 0) { + thisStep = images[image].steps[index]; + thisStep.UI.onRemove(thisStep.options.step); + images[image].steps.splice(index, 1); + } + //tell the UI a step has been removed + } + + function removeSteps(image, index) { + var run = {}, indices; + var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; + var args = (this.name == "ImageSequencer") ? [] : [this.images]; + for (var arg in arguments) args.push(copy(arguments[arg])); + + var json_q = formatInput.call(this_, args, "-"); + inputlog.push({ method: "removeSteps", json_q: copy(json_q) }); + + for (var img in json_q) { + indices = json_q[img].sort(function(a, b) { return b - a }); + run[img] = indices[indices.length - 1]; + for (var i in indices) + removeStep(img, indices[i]); + } + // this.run(run); // This is creating problems + return this; + } + + function insertSteps(image, index, name, o) { + var run = {}; + var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; + var args = (this.name == "ImageSequencer") ? [] : [this.images]; + for (var arg in arguments) args.push(arguments[arg]); + + var json_q = formatInput.call(this_, args, "^"); + inputlog.push({ method: "insertSteps", json_q: copy(json_q) }); + + for (var img in json_q) { + var details = json_q[img]; + details = details.sort(function(a, b) { return b.index - a.index }); + for (var i in details) + require("./InsertStep")(this_, img, details[i].index, details[i].name, details[i].o); + run[img] = details[details.length - 1].index; + } + // this.run(run); // This is Creating issues + return this; + } + + // Config is an object which contains the runtime configuration like progress bar + // information and index from which the sequencer should run + function run(config, t_image, t_from) { + var progressObj, index = 0; + config = config || { mode: 'no-arg' }; + if (config.index) index = config.index; + + if (config.mode != 'test') { + if (config.mode != "no-arg" && typeof config != 'function') { + if (config.progressObj) progressObj = config.progressObj; + delete arguments['0']; + } + } + else { + arguments['0'] = config.mode; + } + + var this_ = (this.name == "ImageSequencer") ? this : this.sequencer; + var args = (this.name == "ImageSequencer") ? [] : [this.images]; + for (var arg in arguments) args.push(copy(arguments[arg])); + + var callback = function() { }; + for (var arg in args) + if (objTypeOf(args[arg]) == "Function") + callback = args.splice(arg, 1)[0]; + + var json_q = formatInput.call(this_, args, "r"); + + require('./Run')(this_, json_q, callback, index, progressObj); + + return true; + } + + function loadImages() { + var args = []; + var sequencer = this; + for (var arg in arguments) args.push(copy(arguments[arg])); + var json_q = formatInput.call(this, args, "l"); + + inputlog.push({ method: "loadImages", json_q: copy(json_q) }); + var loadedimages = this.copy(json_q.loadedimages); + + var ret = { + name: "ImageSequencer Wrapper", + sequencer: this, + addSteps: this.addSteps, + removeSteps: this.removeSteps, + insertSteps: this.insertSteps, + run: this.run, + UI: this.UI, + setUI: this.setUI, + images: loadedimages + }; + + function load(i) { + if (i == loadedimages.length) { + json_q.callback.call(ret); + return; + } + var img = loadedimages[i]; + require('./ui/LoadImage')(sequencer, img, json_q.images[img], function() { + load(++i); + }); + } + + load(0); + } + + function replaceImage(selector, steps, options) { + options = options || {}; + options.callback = options.callback || function() { }; + return require('./ReplaceImage')(this, selector, steps, options); + } + + //returns the steps added + function getSteps(){ + var steps; + if(arguments[0]) + steps= this.images.test.steps; + else + steps = this.images.image1.steps; + return [...steps]; + } + + function setUI(UI) { + this.events = require('./ui/UserInterface')(UI); + } + + var exportBin = function(dir, basic, filename) { + return require('./ExportBin')(dir, this, basic, filename); + } + + function modulesInfo(name) { + var modulesdata = {} + if (name == "load-image") return {}; + if (arguments.length == 0) { + for (var modulename in this.modules) { + modulesdata[modulename] = modules[modulename][1]; + } + for (var sequencename in this.sequences) { + modulesdata[sequencename] = { name: sequencename, steps: this.sequences[sequencename] }; + } + } + else { + if (modules[name]) + modulesdata = modules[name][1]; + else + modulesdata = { 'inputs': sequences[name]['options'] }; + } + return modulesdata; + } + + // Genates a CLI string for the current sequence + function toCliString() { + var cliStringSteps = `"`, cliOptions = {}; + for (var step in this.steps) { + if (this.steps[step].options.name !== "load-image") + cliStringSteps += `${this.steps[step].options.name} `; + for (var inp in modulesInfo(this.steps[step].options.name).inputs) { + cliOptions[inp] = this.steps[step].options[inp]; + } + } + cliStringSteps = cliStringSteps.substr(0, cliStringSteps.length - 1) + `"`; + return `sequencer -i [PATH] -s ${cliStringSteps} -d '${JSON.stringify(cliOptions)}'` + } + + // Strigifies the current sequence + function toString(step) { + if (step) { + return stepToString(step); + } else { + return copy(this.images.image1.steps).map(stepToString).slice(1).join(','); + } + } + + // Stringifies one step of the sequence + function stepToString(step) { + let inputs = modulesInfo(step.options.name).inputs || {}, op = {}; + + for (let input in inputs) { + + if (!!step.options[input] && step.options[input] != inputs[input].default) { + op[input] = step.options[input]; + op[input] = encodeURIComponent(op[input]); + } + + } + + var configurations = Object.keys(op).map(key => key + ':' + op[key]).join('|'); + return `${step.options.name}{${configurations}}`; + } + + // exports the current sequence as an array of JSON steps + function toJSON() { + return this.stringToJSON(this.toString()); + } + + // Coverts stringified sequence into an array of JSON steps + function stringToJSON(str) { + let steps; + if (str.includes(',')) + steps = str.split(','); + else + steps = [str]; + return steps.map(stringToJSONstep); + } + + // Converts one stringified step into JSON + function stringToJSONstep(str) { + var bracesStrings; + if (str.includes('{')) + if (str.includes('(') && str.indexOf('(') < str.indexOf('{')) + bracesStrings = ['(', ')']; + else + bracesStrings = ['{', '}']; + else + bracesStrings = ['(', ')']; + + if (str.indexOf(bracesStrings[0]) === -1) { // if there are no settings specified + var moduleName = str.substr(0); + stepSettings = ""; + } else { + var moduleName = str.substr(0, str.indexOf(bracesStrings[0])); + stepSettings = str.slice(str.indexOf(bracesStrings[0]) + 1, -1); + } + + stepSettings = stepSettings.split('|').reduce(function formatSettings(accumulator, current, i) { + var settingName = current.substr(0, current.indexOf(':')), + settingValue = current.substr(current.indexOf(':') + 1); + settingValue = settingValue.replace(/^\(/, '').replace(/\)$/, ''); // strip () at start/end + settingValue = settingValue.replace(/^\{/, '').replace(/\}$/, ''); // strip {} at start/end + settingValue = decodeURIComponent(settingValue); + current = [ + settingName, + settingValue + ]; + if (!!settingName) accumulator[settingName] = settingValue; + return accumulator; + }, {}); + + return { + name: moduleName, + options: stepSettings + } + } + + // imports a string into the sequencer steps + function importString(str) { + let sequencer = this; + if (this.name != "ImageSequencer") + sequencer = this.sequencer; + var stepsFromString = stringToJSON(str); + stepsFromString.forEach(function eachStep(stepObj) { + sequencer.addSteps(stepObj.name, stepObj.options); + }); + } + + // imports a array of JSON steps into the sequencer steps + function importJSON(obj) { + let sequencer = this; + if (this.name != "ImageSequencer") + sequencer = this.sequencer; + obj.forEach(function eachStep(stepObj) { + sequencer.addSteps(stepObj.name, stepObj.options); + }); + } + + function loadNewModule(name, options) { + + if (!options) { + return this; + + } else if (Array.isArray(options)) { + // contains the array of module and info + this.modules[name] = options; + + } else if (options.func && options.info) { + // passed in options object + this.modules[name] = [ + options.func, options.info + ]; + + } else if (options.path && !this.inBrowser) { + // load from path(only in node) + const module = [ + require(`${options.path}/Module.js`), + require(`${options.path}/info.json`) + ]; + this.modules[name] = module; + } + return this; + } + + function saveNewModule(name, path) { + if (options.inBrowser) { + // Not for browser context + return; + } + var mods = fs.readFileSync('./src/Modules.js').toString(); + mods = mods.substr(0, mods.length - 1) + " '" + name + "': require('" + path + "'),\n}"; + fs.writeFileSync('./src/Modules.js', mods); + } + + function saveSequence(name, sequenceString) { + const sequence = stringToJSON(sequenceString); + // Save the given sequence string as a module + if (options.inBrowser) { + // Inside the browser we save the meta-modules using the Web Storage API + var sequences = JSON.parse(window.localStorage.getItem('sequences')); + sequences[name] = sequence; + window.localStorage.setItem('sequences', JSON.stringify(sequences)); + } + else { + // In node we save the sequences in the json file SavedSequences.json + var sequences = require('./SavedSequences.json'); + sequences[name] = sequence; + fs.writeFileSync('./src/SavedSequences.json', JSON.stringify(sequences)); + } + } + + function loadModules() { + // This function loads the modules and saved sequences + this.modules = require('./Modules'); + if (options.inBrowser) + this.sequences = JSON.parse(window.localStorage.getItem('sequences')); + else + this.sequences = require('./SavedSequences.json'); + } + + return { + //literals and objects + name: "ImageSequencer", + options: options, + inputlog: inputlog, + modules: modules, + sequences: sequences, + images: images, + events: events, + + //user functions + loadImages: loadImages, + loadImage: loadImages, + addSteps: addSteps, + removeSteps: removeSteps, + insertSteps: insertSteps, + replaceImage: replaceImage, + run: run, + setUI: setUI, + exportBin: exportBin, + modulesInfo: modulesInfo, + toCliString: toCliString, + toString: toString, + stepToString: stepToString, + toJSON: toJSON, + stringToJSON: stringToJSON, + stringToJSONstep: stringToJSONstep, + importString: importString, + importJSON: importJSON, + loadNewModule: loadNewModule, + saveNewModule: saveNewModule, + createMetaModule: require('./util/createMetaModule'), + saveSequence: saveSequence, + loadModules: loadModules, + getSteps:getSteps, + + //other functions + log: log, + objTypeOf: objTypeOf, + copy: copy, + + setInputStep: require('./ui/SetInputStep')(sequencer) + } + +} +module.exports = ImageSequencer; + +},{"./AddStep":181,"./ExportBin":182,"./FormatInput":183,"./InsertStep":185,"./Modules":186,"./ReplaceImage":187,"./Run":188,"./SavedSequences.json":190,"./ui/LoadImage":299,"./ui/SetInputStep":300,"./ui/UserInterface":301,"./util/createMetaModule":304,"./util/getStep.js":306,"fs":47}],185:[function(require,module,exports){ +const getStepUtils = require('./util/getStep.js'); + +// insert one or more steps at a given index in the sequencer +function InsertStep(ref, image, index, name, o) { + if (ref.sequences[name]) { + return ref.importJSON(ref.sequences[name]); + } + + function insertStep(image, index, name, o_) { + if (ref.modules[name]) var moduleInfo = ref.modules[name][1]; + else { + console.log('Module ' + name + ' not found.'); + } + + var o = ref.copy(o_); + o.number = ref.options.sequencerCounter++; //Gives a Unique ID to each step + o.name = o_.name || name || moduleInfo.name; + o.description = o_.description || moduleInfo.description; + o.selector = o_.selector || 'ismod-' + name; + o.container = o_.container || ref.options.selector; + o.image = image; + o.inBrowser = ref.options.inBrowser; + + if (index == -1) index = ref.images[image].steps.length; + + o.step = { + name: o.name, + description: o.description, + ID: o.number, + imageName: o.image, + inBrowser: ref.options.inBrowser, + ui: ref.options.ui, + options: o + }; + var UI = ref.events; + + // define the expandSteps function for sequencer + ref.modules[name].expandSteps = function expandSteps(stepsArray) { + for (var i in stepsArray) { + let step = stepsArray[i]; + ref.insertSteps(index + Number.parseInt(i), step['name'], step['options']); + // ref.addSteps(step['name'], step['options']); + } + } + + // Tell UI that a step has been set up. + o = o || {}; + + if (!ref.modules[name][1].length) { + UI.onSetup(o.step, { index: index }); + ref.images[image].steps.splice(index, 0, ref.modules[name][0](o, UI)); + } else { + ref.modules[name][0](o, UI); + } + + return true; + } + + insertStep(image, index, name, o); + ref.steps = ref.images[image].steps; + +} +module.exports = InsertStep; + +},{"./util/getStep.js":306}],186:[function(require,module,exports){ +/* +* Core modules and their info files +*/ +module.exports = { + 'add-qr': require('./modules/AddQR'), + 'average': require('./modules/Average'), + 'blend': require('./modules/Blend'), + 'blur': require('./modules/Blur'), + 'brightness': require('./modules/Brightness'), + 'channel': require('./modules/Channel'), + 'colorbar': require('./modules/Colorbar'), + 'colormap': require('./modules/Colormap'), + 'contrast': require('./modules/Contrast'), + 'convolution': require('./modules/Convolution'), + 'crop': require('./modules/Crop'), + 'decode-qr': require('./modules/DecodeQr'), + 'dither': require('./modules/Dither'), + 'draw-rectangle': require('./modules/DrawRectangle'), + 'dynamic': require('./modules/Dynamic'), + 'edge-detect': require('./modules/EdgeDetect'), + 'fisheye-gl': require('./modules/FisheyeGl'), + 'histogram': require('./modules/Histogram'), + 'gamma-correction': require('./modules/GammaCorrection'), + 'gradient': require('./modules/Gradient'), + 'import-image': require('./modules/ImportImage'), + 'invert': require('image-sequencer-invert'), + 'ndvi': require('./modules/Ndvi'), + 'ndvi-colormap': require('./modules/NdviColormap'), + 'paint-bucket': require('./modules/PaintBucket'), + 'overlay': require('./modules/Overlay'), + 'resize': require('./modules/Resize'), + 'rotate': require('./modules/Rotate'), + 'saturation': require('./modules/Saturation'), + 'threshold': require('./modules/Threshold'), + 'tint': require('./modules/Tint'), + 'white-balance': require('./modules/WhiteBalance') +} + +},{"./modules/AddQR":193,"./modules/Average":196,"./modules/Blend":199,"./modules/Blur":203,"./modules/Brightness":206,"./modules/Channel":209,"./modules/Colorbar":212,"./modules/Colormap":216,"./modules/Contrast":220,"./modules/Convolution":224,"./modules/Crop":229,"./modules/DecodeQr":232,"./modules/Dither":236,"./modules/DrawRectangle":240,"./modules/Dynamic":243,"./modules/EdgeDetect":247,"./modules/FisheyeGl":250,"./modules/GammaCorrection":253,"./modules/Gradient":256,"./modules/Histogram":259,"./modules/ImportImage":263,"./modules/Ndvi":267,"./modules/NdviColormap":270,"./modules/Overlay":273,"./modules/PaintBucket":277,"./modules/Resize":280,"./modules/Rotate":283,"./modules/Saturation":286,"./modules/Threshold":290,"./modules/Tint":293,"./modules/WhiteBalance":296,"image-sequencer-invert":62}],187:[function(require,module,exports){ +// Uses a given image as input and replaces it with the output. +// Works only in the browser. +function ReplaceImage(ref,selector,steps,options) { + if(!ref.options.inBrowser) return false; // This isn't for Node.js + var tempSequencer = ImageSequencer({ui: false}); + var this_ = ref; + if (window.hasOwnProperty('$')) var input = $(selector); + else var input = document.querySelectorAll(selector); + var images = []; + for (var i = 0; i < input.length; i++) { + if (input[i] instanceof HTMLImageElement) images.push(input[i]); + } + + function replaceImage (img, steps) { + var url = img.src; + // refactor to filetypeFromUrl() + var ext = url.split('?')[0].split('.').pop(); + + var xmlHTTP = new XMLHttpRequest(); + xmlHTTP.open('GET', url, true); + xmlHTTP.responseType = 'arraybuffer'; + xmlHTTP.onload = function(e) { + var arr = new Uint8Array(this.response); + + // in chunks to avoid "RangeError: Maximum call stack exceeded" + // https://github.com/publiclab/image-sequencer/issues/241 + // https://stackoverflow.com/a/20048852/1116657 + var raw = ''; + var i,j,subArray,chunk = 5000; + for (i=0,j=arr.length; i= 0; i--) { - let arr = []; - for (let j = kernel[i].length - 1; j >= 0; j--) { - arr.push(kernel[i][j]); - } - result.push(arr); - } - return result; - } +const getStepUtils = require('./util/getStep.js'); + +function Run(ref, json_q, callback, ind, progressObj) { + if (!progressObj) progressObj = { stop: function() { } }; + + function drawStep(drawarray, pos) { + if (pos == drawarray.length && drawarray[pos - 1] !== undefined) { + var image = drawarray[pos - 1].image; + if (ref.objTypeOf(callback) == "Function" && ref.images[image].steps.slice(-1)[0].output) { + var steps = ref.images[image].steps; + var out = steps[steps.length - 1].output.src; + callback(out); + return true; + } + } + + // so we don't run on the loadImage module: + if (drawarray[pos] !== undefined) { + var image = drawarray[pos].image; + var i = drawarray[pos].i; + var input = ref.images[image].steps[i - 1].output; + var step = ref.images[image].steps[i]; + + step.getStep = function getStep(offset) { + if (i + offset >= ref.images[image].steps.length) return { options: { name: undefined } }; + else return ref.images[image].steps.slice(i + offset)[0]; + }; + step.getIndex = function getIndex() { + return i; + } + + for (var util in getStepUtils) { + if (getStepUtils.hasOwnProperty(util)) { + step[util] = getStepUtils[util]; + } + } + + // Tell UI that a step is being drawn. + step.UI.onDraw(step.options.step); + + // provides a set of standard tools for each step + var inputForNextStep = require('./RunToolkit')(ref.copy(input)); + + step.draw( + inputForNextStep, + function onEachStep() { + + // This output is accessible by UI + ref.images[image].steps[i].options.step.output = ref.images[image].steps[i].output.src; + + // Tell UI that step has been drawn. + ref.images[image].steps[i].UI.onComplete(ref.images[image].steps[i].options.step); + + drawStep(drawarray, ++pos); + }, + progressObj + ); + } + } + + function drawSteps(json_q) { + var drawarray = []; + for (var image in json_q) { + var no_steps = ref.images[image].steps.length; + var init = json_q[image]; + for (var i = 0; i < no_steps - init; i++) { + drawarray.push({ image: image, i: init + i }); + } + } + drawStep(drawarray, ind); + } + + function filter(json_q) { + for (var image in json_q) { + if (json_q[image] == 0 && ref.images[image].steps.length == 1) + delete json_q[image]; + else if (json_q[image] == 0) json_q[image]++; + } + for (var image in json_q) { + var prevstep = ref.images[image].steps[json_q[image] - 1]; + while ( + typeof prevstep == "undefined" || + typeof prevstep.output == "undefined" + ) { + prevstep = ref.images[image].steps[--json_q[image] - 1]; + } + } + return json_q; + } + + var json_q = filter(json_q); + return drawSteps(json_q); } -},{"lodash":75}],189:[function(require,module,exports){ -module.exports = function Convolution(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - options.kernelValues = options.kernelValues || defaults.kernelValues; - options.constantFactor = options.constantFactor || defaults.constantFactor; - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function extraManipulation(pixels) { - pixels = require('./Convolution')(pixels, options.constantFactor, options.kernelValues); - return pixels; - } - - function output(image, datauri, mimetype) { - - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = Run; -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Convolution":188,"./info.json":191}],190:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":189,"./info.json":191,"dup":162}],191:[function(require,module,exports){ -module.exports={ - "name": "Convolution", - "description": "Image Convolution using a given 3x3 kernel matrix Read more", - "inputs": { - "constantFactor":{ - "type": "Float", - "desc": "a constant factor, multiplies all the kernel values by that factor", - "default": 0.1111, - "placeholder": 0.1111 - }, - - "kernelValues": { - "type": "String", - "desc": "nine space separated numbers representing the kernel values in left to right and top to bottom format.", - "default": "1 1 1 1 1 1 1 1 1", - "placeholder": "1 1 1 1 1 1 1 1 1" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +},{"./RunToolkit":189,"./util/getStep.js":306}],189:[function(require,module,exports){ +const getPixels = require('get-pixels'); +const pixelManipulation = require('./modules/_nomodule/PixelManipulation'); +const lodash = require('lodash'); +const dataUriToBuffer = require('data-uri-to-buffer'); +const savePixels = require('save-pixels'); -},{}],192:[function(require,module,exports){ -(function (Buffer){ -module.exports = function Crop(input,options,callback) { - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - var getPixels = require('get-pixels'), - savePixels = require('save-pixels'); - - options.x = parseInt(options.x) || defaults.x; - options.y = parseInt(options.y) || defaults.y; - - getPixels(input.src,function(err,pixels){ - options.w = parseInt(options.w) || Math.floor(pixels.shape[0]); - options.h = parseInt(options.h) || Math.floor(pixels.shape[1]); - options.backgroundColor = options.backgroundColor || defaults.backgroundColor; - var ox = options.x; - var oy = options.y; - var w = options.w; - var h = options.h; - var iw = pixels.shape[0]; //Width of Original Image - var ih = pixels.shape[1]; //Height of Original Image - var backgroundArray = []; - backgroundColor = options.backgroundColor.split(" "); - for(var i = 0; i < w ; i++){ - backgroundArray = backgroundArray.concat([backgroundColor[0],backgroundColor[1],backgroundColor[2],backgroundColor[3]]); - } - var newarray = new Uint8Array(4*w*h); - for (var n = oy; n < oy + h; n++) { - if(n= xe && n >= ye) { + pixels.set(m, n, 0, qrPixels.get(m - xe, n - ye, 0)) + pixels.set(m, n, 1, qrPixels.get(m - xe, n - ye, 1)) + pixels.set(m, n, 2, qrPixels.get(m - xe, n - ye, 2)) + pixels.set(m, n, 3, qrPixels.get(m - xe, n - ye, 3)) + } + + else { + pixels.set(m, n, 0, oldPixels.get(m, n, 0)) + pixels.set(m, n, 1, oldPixels.get(m, n, 1)) + pixels.set(m, n, 2, oldPixels.get(m, n, 2)) + pixels.set(m, n, 3, oldPixels.get(m, n, 3)) + } + + } + } + callback(); + + }) + }) +} + +},{"get-pixels":30,"imagejs":63,"qrcode":119}],193:[function(require,module,exports){ +module.exports = [ + require('./Module'), + require('./info.json') +] +},{"./Module":191,"./info.json":194}],194:[function(require,module,exports){ +module.exports={ + "name": "Add QR", + "description": "Adds QR corresponding to the given string", + "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", + "inputs": { + "size": { + "type": "integer", + "desc": "size of QR code in pixels", + "default": 200 + }, + "qrCodeString":{ + "type": "string", + "desc": "input string to generate QR code", + "default": "https://github.com/publiclab/image-sequencer" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" + } + },{}],195:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":193,"./info.json":196,"dup":162}],196:[function(require,module,exports){ -module.exports={ - "name": "Crop", - "description": "Crop image to given x, y, w, h in pixels or % , measured from top left", - "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", - "inputs": { - "x": { - "type": "integer", - "desc": "X-position (measured from left) from where cropping starts", - "default": 0 - }, - "y": { - "type": "integer", - "desc": "Y-position (measured from top) from where cropping starts", - "default": 0 - }, - "w": { - "type": "integer", - "desc": "Width of crop", - "default": "(50%)" - }, - "h": { - "type": "integer", - "desc": "Height of crop", - "default": "(50%)" - }, - "backgroundColor": { - "type": "String", - "desc": "Background Color (Four space separated RGBA values)", - "default": "255 255 255 255", - "placeholder": "255 255 255 255" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +/* +* Average all pixel colors +*/ +module.exports = function Average(options, UI) { -},{}],197:[function(require,module,exports){ -/* - * Decodes QR from a given image. - */ -module.exports = function DoNothing(options,UI) { - - var output; - var jsQR = require('jsqr'); - var getPixels = require('get-pixels'); - - // This function is called everytime a step has to be redrawn - function draw(input,callback,progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - getPixels(input.src,function(err,pixels){ - - if(err) throw err; - - var w = pixels.shape[0]; - var h = pixels.shape[1]; - var decoded = jsQR(pixels.data,w,h); - - - // Tell Image Sequencer that this step is complete - options.step.qrval = (decoded)?decoded.data:"undefined"; - }); - - function output(image, datauri, mimetype){ - // This output is accessible by Image Sequencer - step.output = { - src: datauri, - format: mimetype - }; - } - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - format: input.format, - image: options.image, - callback: callback - }); - - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} + var output; -},{"../_nomodule/PixelManipulation.js":264,"get-pixels":29,"jsqr":74}],198:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":197,"./info.json":199,"dup":162}],199:[function(require,module,exports){ -module.exports={ - "name": "Decode QR", - "description": "Search for and decode a QR code in the image", - "inputs": { - }, - "outputs": { - "qrval": { - "type": "text" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} + options.step.metadata = options.step.metadata || {}; -},{}],200:[function(require,module,exports){ -module.exports = function Dither(pixels, type) { - type = type; - let bayerThresholdMap = [ - [15, 135, 45, 165], - [195, 75, 225, 105], - [60, 180, 30, 150], - [240, 120, 210, 90] - ]; - - let lumR = []; - let lumG = []; - let lumB = []; - for (let i = 0; i < 256; i++) { - lumR[i] = i * 0.299; - lumG[i] = i * 0.587; - lumB[i] = i * 0.114; - } - let threshold = 129; - let imageDataLength = pixels.data.length; //imageData.data.length; - - // Greyscale luminance (sets r pixels to luminance of rgb) - for (let i = 0; i <= imageDataLength; i++) { - pixels.data[i] = Math.floor(lumR[pixels.data[i++]] + lumG[pixels.data[i++]] + lumB[pixels.data[i++]]); - } - - let w = pixels.shape[0]; - let newPixel, err; - - for (let currentPixel = 0; currentPixel <= imageDataLength; currentPixel += 4) { - - if (type === "none") { - // No dithering - pixels.data[currentPixel] = pixels.data[currentPixel] < threshold ? 0 : 255; - - } else if (type === "bayer") { - - // 4x4 Bayer ordered dithering algorithm - let x = currentPixel / 4 % w; - let y = Math.floor(currentPixel / 4 / w); - let map = Math.floor((pixels.data[currentPixel] + bayerThresholdMap[x % 4][y % 4]) / 2); - pixels.data[currentPixel] = (map < threshold) ? 0 : 255; - - } else if (type === "floydsteinberg") { - - // Floyd–Steinberg dithering algorithm - newPixel = pixels.data[currentPixel] < 129 ? 0 : 255; - err = Math.floor((pixels.data[currentPixel] - newPixel) / 16); - pixels.data[currentPixel] = newPixel; - - pixels.data[currentPixel + 4] += err * 7; - pixels.data[currentPixel + 4 * w - 4] += err * 3; - pixels.data[currentPixel + 4 * w] += err * 5; - pixels.data[currentPixel + 4 * w + 4] += err * 1; - - } else { - - // Bill Atkinson's dithering algorithm - newPixel = pixels.data[currentPixel] < threshold ? 0 : 255; - err = Math.floor((pixels.data[currentPixel] - newPixel) / 8); - pixels.data[currentPixel] = newPixel; - - pixels.data[currentPixel + 4] += err; - pixels.data[currentPixel + 8] += err; - pixels.data[currentPixel + 4 * w - 4] += err; - pixels.data[currentPixel + 4 * w] += err; - pixels.data[currentPixel + 4 * w + 4] += err; - pixels.data[currentPixel + 8 * w] += err; - - } - - // Set g and b pixels equal to r - pixels.data[currentPixel + 1] = pixels.data[currentPixel + 2] = pixels.data[currentPixel]; - } - return pixels; - -} + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + // do the averaging + function extraManipulation(pixels) { + var i = 0, sum = [0, 0, 0, 0]; + while (i < pixels.data.length) { + sum[0] += pixels.data[i++]; + sum[1] += pixels.data[i++]; + sum[2] += pixels.data[i++]; + sum[3] += pixels.data[i++]; + } + + let divisor = pixels.data.length / 4; + + sum[0] = Math.floor(sum[0] / divisor); + sum[1] = Math.floor(sum[1] / divisor); + sum[2] = Math.floor(sum[2] / divisor); + sum[3] = Math.floor(sum[3] / divisor); + + i = 0 + while (i < pixels.data.length) { + pixels.data[i++] = sum[0]; + pixels.data[i++] = sum[1]; + pixels.data[i++] = sum[2]; + pixels.data[i++] = sum[3]; + } + + // report back and store average in metadata: + options.step.metadata.averages = sum; + + // TODO: refactor into a new "display()" method as per https://github.com/publiclab/image-sequencer/issues/242 + if (options.step.inBrowser && options.step.ui) $(options.step.ui).find('.details').append("

Averages (r, g, b, a): " + sum.join(', ') + "

"); + return pixels; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { + src: datauri, + format: mimetype + }; + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298}],196:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":195,"./info.json":197,"dup":193}],197:[function(require,module,exports){ +module.exports={ + "name": "Average", + "description": "Average all pixel color", + "inputs": { + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],198:[function(require,module,exports){ +module.exports = function Dynamic(options, UI, util) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + + options.func = options.func || defaults.blend; + options.offset = options.offset || defaults.offset; + + var output; + + // This function is called on every draw. + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + // convert to runnable code: + if (typeof options.func === "string") eval('options.func = ' + options.func); + + var getPixels = require('get-pixels'); + + // convert offset as string to int + if (typeof options.offset === "string") options.offset = parseInt(options.offset); + + // save first image's pixels + var priorStep = this.getStep(options.offset); + + if (priorStep.output === undefined) { + this.output = input; + UI.notify('Offset Unavailable', 'offset-notification'); + callback(); + } + + getPixels(priorStep.output.src, function(err, pixels) { + options.firstImagePixels = pixels; + + function changePixel(r2, g2, b2, a2, x, y) { + // blend! + let p = options.firstImagePixels; + return options.func( + r2, g2, b2, a2, + p.get(x, y, 0), + p.get(x, y, 1), + p.get(x, y, 2), + p.get(x, y, 3) + ) + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + // run PixelManipulatin on second image's pixels + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + }); + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":200,"get-pixels":30}],199:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":198,"./info.json":200,"dup":193}],200:[function(require,module,exports){ +module.exports={ + "name": "Blend", + "description": "Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!", + "inputs": { + "offset": { + "type": "integer", + "desc": "Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.", + "default": -2 + }, + "blend": { + "type": "input", + "desc": "Function to use to blend the two images.", + "default": "function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],201:[function(require,module,exports){ -module.exports = function Dither(options, UI){ - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - var output; - - function draw(input,callback,progressObj){ - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - options.dither = options.dither || defaults.dither; - - function extraManipulation(pixels) { - pixels = require('./Dither')(pixels, options.dither) - return pixels - } - - function output(image, datauri, mimetype){ - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Dither":200,"./info.json":203}],202:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":201,"./info.json":203,"dup":162}],203:[function(require,module,exports){ -module.exports={ - "name": "Dither", - "description": "Approximates a color from a mixture of other colors when the required color is not available, creating illusions of the color that is not present actually.Read more", - "inputs": { - "dither": { - "type": "select", - "desc": "Name of the Dithering Algorithm", - "default": "none", - "values": ["none","floydsteinberg","bayer","Atkinson"] - } - } -} - -},{}],204:[function(require,module,exports){ -module.exports = exports = function(pixels, options){ - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - options.startingX = options.startingX || defaults.startingX; - options.startingY = options.startingY || defaults.startingY; - var ox = Number(options.startingX), - oy = Number(options.startingY), - iw = pixels.shape[0], - ih = pixels.shape[1], - thickness = Number(options.thickness) || defaults.thickness, - ex = options.endX = Number(options.endX) - thickness || iw - 1, - ey = options.endY = Number(options.endY) -thickness || ih - 1, - color = options.color || defaults.color; - color = color.split(" "); - - var drawSide = function(startX, startY, endX, endY){ - for (var n=startX; n <= endX+thickness; n++){ - for (var k=startY; k <= endY+thickness; k++){ - pixels.set(n, k, 0, color[0]); - pixels.set(n, k, 1, color[1]); - pixels.set(n, k, 2, color[2]); - pixels.set(n, k, 3, color[3]); - } - } - } - - drawSide(ox, oy, ox, ey); // Left - drawSide(ex, oy, ex, ey); // Right - drawSide(ox, oy, ex, oy); // Top - drawSide(ox, ey, ex, ey); // Bottom - return pixels; -} -},{"./../../util/getDefaults.js":271,"./info.json":207}],205:[function(require,module,exports){ -module.exports = function DrawRectangle(options, UI) { - - - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function changePixel(r, g, b, a) { - return [r, g, b, a] - } - - function extraManipulation(pixels) { - pixels = require('./DrawRectangle')(pixels, options) - return pixels - } - - function output(image, datauri, mimetype) { - - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = exports = function(pixels, blur) { + let kernel = kernelGenerator(blur, 1), oldpix = require('lodash').cloneDeep(pixels); + kernel = flipKernel(kernel); -},{"../_nomodule/PixelManipulation.js":264,"./DrawRectangle":204}],206:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":205,"./info.json":207,"dup":162}],207:[function(require,module,exports){ -module.exports={ - "name": "Draw Rectangle", - "description": "It draws a rectangle on the image", - "inputs": { - "startingX":{ - "type": "Number", - "desc": "starting x position of the rectangle", - "default": 0 - }, - - "startingY": { - "type": "Number", - "desc": "starting y position of the rectangle", - "default": 0 - }, - - "endX":{ - "type": "integer", - "desc": "last x position of the rectangle", - "default": "width" - }, - - "endY":{ - "type": "integer", - "desc": "last y position of the rectangle", - "default": "height" - }, - - "thickness":{ - "type": "integer", - "desc": "thickness of border", - "default": 1 - }, - - "color":{ - "type": "String", - "desc": "RGBA values separated by a space", - "default": "0 0 0 255" - } - } -} + for (let i = 0; i < pixels.shape[0]; i++) { + for (let j = 0; j < pixels.shape[1]; j++) { + let neighboutPos = getNeighbouringPixelPositions([i, j]); + let acc = [0.0, 0.0, 0.0, 0.0]; + for (let a = 0; a < kernel.length; a++) { + for (let b = 0; b < kernel.length; b++) { + acc[0] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 0) * kernel[a][b]); + acc[1] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 1) * kernel[a][b]); + acc[2] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 2) * kernel[a][b]); + acc[3] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 3) * kernel[a][b]); + } + } + pixels.set(i, j, 0, acc[0]); + pixels.set(i, j, 1, acc[1]); + pixels.set(i, j, 2, acc[2]); + } + } + return pixels; + + + + //Generates a 3x3 Gaussian kernel + function kernelGenerator(sigma, size) { + + /* + Trying out a variable radius kernel not working as of now + */ + // const coeff = (1.0/(2.0*Math.PI*sigma*sigma)) + // const expCoeff = -1 * (1.0/2.0 * sigma * sigma) + // let e = Math.E + // let result = [] + // for(let i = -1 * size;i<=size;i++){ + // let arr = [] + // for(let j= -1 * size;j<=size;j++){ + // arr.push(coeff * Math.pow(e,expCoeff * ((i * i) + (j*j)))) + // } + // result.push(arr) + // } + // let sum = result.reduce((sum,val)=>{ + // return val.reduce((sumInner,valInner)=>{ + // return sumInner+valInner + // }) + // }) + // result = result.map(arr=>arr.map(val=>(val + 0.0)/(sum + 0.0))) + + // return result + + return [ + [2.0 / 159.0, 4.0 / 159.0, 5.0 / 159.0, 4.0 / 159.0, 2.0 / 159.0], + [4.0 / 159.0, 9.0 / 159.0, 12.0 / 159.0, 9.0 / 159.0, 4.0 / 159.0], + [5.0 / 159.0, 12.0 / 159.0, 15.0 / 159.0, 12.0 / 159.0, 5.0 / 159.0], + [4.0 / 159.0, 9.0 / 159.0, 12.0 / 159.0, 9.0 / 159.0, 4.0 / 159.0], + [2.0 / 159.0, 4.0 / 159.0, 5.0 / 159.0, 4.0 / 159.0, 2.0 / 159.0] + ]; + } + function getNeighbouringPixelPositions(pixelPosition) { + let x = pixelPosition[0], y = pixelPosition[1], result = []; + + for (let i = -2; i <= 2; i++) { + let arr = []; + for (let j = -2; j <= 2; j++) + arr.push([x + i, y + j]); + + result.push(arr); + } + return result; + } + + function flipKernel(kernel) { + let result = []; + for (let i = kernel.length - 1; i >= 0; i--) { + let arr = []; + for (let j = kernel[i].length - 1; j >= 0; j--) { + arr.push(kernel[i][j]); + } + result.push(arr); + } + return result; + } +} +},{"lodash":76}],202:[function(require,module,exports){ +/* +* Blur an Image +*/ +module.exports = function Blur(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.blur = options.blur || defaults.blur; + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function extraManipulation(pixels) { + pixels = require('./Blur')(pixels, options.blur); + return pixels; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Blur":201,"./info.json":204}],203:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":202,"./info.json":204,"dup":193}],204:[function(require,module,exports){ +module.exports={ + "name": "Blur", + "description": "Applies a Gaussian blur given by the intensity value", + "inputs": { + "blur": { + "type": "range", + "desc": "Amount of gaussian blur(Less blur gives more detail, typically 0-5)", + "default": "2", + "min": "0", + "max": "5", + "step": "0.25" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],205:[function(require,module,exports){ +/* +* Changes the Image Brightness +*/ +module.exports = function Brightness(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + var output; + + + + function draw(input, callback, progressObj) { + + options.brightness = parseInt(options.brightness) || defaults.brightness; + + progressObj.stop(true); + progressObj.overrideFlag = true; + + /* + In this case progress is handled by changepixel internally otherwise progressObj + needs to be overriden and used + For eg. progressObj = new SomeProgressModule() + */ + + var step = this, val = (options.brightness) / 100.0;; + + function changePixel(r, g, b, a) { + + r = Math.min(val * r, 255); + g = Math.min(val * g, 255); + b = Math.min(val * b, 255); + return [r, g, b, a]; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":207}],206:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":205,"./info.json":207,"dup":193}],207:[function(require,module,exports){ +module.exports={ + "name": "Brightness", + "description": "Change the brightness of the image by given percent value", + "inputs": { + "brightness": { + "type": "range", + "desc": "% brightness for the new image", + "default": "175", + "min": "0", + "max": "200", + "step": "1" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],208:[function(require,module,exports){ -module.exports = function Dynamic(options,UI) { - - var output; - - // This function is called on every draw. - function draw(input,callback,progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - // start with monochrome, but if options.red, options.green, and options.blue are set, accept them too - options.monochrome = options.monochrome || "(R+G+B)/3"; - - function generator(expression) { - var func = 'f = function (r, g, b, a) { var R = r, G = g, B = b, A = a;' - func = func + 'return '; - func = func + expression + '}'; - var f; - eval(func); - return f; - } - - var channels = ['red', 'green', 'blue', 'alpha']; - - channels.forEach(function(channel) { - if (options.hasOwnProperty(channel)) options[channel + '_function'] = generator(options[channel]); - else if (channel === 'alpha') options['alpha_function'] = function() { return 255; } - else options[channel + '_function'] = generator(options.monochrome); - }); - - function changePixel(r, g, b, a) { - - /* neighbourpixels can be calculated by - this.getNeighbourPixel.fun(x,y) or this.getNeighborPixel.fun(x,y) - */ - var combined = (r + g + b) / 3.000; - return [ - options.red_function(r, g, b, a), - options.green_function(r, g, b, a), - options.blue_function(r, g, b, a), - options.alpha_function(r, g, b, a), - ]; - } - - /* Functions to get the neighbouring pixel by position (x,y) */ - function getNeighbourPixel(pixels,curX,curY,distX,distY){ - return [ - pixels.get(curX+distX,curY+distY,0) - ,pixels.get(curX+distX,curY+distY,1) - ,pixels.get(curX+distX,curY+distY,2) - ,pixels.get(curX+distX,curY+distY,3) - ] - } - - // via P5js: https://github.com/processing/p5.js/blob/2920492842aae9a8bf1a779916893ac19d65cd38/src/math/calculation.js#L461-L472 - function map(n, start1, stop1, start2, stop2, withinBounds) { - var newval = (n - start1) / (stop1 - start1) * (stop2 - start2) + start2; - if (!withinBounds) { - return newval; - } - // also via P5js: https://github.com/processing/p5.js/blob/2920492842aae9a8bf1a779916893ac19d65cd38/src/math/calculation.js#L116-L119 - function constrain(n, low, high) { - return Math.max(Math.min(n, high), low); - }; - if (start2 < stop2) { - return constrain(newval, start2, stop2); - } else { - return constrain(newval, stop2, start2); - } - }; - - function output(image,datauri,mimetype){ - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - getNeighbourPixel: getNeighbourPixel, - getNeighborPixel: getNeighbourPixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +/* + * Display only one color channel + */ +module.exports = function Channel(options, UI) { -},{"../_nomodule/PixelManipulation.js":264}],209:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":208,"./info.json":210,"dup":162}],210:[function(require,module,exports){ -module.exports={ - "name": "Dynamic", - "description": "A module which accepts JavaScript math expressions to produce each color channel based on the original image's color. See Infragrammar.", - "inputs": { - "red": { - "type": "input", - "desc": "Expression to return for red channel with R, G, B, and A inputs", - "default": "r" - }, - "green": { - "type": "input", - "desc": "Expression to return for green channel with R, G, B, and A inputs", - "default": "g" - }, - "blue": { - "type": "input", - "desc": "Expression to return for blue channel with R, G, B, and A inputs", - "default": "b" - }, - "monochrome (fallback)": { - "type": "input", - "desc": "Expression to return with R, G, B, and A inputs; fallback for other channels if none provided", - "default": "r + g + b" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + + options.channel = options.channel || defaults.channel; + + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function changePixel(r, g, b, a) { + if (options.channel === "red") return [r, 0, 0, a]; + if (options.channel === "green") return [0, g, 0, a]; + if (options.channel === "blue") return [0, 0, b, a]; + } + + function output(image, datauri, mimetype) { + + // This output is accesible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + + return { + options: options, + //setup: setup, // optional + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":210}],209:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":208,"./info.json":210,"dup":193}],210:[function(require,module,exports){ +module.exports={ + "name": "Channel", + "description": "Displays only one color channel of an image -- default is green", + "inputs": { + "channel": { + "type": "select", + "desc": "Color channel", + "default": "green", + "values": ["red", "green", "blue"] + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],211:[function(require,module,exports){ -const _ = require('lodash') - -//define kernels for the sobel filter -const kernelx = [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], - kernely = [[-1, -2, -1], [0, 0, 0], [1, 2, 1]]; - -module.exports = function(pixels, highThresholdRatio, lowThresholdRatio, inBrowser) { - let angles = [], mags = [], strongEdgePixels = [], weakEdgePixels = [], notInUI = !inBrowser; - for (var x = 0; x < pixels.shape[0]; x++) { - angles.push([]); - mags.push([]); - for (var y = 0; y < pixels.shape[1]; y++) { - var result = changePixel( - pixels, - pixels.get(x, y, 0), - pixels.get(x, y, 3), - x, - y - ); - let pixel = result.pixel; - - pixels.set(x, y, 0, pixel[0]); - pixels.set(x, y, 1, pixel[1]); - pixels.set(x, y, 2, pixel[2]); - pixels.set(x, y, 3, pixel[3]); - - mags.slice(-1)[0].push(pixel[3]); - angles.slice(-1)[0].push(result.angle); - } - } - nonMaxSupress(pixels, mags, angles); - doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, mags, strongEdgePixels, weakEdgePixels); - return pixels; -} - -//changepixel function that convolutes every pixel (sobel filter) -function changePixel(pixels, val, a, x, y) { - let magX = 0.0; - for (let a = 0; a < 3; a++) { - for (let b = 0; b < 3; b++) { - - let xn = x + a - 1; - let yn = y + b - 1; - - magX += pixels.get(xn, yn, 0) * kernelx[a][b]; - } - } - let magY = 0.0; - for (let a = 0; a < 3; a++) { - for (let b = 0; b < 3; b++) { - - let xn = x + a - 1; - let yn = y + b - 1; - - magY += pixels.get(xn, yn, 0) * kernely[a][b]; - } - } - let mag = Math.sqrt(Math.pow(magX, 2) + Math.pow(magY, 2)); - let angle = Math.atan2(magY, magX); - return { - pixel: - [val, val, val, mag], - angle: angle - }; -} - -//Non Maximum Supression without interpolation -function nonMaxSupress(pixels, mags, angles) { - - angles = angles.map((arr) => arr.map(convertToDegrees)); - - for (let i = 1; i < pixels.shape[0] - 1; i++) { - for (let j = 1; j < pixels.shape[1] - 1; j++) { - - let angle = angles[i][j]; - let pixel = pixels.get(i, j); - - if ((angle >= -22.5 && angle <= 22.5) || - (angle < -157.5 && angle >= -180)) - - if ((mags[i][j] >= mags[i][j + 1]) && - (mags[i][j] >= mags[i][j - 1])) - pixels.set(i, j, 3, mags[i][j]); - else - pixels.set(i, j, 3, 0); - - else if ((angle >= 22.5 && angle <= 67.5) || - (angle < -112.5 && angle >= -157.5)) - - if ((mags[i][j] >= mags[i + 1][j + 1]) && - (mags[i][j] >= mags[i - 1][j - 1])) - pixels.set(i, j, 3, mags[i][j]); - else - pixels.set(i, j, 3, 0); - - else if ((angle >= 67.5 && angle <= 112.5) || - (angle < -67.5 && angle >= -112.5)) - - if ((mags[i][i] >= mags[i + 1][j]) && - (mags[i][j] >= mags[i][j])) - pixels.set(i, j, 3, mags[i][j]); - else - pixels.set(i, j, 3, 0); - - else if ((angle >= 112.5 && angle <= 157.5) || - (angle < -22.5 && angle >= -67.5)) - - if ((mags[i][j] >= mags[i + 1][j - 1]) && - (mags[i][j] >= mags[i - 1][j + 1])) - pixels.set(i, j, 3, mags[i][j]); - else - pixels.set(i, j, 3, 0); - - } - } -} -//Converts radians to degrees -var convertToDegrees = radians => (radians * 180) / Math.PI; - -//Finds the max value in a 2d array like mags -var findMaxInMatrix = arr => Math.max(...arr.map(el => el.map(val => !!val ? val : 0)).map(el => Math.max(...el))); - -//Applies the double threshold to the image -function doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, mags, strongEdgePixels, weakEdgePixels) { - - const highThreshold = findMaxInMatrix(mags) * highThresholdRatio; - const lowThreshold = highThreshold * lowThresholdRatio; - - for (let i = 0; i < pixels.shape[0]; i++) { - for (let j = 0; j < pixels.shape[1]; j++) { - let pixelPos = [i, j]; - - mags[i][j] > lowThreshold - ? mags[i][j] > highThreshold - ? strongEdgePixels.push(pixelPos) - : weakEdgePixels.push(pixelPos) - : pixels.set(i, j, 3, 0); - } - } - - strongEdgePixels.forEach(pix => pixels.set(pix[0], pix[1], 3, 255)); -} - -// hysteresis edge tracking algorithm -- not working as of now -/* function hysteresis(pixels) { - function getNeighbouringPixelPositions(pixelPosition) { - let x = pixelPosition[0], y = pixelPosition[1] - return [[x + 1, y + 1], - [x + 1, y], - [x + 1, y - 1], - [x, y + 1], - [x, y - 1], - [x - 1, y + 1], - [x - 1, y], - [x - 1, y - 1]] - } - - //This can potentially be improved see https://en.wikipedia.org/wiki/Connected-component_labeling - for (weakPixel in weakEdgePixels) { - let neighbourPixels = getNeighbouringPixelPositions(weakEdgePixels[weakPixel]) - for (pixel in neighbourPixels) { - if (strongEdgePixels.find(el => _.isEqual(el, neighbourPixels[pixel]))) { - pixels.set(weakPixel[0], weakPixel[1], 3, 255) - weakEdgePixels.splice(weakPixel, weakPixel) - break - } - } - } - weakEdgePixels.forEach(pix => pixels.set(pix[0], pix[1], 3, 0)) - return pixels -} */ - - - +module.exports = require('../../util/createMetaModule.js')( + function mapFunction(options) { -},{"lodash":75}],212:[function(require,module,exports){ -/* -* Detect Edges in an Image -*/ -module.exports = function edgeDetect(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.blur = options.blur || defaults.blur; - options.highThresholdRatio = options.highThresholdRatio || defaults.highThresholdRatio; - options.lowThresholdRatio = options.lowThresholdRatio || defaults.lowThresholdRatio; - - var output; - - // The function which is called on every draw. - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - - // Extra Manipulation function used as an enveloper for applying gaussian blur and Convolution - function extraManipulation(pixels) { - pixels = require('ndarray-gaussian-filter')(pixels, options.blur); - pixels = require('./EdgeUtils')(pixels, options.highThresholdRatio, options.lowThresholdRatio, options.inBrowser); - return pixels; - } - - function changePixel(r, g, b, a) { - return [(r + g + b) / 3, (r + g + b) / 3, (r + g + b) / 3, a]; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} + // return steps with options: + return [ + { 'name': 'gradient', 'options': {} }, + { 'name': 'colormap', 'options': { colormap: options.colormap } }, + { 'name': 'crop', 'options': { 'y': 0, 'h': options.h } }, + { 'name': 'overlay', 'options': { 'x': options.x, 'y': options.y, 'offset': -4 } } + ]; + }, { + infoJson: require('./info.json') + } +)[0]; -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./EdgeUtils":211,"./info.json":214,"ndarray-gaussian-filter":80}],213:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":212,"./info.json":214,"dup":162}],214:[function(require,module,exports){ -module.exports={ - "name": "Detect Edges", - "description": "This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ", - "inputs": { - "blur": { - "type": "range", - "desc": "Amount of gaussian blur(Less blur gives more detail, typically 0-5)", - "default": "2", - "min": "0", - "max": "5", - "step": "0.25" - }, - "highThresholdRatio":{ - "type": "float", - "desc": "The high threshold ratio for the image", - "default": 0.2 - }, - "lowThresholdRatio": { - "type": "float", - "desc": "The low threshold value for the image", - "default": 0.15 - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +},{"../../util/createMetaModule.js":304,"./info.json":213}],212:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":211,"./info.json":213,"dup":193}],213:[function(require,module,exports){ +module.exports={ + "name": "Colorbar", + "description": "Generates a colorbar to lay over the image", + "inputs": { + "colormap": { + "type": "select", + "desc": "Name of the Colormap", + "default": "default", + "values": [ + "default", + "greyscale", + "stretched", + "fastie" + ] + }, + "x": { + "type": "integer", + "desc": "X-position of the image on which the new image is overlayed", + "default": 0 + }, + "y": { + "type": "integer", + "desc": "Y-position of the image on which the new image is overlayed", + "default": 0 + }, + "h": { + "type": "iinteger", + "desc": "height of the colorbar", + "default": 10 + } + }, + "docs-link": "https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} +},{}],214:[function(require,module,exports){ +/* + * Accepts a value from 0-255 and returns the new color-mapped pixel + * from a lookup table, which can be specified as an array of [begin, end] + * gradients, where begin and end are represented as [r, g, b] colors. In + * combination, a lookup table which maps values from 0 - 255 smoothly from black to white looks like: + * [ + * [0, [0, 0, 0], [255, 255, 255]], + * [1, [255, 255, 255], [255, 255, 255]] + * ] + * + * Adapted from bgamari's work in Infragram: https://github.com/p-v-o-s/infragram-js/commit/346c97576a07b71a55671d17e0153b7df74e803b + */ +module.exports = function Colormap(value, options) { + options.colormap = options.colormap || colormaps.default; + // if a lookup table is provided as an array: + if(typeof(options.colormap) == "object") + colormapFunction = colormap(options.colormap); + // if a stored colormap is named with a string like "fastie": + else if(colormaps.hasOwnProperty(options.colormap)) + colormapFunction = colormaps[options.colormap]; + else colormapFunction = colormaps.default; + return colormapFunction(value / 255.00); +} + +function colormap(segments) { + return function(x) { + var i, result, x0, x1, xstart, y0, y1, _i, _j, _len, _ref, _ref1, _ref2, _ref3; + _ref = [0, 0], y0 = _ref[0], y1 = _ref[1]; + _ref1 = [segments[0][0], 1], x0 = _ref1[0], x1 = _ref1[1]; + if (x < x0) { + return y0; + } + for (i = _i = 0, _len = segments.length; _i < _len; i = ++_i) { + _ref2 = segments[i], xstart = _ref2[0], y0 = _ref2[1], y1 = _ref2[2]; + x0 = xstart; + if (i === segments.length - 1) { + x1 = 1; + break; + } + x1 = segments[i + 1][0]; + if ((xstart <= x && x < x1)) { + break; + } + } + result = []; + for (i = _j = 0, _ref3 = y0.length; 0 <= _ref3 ? _j < _ref3 : _j > _ref3; i = 0 <= _ref3 ? ++_j : --_j) { + result[i] = (x - x0) / (x1 - x0) * (y1[i] - y0[i]) + y0[i]; + } + return result; + }; +}; + +var colormaps = { + greyscale: colormap([ + [0, [0, 0, 0], [255, 255, 255] ], + [1, [255, 255, 255], [255, 255, 255] ] + ]), + + bluwhtgrngis: colormap([ + [0, [6,23,86], [6,25, 84] ], + [0.0625, [6,25,84], [6,25, 84] ],//1 + [0.125, [6,25,84], [6,25, 84] ],//2 + [0.1875, [6,25,84], [6,25, 84] ], + [0.25, [6,25,84], [6,25,84] ], + [0.3125, [6,25,84], [9,24, 84] ],//5 + [0.3438, [9,24, 84], [119,120,162] ],//5 + [0.375, [119,129,162],[249,250,251] ], //6 + [0.406, [249,250,251],[255,255,255] ], //6.5 + [0.4375, [255,255,255],[255,255,255] ], //7 white + [0.50, [255,255,255],[214,205,191] ],//8 + [0.52, [214,205,191],[178,175,96] ],//8.2 + [0.5625, [178,175,96], [151,176,53] ],//9 + [0.593, [151,176,53], [146,188,12] ],//9.5 + [0.625, [146,188,12], [96,161,1] ], //10 + [0.6875, [96,161,1], [30,127,3] ],//11 + [0.75, [30,127,3], [0,99,1] ],//12 + [0.8125, [0,99,1], [0,74,1] ],//13 + [0.875, [0,74,1], [0,52, 0] ],//14 + [0.9375, [0,52, 0], [0,34,0] ], //15 + [0.968, [0,34,0], [68,70,67] ] //16 + ]), + + + brntogrn: colormap([ + [0, [110,12,3], [118,6,1] ], + [0.0625, [118,6,1], [141,19,6] ], + [0.125, [141,19,6], [165,35,13] ], + [0.1875, [165,35,13], [177,59,25] ], + [0.2188, [177,59,25], [192,91,36] ], + [0.25, [192,91,36], [214, 145, 76] ], + [0.3125, [214,145,76], [230,183,134] ], + [0.375, [230,183,134],[243, 224, 194]], + [0.4375, [243,224,194],[250,252,229] ], + [0.50, [250,252,229],[217,235,185] ], + [0.5625, [217,235,185],[184,218,143] ], + [0.625, [184,218,143],[141,202,89] ], + [0.6875, [141,202,89], [80,176,61] ], + [0.75, [80,176,61], [0, 147, 32] ], + [0.8125, [0,147,32], [1, 122, 22] ], + [0.875, [1,122,22], [0, 114, 19] ], + [0.90, [0,114,19], [0,105,18] ], + [0.9375, [0,105,18], [7,70,14] ] + + ]), + + + blutoredjet: colormap([ + [0, [0,0,140], [1,1,186] ], + [0.0625, [1,1,186], [0,1,248] ], + [0.125, [0,1,248], [0,70,254] ], + [0.1875, [0,70,254], [0,130,255] ], + [0.25, [0,130,255], [2,160,255] ], + [0.2813, [2,160,255], [0,187,255] ], //inset + [0.3125, [0,187,255], [6,250,255] ], + // [0.348, [0,218,255], [8,252,251] ],//inset + [0.375, [8,252,251], [27,254,228] ], + [0.406, [27,254,228], [70,255,187] ], //insert + [0.4375, [70,255,187], [104,254,151]], + [0.47, [104,254,151],[132,255,19] ],//insert + [0.50, [132,255,19], [195,255,60] ], + [0.5625, [195,255,60], [231,254,25] ], + [0.5976, [231,254,25], [253,246,1] ],//insert + [0.625, [253,246,1], [252,210,1] ], //yellow + [0.657, [252,210,1], [255,183,0] ],//insert + [0.6875, [255,183,0], [255,125,2] ], + [0.75, [255,125,2], [255,65, 1] ], + [0.8125, [255,65, 1], [247, 1, 1] ], + [0.875, [247,1,1], [200, 1, 3] ], + [0.9375, [200,1,3], [122, 3, 2] ] + + ]), + + + colors16: colormap([ + [0, [0,0,0], [0,0,0] ], + [0.0625, [3,1,172], [3,1,172] ], + [0.125, [3,1,222], [3,1, 222] ], + [0.1875, [0,111,255], [0,111,255] ], + [0.25, [3,172,255], [3,172,255] ], + [0.3125, [1,226,255], [1,226,255] ], + [0.375, [2,255,0], [2,255,0] ], + [0.4375, [198,254,0], [190,254,0] ], + [0.50, [252,255,0], [252,255,0] ], + [0.5625, [255,223,3], [255,223,3] ], + [0.625, [255,143,3], [255,143,3] ], + [0.6875, [255,95,3], [255,95,3] ], + [0.75, [242,0,1], [242,0,1] ], + [0.8125, [245,0,170], [245,0,170] ], + [0.875, [223,180,225], [223,180,225] ], + [0.9375, [255,255,255], [255,255, 255]] + + ]), + + default: colormap([ + [0, [45,1,121], [25,1,137] ], + [0.125, [25,1,137], [0,6,156] ], + [0.1875, [0,6,156], [7,41,172] ], + [0.25, [7,41,172], [22,84,187] ], + [0.3125, [22,84,187], [25,125,194] ], + [0.375, [25,125,194], [26,177,197] ], + [0.4375, [26,177,197], [23,199,193] ], + [0.47, [23,199,193], [25, 200,170] ], + [0.50, [25, 200,170], [21,209,27] ], + [0.5625, [21,209,27], [108,215,18] ], + [0.625, [108,215,18], [166,218,19] ], + [0.6875, [166,218,19], [206,221,20] ], + [0.75, [206,221,20], [222,213,19 ] ], + [0.7813, [222,213,19], [222, 191, 19]], + [0.8125, [222, 191, 19], [227,133,17] ], + [0.875, [227,133,17], [231,83,16] ], + [0.9375, [231,83,16], [220,61,48] ] + + ]), + + + fastie: colormap([ + [0, [255, 255, 255], [0, 0, 0] ], + [0.167, [0, 0, 0], [255, 255, 255] ], + [0.33, [255, 255, 255], [0, 0, 0] ], + [0.5, [0, 0, 0], [140, 140, 255] ], + [0.55, [140, 140, 255], [0, 255, 0] ], + [0.63, [0, 255, 0], [255, 255, 0] ], + [0.75, [255, 255, 0], [255, 0, 0] ], + [0.95, [255, 0, 0], [255, 0, 255] ] + ]), + + + stretched: colormap([ + [0, [0, 0, 255], [0, 0, 255] ], + [0.1, [0, 0, 255], [38, 195, 195] ], + [0.5, [0, 150, 0], [255, 255, 0] ], + [0.7, [255, 255, 0], [255, 50, 50] ], + [0.9, [255, 50, 50], [255, 50, 50] ] + ]) + +} },{}],215:[function(require,module,exports){ -/* - * Resolves Fisheye Effect - */ -module.exports = function DoNothing(options,UI) { - - var output; - - require('fisheyegl'); - - function draw(input,callback) { - - var step = this; - - if (!options.inBrowser) { // This module is only for browser - this.output = input; - callback(); - } - else { - // Create a canvas, if it doesn't already exist. - if (!document.querySelector('#image-sequencer-canvas')) { - var canvas = document.createElement('canvas'); - canvas.style.display = "none"; - canvas.setAttribute('id','image-sequencer-canvas'); - document.body.append(canvas); - } - else var canvas = document.querySelector('#image-sequencer-canvas'); - - distorter = FisheyeGl({ - selector: "#image-sequencer-canvas" - }); - - // Parse the inputs - options.a = parseFloat(options.a) || distorter.lens.a; - options.b = parseFloat(options.b) || distorter.lens.b; - options.Fx = parseFloat(options.Fx) || distorter.lens.Fx; - options.Fy = parseFloat(options.Fy) || distorter.lens.Fy; - options.scale = parseFloat(options.scale) || distorter.lens.scale; - options.x = parseFloat(options.x) || distorter.fov.x; - options.y = parseFloat(options.y) || distorter.fov.y; - - // Set fisheyegl inputs - distorter.lens.a = options.a; - distorter.lens.b = options.b; - distorter.lens.Fx = options.Fx; - distorter.lens.Fy = options.Fy; - distorter.lens.scale = options.scale; - distorter.fov.x = options.x; - distorter.fov.y = options.y; - - // generate fisheyegl output - distorter.setImage(input.src,function(){ - - // this output is accessible to Image Sequencer - step.output = {src: canvas.toDataURL(), format: input.format}; - - // Tell Image Sequencer and UI that step has been drawn - callback(); - - }); - - } - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = function Colormap(options, UI) { -},{"fisheyegl":21}],216:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":215,"./info.json":217,"dup":162}],217:[function(require,module,exports){ -module.exports={ - "name": "Fisheye GL", - "description": "Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).", - "requires": [ "webgl" ], - "inputs": { - "a": { - "type": "float", - "desc": "a parameter", - "default": 1, - "min": 1, - "max": 4 - }, - "b": { - "type": "float", - "desc": "b parameter", - "default": 1, - "min": 1, - "max": 4 - }, - "Fx": { - "type": "float", - "desc": "Fx parameter", - "default": 0, - "min": 0, - "max": 4 - }, - "Fy": { - "type": "float", - "desc": "Fy parameter", - "default": 0, - "min": 0, - "max": 4 - }, - "scale": { - "type": "float", - "desc": "Image Scaling", - "default": 1.5, - "min": 0, - "max": 20 - }, - "x": { - "type": "float", - "desc": "FOV x parameter", - "default": 1.5, - "min": 0, - "max": 20 - }, - "y": { - "type": "float", - "desc": "FOV y parameter", - "default": 1.5, - "min": 0, - "max": 20 - }, - "fragmentSrc": { - "type": "PATH", - "desc": "Path to a WebGL fragment shader file", - "default": "(inbuilt)" - }, - "vertexSrc": { - "type": "PATH", - "desc": "Path to a WebGL vertex shader file", - "default": "(inbuilt)" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} + var output; + + // This function is called on every draw. + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function changePixel(r, g, b, a) { + var combined = (r + g + b) / 3.000; + var res = require('./Colormap')(combined, options); + return [res[0], res[1], res[2], 255]; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./Colormap":214}],216:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":215,"./info.json":217,"dup":193}],217:[function(require,module,exports){ +module.exports={ + "name": "Colormap", + "description": "Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.", + "inputs": { + "colormap": { + "type": "select", + "desc": "Name of the Colormap", + "default": "default", + "values": ["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"] + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],218:[function(require,module,exports){ -module.exports = function Gamma(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')), - adjustment = options.adjustment || defaults.adjustment; - var val = adjustment / defaults.adjustment; - - function changePixel(r, g, b, a) { - - r = Math.pow(r / 255, val) * 255; - g = Math.pow(g / 255, val) * 255; - b = Math.pow(b / 255, val) * 255; - - return [r, g, b, a]; - } - - function output(image, datauri, mimetype) { - - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +var _ = require('lodash'); -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":220}],219:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":218,"./info.json":220,"dup":162}],220:[function(require,module,exports){ -module.exports={ - "name": "Gamma Correction", - "description": "Apply gamma correction on the image Read more", - "inputs": { - "adjustment": { - "type": "float", - "desc": "gamma correction (inverse of actual gamma factor) for the new image", - "default": 0.2 - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} +module.exports = exports = function(pixels, contrast) { + let oldpix = _.cloneDeep(pixels); + contrast = Number(contrast) + if (contrast < -100) contrast = -100; + if (contrast > 100) contrast = 100; + contrast = (100.0 + contrast) / 100.0; + contrast *= contrast; -},{}],221:[function(require,module,exports){ + for (let i = 0; i < pixels.shape[0]; i++) { + for (let j = 0; j < pixels.shape[1]; j++) { + var r = oldpix.get(i, j, 0) / 255.0; + r -= 0.5; + r *= contrast; + r += 0.5; + r *= 255; + if (r < 0) r = 0; + if (r > 255) r = 255; + + + var g = oldpix.get(i, j, 1) / 255.0; + g -= 0.5; + g *= contrast; + g += 0.5; + g *= 255; + if (g < 0) g = 0; + if (g > 255) g = 255; + + + var b = oldpix.get(i, j, 2) / 255.0; + b -= 0.5; + b *= contrast; + b += 0.5; + b *= 255; + if (b < 0) b = 0; + if (b > 255) b = 255; + + + pixels.set(i, j, 0, r); + pixels.set(i, j, 1, g); + pixels.set(i, j, 2, b); + + } + } + return pixels; +} +},{"lodash":76}],219:[function(require,module,exports){ +// /* +// * Changes the Image Contrast +// */ + +module.exports = function Contrast(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.contrast = options.contrast || defaults.contrast; + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function extraManipulation(pixels) { + pixels = require('./Contrast')(pixels, options.contrast) + return pixels + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Contrast":218,"./info.json":221}],220:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":219,"./info.json":221,"dup":193}],221:[function(require,module,exports){ +module.exports={ + "name": "Contrast", + "description": "Change the contrast of the image by given value", + "inputs": { + "contrast": { + "type": "range", + "desc": "contrast for the new image, typically -100 to 100", + "default": "70", + "min": "-100", + "max": "100", + "step": "1" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],222:[function(require,module,exports){ +var _ = require('lodash'); +module.exports = exports = function(pixels, constantFactor, kernelValues) { + let kernel = kernelGenerator(constantFactor, kernelValues), oldpix = _.cloneDeep(pixels); + kernel = flipKernel(kernel); + + for (let i = 0; i < pixels.shape[0]; i++) { + for (let j = 0; j < pixels.shape[1]; j++) { + let neighboutPos = getNeighbouringPixelPositions([i, j]); + let acc = [0.0, 0.0, 0.0, 0.0]; + for (let a = 0; a < kernel.length; a++) { + for (let b = 0; b < kernel.length; b++) { + acc[0] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 0) * kernel[a][b]); + acc[1] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 1) * kernel[a][b]); + acc[2] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 2) * kernel[a][b]); + acc[3] += (oldpix.get(neighboutPos[a][b][0], neighboutPos[a][b][1], 3) * kernel[a][b]); + } + } + acc[0] = Math.min(acc[0], 255); + acc[1] = Math.min(acc[1], 255); + acc[2] = Math.min(acc[2], 255); + pixels.set(i, j, 0, acc[0]); + pixels.set(i, j, 1, acc[1]); + pixels.set(i, j, 2, acc[2]); + } + } + return pixels; + + + function kernelGenerator(constantFactor, kernelValues) { + kernelValues = kernelValues.split(" "); + for (i = 0; i < 9; i++) { + kernelValues[i] = Number(kernelValues[i]) * constantFactor; + } + let k = 0; + let arr = []; + for (i = 0; i < 3; i++) { + let columns = []; + for (j = 0; j < 3; j++) { + columns.push(kernelValues[k]); + k += 1; + } + arr.push(columns); + } + return arr; + } + + function getNeighbouringPixelPositions(pixelPosition) { + let x = pixelPosition[0], y = pixelPosition[1], result = []; + + for (let i = -1; i <= 1; i++) { + let arr = []; + for (let j = -1; j <= 1; j++) + arr.push([x + i, y + j]); + + result.push(arr); + } + return result; + } + + function flipKernel(kernel) { + let result = []; + for (let i = kernel.length - 1; i >= 0; i--) { + let arr = []; + for (let j = kernel[i].length - 1; j >= 0; j--) { + arr.push(kernel[i][j]); + } + result.push(arr); + } + return result; + } +} +},{"lodash":76}],223:[function(require,module,exports){ +module.exports = function Convolution(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + + options.kernelValues = options.kernelValues || defaults.kernelValues; + options.constantFactor = options.constantFactor || defaults.constantFactor; + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function extraManipulation(pixels) { + pixels = require('./Convolution')(pixels, options.constantFactor, options.kernelValues); + return pixels; + } + + function output(image, datauri, mimetype) { + + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Convolution":222,"./info.json":225}],224:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":223,"./info.json":225,"dup":193}],225:[function(require,module,exports){ +module.exports={ + "name": "Convolution", + "description": "Image Convolution using a given 3x3 kernel matrix Read more", + "inputs": { + "constantFactor":{ + "type": "Float", + "desc": "a constant factor, multiplies all the kernel values by that factor", + "default": 0.1111, + "placeholder": 0.1111 + }, + + "kernelValues": { + "type": "String", + "desc": "nine space separated numbers representing the kernel values in left to right and top to bottom format.", + "default": "1 1 1 1 1 1 1 1 1", + "placeholder": "1 1 1 1 1 1 1 1 1" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],226:[function(require,module,exports){ (function (Buffer){ -module.exports = function Invert(options, UI) { - - var output; - - // The function which is called on every draw. - function draw(input, callback, progressObj) { - var getPixels = require('get-pixels'); - var savePixels = require('save-pixels'); - - var step = this; - - getPixels(input.src, function(err, pixels) { - - if (err) { - console.log("Bad Image path"); - return; - } - - var width = pixels.shape[0]; - - for (var i = 0; i < pixels.shape[0]; i++) { - for (var j = 0; j < pixels.shape[1]; j++) { - let val = (i / width) * 255; - pixels.set(i, j, 0, val); - pixels.set(i, j, 1, val); - pixels.set(i, j, 2, val); - pixels.set(i, j, 3, 255); - } - } - var chunks = []; - var totalLength = 0; - var r = savePixels(pixels, input.format, { quality: 100 }); - - r.on("data", function(chunk) { - totalLength += chunk.length; - chunks.push(chunk); - }); - - r.on("end", function() { - var data = Buffer.concat(chunks, totalLength).toString("base64"); - var datauri = "data:image/" + input.format + ";base64," + data; - output(input.image, datauri, input.format); - callback(); - }); - }); - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = function Crop(input,options,callback) { + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + var getPixels = require('get-pixels'), + savePixels = require('save-pixels'); + + options.x = parseInt(options.x) || defaults.x; + options.y = parseInt(options.y) || defaults.y; + + getPixels(input.src,function(err,pixels){ + options.w = parseInt(options.w) || Math.floor(pixels.shape[0]); + options.h = parseInt(options.h) || Math.floor(pixels.shape[1]); + options.backgroundColor = options.backgroundColor || defaults.backgroundColor; + var ox = options.x; + var oy = options.y; + var w = options.w; + var h = options.h; + var iw = pixels.shape[0]; //Width of Original Image + var ih = pixels.shape[1]; //Height of Original Image + var backgroundArray = []; + backgroundColor = options.backgroundColor.split(" "); + for(var i = 0; i < w ; i++){ + backgroundArray = backgroundArray.concat([backgroundColor[0],backgroundColor[1],backgroundColor[2],backgroundColor[3]]); + } + var newarray = new Uint8Array(4*w*h); + for (var n = oy; n < oy + h; n++) { + if(n `${tot}\n${idx} : ${cur}`, ``)); - var newarray = new Uint8Array(4 * 256 * 256); - pixels.data = newarray; - pixels.shape = [256, 256, 4]; - pixels.stride[1] = 4 * 256; - - for (let x = 0; x < 256; x++) { - for (let y = 0; y < 256; y++) { - pixels.set(x, y, 0, 255); - pixels.set(x, y, 1, 255); - pixels.set(x, y, 2, 255); - pixels.set(x, y, 3, 255); - } - } - - let startY = options.gradient ? 10 : 0; - if (options.gradient) { - for (let x = 0; x < 256; x++) { - for (let y = 0; y < 10; y++) { - pixels.set(x, 255 - y, 0, x); - pixels.set(x, 255 - y, 1, x); - pixels.set(x, 255 - y, 2, x); - } - } - } - - let convfactor = (256 - startY) / Math.max(...hist); - - for (let x = 0; x < 256; x++) { - let pixCount = Math.round(convfactor * hist[x]); - - for (let y = startY; y < pixCount; y++) { - pixels.set(x, 255 - y, 0, 204); - pixels.set(x, 255 - y, 1, 255); - pixels.set(x, 255 - y, 2, 153); - } - } - - return pixels; - } - - function output(image, datauri, mimetype) { - - // This output is accesible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - - return { - options: options, - //setup: setup, // optional - draw: draw, - output: output, - UI: UI - } -} +},{"./../../util/getDefaults.js":305,"./info.json":230,"buffer":48,"get-pixels":30,"save-pixels":168}],227:[function(require,module,exports){ +/* + * Image Cropping module + * Usage: + * Expected Inputs: + * options.x : x-coordinate of image where the modules starts cropping | default : 0 + * options.y : y-coordinate of image where the modules starts cropping | default : 0 + * options.w : width of the resulting cropped image | default : 50% of input image width + * options.h : height of the resulting cropped image | default : 50% of input image height + * Output: + * The cropped image, which is essentially a rectangle bounded by the lines: + * x = options.x + * x = options.x + options.w + * y = options.y + * y = options.y + options.h + */ +module.exports = function CropModule(options, UI) { -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":226}],225:[function(require,module,exports){ -module.exports = [ - require('./Module.js'), - require('./info.json') -] -},{"./Module.js":224,"./info.json":226}],226:[function(require,module,exports){ -module.exports={ - "name": "Histogram", - "description": "Calculates the histogram for the image", - "inputs": { - "gradient": { - "type": "select", - "desc": "Toggle the gradient along x-axis", - "default": "true", - "values": [ - "true", - "false" - ] - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} -},{}],227:[function(require,module,exports){ -/* - * Import Image module; this fetches a given remote or local image via URL - * or data-url, and overwrites the current one. It saves the original as - * step.metadata.input for use in future modules such as blending. - * TODO: we could accept an operation for blending like "screen" or "overlay", - * or a function with blend(r1,g1,b1,a1,r2,g2,b2,a2), OR we could simply allow - * subsequent modules to do this blending and keep this one simple. - */ -module.exports = function ImportImageModule(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.imageUrl = options.url || defaults.url; - - var output, - imgObj = new Image(); - - // we should get UI to return the image thumbnail so we can attach our own UI extensions - - // add our custom in-module html ui: - if (options.step.inBrowser) { - var ui = require('./Ui.js')(options.step, UI); - ui.setup(); - } - - // This function is caled everytime the step has to be redrawn - function draw(input, callback) { - - var step = this; - - if (!options.inBrowser) { // This module is only for browser - this.output = input; - callback(); - } else { - step.metadata = step.metadata || {}; - // TODO: develop a standard API method for saving each input state, - // for reference in future steps (for blending, for example) - step.metadata.input = input; - - function onLoad() { - - // This output is accessible to Image Sequencer - step.output = { - src: imgObj.src, - format: options.format - } - - // Tell Image Sequencer that step has been drawn - callback(); - } - - options.format = require('../../util/GetFormat')(options.imageUrl); - imgObj.onload = onLoad; - imgObj.src = options.imageUrl; - - } - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} + // we should get UI to return the image thumbnail so we can attach our own UI extensions + // add our custom in-module html ui: + if (options.step.inBrowser && !options.noUI) var ui = require('./Ui.js')(options.step, UI); + var output, + setupComplete = false; -},{"../../util/GetFormat":268,"./../../util/getDefaults.js":271,"./Ui.js":228,"./info.json":230}],228:[function(require,module,exports){ -// hide on save -module.exports = function ImportImageModuleUi(step, ui) { - - function setup(setImage, onLoad) { - - // generate a unique timestamp based id for the dropzone - var dropzoneId = 'dropzone-import-image-' + step.ID; - - // add a file input listener - var dropZone ='\ -
\ -

\ - Select or drag in an image to overlay.\ -

\ -
\ - \ -
\ -
'; - - // insert into .details area - // TODO: develop API-based consistent way to add UI elements - $(step.ui) - .find('.details') - .prepend(dropZone); - - // setup file input listener - sequencer.setInputStep({ - dropZoneSelector: "#" + dropzoneId, - fileInputSelector: "#" + dropzoneId + " .file-input", - onLoad: function onLoadFromInput(progress) { - var reader = progress.target; - step.options.imageUrl = reader.result; - step.options.url = reader.result; - sequencer.run(); - setUrlHashParameter("steps", sequencer.toString()); - } - }); - - $(step.ui) - .find('.btn-save').on('click', function onClickSave() { - - var src = $(step.ui) - .find('.det input').val(); - step.options.imageUrl = src; - sequencer.run(); - - }); - - } - - return { - setup: setup - } -} + // This function is caled everytime the step has to be redrawn + function draw(input,callback) { + + var step = this; + + // save the input image; + // TODO: this should be moved to module API to persist the input image + options.step.input = input.src; + var parseCornerCoordinateInputs = require('../../util/ParseInputCoordinates'); + + //parse the inputs + parseCornerCoordinateInputs(options,{ + src: input.src, + x: { valInp: options.x, type: 'horizontal' }, + y: { valInp: options.y, type: 'vertical' }, + w: { valInp: options.w, type: 'horizontal' }, + h: { valInp: options.h, type: 'vertical' }, + }, function (options, coord) { + options.x = parseInt(coord.x.valInp); + options.y = parseInt(coord.y.valInp); + options.w = coord.w.valInp; + options.h = coord.h.valInp; + }); + + require('./Crop')(input, options, function (out, format) { + + // This output is accessible to Image Sequencer + step.output = { + src: out, + format: format + } + + // This output is accessible to the UI + options.step.output = out; + + // Tell the UI that the step has been drawn + UI.onComplete(options.step); + + // we should do this via event/listener: + if (ui && ui.hide) ui.hide(); + + // start custom UI setup (draggable UI) + // only once we have an input image + if (setupComplete === false && options.step.inBrowser && !options.noUI) { + setupComplete = true; + ui.setup(); + } + + // Tell Image Sequencer that step has been drawn + callback(); + + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../../util/ParseInputCoordinates":303,"./Crop":226,"./Ui.js":228}],228:[function(require,module,exports){ +// hide on save +module.exports = function CropModuleUi(step, ui) { + + let inputWidth = 0, + inputHeight = 0; + + // We don't have input image dimensions at the + // time of setting up the UI; that comes when draw() is triggered. + // So we trigger setup only on first run of draw() + // TODO: link this to an event rather than an explicit call in Module.js + function setup() { + let x = 0, + y = 0; + + // display original uncropped input image on initial setup + showOriginal(); + + inputWidth = Math.floor(imgEl().naturalWidth); + inputHeight = Math.floor(imgEl().naturalHeight); + + // display with 50%/50% default crop: + setOptions(x, y, inputWidth, inputHeight); + + $(imgEl()).imgAreaSelect({ + handles: true, + x1: x, + y1: y, + x2: x + inputWidth / 2, + y2: y + inputHeight / 2, + // when selection is complete + onSelectEnd: function onSelectEnd(img, selection) { + // assign crop values to module UI form inputs: + let converted = convertToNatural( + selection.x1, + selection.y1, + selection.width, + selection.height + ); + setOptions( + converted[0], + converted[1], + converted[2], + converted[3] + ); + } + }); + } + + function convertToNatural(_x, _y, _width, _height) { + let displayWidth = $(imgEl()).width(), + displayHeight = $(imgEl()).height(); + // return in same order [ x, y, width, height ]: + return [ + Math.floor(( _x / displayWidth ) * inputWidth), + Math.floor(( _y / displayHeight ) * inputHeight), + Math.floor(( _width / displayWidth ) * inputWidth), + Math.floor(( _height / displayHeight ) * inputHeight) + ] + } + + function remove() { + $(imgEl()).imgAreaSelect({ + remove: true + }); + } + + function hide() { + // then hide the draggable UI + $(imgEl()).imgAreaSelect({ + hide: true + }); + } + + // step.imgSelector is not defined, imgElement is: + function imgEl() { + return step.imgElement; + } + + function setOptions(x1, y1, width, height) { + let options = $($(imgEl()).parents()[2]).find("input"); + options[0].value = x1; + options[1].value = y1; + options[2].value = width; + options[3].value = height; + } + + // replaces currently displayed output thumbnail with the input image, for ui dragging purposes + function showOriginal() { + step.imgElement.src = step.input; + } + + return { + setup: setup, + remove: remove, + hide: hide + } +} },{}],229:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":227,"./info.json":230,"dup":162}],230:[function(require,module,exports){ -module.exports={ - "name": "Import Image", - "description": "Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.", - "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", - "inputs": { - "url": { - "type": "string", - "desc": "URL of image to import", - "default": "./images/monarch.png" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +arguments[4][193][0].apply(exports,arguments) +},{"./Module":227,"./info.json":230,"dup":193}],230:[function(require,module,exports){ +module.exports={ + "name": "Crop", + "description": "Crop image to given x, y, w, h in pixels or % , measured from top left", + "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", + "inputs": { + "x": { + "type": "integer", + "desc": "X-position (measured from left) from where cropping starts", + "default": 0 + }, + "y": { + "type": "integer", + "desc": "Y-position (measured from top) from where cropping starts", + "default": 0 + }, + "w": { + "type": "integer", + "desc": "Width of crop", + "default": "(50%)" + }, + "h": { + "type": "integer", + "desc": "Height of crop", + "default": "(50%)" + }, + "backgroundColor": { + "type": "String", + "desc": "Background Color (Four space separated RGBA values)", + "default": "255 255 255 255", + "placeholder": "255 255 255 255" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" } + },{}],231:[function(require,module,exports){ -/* - * Sample Meta Module for demonstration purpose only - */ -module.exports = require('../../util/createMetaModule.js')( - function mapFunction(options) { - - return [ - { 'name': 'ndvi', 'options': {} }, - { 'name': 'colormap', 'options': { colormap: options.colormap } }, - ]; - }, { - infoJson: require('./info.json') - } -)[0]; -},{"../../util/createMetaModule.js":270,"./info.json":233}],232:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":231,"./info.json":233,"dup":162}],233:[function(require,module,exports){ -module.exports={ - "name": "NDVI-Colormap", - "description": "Sequentially Applies NDVI and Colormap steps", - "inputs": {}, - "docs-link": "https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +/* + * Decodes QR from a given image. + */ +module.exports = function DoNothing(options,UI) { + + var output; + var jsQR = require('jsqr'); + var getPixels = require('get-pixels'); + + // This function is called everytime a step has to be redrawn + function draw(input,callback,progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + getPixels(input.src,function(err,pixels){ + + if(err) throw err; + + var w = pixels.shape[0]; + var h = pixels.shape[1]; + var decoded = jsQR(pixels.data,w,h); + + + // Tell Image Sequencer that this step is complete + options.step.qrval = (decoded)?decoded.data:"undefined"; + }); + + function output(image, datauri, mimetype){ + // This output is accessible by Image Sequencer + step.output = { + src: datauri, + format: mimetype + }; + } + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + format: input.format, + image: options.image, + callback: callback + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } } + +},{"../_nomodule/PixelManipulation.js":298,"get-pixels":30,"jsqr":75}],232:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":231,"./info.json":233,"dup":193}],233:[function(require,module,exports){ +module.exports={ + "name": "Decode QR", + "description": "Search for and decode a QR code in the image", + "inputs": { + }, + "outputs": { + "qrval": { + "type": "text" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + },{}],234:[function(require,module,exports){ -/* - * NDVI with red filter (blue channel is infrared) - */ -module.exports = function Ndvi(options, UI) { - - if (options.step.inBrowser) var ui = require('./Ui.js')(options.step, UI); - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.filter = options.filter || defaults.filter; - - var output; - - // The function which is called on every draw. - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function changePixel(r, g, b, a) { - if (options.filter == "red") var ndvi = (b - r) / (1.00 * b + r); - if (options.filter == "blue") var ndvi = (r - b) / (1.00 * b + r); - var x = 255 * (ndvi + 1) / 2; - return [x, x, x, a]; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - function modifiedCallback() { - if (options.step.inBrowser) { - ui.setup(); - } - callback(); - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: modifiedCallback - }); - - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = function Dither(pixels, type) { + type = type; + let bayerThresholdMap = [ + [15, 135, 45, 165], + [195, 75, 225, 105], + [60, 180, 30, 150], + [240, 120, 210, 90] + ]; -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Ui.js":235,"./info.json":237}],235:[function(require,module,exports){ -// hide on save -module.exports = function CropModuleUi(step, ui) { - - /* sets the pixel value under the mouse pointer - * on the title attribute of the image element. - */ - function setup() { - var ndviImage = $(imgEl()); - - ndviImage.mousemove(function ndviMousemove(e) { - - var canvas = document.createElement("canvas"); - canvas.width = ndviImage.width(); - canvas.height = ndviImage.height(); - canvas.getContext('2d').drawImage(this, 0, 0); - - var offset = $(this).offset(); - var xPos = e.pageX - offset.left; - var yPos = e.pageY - offset.top; - var ndvi = canvas.getContext('2d').getImageData(xPos, yPos, 1, 1).data[0]; - ndvi = ndvi/127.5 - 1 ; - ndvi = ndvi.toFixed(2); - ndviImage[0].title = "NDVI: " + ndvi; - }); - } - // step.imgSelector is not defined, imgElement is: - function imgEl() { - return step.imgElement; - } - - return { - setup: setup - } -} + let lumR = []; + let lumG = []; + let lumB = []; + for (let i = 0; i < 256; i++) { + lumR[i] = i * 0.299; + lumG[i] = i * 0.587; + lumB[i] = i * 0.114; + } + let threshold = 129; + let imageDataLength = pixels.data.length; //imageData.data.length; -},{}],236:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":234,"./info.json":237,"dup":162}],237:[function(require,module,exports){ -module.exports={ - "name": "NDVI", - "description": "Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters", - "inputs": { - "filter": { - "type": "select", - "desc": "Filter color", - "default": "red", - "values": ["red", "blue"] - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} + // Greyscale luminance (sets r pixels to luminance of rgb) + for (let i = 0; i <= imageDataLength; i++) { + pixels.data[i] = Math.floor(lumR[pixels.data[i++]] + lumG[pixels.data[i++]] + lumB[pixels.data[i++]]); + } + let w = pixels.shape[0]; + let newPixel, err; + + for (let currentPixel = 0; currentPixel <= imageDataLength; currentPixel += 4) { + + if (type === "none") { + // No dithering + pixels.data[currentPixel] = pixels.data[currentPixel] < threshold ? 0 : 255; + + } else if (type === "bayer") { + + // 4x4 Bayer ordered dithering algorithm + let x = currentPixel / 4 % w; + let y = Math.floor(currentPixel / 4 / w); + let map = Math.floor((pixels.data[currentPixel] + bayerThresholdMap[x % 4][y % 4]) / 2); + pixels.data[currentPixel] = (map < threshold) ? 0 : 255; + + } else if (type === "floydsteinberg") { + + // Floyd–Steinberg dithering algorithm + newPixel = pixels.data[currentPixel] < 129 ? 0 : 255; + err = Math.floor((pixels.data[currentPixel] - newPixel) / 16); + pixels.data[currentPixel] = newPixel; + + pixels.data[currentPixel + 4] += err * 7; + pixels.data[currentPixel + 4 * w - 4] += err * 3; + pixels.data[currentPixel + 4 * w] += err * 5; + pixels.data[currentPixel + 4 * w + 4] += err * 1; + + } else { + + // Bill Atkinson's dithering algorithm + newPixel = pixels.data[currentPixel] < threshold ? 0 : 255; + err = Math.floor((pixels.data[currentPixel] - newPixel) / 8); + pixels.data[currentPixel] = newPixel; + + pixels.data[currentPixel + 4] += err; + pixels.data[currentPixel + 8] += err; + pixels.data[currentPixel + 4 * w - 4] += err; + pixels.data[currentPixel + 4 * w] += err; + pixels.data[currentPixel + 4 * w + 4] += err; + pixels.data[currentPixel + 8 * w] += err; + + } + + // Set g and b pixels equal to r + pixels.data[currentPixel + 1] = pixels.data[currentPixel + 2] = pixels.data[currentPixel]; + } + return pixels; + +} + +},{}],235:[function(require,module,exports){ +module.exports = function Dither(options, UI){ + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + var output; + + function draw(input,callback,progressObj){ + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + options.dither = options.dither || defaults.dither; + + function extraManipulation(pixels) { + pixels = require('./Dither')(pixels, options.dither) + return pixels + } + + function output(image, datauri, mimetype){ + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Dither":234,"./info.json":237}],236:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":235,"./info.json":237,"dup":193}],237:[function(require,module,exports){ +module.exports={ + "name": "Dither", + "description": "Approximates a color from a mixture of other colors when the required color is not available, creating illusions of the color that is not present actually.Read more", + "inputs": { + "dither": { + "type": "select", + "desc": "Name of the Dithering Algorithm", + "default": "none", + "values": ["none","floydsteinberg","bayer","Atkinson"] + } + } +} + },{}],238:[function(require,module,exports){ -module.exports = function Dynamic(options, UI, util) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.x = options.x || defaults.x; - options.y = options.y || defaults.y; - - var output; - - // This function is called on every draw. - function draw(input, callback, progressObj) { - - options.offset = options.offset || -2; - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - var parseCornerCoordinateInputs = require('../../util/ParseInputCoordinates'); - - //parse the inputs - parseCornerCoordinateInputs(options, { - src: input.src, - x: { valInp: options.x, type: 'horizontal' }, - y: { valInp: options.y, type: 'vertical' }, - }, function (options, input) { - options.x = parseInt(input.x.valInp); - options.y = parseInt(input.y.valInp); - }); - - // save the pixels of the base image - var baseStepImage = this.getStep(options.offset).image; - var baseStepOutput = this.getOutput(options.offset); - - var getPixels = require('get-pixels'); - - getPixels(input.src, function (err, pixels) { - options.secondImagePixels = pixels; - - function changePixel(r1, g1, b1, a1, x, y) { - - // overlay - var p = options.secondImagePixels; - if (x >= options.x - && x < p.shape[0] - && y >= options.y - && y < p.shape[1]) - return [ - p.get(x, y, 0), - p.get(x, y, 1), - p.get(x, y, 2), - p.get(x, y, 3) - ]; - else - return [r1, g1, b1, a1]; - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - // run PixelManipulation on first Image pixels - return require('../_nomodule/PixelManipulation.js')(baseStepOutput, { - output: output, - changePixel: changePixel, - format: baseStepOutput.format, - image: baseStepImage, - inBrowser: options.inBrowser, - callback: callback - }); - }); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +module.exports = exports = function(pixels, options){ + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); -},{"../../util/ParseInputCoordinates":269,"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":240,"get-pixels":29}],239:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":238,"./info.json":240,"dup":162}],240:[function(require,module,exports){ -module.exports={ - "name": "Overlay", - "description": "Overlays an Image over another at a given position(x,y) in pixels or in %", - "inputs": { - "x": { - "type": "integer", - "desc": "X-position of the image on which the new image is overlayed", - "default": 0 - }, - "y": { - "type": "integer", - "desc": "Y-position of the image on which the new image is overlayed", - "default": 0 - }, - "offset": { - "type": "integer", - "desc": "offset to the output of the step on which the output of the last step is overlayed", - "default": -2 - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" + options.startingX = options.startingX || defaults.startingX; + options.startingY = options.startingY || defaults.startingY; + var ox = Number(options.startingX), + oy = Number(options.startingY), + iw = pixels.shape[0], + ih = pixels.shape[1], + thickness = Number(options.thickness) || defaults.thickness, + ex = options.endX = Number(options.endX) - thickness || iw - 1, + ey = options.endY = Number(options.endY) -thickness || ih - 1, + color = options.color || defaults.color; + color = color.split(" "); + + var drawSide = function(startX, startY, endX, endY){ + for (var n=startX; n <= endX+thickness; n++){ + for (var k=startY; k <= endY+thickness; k++){ + pixels.set(n, k, 0, color[0]); + pixels.set(n, k, 1, color[1]); + pixels.set(n, k, 2, color[2]); + pixels.set(n, k, 3, color[3]); + } + } + } + + drawSide(ox, oy, ox, ey); // Left + drawSide(ex, oy, ex, ey); // Right + drawSide(ox, oy, ex, oy); // Top + drawSide(ox, ey, ex, ey); // Bottom + return pixels; } -},{}],241:[function(require,module,exports){ -module.exports = function PaintBucket(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function extraManipulation(pixels) { - - pixels = require('./PaintBucket')(pixels, options) - return pixels - - } - - function output(image, datauri, mimetype) { - // This output is accesible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +},{"./../../util/getDefaults.js":305,"./info.json":241}],239:[function(require,module,exports){ +module.exports = function DrawRectangle(options, UI) { -},{"../_nomodule/PixelManipulation.js":264,"./PaintBucket":242}],242:[function(require,module,exports){ -module.exports = exports = function(pixels, options) { - - - let defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - let fillColor = options.fillColor || defaults.fillColor, - x = parseInt(options.startingX) || defaults.startingX, - y = parseInt(options.startingY) || defaults.startingY, - height = pixels.shape[1], - width = pixels.shape[0], - r = pixels.get(x, y, 0), - g = pixels.get(x, y, 1), - b = pixels.get(x, y, 2), - a = pixels.get(x, y, 3), - queuex = [x], - queuey = [y], - curry, currx, - north, - south, - n, - tolerance = parseInt(options.tolerance) || defaults.tolerance, - maxFactor = (1 + tolerance / 100), - minFactor = (1 - tolerance / 100); - - fillColor = fillColor.split(" "); - function isSimilar(currx, curry) { - return (pixels.get(currx, curry, 0) >= r * minFactor && pixels.get(currx, curry, 0) <= r * maxFactor && - pixels.get(currx, curry, 1) >= g * minFactor && pixels.get(currx, curry, 1) <= g * maxFactor && - pixels.get(currx, curry, 2) >= b * minFactor && pixels.get(currx, curry, 2) <= b * maxFactor && - pixels.get(currx, curry, 3) >= a * minFactor && pixels.get(currx, curry, 3) <= a * maxFactor); - } - - while (queuey.length) { - currx = queuex.pop() - curry = queuey.pop() - - if (isSimilar(currx, curry)) { - north = south = curry - - do { - north -= 1 - } while (isSimilar(currx, north) && north >= 0) - - do { - south += 1 - } while (isSimilar(currx, south) && south < height) - - for (n = north + 1; n < south; n += 1) { - pixels.set(currx, n, 0, fillColor[0]); - pixels.set(currx, n, 1, fillColor[1]); - pixels.set(currx, n, 2, fillColor[2]); - pixels.set(currx, n, 3, fillColor[3]); - if (isSimilar(currx - 1, n)) { - queuex.push(currx - 1) - queuey.push(n) - } - if (isSimilar(currx + 1, n)) { - queuex.push(currx + 1) - queuey.push(n) - } - } - } - } - - return pixels; -} + + var output; -},{"./../../util/getDefaults.js":271,"./info.json":244}],243:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":241,"./info.json":244,"dup":162}],244:[function(require,module,exports){ -module.exports={ - "name": "PaintBucket", - "description": "Fill color in pixels", - "inputs": { - "startingX": { - "type": "integer", - "desc": "value of the starting x-coordinate", - "default": "10" - }, - "startingY": { - "type": "integer", - "desc": "value of the starting y-coordinate", - "default": "10" - }, - "fillColor": { - "type": "String", - "desc": "four space separated numbers representing the RGBA values of fill-color", - "default": "100 100 100 255", - "placeholder": "100 100 100 255" - }, - "tolerance": { - "type": "range", - "desc": "% tolerance", - "default": "10", - "min": "0", - "max": "100", - "step": "1" - } - } + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function changePixel(r, g, b, a) { + return [r, g, b, a] + } + + function extraManipulation(pixels) { + pixels = require('./DrawRectangle')(pixels, options) + return pixels + } + + function output(image, datauri, mimetype) { + + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } } + +},{"../_nomodule/PixelManipulation.js":298,"./DrawRectangle":238}],240:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":239,"./info.json":241,"dup":193}],241:[function(require,module,exports){ +module.exports={ + "name": "Draw Rectangle", + "description": "It draws a rectangle on the image", + "inputs": { + "startingX":{ + "type": "Number", + "desc": "starting x position of the rectangle", + "default": 0 + }, + + "startingY": { + "type": "Number", + "desc": "starting y position of the rectangle", + "default": 0 + }, + + "endX":{ + "type": "integer", + "desc": "last x position of the rectangle", + "default": "width" + }, + + "endY":{ + "type": "integer", + "desc": "last y position of the rectangle", + "default": "height" + }, + + "thickness":{ + "type": "integer", + "desc": "thickness of border", + "default": 1 + }, + + "color":{ + "type": "String", + "desc": "RGBA values separated by a space", + "default": "0 0 0 255" + } + } +} + +},{}],242:[function(require,module,exports){ +module.exports = function Dynamic(options,UI) { + + var output; + + // This function is called on every draw. + function draw(input,callback,progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + // start with monochrome, but if options.red, options.green, and options.blue are set, accept them too + options.monochrome = options.monochrome || "(R+G+B)/3"; + + function generator(expression) { + var func = 'f = function (r, g, b, a) { var R = r, G = g, B = b, A = a;' + func = func + 'return '; + func = func + expression + '}'; + var f; + eval(func); + return f; + } + + var channels = ['red', 'green', 'blue', 'alpha']; + + channels.forEach(function(channel) { + if (options.hasOwnProperty(channel)) options[channel + '_function'] = generator(options[channel]); + else if (channel === 'alpha') options['alpha_function'] = function() { return 255; } + else options[channel + '_function'] = generator(options.monochrome); + }); + + function changePixel(r, g, b, a) { + + /* neighbourpixels can be calculated by + this.getNeighbourPixel.fun(x,y) or this.getNeighborPixel.fun(x,y) + */ + var combined = (r + g + b) / 3.000; + return [ + options.red_function(r, g, b, a), + options.green_function(r, g, b, a), + options.blue_function(r, g, b, a), + options.alpha_function(r, g, b, a), + ]; + } + + /* Functions to get the neighbouring pixel by position (x,y) */ + function getNeighbourPixel(pixels,curX,curY,distX,distY){ + return [ + pixels.get(curX+distX,curY+distY,0) + ,pixels.get(curX+distX,curY+distY,1) + ,pixels.get(curX+distX,curY+distY,2) + ,pixels.get(curX+distX,curY+distY,3) + ] + } + + // via P5js: https://github.com/processing/p5.js/blob/2920492842aae9a8bf1a779916893ac19d65cd38/src/math/calculation.js#L461-L472 + function map(n, start1, stop1, start2, stop2, withinBounds) { + var newval = (n - start1) / (stop1 - start1) * (stop2 - start2) + start2; + if (!withinBounds) { + return newval; + } + // also via P5js: https://github.com/processing/p5.js/blob/2920492842aae9a8bf1a779916893ac19d65cd38/src/math/calculation.js#L116-L119 + function constrain(n, low, high) { + return Math.max(Math.min(n, high), low); + }; + if (start2 < stop2) { + return constrain(newval, start2, stop2); + } else { + return constrain(newval, stop2, start2); + } + }; + + function output(image,datauri,mimetype){ + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + getNeighbourPixel: getNeighbourPixel, + getNeighborPixel: getNeighbourPixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298}],243:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":242,"./info.json":244,"dup":193}],244:[function(require,module,exports){ +module.exports={ + "name": "Dynamic", + "description": "A module which accepts JavaScript math expressions to produce each color channel based on the original image's color. See Infragrammar.", + "inputs": { + "red": { + "type": "input", + "desc": "Expression to return for red channel with R, G, B, and A inputs", + "default": "r" + }, + "green": { + "type": "input", + "desc": "Expression to return for green channel with R, G, B, and A inputs", + "default": "g" + }, + "blue": { + "type": "input", + "desc": "Expression to return for blue channel with R, G, B, and A inputs", + "default": "b" + }, + "monochrome (fallback)": { + "type": "input", + "desc": "Expression to return with R, G, B, and A inputs; fallback for other channels if none provided", + "default": "r + g + b" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + },{}],245:[function(require,module,exports){ -/* - * Resize the image by given percentage value - */ -module.exports = function Resize(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.resize = options.resize || defaults.resize; - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - var imagejs = require('imagejs'); - - function changePixel(r, g, b, a) { - return [r, g, b, a] - } - - function extraManipulation(pixels) { - // value above 100% scales up, and below 100% scales down - var resize_value = parseInt(options.resize.slice(0, -1)); - - var new_width, - new_height; - - new_width = Math.round(pixels.shape[0] * (resize_value / 100)); - new_height = Math.round(pixels.shape[1] * (resize_value / 100)); - - var bitmap = new imagejs.Bitmap({width: pixels.shape[0], height: pixels.shape[1]}); - bitmap._data.data = pixels.data; - - - var resized = bitmap.resize({ - width: new_width, height: new_height, - algorithm: "bicubicInterpolation" - }); - - pixels.data = resized._data.data; - pixels.shape = [new_width,new_height,4]; - pixels.stride[1] = 4 * new_width; - - return pixels; - } - - function output(image, datauri, mimetype) { - // This output is accesible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +const _ = require('lodash') -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":247,"imagejs":62}],246:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":245,"./info.json":247,"dup":162}],247:[function(require,module,exports){ -module.exports={ - "name": "Resize", - "description": "Resize image by given percentage value", - "inputs": { - "resize": { - "type": "string", - "desc": "Percentage value of the resize", - "default": "125%" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +//define kernels for the sobel filter +const kernelx = [[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], + kernely = [[-1, -2, -1], [0, 0, 0], [1, 2, 1]]; + +module.exports = function(pixels, highThresholdRatio, lowThresholdRatio, inBrowser) { + let angles = [], mags = [], strongEdgePixels = [], weakEdgePixels = [], notInUI = !inBrowser; + for (var x = 0; x < pixels.shape[0]; x++) { + angles.push([]); + mags.push([]); + for (var y = 0; y < pixels.shape[1]; y++) { + var result = changePixel( + pixels, + pixels.get(x, y, 0), + pixels.get(x, y, 3), + x, + y + ); + let pixel = result.pixel; + + pixels.set(x, y, 0, pixel[0]); + pixels.set(x, y, 1, pixel[1]); + pixels.set(x, y, 2, pixel[2]); + pixels.set(x, y, 3, pixel[3]); + + mags.slice(-1)[0].push(pixel[3]); + angles.slice(-1)[0].push(result.angle); + } + } + nonMaxSupress(pixels, mags, angles); + doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, mags, strongEdgePixels, weakEdgePixels); + return pixels; } -},{}],248:[function(require,module,exports){ -/* - * Rotates image - */ -module.exports = function Rotate(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - options.rotate = parseInt(options.rotate) || defaults.rotate; - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - var imagejs = require('imagejs'); - - function changePixel(r, g, b, a) { - return [r, g, b, a] - } - - function extraManipulation(pixels) { - var rotate_value = (options.rotate)%360; - - if(rotate_value%360 == 0) - return pixels; - - var bitmap = new imagejs.Bitmap({width: pixels.shape[0], height: pixels.shape[1]}); - bitmap._data.data = pixels.data; - - var rotated = bitmap.rotate({ - degrees: rotate_value, - }); - pixels.data = rotated._data.data; - - return pixels; - } - - function output(image, datauri, mimetype) { - // This output is accesible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":250,"imagejs":62}],249:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":248,"./info.json":250,"dup":162}],250:[function(require,module,exports){ -module.exports={ - "name": "Rotate", - "description": "Rotates image by specified degrees", - "inputs": { - "rotate": { - "type": "range", - "desc": "Angular value for rotation in degrees", - "default": "90", - "min": "0", - "max": "360", - "step": "1" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" - } +//changepixel function that convolutes every pixel (sobel filter) +function changePixel(pixels, val, a, x, y) { + let magX = 0.0; + for (let a = 0; a < 3; a++) { + for (let b = 0; b < 3; b++) { -},{}],251:[function(require,module,exports){ -/* - * Saturate an image with a value from 0 to 1 - */ -module.exports = function Saturation(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - var cR = 0.299; - var cG = 0.587; - var cB = 0.114; - - function changePixel(r, g, b, a) { - - var p = Math.sqrt((cR * (r * r)) + (cG * (g * g)) + (cB * (g * g))); - - r = p + (r - p) * (options.saturation); - g = p + (g - p) * (options.saturation); - b = p + (b - p) * (options.saturation); - - - return [Math.round(r), Math.round(g), Math.round(b), a]; - } - - function output(image, datauri, mimetype) { - - // This output is accesible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - - return { - options: options, - //setup: setup, // optional - draw: draw, - output: output, - UI: UI - } -} + let xn = x + a - 1; + let yn = y + b - 1; -},{"../_nomodule/PixelManipulation.js":264}],252:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":251,"./info.json":253,"dup":162}],253:[function(require,module,exports){ -module.exports={ - "name": "Saturation", - "description": "Change the saturation of the image by given value, from 0-1, with 1 being 100% saturated.", - "inputs": { - "saturation": { - "type": "range", - "desc": "saturation for the new image between 0 and 2, 0 being black and white and 2 being highly saturated", - "default": "0.5", - "min": "0", - "max": "2", - "step": "0.1" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} + magX += pixels.get(xn, yn, 0) * kernelx[a][b]; + } + } + let magY = 0.0; + for (let a = 0; a < 3; a++) { + for (let b = 0; b < 3; b++) { -},{}],254:[function(require,module,exports){ -/* - * Image thresholding with 'image-filter-threshold' - */ -module.exports = function ImageThreshold(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this, hist = new Array(256).fill(0); - - function changePixel(r, g, b, a) { - let pixVal = Math.round((r + g + b) / 3); - hist[pixVal]++; - return [r, g, b, a]; - } - - function extraManipulation(pixels) { - pixels = require('./Threshold')(pixels, options, hist) - return pixels - } - function output(image, datauri, mimetype) { - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - } - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - callback: callback - }); - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} + let xn = x + a - 1; + let yn = y + b - 1; -},{"../_nomodule/PixelManipulation.js":264,"./Threshold":255}],255:[function(require,module,exports){ -module.exports = function Threshold(pixels, options, histData) { - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - type = options.threshold ; - threshold = parseInt(options.input) || defaults.input; - var lumR = []; - var lumG = []; - var lumB = []; - for (var i = 0; i < 256; i++) { - lumR[i] = i * 0.299; - lumG[i] = i * 0.587; - lumB[i] = i * 0.114; - } - - var imageDataLength = pixels.data.length; //imageData.data.length; - for (var i = 0; i <= imageDataLength; i++) { - pixels.data[i] = Math.floor(lumR[pixels.data[i++]] + lumG[pixels.data[i++]] + lumB[pixels.data[i++]]); - } - - if (type === "Automatic Thresholding") - threshold = otsu(histData); - - for (var currentPixel = 0; currentPixel <= imageDataLength; currentPixel += 4) { - - pixels.data[currentPixel] = pixels.data[currentPixel] < threshold ? 0 : 255; - pixels.data[currentPixel + 1] = pixels.data[currentPixel + 2] = pixels.data[currentPixel]; - } - return pixels; -} - -function otsu(histData) { - let total = 0; - for (let t = 0; t < 256; t++) total += histData[t]; - - let sum = 0; - for (let t = 0; t < 256; t++) sum += t * histData[t]; - - let sumB = 0; - let wB = 0; - let wF = 0; - - let varMax = 0; - let threshold = 0; - - for (let t = 0; t < 256; t++) { - wB += histData[t]; // Weight Background - if (wB == 0) continue; - - wF = total - wB; // Weight Foreground - if (wF == 0) break; - - sumB += t * histData[t]; - - let mB = sumB / wB; // Mean Background - let mF = (sum - sumB) / wF; // Mean Foreground - - // Calculate Between Class Variance - let varBetween = wB * wF * (mB - mF) * (mB - mF); - - // Check if new maximum found - if (varBetween > varMax) { - varMax = varBetween; - threshold = t; - } - } - - return threshold; - + magY += pixels.get(xn, yn, 0) * kernely[a][b]; + } + } + let mag = Math.sqrt(Math.pow(magX, 2) + Math.pow(magY, 2)); + let angle = Math.atan2(magY, magX); + return { + pixel: + [val, val, val, mag], + angle: angle + }; } -},{"./../../util/getDefaults.js":271,"./info.json":257}],256:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":254,"./info.json":257,"dup":162}],257:[function(require,module,exports){ -module.exports={ - "name": "Threshold", - "description": "Thresholding is used to create binary images", - "inputs": { - "threshold": { - "type": "select", - "desc": "Type of Thresholding", - "default": "Manual Thresholding", - "values": ["Manual Thresholding", "Automatic Thresholding"] - }, - "input": { - "type": "range", - "desc": "Threshold Value", - "default": "120", - "min": "0", - "max": "255", - "step": "1" - } - } -} +//Non Maximum Supression without interpolation +function nonMaxSupress(pixels, mags, angles) { + + angles = angles.map((arr) => arr.map(convertToDegrees)); + + for (let i = 1; i < pixels.shape[0] - 1; i++) { + for (let j = 1; j < pixels.shape[1] - 1; j++) { + + let angle = angles[i][j]; + let pixel = pixels.get(i, j); + + if ((angle >= -22.5 && angle <= 22.5) || + (angle < -157.5 && angle >= -180)) + + if ((mags[i][j] >= mags[i][j + 1]) && + (mags[i][j] >= mags[i][j - 1])) + pixels.set(i, j, 3, mags[i][j]); + else + pixels.set(i, j, 3, 0); + + else if ((angle >= 22.5 && angle <= 67.5) || + (angle < -112.5 && angle >= -157.5)) + + if ((mags[i][j] >= mags[i + 1][j + 1]) && + (mags[i][j] >= mags[i - 1][j - 1])) + pixels.set(i, j, 3, mags[i][j]); + else + pixels.set(i, j, 3, 0); + + else if ((angle >= 67.5 && angle <= 112.5) || + (angle < -67.5 && angle >= -112.5)) + + if ((mags[i][i] >= mags[i + 1][j]) && + (mags[i][j] >= mags[i][j])) + pixels.set(i, j, 3, mags[i][j]); + else + pixels.set(i, j, 3, 0); + + else if ((angle >= 112.5 && angle <= 157.5) || + (angle < -22.5 && angle >= -67.5)) + + if ((mags[i][j] >= mags[i + 1][j - 1]) && + (mags[i][j] >= mags[i - 1][j + 1])) + pixels.set(i, j, 3, mags[i][j]); + else + pixels.set(i, j, 3, 0); + + } + } +} +//Converts radians to degrees +var convertToDegrees = radians => (radians * 180) / Math.PI; + +//Finds the max value in a 2d array like mags +var findMaxInMatrix = arr => Math.max(...arr.map(el => el.map(val => !!val ? val : 0)).map(el => Math.max(...el))); + +//Applies the double threshold to the image +function doubleThreshold(pixels, highThresholdRatio, lowThresholdRatio, mags, strongEdgePixels, weakEdgePixels) { + + const highThreshold = findMaxInMatrix(mags) * highThresholdRatio; + const lowThreshold = highThreshold * lowThresholdRatio; + + for (let i = 0; i < pixels.shape[0]; i++) { + for (let j = 0; j < pixels.shape[1]; j++) { + let pixelPos = [i, j]; + + mags[i][j] > lowThreshold + ? mags[i][j] > highThreshold + ? strongEdgePixels.push(pixelPos) + : weakEdgePixels.push(pixelPos) + : pixels.set(i, j, 3, 0); + } + } + + strongEdgePixels.forEach(pix => pixels.set(pix[0], pix[1], 3, 255)); +} + +// hysteresis edge tracking algorithm -- not working as of now +/* function hysteresis(pixels) { + function getNeighbouringPixelPositions(pixelPosition) { + let x = pixelPosition[0], y = pixelPosition[1] + return [[x + 1, y + 1], + [x + 1, y], + [x + 1, y - 1], + [x, y + 1], + [x, y - 1], + [x - 1, y + 1], + [x - 1, y], + [x - 1, y - 1]] + } + + //This can potentially be improved see https://en.wikipedia.org/wiki/Connected-component_labeling + for (weakPixel in weakEdgePixels) { + let neighbourPixels = getNeighbouringPixelPositions(weakEdgePixels[weakPixel]) + for (pixel in neighbourPixels) { + if (strongEdgePixels.find(el => _.isEqual(el, neighbourPixels[pixel]))) { + pixels.set(weakPixel[0], weakPixel[1], 3, 255) + weakEdgePixels.splice(weakPixel, weakPixel) + break + } + } + } + weakEdgePixels.forEach(pix => pixels.set(pix[0], pix[1], 3, 0)) + return pixels +} */ + + + + +},{"lodash":76}],246:[function(require,module,exports){ +/* +* Detect Edges in an Image +*/ +module.exports = function edgeDetect(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.blur = options.blur || defaults.blur; + options.highThresholdRatio = options.highThresholdRatio || defaults.highThresholdRatio; + options.lowThresholdRatio = options.lowThresholdRatio || defaults.lowThresholdRatio; + + var output; + + // The function which is called on every draw. + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + + // Extra Manipulation function used as an enveloper for applying gaussian blur and Convolution + function extraManipulation(pixels) { + pixels = require('ndarray-gaussian-filter')(pixels, options.blur); + pixels = require('./EdgeUtils')(pixels, options.highThresholdRatio, options.lowThresholdRatio, options.inBrowser); + return pixels; + } + + function changePixel(r, g, b, a) { + return [(r + g + b) / 3, (r + g + b) / 3, (r + g + b) / 3, a]; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./EdgeUtils":245,"./info.json":248,"ndarray-gaussian-filter":81}],247:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":246,"./info.json":248,"dup":193}],248:[function(require,module,exports){ +module.exports={ + "name": "Detect Edges", + "description": "This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ", + "inputs": { + "blur": { + "type": "range", + "desc": "Amount of gaussian blur(Less blur gives more detail, typically 0-5)", + "default": "2", + "min": "0", + "max": "5", + "step": "0.25" + }, + "highThresholdRatio":{ + "type": "float", + "desc": "The high threshold ratio for the image", + "default": 0.2 + }, + "lowThresholdRatio": { + "type": "float", + "desc": "The low threshold value for the image", + "default": 0.15 + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],249:[function(require,module,exports){ +/* + * Resolves Fisheye Effect + */ +module.exports = function DoNothing(options,UI) { + + var output; + + require('fisheyegl'); + + function draw(input,callback) { + + var step = this; + + if (!options.inBrowser) { // This module is only for browser + this.output = input; + callback(); + } + else { + // Create a canvas, if it doesn't already exist. + if (!document.querySelector('#image-sequencer-canvas')) { + var canvas = document.createElement('canvas'); + canvas.style.display = "none"; + canvas.setAttribute('id','image-sequencer-canvas'); + document.body.append(canvas); + } + else var canvas = document.querySelector('#image-sequencer-canvas'); + + distorter = FisheyeGl({ + selector: "#image-sequencer-canvas" + }); + + // Parse the inputs + options.a = parseFloat(options.a) || distorter.lens.a; + options.b = parseFloat(options.b) || distorter.lens.b; + options.Fx = parseFloat(options.Fx) || distorter.lens.Fx; + options.Fy = parseFloat(options.Fy) || distorter.lens.Fy; + options.scale = parseFloat(options.scale) || distorter.lens.scale; + options.x = parseFloat(options.x) || distorter.fov.x; + options.y = parseFloat(options.y) || distorter.fov.y; + + // Set fisheyegl inputs + distorter.lens.a = options.a; + distorter.lens.b = options.b; + distorter.lens.Fx = options.Fx; + distorter.lens.Fy = options.Fy; + distorter.lens.scale = options.scale; + distorter.fov.x = options.x; + distorter.fov.y = options.y; + + // generate fisheyegl output + distorter.setImage(input.src,function(){ + + // this output is accessible to Image Sequencer + step.output = {src: canvas.toDataURL(), format: input.format}; + + // Tell Image Sequencer and UI that step has been drawn + callback(); + + }); + + } + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"fisheyegl":22}],250:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":249,"./info.json":251,"dup":193}],251:[function(require,module,exports){ +module.exports={ + "name": "Fisheye GL", + "description": "Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).", + "requires": [ "webgl" ], + "inputs": { + "a": { + "type": "float", + "desc": "a parameter", + "default": 1, + "min": 1, + "max": 4 + }, + "b": { + "type": "float", + "desc": "b parameter", + "default": 1, + "min": 1, + "max": 4 + }, + "Fx": { + "type": "float", + "desc": "Fx parameter", + "default": 0, + "min": 0, + "max": 4 + }, + "Fy": { + "type": "float", + "desc": "Fy parameter", + "default": 0, + "min": 0, + "max": 4 + }, + "scale": { + "type": "float", + "desc": "Image Scaling", + "default": 1.5, + "min": 0, + "max": 20 + }, + "x": { + "type": "float", + "desc": "FOV x parameter", + "default": 1.5, + "min": 0, + "max": 20 + }, + "y": { + "type": "float", + "desc": "FOV y parameter", + "default": 1.5, + "min": 0, + "max": 20 + }, + "fragmentSrc": { + "type": "PATH", + "desc": "Path to a WebGL fragment shader file", + "default": "(inbuilt)" + }, + "vertexSrc": { + "type": "PATH", + "desc": "Path to a WebGL vertex shader file", + "default": "(inbuilt)" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],252:[function(require,module,exports){ +module.exports = function Gamma(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')), + adjustment = options.adjustment || defaults.adjustment; + var val = adjustment / defaults.adjustment; + + function changePixel(r, g, b, a) { + + r = Math.pow(r / 255, val) * 255; + g = Math.pow(g / 255, val) * 255; + b = Math.pow(b / 255, val) * 255; + + return [r, g, b, a]; + } + + function output(image, datauri, mimetype) { + + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":254}],253:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":252,"./info.json":254,"dup":193}],254:[function(require,module,exports){ +module.exports={ + "name": "Gamma Correction", + "description": "Apply gamma correction on the image Read more", + "inputs": { + "adjustment": { + "type": "float", + "desc": "gamma correction (inverse of actual gamma factor) for the new image", + "default": 0.2 + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],255:[function(require,module,exports){ +(function (Buffer){ +module.exports = function Invert(options, UI) { + + var output; + + // The function which is called on every draw. + function draw(input, callback, progressObj) { + var getPixels = require('get-pixels'); + var savePixels = require('save-pixels'); + + var step = this; + + getPixels(input.src, function(err, pixels) { + + if (err) { + console.log("Bad Image path"); + return; + } + + var width = pixels.shape[0]; + + for (var i = 0; i < pixels.shape[0]; i++) { + for (var j = 0; j < pixels.shape[1]; j++) { + let val = (i / width) * 255; + pixels.set(i, j, 0, val); + pixels.set(i, j, 1, val); + pixels.set(i, j, 2, val); + pixels.set(i, j, 3, 255); + } + } + var chunks = []; + var totalLength = 0; + var r = savePixels(pixels, input.format, { quality: 100 }); + + r.on("data", function(chunk) { + totalLength += chunk.length; + chunks.push(chunk); + }); + + r.on("end", function() { + var data = Buffer.concat(chunks, totalLength).toString("base64"); + var datauri = "data:image/" + input.format + ";base64," + data; + output(input.image, datauri, input.format); + callback(); + }); + }); + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +}).call(this,require("buffer").Buffer) +},{"buffer":48,"get-pixels":30,"save-pixels":168}],256:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":255,"./info.json":257,"dup":193}],257:[function(require,module,exports){ +module.exports={ + "name": "Gradient", + "description": "Gives a gradient of the image", + "inputs": {}, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],258:[function(require,module,exports){ -module.exports = function Tint(options, UI) { - - var defaults = require('./../../util/getDefaults.js')(require('./info.json')); - - var output; - - function draw(input, callback, progressObj) { - - var color = options.color || defaults.color; - color = color.split(" "); - var factor = options.factor || defaults.factor; - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function changePixel(r, g, b, a) { - - r -= (r - color[0]) * factor; - g -= (g - color[1]) * factor; - b -= (b - color[2]) * factor; - return [r, g, b, a] - } - - function output(image, datauri, mimetype) { - - // This output is accessible by Image Sequencer - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - changePixel: changePixel, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - - } - return { - options: options, - draw: draw, - output: output, - UI: UI - } -} +/* + * Calculates the histogram of the image + */ +module.exports = function Channel(options, UI) { -},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":260}],259:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":258,"./info.json":260,"dup":162}],260:[function(require,module,exports){ -module.exports={ - "name": "Tint", - "description": "Add color tint to an image", - "inputs": { - "color":{ - "type": "String", - "desc": "RGB values separated by a space", - "default": "0 0 255" - }, - "factor": { - "type": "range", - "desc": "Amount of tint", - "default": "0.5", - "min": "0", - "max": "1", - "step": "0.01" - } - } -} + var output; + function draw(input, callback, progressObj) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.gradient = options.gradient || defaults.gradient; + options.gradient = JSON.parse(options.gradient); + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this, hist = new Array(256).fill(0); + + function changePixel(r, g, b, a) { + let pixVal = Math.round((r + g + b) / 3); + hist[pixVal]++; + return [r, g, b, a]; + } + + function extraManipulation(pixels) { + // if (!options.inBrowser) + // require('fs').writeFileSync('./output/histo.txt', hist.reduce((tot, cur, idx) => `${tot}\n${idx} : ${cur}`, ``)); + var newarray = new Uint8Array(4 * 256 * 256); + pixels.data = newarray; + pixels.shape = [256, 256, 4]; + pixels.stride[1] = 4 * 256; + + for (let x = 0; x < 256; x++) { + for (let y = 0; y < 256; y++) { + pixels.set(x, y, 0, 255); + pixels.set(x, y, 1, 255); + pixels.set(x, y, 2, 255); + pixels.set(x, y, 3, 255); + } + } + + let startY = options.gradient ? 10 : 0; + if (options.gradient) { + for (let x = 0; x < 256; x++) { + for (let y = 0; y < 10; y++) { + pixels.set(x, 255 - y, 0, x); + pixels.set(x, 255 - y, 1, x); + pixels.set(x, 255 - y, 2, x); + } + } + } + + let convfactor = (256 - startY) / Math.max(...hist); + + for (let x = 0; x < 256; x++) { + let pixCount = Math.round(convfactor * hist[x]); + + for (let y = startY; y < pixCount; y++) { + pixels.set(x, 255 - y, 0, 204); + pixels.set(x, 255 - y, 1, 255); + pixels.set(x, 255 - y, 2, 153); + } + } + + return pixels; + } + + function output(image, datauri, mimetype) { + + // This output is accesible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + + return { + options: options, + //setup: setup, // optional + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":260}],259:[function(require,module,exports){ +module.exports = [ + require('./Module.js'), + require('./info.json') +] +},{"./Module.js":258,"./info.json":260}],260:[function(require,module,exports){ +module.exports={ + "name": "Histogram", + "description": "Calculates the histogram for the image", + "inputs": { + "gradient": { + "type": "select", + "desc": "Toggle the gradient along x-axis", + "default": "true", + "values": [ + "true", + "false" + ] + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],261:[function(require,module,exports){ -module.exports = function Balance(options, UI) { - - var output; - - function draw(input, callback, progressObj) { - - options.temperature = (options.temperature > "40000") ? "40000" : options.temperature - - progressObj.stop(true); - progressObj.overrideFlag = true; - - var step = this; - - function extraManipulation(pixels) { - - let temp = parseInt(options.temperature) - temp /= 100 - - let r, g, b; - - if (temp <= 66) { - r = 255; - g = Math.min(Math.max(99.4708025861 * Math.log(temp) - 161.1195681661, 0), 255); - } else { - r = Math.min(Math.max(329.698727446 * Math.pow(temp - 60, -0.1332047592), 0), 255); - g = Math.min(Math.max(288.1221695283 * Math.pow(temp - 60, -0.0755148492), 0), 255); - } - - if (temp >= 66) { - b = 255; - } else if (temp <= 19) { - b = 0; - } else { - b = temp - 10; - b = Math.min(Math.max(138.5177312231 * Math.log(b) - 305.0447927307, 0), 255); - } - - for (let i = 0; i < pixels.shape[0]; i++) { - for (let j = 0; j < pixels.shape[1]; j++) { - - r_data = pixels.get(i, j, 0) - r_new_data = (255 / r) * r_data - pixels.set(i, j, 0, r_new_data) - - g_data = pixels.get(i, j, 1) - g_new_data = (255 / g) * g_data - pixels.set(i, j, 1, g_new_data) - - b_data = pixels.get(i, j, 2) - b_new_data = (255 / b) * b_data - pixels.set(i, j, 2, b_new_data) - } - } - - return pixels - } - - function output(image, datauri, mimetype) { - - step.output = { src: datauri, format: mimetype }; - - } - - return require('../_nomodule/PixelManipulation.js')(input, { - output: output, - extraManipulation: extraManipulation, - format: input.format, - image: options.image, - inBrowser: options.inBrowser, - callback: callback - }); - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } - -} -},{"../_nomodule/PixelManipulation.js":264}],262:[function(require,module,exports){ -arguments[4][162][0].apply(exports,arguments) -},{"./Module":261,"./info.json":263,"dup":162}],263:[function(require,module,exports){ -module.exports={ - "name": "White Balance", - "description": "Change the colour balance of the image by adjusting the colour temperature.", - "inputs": { - "temperature": { - "type": "string", - "desc": "Temperature between 0 - 40,000 Kelvin", - "default": "6000" - } - }, - "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" -} -},{}],264:[function(require,module,exports){ -(function (process,Buffer){ -/* -* General purpose per-pixel manipulation -* accepting a changePixel() method to remix a pixel's channels -*/ -module.exports = function PixelManipulation(image, options) { - - // To handle the case where pixelmanipulation is called on the input object itself - // like input.pixelManipulation(options) - if (arguments.length <= 1) { - options = image; - image = this; - } - - options = options || {}; - - const getPixels = require("get-pixels"), - savePixels = require("save-pixels"); - - getPixels(image.src, function(err, pixels) { - if (err) { - console.log("Bad image path", image); - return; - } - - if (options.getNeighbourPixel) { - options.getNeighbourPixel.fun = function getNeighborPixel(distX, distY) { - return options.getNeighbourPixel(pixels, x, y, distX, distY); - }; - } - - // iterate through pixels; - // TODO: this could possibly be more efficient; see - // https://github.com/p-v-o-s/infragram-js/blob/master/public/infragram.js#L173-L181 - - if (!options.inBrowser && !process.env.TEST) { - try { - var pace = require("pace")(pixels.shape[0] * pixels.shape[1]); - } catch (e) { - options.inBrowser = true; - } - } - - if (options.preProcess) pixels = options.preProcess(pixels); // Allow for preprocessing - - if (options.changePixel) { - - /* Allows for Flexibility - if per pixel manipulation is not required */ - - for (var x = 0; x < pixels.shape[0]; x++) { - for (var y = 0; y < pixels.shape[1]; y++) { - let pixel = options.changePixel( - pixels.get(x, y, 0), - pixels.get(x, y, 1), - pixels.get(x, y, 2), - pixels.get(x, y, 3), - x, - y - ); - - pixels.set(x, y, 0, pixel[0]); - pixels.set(x, y, 1, pixel[1]); - pixels.set(x, y, 2, pixel[2]); - pixels.set(x, y, 3, pixel[3]); - - if (!options.inBrowser && !process.env.TEST) pace.op(); - } - } - } - - // perform any extra operations on the entire array: - if (options.extraManipulation) pixels = options.extraManipulation(pixels); - - // there may be a more efficient means to encode an image object, - // but node modules and their documentation are essentially arcane on this point - var chunks = []; - var totalLength = 0; - var r = savePixels(pixels, options.format, { quality: 100 }); - - r.on("data", function(chunk) { - totalLength += chunk.length; - chunks.push(chunk); - }); - - r.on("end", function() { - var data = Buffer.concat(chunks, totalLength).toString("base64"); - var datauri = "data:image/" + options.format + ";base64," + data; - if (options.output) - options.output(options.image, datauri, options.format); - if (options.callback) options.callback(); - }); - }); -}; +/* + * Import Image module; this fetches a given remote or local image via URL + * or data-url, and overwrites the current one. It saves the original as + * step.metadata.input for use in future modules such as blending. + * TODO: we could accept an operation for blending like "screen" or "overlay", + * or a function with blend(r1,g1,b1,a1,r2,g2,b2,a2), OR we could simply allow + * subsequent modules to do this blending and keep this one simple. + */ +module.exports = function ImportImageModule(options, UI) { -}).call(this,require('_process'),require("buffer").Buffer) -},{"_process":117,"buffer":47,"get-pixels":29,"pace":94,"save-pixels":138}],265:[function(require,module,exports){ -// special module to load an image into the start of the sequence; used in the HTML UI -function LoadImage(ref, name, src, main_callback) { - function makeImage(datauri) { - var image = { - src: datauri, - format: datauri.split(':')[1].split(';')[0].split('/')[1] - } - return image; - } - function CImage(src, callback) { - var datauri; - if (!!src.match(/^data:/i)) { - datauri = src; - callback(datauri); - } - else if (!ref.options.inBrowser && !!src.match(/^https?:\/\//i)) { - require( src.match(/^(https?):\/\//i)[1] ).get(src,function(res){ - var data = ''; - var contentType = res.headers['content-type']; - res.setEncoding('base64'); - res.on('data',function(chunk) {data += chunk;}); - res.on('end',function() { - callback("data:"+contentType+";base64,"+data); - }); - }); - } - else if (ref.options.inBrowser) { - var ext = src.split('.').pop(); - var image = document.createElement('img'); - var canvas = document.createElement('canvas'); - var context = canvas.getContext('2d'); - image.onload = function() { - canvas.width = image.naturalWidth; - canvas.height = image.naturalHeight; - context.drawImage(image,0,0); - datauri = canvas.toDataURL(ext); - callback(datauri); - } - image.src = src; - } - else { - datauri = require('urify')(src); - callback(datauri); - } - } - - function loadImage(name, src) { - var step = { - name: "load-image", - description: "This initial step loads and displays the original image without any modifications.

To work with a new or different image, drag one into the drop zone.", - ID: ref.options.sequencerCounter++, - imageName: name, - inBrowser: ref.options.inBrowser, - ui: ref.options.ui - }; - - var image = { - src: src, - steps: [{ - options: { - id: step.ID, - name: "load-image", - description: "This initial step loads and displays the original image without any modifications.", - title: "Load Image", - step: step - }, - UI: ref.events, - draw: function() { - UI.onDraw(options.step); - if(arguments.length==1){ - this.output = CImage(arguments[0]); - options.step.output = this.output; - UI.onComplete(options.step); - return true; - } - else if(arguments.length==2) { - this.output = CImage(arguments[0]); - options.step.output = this.output; - arguments[1](); - UI.onComplete(options.step); - return true; - } - return false; - }, - }] - }; - CImage(src, function(datauri) { - var output = makeImage(datauri); - ref.images[name] = image; - var loadImageStep = ref.images[name].steps[0]; - loadImageStep.output = output; - loadImageStep.options.step.output = loadImageStep.output.src; - loadImageStep.UI.onSetup(loadImageStep.options.step); - loadImageStep.UI.onDraw(loadImageStep.options.step); - loadImageStep.UI.onComplete(loadImageStep.options.step); - - main_callback(); - return true; - }); - } - - return loadImage(name,src); -} - -module.exports = LoadImage; + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.imageUrl = options.url || defaults.url; -},{"urify":147}],266:[function(require,module,exports){ -// TODO: potentially move this into ImportImage module -function setInputStepInit() { - - return function setInputStep(options) { - - var dropzone = $(options.dropZoneSelector); - var fileInput = $(options.fileInputSelector); - var takePhoto = $(options.takePhotoSelector); - - var onLoad = options.onLoad; - var onTakePhoto = options.onTakePhoto; - - var reader = new FileReader(); - - function handleFile(e) { - - e.preventDefault(); - e.stopPropagation(); // stops the browser from redirecting. - - if (e.target && e.target.files) var file = e.target.files[0]; - else var file = e.dataTransfer.files[0]; - if(!file) return; - - var reader = new FileReader(); - - reader.onload = onLoad; - - reader.readAsDataURL(file); - } - - function runVideo(){ - /* event handler for Take-Photo */ - document.getElementById('video').style.display='inline'; - document.getElementById('capture').style.display='inline'; - document.getElementById('close').style.display='inline'; - - var video = document.getElementById('video'); - canvas = document.getElementById('canvas'), - context = canvas.getContext('2d'), - vendorUrl = window.URL || window.webkitURL; - - const constraints = { audio: false,video: true}; - - function handleSuccess(stream) { - window.stream = stream; // make stream available to browser console - video.srcObject = stream; - video.onloadedmetadata = function(e) { - video.play(); - }; - document.getElementById('close').addEventListener('click', function () { - stopStream(stream); - }); - } - function handleError(error) { - console.log('navigator.getUserMedia error: ', error); - } - navigator.mediaDevices.getUserMedia(constraints).then(handleSuccess).catch(handleError); - - - document.getElementById('capture').addEventListener('click', function(stream){ - context.drawImage(video, 0, 0, 400, 300); - options.onTakePhoto(canvas.toDataURL()); - }); - - function stopStream(stream) { - stream.getVideoTracks().forEach(function (track) { - track.stop(); - }); - document.getElementById('video').style.display='none'; - document.getElementById('capture').style.display='none'; - document.getElementById('close').style.display='none'; - } -} - - fileInput.on('change', handleFile); - takePhoto.on('click', runVideo); - - dropzone[0].addEventListener('drop', handleFile, false); - - dropzone.on('dragover', function onDragover(e) { - e.stopPropagation(); - e.preventDefault(); - e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy. - }, false); - - dropzone.on('dragenter', function onDragEnter(e) { - dropzone.addClass('hover'); - }); - - dropzone.on('dragleave', function onDragLeave(e) { - dropzone.removeClass('hover'); - }); - - } - -} -module.exports = setInputStepInit; + var output, + imgObj = new Image(); + + // we should get UI to return the image thumbnail so we can attach our own UI extensions + + // add our custom in-module html ui: + if (options.step.inBrowser) { + var ui = require('./Ui.js')(options.step, UI); + ui.setup(); + } + + // This function is caled everytime the step has to be redrawn + function draw(input, callback) { + + var step = this; + + if (!options.inBrowser) { // This module is only for browser + this.output = input; + callback(); + } else { + step.metadata = step.metadata || {}; + // TODO: develop a standard API method for saving each input state, + // for reference in future steps (for blending, for example) + step.metadata.input = input; + + function onLoad() { + + // This output is accessible to Image Sequencer + step.output = { + src: imgObj.src, + format: options.format + } + + // Tell Image Sequencer that step has been drawn + callback(); + } + + options.format = require('../../util/GetFormat')(options.imageUrl); + imgObj.onload = onLoad; + imgObj.src = options.imageUrl; + + } + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../../util/GetFormat":302,"./../../util/getDefaults.js":305,"./Ui.js":262,"./info.json":264}],262:[function(require,module,exports){ +// hide on save +module.exports = function ImportImageModuleUi(step, ui) { + + function setup(setImage, onLoad) { + + // generate a unique timestamp based id for the dropzone + var dropzoneId = 'dropzone-import-image-' + step.ID; + + // add a file input listener + var dropZone ='\ +
\ +

\ + Select or drag in an image to overlay.\ +

\ +
\ + \ +
\ +
'; + + // insert into .details area + // TODO: develop API-based consistent way to add UI elements + $(step.ui) + .find('.details') + .prepend(dropZone); + + // setup file input listener + sequencer.setInputStep({ + dropZoneSelector: "#" + dropzoneId, + fileInputSelector: "#" + dropzoneId + " .file-input", + onLoad: function onLoadFromInput(progress) { + var reader = progress.target; + step.options.imageUrl = reader.result; + step.options.url = reader.result; + sequencer.run(); + setUrlHashParameter("steps", sequencer.toString()); + } + }); + + $(step.ui) + .find('.btn-save').on('click', function onClickSave() { + + var src = $(step.ui) + .find('.det input').val(); + step.options.imageUrl = src; + sequencer.run(); + + }); + + } + + return { + setup: setup + } +} + +},{}],263:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":261,"./info.json":264,"dup":193}],264:[function(require,module,exports){ +module.exports={ + "name": "Import Image", + "description": "Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.", + "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", + "inputs": { + "url": { + "type": "string", + "desc": "URL of image to import", + "default": "./images/monarch.png" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} +},{}],265:[function(require,module,exports){ +/* + * NDVI with red filter (blue channel is infrared) + */ +module.exports = function Ndvi(options, UI) { + + if (options.step.inBrowser) var ui = require('./Ui.js')(options.step, UI); + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.filter = options.filter || defaults.filter; + + var output; + + // The function which is called on every draw. + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function changePixel(r, g, b, a) { + if (options.filter == "red") var ndvi = (b - r) / (1.00 * b + r); + if (options.filter == "blue") var ndvi = (r - b) / (1.00 * b + r); + var x = 255 * (ndvi + 1) / 2; + return [x, x, x, a]; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + function modifiedCallback() { + if (options.step.inBrowser) { + ui.setup(); + } + callback(); + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: modifiedCallback + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Ui.js":266,"./info.json":268}],266:[function(require,module,exports){ +// hide on save +module.exports = function CropModuleUi(step, ui) { + + /* sets the pixel value under the mouse pointer + * on the title attribute of the image element. + */ + function setup() { + var ndviImage = $(imgEl()); + + ndviImage.mousemove(function ndviMousemove(e) { + + var canvas = document.createElement("canvas"); + canvas.width = ndviImage.width(); + canvas.height = ndviImage.height(); + canvas.getContext('2d').drawImage(this, 0, 0); + + var offset = $(this).offset(); + var xPos = e.pageX - offset.left; + var yPos = e.pageY - offset.top; + var ndvi = canvas.getContext('2d').getImageData(xPos, yPos, 1, 1).data[0]; + ndvi = ndvi/127.5 - 1 ; + ndvi = ndvi.toFixed(2); + ndviImage[0].title = "NDVI: " + ndvi; + }); + } + // step.imgSelector is not defined, imgElement is: + function imgEl() { + return step.imgElement; + } + + return { + setup: setup + } +} },{}],267:[function(require,module,exports){ -/* - * User Interface Handling Module - */ - -module.exports = function UserInterface(events = {}) { - - events.onSetup = events.onSetup || function(step) { - if (step.ui == false) { - // No UI - } else if(step.inBrowser) { - // Create and append an HTML Element - console.log("Added Step \""+step.name+"\" to \""+step.imageName+"\"."); - } else { - // Create a NodeJS Object - console.log('\x1b[36m%s\x1b[0m',"Added Step \""+step.name+"\" to \""+step.imageName+"\"."); - } - } - - events.onDraw = events.onDraw || function(step) { - if (step.ui == false) { - // No UI - } else if(step.inBrowser) { - // Overlay a loading spinner - console.log("Drawing Step \""+step.name+"\" on \""+step.imageName+"\"."); - } else { - // Don't do anything - console.log('\x1b[33m%s\x1b[0m',"Drawing Step \""+step.name+"\" on \""+step.imageName+"\"."); - } - } - - events.onComplete = events.onComplete || function(step) { - if (step.ui == false) { - // No UI - } else if(step.inBrowser) { - // Update the DIV Element - // Hide the laoding spinner - console.log("Drawn Step \""+step.name+"\" on \""+step.imageName+"\"."); - } else { - // Update the NodeJS Object - console.log('\x1b[32m%s\x1b[0m',"Drawn Step \""+step.name+"\" on \""+step.imageName+"\"."); - } - } - - events.onRemove = events.onRemove || function(step) { - if (step.ui == false){ - // No UI - } else if(step.inBrowser) { - // Remove the DIV Element - console.log("Removing Step \""+step.name+"\" of \""+step.imageName+"\"."); - } else { - // Delete the NodeJS Object - console.log('\x1b[31m%s\x1b[0m',"Removing Step \""+step.name+"\" of \""+step.imageName+"\"."); - } - } - - events.notify = events.notify || function(msg) { - console.log(msg); - } - - return events; - -} - -},{}],268:[function(require,module,exports){ -/* -* Determine format from a URL or data-url, return "jpg" "png" "gif" etc -* TODO: write a test for this using the examples -*/ -module.exports = function GetFormat(src) { - - var format = undefined; // haha default - - // EXAMPLE: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z"; - // EXAMPLE: "http://example.com/example.png" - // EXAMPLE: "/example.png" - - if (isDataUrl(src)) { - format = src.split(';')[0].split('/').pop(); - } else { - format = src.split('.').pop(); - } - - function isDataUrl(src) { - return src.substr(0, 10) === "data:image" - } - - format = format.toLowerCase(); - - if (format === "jpeg") format = "jpg"; - - function validateFormat(data){ - let supportedFormats = [ - 'jpg', - 'jpeg', - 'png', - 'gif', - 'canvas', - ]; - return supportedFormats.includes(data); - } - - return validateFormat(format)?format:'jpg'; - -} +arguments[4][193][0].apply(exports,arguments) +},{"./Module":265,"./info.json":268,"dup":193}],268:[function(require,module,exports){ +module.exports={ + "name": "NDVI", + "description": "Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters", + "inputs": { + "filter": { + "type": "select", + "desc": "Filter color", + "default": "red", + "values": ["red", "blue"] + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} },{}],269:[function(require,module,exports){ -module.exports = function parseCornerCoordinateInputs(options,coord,callback) { - var getPixels = require('get-pixels'); - getPixels(coord.src, function(err, pixels) { - var iw = pixels.shape[0], - ih = pixels.shape[1]; - if (!coord.x.valInp) { - return - } - else { - Object.keys(coord).forEach(convert); - function convert(key) { - var val = coord[key]; - if (val.valInp && val.valInp.slice(-1) === "%") { - val.valInp = parseInt(val.valInp, 10); - if (val.type === 'horizontal') - val.valInp = val.valInp * iw / 100; - else - val.valInp = val.valInp * ih / 100; - } - } - } - callback(options, coord); - }) - } -},{"get-pixels":29}],270:[function(require,module,exports){ -module.exports = function createMetaModule(mapFunction, moduleOptions) { - - moduleOptions = moduleOptions || {}; - moduleOptions.infoJson = moduleOptions.infoJson || {}; - - function MetaModule(options, UI) { - - var defaults = require('./getDefaults.js')(moduleOptions.infoJson); - var output; - - - // Parses the options and gets the input which is not available in options from defaults - for (key in moduleOptions.infoJson.inputs) { - if (moduleOptions.infoJson.inputs.hasOwnProperty(key)) { - options[key] = options[key] || defaults[key]; - } - } - - // map inputs to internal step options; - // use this to set defaults for internal steps - // and to expose internal settings as external meta-module parameters; - // it must return a steps object - var steps = mapFunction(options); - - /* example: - function mapFunction(opt, _defaults) { - - // return steps with options: - return [ - { 'name': 'gradient', 'options': {} }, - { 'name': 'colormap', 'options': { colormap: options.colormap } }, - { 'name': 'crop', 'options': { 'y': 0, 'h': options.h } }, - { 'name': 'overlay', 'options': { 'x': options.x, 'y': options.y, 'offset': -4 } } - ]; - } - */ - - // ui: false prevents internal logs - var internalSequencer = ImageSequencer({ inBrowser: false, ui: false }); - - function draw(input, callback) { - - var step = this; - - internalSequencer.loadImage(input.src, function onAddImage() { - internalSequencer.importJSON(steps); - internalSequencer.run(function onCallback(internalOutput) { - step.output = { src: internalOutput, format: input.format }; - callback(); - }); - }); - - } - - return { - options: options, - draw: draw, - output: output, - UI: UI - } - } - - return [MetaModule, moduleOptions.infoJson]; -} +/* + * Sample Meta Module for demonstration purpose only + */ +module.exports = require('../../util/createMetaModule.js')( + function mapFunction(options) { -},{"./getDefaults.js":271}],271:[function(require,module,exports){ -module.exports = function(info){ - var defaults = {}; - for (var key in info.inputs) { - if (info.inputs.hasOwnProperty(key)) { - defaults[key] = info.inputs[key].default; - } - } - return defaults; -} - -},{}],272:[function(require,module,exports){ -module.exports = { - getPreviousStep: function() { - return this.getStep(-1); - }, - - getNextStep: function() { - return this.getStep(1); - }, - - getInput: function(offset) { - if (offset + this.getIndex() === 0) offset++; - return this.getStep(offset - 1).output; - }, - - getOutput: function(offset) { - return this.getStep(offset).output; - }, - - getOptions: function() { - return this.getStep(0).options; - }, - - setOptions: function(optionsObj) { - let options = this.getStep(0).options; - for (let key in optionsObj) { - if (options[key]) options[key] = optionsObj[key]; - } - }, - - getFormat: function() { - return this.getStep(-1).output.format; - }, - - getHeight: function(callback) { - let img = new Image(); - img.onload = function() { - callback(img.height); - }; - img.src = this.getInput(0).src; - }, - - getWidth: function(callback) { - let img = new Image(); - img.onload = function() { - callback(img.width); - }; - img.src = this.getInput(0).src; - } + return [ + { 'name': 'ndvi', 'options': {} }, + { 'name': 'colormap', 'options': { colormap: options.colormap } }, + ]; + }, { + infoJson: require('./info.json') + } +)[0]; +},{"../../util/createMetaModule.js":304,"./info.json":271}],270:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":269,"./info.json":271,"dup":193}],271:[function(require,module,exports){ +module.exports={ + "name": "NDVI-Colormap", + "description": "Sequentially Applies NDVI and Colormap steps", + "inputs": {}, + "docs-link": "https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" } -},{}]},{},[154]); +},{}],272:[function(require,module,exports){ +module.exports = function Dynamic(options, UI, util) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.x = options.x || defaults.x; + options.y = options.y || defaults.y; + + var output; + + // This function is called on every draw. + function draw(input, callback, progressObj) { + + options.offset = options.offset || -2; + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + var parseCornerCoordinateInputs = require('../../util/ParseInputCoordinates'); + + //parse the inputs + parseCornerCoordinateInputs(options, { + src: input.src, + x: { valInp: options.x, type: 'horizontal' }, + y: { valInp: options.y, type: 'vertical' }, + }, function (options, input) { + options.x = parseInt(input.x.valInp); + options.y = parseInt(input.y.valInp); + }); + + // save the pixels of the base image + var baseStepImage = this.getStep(options.offset).image; + var baseStepOutput = this.getOutput(options.offset); + + var getPixels = require('get-pixels'); + + getPixels(input.src, function (err, pixels) { + options.secondImagePixels = pixels; + + function changePixel(r1, g1, b1, a1, x, y) { + + // overlay + var p = options.secondImagePixels; + if (x >= options.x + && x < p.shape[0] + && y >= options.y + && y < p.shape[1]) + return [ + p.get(x, y, 0), + p.get(x, y, 1), + p.get(x, y, 2), + p.get(x, y, 3) + ]; + else + return [r1, g1, b1, a1]; + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + // run PixelManipulation on first Image pixels + return require('../_nomodule/PixelManipulation.js')(baseStepOutput, { + output: output, + changePixel: changePixel, + format: baseStepOutput.format, + image: baseStepImage, + inBrowser: options.inBrowser, + callback: callback + }); + }); + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../../util/ParseInputCoordinates":303,"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":274,"get-pixels":30}],273:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":272,"./info.json":274,"dup":193}],274:[function(require,module,exports){ +module.exports={ + "name": "Overlay", + "description": "Overlays an Image over another at a given position(x,y) in pixels or in %", + "inputs": { + "x": { + "type": "integer", + "desc": "X-position of the image on which the new image is overlayed", + "default": 0 + }, + "y": { + "type": "integer", + "desc": "Y-position of the image on which the new image is overlayed", + "default": 0 + }, + "offset": { + "type": "integer", + "desc": "offset to the output of the step on which the output of the last step is overlayed", + "default": -2 + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} +},{}],275:[function(require,module,exports){ +module.exports = function PaintBucket(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function extraManipulation(pixels) { + + pixels = require('./PaintBucket')(pixels, options) + return pixels + + } + + function output(image, datauri, mimetype) { + // This output is accesible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./PaintBucket":276}],276:[function(require,module,exports){ +module.exports = exports = function(pixels, options) { + + + let defaults = require('./../../util/getDefaults.js')(require('./info.json')); + + let fillColor = options.fillColor || defaults.fillColor, + x = parseInt(options.startingX) || defaults.startingX, + y = parseInt(options.startingY) || defaults.startingY, + height = pixels.shape[1], + width = pixels.shape[0], + r = pixels.get(x, y, 0), + g = pixels.get(x, y, 1), + b = pixels.get(x, y, 2), + a = pixels.get(x, y, 3), + queuex = [x], + queuey = [y], + curry, currx, + north, + south, + n, + tolerance = parseInt(options.tolerance) || defaults.tolerance, + maxFactor = (1 + tolerance / 100), + minFactor = (1 - tolerance / 100); + + fillColor = fillColor.split(" "); + function isSimilar(currx, curry) { + return (pixels.get(currx, curry, 0) >= r * minFactor && pixels.get(currx, curry, 0) <= r * maxFactor && + pixels.get(currx, curry, 1) >= g * minFactor && pixels.get(currx, curry, 1) <= g * maxFactor && + pixels.get(currx, curry, 2) >= b * minFactor && pixels.get(currx, curry, 2) <= b * maxFactor && + pixels.get(currx, curry, 3) >= a * minFactor && pixels.get(currx, curry, 3) <= a * maxFactor); + } + + while (queuey.length) { + currx = queuex.pop() + curry = queuey.pop() + + if (isSimilar(currx, curry)) { + north = south = curry + + do { + north -= 1 + } while (isSimilar(currx, north) && north >= 0) + + do { + south += 1 + } while (isSimilar(currx, south) && south < height) + + for (n = north + 1; n < south; n += 1) { + pixels.set(currx, n, 0, fillColor[0]); + pixels.set(currx, n, 1, fillColor[1]); + pixels.set(currx, n, 2, fillColor[2]); + pixels.set(currx, n, 3, fillColor[3]); + if (isSimilar(currx - 1, n)) { + queuex.push(currx - 1) + queuey.push(n) + } + if (isSimilar(currx + 1, n)) { + queuex.push(currx + 1) + queuey.push(n) + } + } + } + } + + return pixels; +} + +},{"./../../util/getDefaults.js":305,"./info.json":278}],277:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":275,"./info.json":278,"dup":193}],278:[function(require,module,exports){ +module.exports={ + "name": "PaintBucket", + "description": "Fill color in pixels", + "inputs": { + "startingX": { + "type": "integer", + "desc": "value of the starting x-coordinate", + "default": "10" + }, + "startingY": { + "type": "integer", + "desc": "value of the starting y-coordinate", + "default": "10" + }, + "fillColor": { + "type": "String", + "desc": "four space separated numbers representing the RGBA values of fill-color", + "default": "100 100 100 255", + "placeholder": "100 100 100 255" + }, + "tolerance": { + "type": "range", + "desc": "% tolerance", + "default": "10", + "min": "0", + "max": "100", + "step": "1" + } + } +} +},{}],279:[function(require,module,exports){ +/* + * Resize the image by given percentage value + */ +module.exports = function Resize(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.resize = options.resize || defaults.resize; + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + var imagejs = require('imagejs'); + + function changePixel(r, g, b, a) { + return [r, g, b, a] + } + + function extraManipulation(pixels) { + // value above 100% scales up, and below 100% scales down + var resize_value = parseInt(options.resize.slice(0, -1)); + + var new_width, + new_height; + + new_width = Math.round(pixels.shape[0] * (resize_value / 100)); + new_height = Math.round(pixels.shape[1] * (resize_value / 100)); + + var bitmap = new imagejs.Bitmap({width: pixels.shape[0], height: pixels.shape[1]}); + bitmap._data.data = pixels.data; + + + var resized = bitmap.resize({ + width: new_width, height: new_height, + algorithm: "bicubicInterpolation" + }); + + pixels.data = resized._data.data; + pixels.shape = [new_width,new_height,4]; + pixels.stride[1] = 4 * new_width; + + return pixels; + } + + function output(image, datauri, mimetype) { + // This output is accesible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":281,"imagejs":63}],280:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":279,"./info.json":281,"dup":193}],281:[function(require,module,exports){ +module.exports={ + "name": "Resize", + "description": "Resize image by given percentage value", + "inputs": { + "resize": { + "type": "string", + "desc": "Percentage value of the resize", + "default": "125%" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} +},{}],282:[function(require,module,exports){ +/* + * Rotates image + */ +module.exports = function Rotate(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.rotate = parseInt(options.rotate) || defaults.rotate; + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + var imagejs = require('imagejs'); + + function changePixel(r, g, b, a) { + return [r, g, b, a] + } + + function extraManipulation(pixels) { + var rotate_value = (options.rotate)%360; + + if(rotate_value%360 == 0) + return pixels; + + var bitmap = new imagejs.Bitmap({width: pixels.shape[0], height: pixels.shape[1]}); + bitmap._data.data = pixels.data; + + var rotated = bitmap.rotate({ + degrees: rotate_value, + }); + pixels.data = rotated._data.data; + + return pixels; + } + + function output(image, datauri, mimetype) { + // This output is accesible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":284,"imagejs":63}],283:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":282,"./info.json":284,"dup":193}],284:[function(require,module,exports){ +module.exports={ + "name": "Rotate", + "description": "Rotates image by specified degrees", + "inputs": { + "rotate": { + "type": "range", + "desc": "Angular value for rotation in degrees", + "default": "90", + "min": "0", + "max": "360", + "step": "1" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" + } + +},{}],285:[function(require,module,exports){ +/* + * Saturate an image with a value from 0 to 1 + */ +module.exports = function Saturation(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + var cR = 0.299; + var cG = 0.587; + var cB = 0.114; + + function changePixel(r, g, b, a) { + + var p = Math.sqrt((cR * (r * r)) + (cG * (g * g)) + (cB * (g * g))); + + r = p + (r - p) * (options.saturation); + g = p + (g - p) * (options.saturation); + b = p + (b - p) * (options.saturation); + + + return [Math.round(r), Math.round(g), Math.round(b), a]; + } + + function output(image, datauri, mimetype) { + + // This output is accesible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + + return { + options: options, + //setup: setup, // optional + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298}],286:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":285,"./info.json":287,"dup":193}],287:[function(require,module,exports){ +module.exports={ + "name": "Saturation", + "description": "Change the saturation of the image by given value, from 0-1, with 1 being 100% saturated.", + "inputs": { + "saturation": { + "type": "range", + "desc": "saturation for the new image between 0 and 2, 0 being black and white and 2 being highly saturated", + "default": "0.5", + "min": "0", + "max": "2", + "step": "0.1" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} + +},{}],288:[function(require,module,exports){ +/* + * Image thresholding with 'image-filter-threshold' + */ +module.exports = function ImageThreshold(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this, hist = new Array(256).fill(0); + + function changePixel(r, g, b, a) { + let pixVal = Math.round((r + g + b) / 3); + hist[pixVal]++; + return [r, g, b, a]; + } + + function extraManipulation(pixels) { + pixels = require('./Threshold')(pixels, options, hist) + return pixels + } + function output(image, datauri, mimetype) { + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + } + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + callback: callback + }); + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./Threshold":289}],289:[function(require,module,exports){ +module.exports = function Threshold(pixels, options, histData) { + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + + type = options.threshold ; + threshold = parseInt(options.input) || defaults.input; + var lumR = []; + var lumG = []; + var lumB = []; + for (var i = 0; i < 256; i++) { + lumR[i] = i * 0.299; + lumG[i] = i * 0.587; + lumB[i] = i * 0.114; + } + + var imageDataLength = pixels.data.length; //imageData.data.length; + for (var i = 0; i <= imageDataLength; i++) { + pixels.data[i] = Math.floor(lumR[pixels.data[i++]] + lumG[pixels.data[i++]] + lumB[pixels.data[i++]]); + } + + if (type === "Automatic Thresholding") + threshold = otsu(histData); + + for (var currentPixel = 0; currentPixel <= imageDataLength; currentPixel += 4) { + + pixels.data[currentPixel] = pixels.data[currentPixel] < threshold ? 0 : 255; + pixels.data[currentPixel + 1] = pixels.data[currentPixel + 2] = pixels.data[currentPixel]; + } + return pixels; +} + +function otsu(histData) { + let total = 0; + for (let t = 0; t < 256; t++) total += histData[t]; + + let sum = 0; + for (let t = 0; t < 256; t++) sum += t * histData[t]; + + let sumB = 0; + let wB = 0; + let wF = 0; + + let varMax = 0; + let threshold = 0; + + for (let t = 0; t < 256; t++) { + wB += histData[t]; // Weight Background + if (wB == 0) continue; + + wF = total - wB; // Weight Foreground + if (wF == 0) break; + + sumB += t * histData[t]; + + let mB = sumB / wB; // Mean Background + let mF = (sum - sumB) / wF; // Mean Foreground + + // Calculate Between Class Variance + let varBetween = wB * wF * (mB - mF) * (mB - mF); + + // Check if new maximum found + if (varBetween > varMax) { + varMax = varBetween; + threshold = t; + } + } + + return threshold; + +} +},{"./../../util/getDefaults.js":305,"./info.json":291}],290:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":288,"./info.json":291,"dup":193}],291:[function(require,module,exports){ +module.exports={ + "name": "Threshold", + "description": "Thresholding is used to create binary images", + "inputs": { + "threshold": { + "type": "select", + "desc": "Type of Thresholding", + "default": "Manual Thresholding", + "values": ["Manual Thresholding", "Automatic Thresholding"] + }, + "input": { + "type": "range", + "desc": "Threshold Value", + "default": "120", + "min": "0", + "max": "255", + "step": "1" + } + } +} + +},{}],292:[function(require,module,exports){ +module.exports = function Tint(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + + var output; + + function draw(input, callback, progressObj) { + + var color = options.color || defaults.color; + color = color.split(" "); + var factor = options.factor || defaults.factor; + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function changePixel(r, g, b, a) { + + r -= (r - color[0]) * factor; + g -= (g - color[1]) * factor; + b -= (b - color[2]) * factor; + return [r, g, b, a] + } + + function output(image, datauri, mimetype) { + + // This output is accessible by Image Sequencer + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + + } + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} + +},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":294}],293:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":292,"./info.json":294,"dup":193}],294:[function(require,module,exports){ +module.exports={ + "name": "Tint", + "description": "Add color tint to an image", + "inputs": { + "color":{ + "type": "String", + "desc": "RGB values separated by a space", + "default": "0 0 255" + }, + "factor": { + "type": "range", + "desc": "Amount of tint", + "default": "0.5", + "min": "0", + "max": "1", + "step": "0.01" + } + } +} + +},{}],295:[function(require,module,exports){ +module.exports = function Balance(options, UI) { + + var output; + + function draw(input, callback, progressObj) { + + options.temperature = (options.temperature > "40000") ? "40000" : options.temperature + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + function extraManipulation(pixels) { + + let temp = parseInt(options.temperature) + temp /= 100 + + let r, g, b; + + if (temp <= 66) { + r = 255; + g = Math.min(Math.max(99.4708025861 * Math.log(temp) - 161.1195681661, 0), 255); + } else { + r = Math.min(Math.max(329.698727446 * Math.pow(temp - 60, -0.1332047592), 0), 255); + g = Math.min(Math.max(288.1221695283 * Math.pow(temp - 60, -0.0755148492), 0), 255); + } + + if (temp >= 66) { + b = 255; + } else if (temp <= 19) { + b = 0; + } else { + b = temp - 10; + b = Math.min(Math.max(138.5177312231 * Math.log(b) - 305.0447927307, 0), 255); + } + + for (let i = 0; i < pixels.shape[0]; i++) { + for (let j = 0; j < pixels.shape[1]; j++) { + + r_data = pixels.get(i, j, 0) + r_new_data = (255 / r) * r_data + pixels.set(i, j, 0, r_new_data) + + g_data = pixels.get(i, j, 1) + g_new_data = (255 / g) * g_data + pixels.set(i, j, 1, g_new_data) + + b_data = pixels.get(i, j, 2) + b_new_data = (255 / b) * b_data + pixels.set(i, j, 2, b_new_data) + } + } + + return pixels + } + + function output(image, datauri, mimetype) { + + step.output = { src: datauri, format: mimetype }; + + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } + +} +},{"../_nomodule/PixelManipulation.js":298}],296:[function(require,module,exports){ +arguments[4][193][0].apply(exports,arguments) +},{"./Module":295,"./info.json":297,"dup":193}],297:[function(require,module,exports){ +module.exports={ + "name": "White Balance", + "description": "Change the colour balance of the image by adjusting the colour temperature.", + "inputs": { + "temperature": { + "type": "string", + "desc": "Temperature between 0 - 40,000 Kelvin", + "default": "6000" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" +} +},{}],298:[function(require,module,exports){ +(function (process,Buffer){ +/* +* General purpose per-pixel manipulation +* accepting a changePixel() method to remix a pixel's channels +*/ +module.exports = function PixelManipulation(image, options) { + + // To handle the case where pixelmanipulation is called on the input object itself + // like input.pixelManipulation(options) + if (arguments.length <= 1) { + options = image; + image = this; + } + + options = options || {}; + + const getPixels = require("get-pixels"), + savePixels = require("save-pixels"); + + getPixels(image.src, function(err, pixels) { + if (err) { + console.log("Bad image path", image); + return; + } + + if (options.getNeighbourPixel) { + options.getNeighbourPixel.fun = function getNeighborPixel(distX, distY) { + return options.getNeighbourPixel(pixels, x, y, distX, distY); + }; + } + + // iterate through pixels; + // TODO: this could possibly be more efficient; see + // https://github.com/p-v-o-s/infragram-js/blob/master/public/infragram.js#L173-L181 + + if (!options.inBrowser && !process.env.TEST) { + try { + var pace = require("pace")(pixels.shape[0] * pixels.shape[1]); + } catch (e) { + options.inBrowser = true; + } + } + + if (options.preProcess) pixels = options.preProcess(pixels); // Allow for preprocessing + + if (options.changePixel) { + + /* Allows for Flexibility + if per pixel manipulation is not required */ + + for (var x = 0; x < pixels.shape[0]; x++) { + for (var y = 0; y < pixels.shape[1]; y++) { + let pixel = options.changePixel( + pixels.get(x, y, 0), + pixels.get(x, y, 1), + pixels.get(x, y, 2), + pixels.get(x, y, 3), + x, + y + ); + + pixels.set(x, y, 0, pixel[0]); + pixels.set(x, y, 1, pixel[1]); + pixels.set(x, y, 2, pixel[2]); + pixels.set(x, y, 3, pixel[3]); + + if (!options.inBrowser && !process.env.TEST) pace.op(); + } + } + } + // perform any extra operations on the entire array: + var res; + if (options.extraManipulation) res = options.extraManipulation(pixels,generateOutput); + // there may be a more efficient means to encode an image object, + // but node modules and their documentation are essentially arcane on this point + function generateOutput(){ + var chunks = []; + var totalLength = 0; + + var r = savePixels(pixels, options.format, { quality: 100 }); + + r.on("data", function(chunk) { + totalLength += chunk.length; + chunks.push(chunk); + }); + + r.on("end", function() { + var data = Buffer.concat(chunks, totalLength).toString("base64"); + var datauri = "data:image/" + options.format + ";base64," + data; + if (options.output) + options.output(options.image, datauri, options.format); + if (options.callback) options.callback(); + }); + } + if(res){ + pixels=res; + generateOutput(); + } + else if(!options.extraManipulation) generateOutput(); + }); +}; + +}).call(this,require('_process'),require("buffer").Buffer) +},{"_process":118,"buffer":48,"get-pixels":30,"pace":95,"save-pixels":168}],299:[function(require,module,exports){ +// special module to load an image into the start of the sequence; used in the HTML UI +function LoadImage(ref, name, src, main_callback) { + function makeImage(datauri) { + var image = { + src: datauri, + format: datauri.split(':')[1].split(';')[0].split('/')[1] + } + return image; + } + function CImage(src, callback) { + var datauri; + if (!!src.match(/^data:/i)) { + datauri = src; + callback(datauri); + } + else if (!ref.options.inBrowser && !!src.match(/^https?:\/\//i)) { + require( src.match(/^(https?):\/\//i)[1] ).get(src,function(res){ + var data = ''; + var contentType = res.headers['content-type']; + res.setEncoding('base64'); + res.on('data',function(chunk) {data += chunk;}); + res.on('end',function() { + callback("data:"+contentType+";base64,"+data); + }); + }); + } + else if (ref.options.inBrowser) { + var ext = src.split('.').pop(); + var image = document.createElement('img'); + var canvas = document.createElement('canvas'); + var context = canvas.getContext('2d'); + image.onload = function() { + canvas.width = image.naturalWidth; + canvas.height = image.naturalHeight; + context.drawImage(image,0,0); + datauri = canvas.toDataURL(ext); + callback(datauri); + } + image.src = src; + } + else { + datauri = require('urify')(src); + callback(datauri); + } + } + + function loadImage(name, src) { + var step = { + name: "load-image", + description: "This initial step loads and displays the original image without any modifications.

To work with a new or different image, drag one into the drop zone.", + ID: ref.options.sequencerCounter++, + imageName: name, + inBrowser: ref.options.inBrowser, + ui: ref.options.ui + }; + + var image = { + src: src, + steps: [{ + options: { + id: step.ID, + name: "load-image", + description: "This initial step loads and displays the original image without any modifications.", + title: "Load Image", + step: step + }, + UI: ref.events, + draw: function() { + UI.onDraw(options.step); + if(arguments.length==1){ + this.output = CImage(arguments[0]); + options.step.output = this.output; + UI.onComplete(options.step); + return true; + } + else if(arguments.length==2) { + this.output = CImage(arguments[0]); + options.step.output = this.output; + arguments[1](); + UI.onComplete(options.step); + return true; + } + return false; + }, + }] + }; + CImage(src, function(datauri) { + var output = makeImage(datauri); + ref.images[name] = image; + var loadImageStep = ref.images[name].steps[0]; + loadImageStep.output = output; + loadImageStep.options.step.output = loadImageStep.output.src; + loadImageStep.UI.onSetup(loadImageStep.options.step); + loadImageStep.UI.onDraw(loadImageStep.options.step); + loadImageStep.UI.onComplete(loadImageStep.options.step); + + main_callback(); + return true; + }); + } + + return loadImage(name,src); +} + +module.exports = LoadImage; + +},{"urify":177}],300:[function(require,module,exports){ +// TODO: potentially move this into ImportImage module +function setInputStepInit() { + + return function setInputStep(options) { + + var dropzone = $(options.dropZoneSelector); + var fileInput = $(options.fileInputSelector); + var takePhoto = $(options.takePhotoSelector); + + var onLoad = options.onLoad; + var onTakePhoto = options.onTakePhoto; + + var reader = new FileReader(); + + function handleFile(e) { + + e.preventDefault(); + e.stopPropagation(); // stops the browser from redirecting. + + if (e.target && e.target.files) var file = e.target.files[0]; + else var file = e.dataTransfer.files[0]; + if(!file) return; + + var reader = new FileReader(); + + reader.onload = onLoad; + + reader.readAsDataURL(file); + } + + function runVideo(){ + /* event handler for Take-Photo */ + document.getElementById('video').style.display='inline'; + document.getElementById('capture').style.display='inline'; + document.getElementById('close').style.display='inline'; + + var video = document.getElementById('video'); + canvas = document.getElementById('canvas'), + context = canvas.getContext('2d'), + vendorUrl = window.URL || window.webkitURL; + + const constraints = { audio: false,video: true}; + + function handleSuccess(stream) { + window.stream = stream; // make stream available to browser console + video.srcObject = stream; + video.onloadedmetadata = function(e) { + video.play(); + }; + document.getElementById('close').addEventListener('click', function () { + stopStream(stream); + }); + } + function handleError(error) { + console.log('navigator.getUserMedia error: ', error); + } + navigator.mediaDevices.getUserMedia(constraints).then(handleSuccess).catch(handleError); + + + document.getElementById('capture').addEventListener('click', function(stream){ + context.drawImage(video, 0, 0, 400, 300); + options.onTakePhoto(canvas.toDataURL()); + }); + + function stopStream(stream) { + stream.getVideoTracks().forEach(function (track) { + track.stop(); + }); + document.getElementById('video').style.display='none'; + document.getElementById('capture').style.display='none'; + document.getElementById('close').style.display='none'; + } +} + + fileInput.on('change', handleFile); + takePhoto.on('click', runVideo); + + dropzone[0].addEventListener('drop', handleFile, false); + + dropzone.on('dragover', function onDragover(e) { + e.stopPropagation(); + e.preventDefault(); + e.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy. + }, false); + + dropzone.on('dragenter', function onDragEnter(e) { + dropzone.addClass('hover'); + }); + + dropzone.on('dragleave', function onDragLeave(e) { + dropzone.removeClass('hover'); + }); + + } + +} +module.exports = setInputStepInit; + +},{}],301:[function(require,module,exports){ +/* + * User Interface Handling Module + */ + +module.exports = function UserInterface(events = {}) { + + events.onSetup = events.onSetup || function(step) { + if (step.ui == false) { + // No UI + } else if(step.inBrowser) { + // Create and append an HTML Element + console.log("Added Step \""+step.name+"\" to \""+step.imageName+"\"."); + } else { + // Create a NodeJS Object + console.log('\x1b[36m%s\x1b[0m',"Added Step \""+step.name+"\" to \""+step.imageName+"\"."); + } + } + + events.onDraw = events.onDraw || function(step) { + if (step.ui == false) { + // No UI + } else if(step.inBrowser) { + // Overlay a loading spinner + console.log("Drawing Step \""+step.name+"\" on \""+step.imageName+"\"."); + } else { + // Don't do anything + console.log('\x1b[33m%s\x1b[0m',"Drawing Step \""+step.name+"\" on \""+step.imageName+"\"."); + } + } + + events.onComplete = events.onComplete || function(step) { + if (step.ui == false) { + // No UI + } else if(step.inBrowser) { + // Update the DIV Element + // Hide the laoding spinner + console.log("Drawn Step \""+step.name+"\" on \""+step.imageName+"\"."); + } else { + // Update the NodeJS Object + console.log('\x1b[32m%s\x1b[0m',"Drawn Step \""+step.name+"\" on \""+step.imageName+"\"."); + } + } + + events.onRemove = events.onRemove || function(step) { + if (step.ui == false){ + // No UI + } else if(step.inBrowser) { + // Remove the DIV Element + console.log("Removing Step \""+step.name+"\" of \""+step.imageName+"\"."); + } else { + // Delete the NodeJS Object + console.log('\x1b[31m%s\x1b[0m',"Removing Step \""+step.name+"\" of \""+step.imageName+"\"."); + } + } + + events.notify = events.notify || function(msg) { + console.log(msg); + } + + return events; + +} + +},{}],302:[function(require,module,exports){ +/* +* Determine format from a URL or data-url, return "jpg" "png" "gif" etc +* TODO: write a test for this using the examples +*/ +module.exports = function GetFormat(src) { + + var format = undefined; // haha default + + // EXAMPLE: "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z"; + // EXAMPLE: "http://example.com/example.png" + // EXAMPLE: "/example.png" + + if (isDataUrl(src)) { + format = src.split(';')[0].split('/').pop(); + } else { + format = src.split('.').pop(); + } + + function isDataUrl(src) { + return src.substr(0, 10) === "data:image" + } + + format = format.toLowerCase(); + + if (format === "jpeg") format = "jpg"; + + function validateFormat(data){ + let supportedFormats = [ + 'jpg', + 'jpeg', + 'png', + 'gif', + 'canvas', + ]; + return supportedFormats.includes(data); + } + + return validateFormat(format)?format:'jpg'; + +} + +},{}],303:[function(require,module,exports){ +module.exports = function parseCornerCoordinateInputs(options,coord,callback) { + var getPixels = require('get-pixels'); + getPixels(coord.src, function(err, pixels) { + var iw = pixels.shape[0], + ih = pixels.shape[1]; + if (!coord.x.valInp) { + return + } + else { + Object.keys(coord).forEach(convert); + function convert(key) { + var val = coord[key]; + if (val.valInp && val.valInp.slice(-1) === "%") { + val.valInp = parseInt(val.valInp, 10); + if (val.type === 'horizontal') + val.valInp = val.valInp * iw / 100; + else + val.valInp = val.valInp * ih / 100; + } + } + } + callback(options, coord); + }) + } +},{"get-pixels":30}],304:[function(require,module,exports){ +module.exports = function createMetaModule(mapFunction, moduleOptions) { + + moduleOptions = moduleOptions || {}; + moduleOptions.infoJson = moduleOptions.infoJson || {}; + + function MetaModule(options, UI) { + + var defaults = require('./getDefaults.js')(moduleOptions.infoJson); + var output; + + + // Parses the options and gets the input which is not available in options from defaults + for (key in moduleOptions.infoJson.inputs) { + if (moduleOptions.infoJson.inputs.hasOwnProperty(key)) { + options[key] = options[key] || defaults[key]; + } + } + + // map inputs to internal step options; + // use this to set defaults for internal steps + // and to expose internal settings as external meta-module parameters; + // it must return a steps object + var steps = mapFunction(options); + + /* example: + function mapFunction(opt, _defaults) { + + // return steps with options: + return [ + { 'name': 'gradient', 'options': {} }, + { 'name': 'colormap', 'options': { colormap: options.colormap } }, + { 'name': 'crop', 'options': { 'y': 0, 'h': options.h } }, + { 'name': 'overlay', 'options': { 'x': options.x, 'y': options.y, 'offset': -4 } } + ]; + } + */ + + // ui: false prevents internal logs + var internalSequencer = ImageSequencer({ inBrowser: false, ui: false }); + + function draw(input, callback) { + + var step = this; + + internalSequencer.loadImage(input.src, function onAddImage() { + internalSequencer.importJSON(steps); + internalSequencer.run(function onCallback(internalOutput) { + step.output = { src: internalOutput, format: input.format }; + callback(); + }); + }); + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } + } + + return [MetaModule, moduleOptions.infoJson]; +} + +},{"./getDefaults.js":305}],305:[function(require,module,exports){ +module.exports = function(info){ + var defaults = {}; + for (var key in info.inputs) { + if (info.inputs.hasOwnProperty(key)) { + defaults[key] = info.inputs[key].default; + } + } + return defaults; +} + +},{}],306:[function(require,module,exports){ +module.exports = { + getPreviousStep: function() { + return this.getStep(-1); + }, + + getNextStep: function() { + return this.getStep(1); + }, + + getInput: function(offset) { + if (offset + this.getIndex() === 0) offset++; + return this.getStep(offset - 1).output; + }, + + getOutput: function(offset) { + return this.getStep(offset).output; + }, + + getOptions: function() { + return this.getStep(0).options; + }, + + setOptions: function(optionsObj) { + let options = this.getStep(0).options; + for (let key in optionsObj) { + if (options[key]) options[key] = optionsObj[key]; + } + }, + + getFormat: function() { + return this.getStep(-1).output.format; + }, + + getHeight: function(callback) { + let img = new Image(); + img.onload = function() { + callback(img.height); + }; + img.src = this.getInput(0).src; + }, + + getWidth: function(callback) { + let img = new Image(); + img.onload = function() { + callback(img.width); + }; + img.src = this.getInput(0).src; + } +} +},{}]},{},[184]); diff --git a/dist/image-sequencer.min.js b/dist/image-sequencer.min.js index 4423cfe0..f7830797 100644 --- a/dist/image-sequencer.min.js +++ b/dist/image-sequencer.min.js @@ -1 +1 @@ -!function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){return i(e[a][1][t]||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a0?n-4:n,f=0;f>16&255,s[l++]=e>>8&255,s[l++]=255&e;2===a&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,s[l++]=255&e);1===a&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,s[l++]=e>>8&255,s[l++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],3:[function(t,e,r){(function(t,n,i){!function(t){if("object"==typeof r&&void 0!==e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:void 0!==n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=t()}}(function(){var e,r,o;return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var l="function"==typeof _dereq_&&_dereq_;if(!s&&l)return l(a,!0);if(o)return o(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;)p(t)}function p(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}l.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},l.prototype.hasCustomScheduler=function(){return this._customScheduler},l.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},l.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},l.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},l.prototype.fatalError=function(e,r){r?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},l.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(l.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?u.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},l.prototype.invoke=function(t,e,r){this._trampolineEnabled?c.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},l.prototype.settlePromises=function(t){this._trampolineEnabled?f.call(this,t):this._schedule(function(){t._settlePromises()})}):(l.prototype.invokeLater=u,l.prototype.invoke=c,l.prototype.settlePromises=f),l.prototype._drainQueues=function(){h(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,h(this._lateQueue)},l.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},l.prototype._reset=function(){this._isTickUsed=!1},r.exports=l,r.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},l=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var u=r(o),c=new t(e);c._propagateFrom(this,1);var f=this._target();if(c._setBoundTo(u),u instanceof t){var h={promiseRejectionQueued:!1,promise:c,target:f,bindingPromise:u};f._then(e,a,void 0,c,h),u._then(s,l,void 0,c,h),c._setOnCancel(u)}else c._resolveCallback(f);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){var r,n=t("./util"),i=n.canEvaluate;n.isIdentifier;function o(t,r){var i;if(null!=t&&(i=t[r]),"function"!=typeof i){var o="Object "+n.classString(t)+" has no method '"+n.toString(r)+"'";throw new e.TypeError(o)}return i}function a(t){return o(t,this.pop()).apply(t,this)}function s(t){return t[this]}function l(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(a,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=l;else if(i){var n=r(t);e=null!==n?n:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,l=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),l.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,l=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=l,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){var i,o,a,s=r._getDomain,l=r._async,u=e("./errors").Warning,c=e("./util"),f=e("./es5"),h=c.canAttachTrace,p=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,m=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,g=null,_=!1,y=!(0==c.env("BLUEBIRD_DEBUG")),b=!(0==c.env("BLUEBIRD_WARNINGS")||!y&&!c.env("BLUEBIRD_WARNINGS")),w=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!y&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),k=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){H("rejectionHandled",i,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),H("unhandledRejection",o,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return z(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:c.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:c.domainBind(e,t):void 0};var x=function(){};r.longStackTraces=function(){if(l.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Q.longStackTraces&&Z()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace,i=r.prototype._dereferenceTrace;Q.longStackTraces=!0,x=function(){if(l.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,r.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),l.enableTrampoline(),Q.longStackTraces=!1},r.prototype._captureStackTrace=D,r.prototype._attachExtraTrace=N,r.prototype._dereferenceTrace=U,n.activateLongStackTraces(),l.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Q.longStackTraces&&Z()};var B=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r={detail:e,cancelable:!0};f.defineProperty(r,"promise",{value:e.promise}),f.defineProperty(r,"reason",{value:e.reason});var n=new CustomEvent(t.toLowerCase(),r);return!c.global.dispatchEvent(n)}}if("function"==typeof Event){t=new Event("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,f.defineProperty(r,"promise",{value:e.promise}),f.defineProperty(r,"reason",{value:e.reason}),!c.global.dispatchEvent(r)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!c.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),C=c.isNode?function(){return t.emit.apply(t,arguments)}:c.global?function(t){var e="on"+t.toLowerCase(),r=c.global[e];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function E(t,e){return{promise:e}}var P={promiseCreated:E,promiseFulfilled:E,promiseRejected:E,promiseResolved:E,promiseCancelled:E,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:E},j=function(t){var e=!1;try{e=C.apply(null,arguments)}catch(t){l.throwLater(t),e=!0}var r=!1;try{r=B(t,P[t].apply(null,arguments))}catch(t){l.throwLater(t),r=!0}return r||e};function S(){return!1}function T(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+c.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function M(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?c.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function A(){return this._onCancelField}function I(t){this._onCancelField=t}function R(){this._cancellationParent=void 0,this._onCancelField=void 0}function L(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}r.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&x()),"warnings"in t){var e=t.warnings;Q.warnings=!!e,k=Q.warnings,c.isObject(e)&&"wForgottenReturn"in e&&(k=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Q.cancellation){if(l.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=R,r.prototype._propagateFrom=L,r.prototype._onCancel=A,r.prototype._setOnCancel=I,r.prototype._attachCancellationCallback=M,r.prototype._execute=T,O=L,Q.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Q.monitoring?(Q.monitoring=!0,r.prototype._fireEvent=j):!t.monitoring&&Q.monitoring&&(Q.monitoring=!1,r.prototype._fireEvent=S)),r},r.prototype._fireEvent=S,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var O=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function F(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function D(){this._trace=new J(this._peekContext())}function N(t,e){if(h(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=V(t);c.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(t,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function z(t,e,n){if(Q.warnings){var i,o=new u(t);if(e)n._attachExtraTrace(o);else if(Q.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=V(o);o.stack=a.message+"\n"+a.stack.join("\n")}j("warning",o)||G(o,"",!0)}}function q(t){for(var e=[],r=0;r0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:q(e)}}function G(t,e,r){if("undefined"!=typeof console){var n;if(c.isObject(t)){var i=t.stack;n=e+g(i,t)}else n=e+String(t);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function H(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){l.throwLater(t)}"unhandledRejection"===t?j(t,r,n)||i||G(r,"Unhandled rejection "):j(t,n)}function W(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():c.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}function Z(){return"function"==typeof K}var X=function(){return!1},Y=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function $(t){var e=t.match(Y);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function J(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);K(this,J),e>32&&this.uncycle()}c.inherits(J,Error),n.CapturedTrace=J,J.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;for(n=(t=this._length=n)-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(n=0;n0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a=0;--u)e[u]._length=l,l++;return}}}},J.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=V(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(q(i.stack.split("\n"))),i=i._parent;!function(t){for(var e=t[0],r=1;r=0;--s)if(n[s]===o){a=s;break}for(s=a;s>=0;--s){var l=n[s];if(e[i]!==l)break;e.pop(),i--}e=n}}(n),function(t){for(var e=0;e=0)return v=/@/,g=e,_=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(g=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?W(e):e.toString()},null):(v=t,g=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},c.isNode&&t.stderr.isTTY?a=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:c.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var Q={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return w&&r.longStackTraces(),{longStackTraces:function(){return Q.longStackTraces},warnings:function(){return Q.warnings},cancellation:function(){return Q.cancellation},monitoring:function(){return Q.monitoring},propagateFromFunction:function(){return O},boundValueFunction:function(){return F},checkForgottenReturns:function(t,e,r,n,i){if(void 0===t&&null!==e&&k){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),l=q(s),u=l.length-1;u>=0;--u){var c=l[u];if(!d.test(c)){var f=c.match(m);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(l.length>0){var h=l[0];for(u=0;u0&&(a="\n"+s[u-1]);break}}}var p="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,e)}},setBounds:function(t,e){if(Z()){for(var r,n,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,l=0;l=s||(X=function(t){if(p.test(t))return!0;var e=$(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:z,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),z(r)},CapturedTrace:J,fireDomEvent:B,fireGlobalEvent:C}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce,n=t.all;function i(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(i,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(i,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},{}],12:[function(t,e,r){"use strict";var n,i,o=t("./es5"),a=o.freeze,s=t("./util"),l=s.inherits,u=s.notEnumerableProp;function c(t,e){function r(n){if(!(this instanceof r))return new r(n);u(this,"message","string"==typeof n?n:e),u(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return l(r,Error),r}var f=c("Warning","warning"),h=c("CancellationError","cancellation error"),p=c("TimeoutError","timeout error"),d=c("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(t){n=c("TypeError","type error"),i=c("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(t){if(!c(this,t))return a.e=t,a}function p(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var l=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(l===n)return l;if(void 0!==l){i._setReturnedNonUndefined();var p=r(l,i);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new o("late cancellation observer");return i._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new u(this))}return p._then(f,h,void 0,this,void 0)}}}return i.isRejected()?(c(this),a.e=t,a):(c(this),t)}return l.prototype.isFinallyHandler=function(){return 0===this.type},u.prototype._resultCancelled=function(){c(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new l(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,p,p)},e.prototype.tap=function(t){return this._passThrough(t,1,p)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,p);var n,o=new Array(r-1),a=0;for(n=0;n0&&"function"==typeof arguments[e]&&(t=arguments[e]);var n=[].slice.call(arguments);t&&n.pop();var i=new r(n).promise();return void 0!==t?i.spread(t):i}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=e._getDomain,l=t("./util"),u=l.tryCatch,c=l.errorObj,f=e._async;function h(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=s();this._callback=null===i?e:l.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function p(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+l.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(i.concurrency)));a=i.concurrency}return new h(t,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,o).promise()}l.inherits(h,r),h.prototype._asyncInit=function(){this._init$(void 0,-2)},h.prototype._init=function(){},h.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,l=this._limit;if(r<0){if(n[r=-1*r-1]=t,l>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(l>=1&&this._inFlight>=l)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=u(h).call(p,t,r,o),m=f._popContext();if(a.checkForgottenReturns(d,m,null!==s?"Promise.filter":"Promise.map",f),d===c)return this._reject(d.e),!0;var v=i(d,this._promise);if(v instanceof e){var g=(v=v._target())._bitField;if(0==(50397184&g))return l>=1&&this._inFlight++,n[r]=v,v._proxy(this,-1*(r+1)),!1;if(0==(33554432&g))return 0!=(16777216&g)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}n[r]=d}return++this._totalResolved>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},h.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var u=arguments[1],c=arguments[2];n=a.isArray(u)?s(t).apply(c,u):s(t).call(c,u)}else n=s(t)();var f=l._popContext();return o.checkForgottenReturns(n,f,"Promise.try",l),l._resolveFromSyncValue(n),l},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";var n=t("./util"),i=n.maybeWrapAsError,o=t("./errors").OperationalError,a=t("./es5");var s=/^(?:name|message|stack|cause)$/;function l(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+u.classString(t);arguments.length>1&&(r+=", "+u.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},S.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},S.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+u.classString(t)):this.all()._then(t,void 0,void 0,g,void 0)},S.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},S.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},S.prototype.error=function(t){return this.caught(u.originatesFromRejection,t)},S.getNewLibraryCopy=r.exports,S.is=function(t){return t instanceof S},S.fromNode=S.fromCallback=function(t){var e=new S(v);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=j(t)(E(e,r));return n===P&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},S.all=function(t){return new b(t).promise()},S.cast=function(t){var e=y(t);return e instanceof S||((e=new S(v))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(t){var e=new S(v);return e._captureStackTrace(),e._rejectCallback(t,!0),e},S.setScheduler=function(t){if("function"!=typeof t)throw new d("expecting a function but got "+u.classString(t));return h.setScheduler(t)},S.prototype._then=function(t,e,r,n,i){var o=void 0!==i,a=o?i:new S(v),l=this._target(),c=l._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=s();if(0!=(50397184&c)){var p,d,g=l._settlePromiseCtx;0!=(33554432&c)?(d=l._rejectionHandler0,p=t):0!=(16777216&c)?(d=l._fulfillmentHandler0,p=e,l._unsetRejectionIsUnhandled()):(g=l._settlePromiseLateCancellationObserver,d=new m("late cancellation observer"),l._attachExtraTrace(d),p=e),h.invoke(g,l,{handler:null===f?p:"function"==typeof p&&u.domainBind(f,p),promise:a,receiver:n,value:d})}else l._addCallbacks(t,e,a,n,f);return a},S.prototype._length=function(){return 65535&this._bitField},S.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},S.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},S.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},S.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},S.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},S.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},S.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},S.prototype._isFinal=function(){return(4194304&this._bitField)>0},S.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},S.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},S.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},S.prototype._setAsyncGuaranteed=function(){h.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},S.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==l)return void 0===e&&this._isBound()?this._boundValue():e},S.prototype._promiseAt=function(t){return this[4*t-4+2]},S.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},S.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=l),this._addCallbacks(e,r,n,i,null)},S.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=l),this._addCallbacks(r,n,i,o,null)},S.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:u.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:u.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:u.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:u.domainBind(i,e))}return this._setLength(o+1),o},S.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},S.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(n(),!1);var r=y(t,this);if(!(r instanceof S))return this._fulfill(t);e&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():h.settlePromises(this),this._dereferenceTrace())}},S.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return h.fatalError(t,u.isNode);(65535&e)>0?h.settlePromises(this):this._ensurePossibleRejectionHandled()}},S.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},S.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},S.defer=S.pending=function(){return x.deprecated("Promise.defer","new Promise"),{promise:new S(v),resolve:T,reject:M}},u.notEnumerableProp(S,"_makeSelfResolutionError",n),e("./method")(S,v,y,o,x),e("./bind")(S,v,y,x),e("./cancel")(S,b,o,x),e("./direct_resolve")(S),e("./synchronous_inspection")(S),e("./join")(S,b,y,v,h,s),S.Promise=S,S.version="3.5.3",e("./map.js")(S,b,o,y,v,x),e("./call_get.js")(S),e("./using.js")(S,o,y,k,v,x),e("./timers.js")(S,v,x),e("./generators.js")(S,o,v,y,a,x),e("./nodeify.js")(S),e("./promisify.js")(S,v),e("./props.js")(S,b,y,o),e("./race.js")(S,v,y,o),e("./reduce.js")(S,b,o,y,v,x),e("./settle.js")(S,b,x),e("./some.js")(S,b,o),e("./filter.js")(S,v),e("./each.js")(S,v),e("./any.js")(S),u.toFastProperties(S),u.toFastProperties(S.prototype),A({a:1}),A({b:2}),A({c:3}),A(1),A(function(){}),A(void 0),A(!1),A(new S(v)),x.setBounds(f.firstLineError,u.lastLineError),S}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){var a=t("./util");a.isArray;function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){var l=(s=s._target())._bitField;if(this._values=s,0==(50397184&l))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0==(33554432&l))return 0!=(16777216&l)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var u=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(u,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(t){for(var e=new o,r=t.length/2|0,n=0;n>1},e.prototype.props=function(){return f(this)},e.props=function(t){return f(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},o.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=t("./errors").RangeError,a=t("./errors").AggregateError,s=i.isArray,l={};function u(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new u(t),i=r.promise();return r.setHowMany(e),r.init(),i}i.inherits(u,r),u.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},u.prototype.init=function(){this._initialized=!0,this._init()},u.prototype.setUnwrap=function(){this._unwrap=!0},u.prototype.howMany=function(){return this._howMany},u.prototype.setHowMany=function(t){this._howMany=t},u.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},u.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},u.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},u.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},u.prototype._fulfilled=function(){return this._totalResolved},u.prototype._rejected=function(){return this._values.length-this.length()},u.prototype._addRejected=function(t){this._values.push(t)},u.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},u.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},u.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},u.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return c(t,e)},e.prototype.some=function(t){return c(this,t)},e._SomePromiseArray=u}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util"),i=n.errorObj,o=n.isObject;var a={}.hasOwnProperty;return function(t,s){if(o(t)){if(t instanceof e)return t;var l=function(t){try{return function(t){return t.then}(t)}catch(t){return i.e=t,i}}(t);if(l===i){s&&s._pushContext();var u=e.reject(l.e);return s&&s._popContext(),u}if("function"==typeof l)return function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)?(u=new e(r),t._then(u._fulfill,u._reject,void 0,u,null),u):function(t,o,a){var s=new e(r),l=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var u=!0,c=n.tryCatch(o).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,u,!0),s=null)});return u=!1,s&&c===i&&(s._rejectCallback(c.e,!0,!0),s=null),l}(t,l,s)}return t}}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,i){var o,l;return void 0!==i?(o=e.resolve(i)._then(s,null,null,t,void 0),n.cancellation()&&i instanceof e&&o._setOnCancel(i)):(o=new e(r),l=setTimeout(function(){o._fulfill()},+t),n.cancellation()&&o._setOnCancel(new a(l)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};e.prototype.delay=function(t){return l(t,this)};function u(t){return clearTimeout(this.handle),t}function c(t){throw clearTimeout(this.handle),t}e.prototype.timeout=function(t,e){var r,s;t=+t;var l=new a(setTimeout(function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),i.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)},t));return n.cancellation()?(s=this.then(),(r=s._then(u,c,void 0,l,void 0))._setOnCancel(l)):r=this._then(u,c,void 0,l,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=t("./util"),l=t("./errors").TypeError,u=t("./util").inherits,c=s.errorObj,f=s.tryCatch,h={};function p(t){setTimeout(function(){throw t},0)}function d(t,r){var i=0,a=t.length,s=new e(o);return function o(){if(i>=a)return s._fulfill();var l=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[i++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(t){return p(t)}if(l instanceof e)return l._then(o,p,null,null,null)}o()}(),s}function m(t,e,r){this._data=t,this._promise=e,this._context=r}function v(t,e,r){this.constructor$(t,e,r)}function g(t){return m.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},m.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==h?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},u(v,m),v.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new v(t,this,i());throw new l}}},{"./errors":12,"./util":36}],36:[function(e,r,i){"use strict";var o=e("./es5"),a="undefined"==typeof navigator,s={e:{}},l,u="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null;function c(){try{var t=l;return l=null,t.apply(this,arguments)}catch(t){return s.e=t,s}}function f(t){return l=t,c}var h=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function p(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function d(t){return"function"==typeof t||"object"==typeof t&&null!==t}function m(t){return p(t)?new Error(P(t)):t}function v(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=w.test(t+"")&&o.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function x(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var B=/^[a-z$_][a-z$_0-9]*$/i;function C(t){return B.test(t)}function E(t,e,r){for(var n=new Array(t),i=0;i10||V[0]>0),q.isNode&&q.toFastProperties(t);try{throw new Error}catch(t){q.lastLineError=t}r.exports=q},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{_process:117,timers:142}],4:[function(t,e,r){},{}],5:[function(t,e,r){(function(r){var n=t("tty"),i=t("./lib/encode"),o=t("stream").Stream,a=e.exports=function(){var t=null;function e(e){if(t)throw new Error("multiple inputs specified");t=e}var i=null;function o(t){if(i)throw new Error("multiple outputs specified");i=t}for(var a=0;a0&&this.down(e),t>0?this.right(t):t<0&&this.left(-t),this},s.prototype.up=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"A")),this},s.prototype.down=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"B")),this},s.prototype.right=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"C")),this},s.prototype.left=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"D")),this},s.prototype.column=function(t){return this.write(i("["+Math.floor(t)+"G")),this},s.prototype.push=function(t){return this.write(i(t?"7":"[s")),this},s.prototype.pop=function(t){return this.write(i(t?"8":"[u")),this},s.prototype.erase=function(t){return"end"===t||"$"===t?this.write(i("[K")):"start"===t||"^"===t?this.write(i("[1K")):"line"===t?this.write(i("[2K")):"down"===t?this.write(i("[J")):"up"===t?this.write(i("[1J")):"screen"===t?this.write(i("[1J")):this.emit("error",new Error("Unknown erase type: "+t)),this},s.prototype.display=function(t){var e={reset:0,bright:1,dim:2,underscore:4,blink:5,reverse:7,hidden:8}[t];return void 0===e&&this.emit("error",new Error("Unknown attribute: "+t)),this.write(i("["+e+"m")),this},s.prototype.foreground=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[38;5;"+t+"m"));else{var e={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.background=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[48;5;"+t+"m"));else{var e={black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.cursor=function(t){return this.write(i(t?"[?25h":"[?25l")),this};var l=a.extractCodes=function(t){for(var e=[],r=-1,n=0;n=0&&e.push(t.slice(r,n)),r=n):r>=0&&n===t.length-1&&e.push(t.slice(r));return e}}).call(this,t("_process"))},{"./lib/encode":6,_process:117,stream:139,tty:143}],6:[function(t,e,r){(function(t){var r=(e.exports=function(e){return new t([27].concat(function t(e){return"string"==typeof e?e.split("").map(r):Array.isArray(e)?e.reduce(function(e,r){return e.concat(t(r))},[]):void 0}(e)))}).ord=function(t){return t.charCodeAt(0)}}).call(this,t("buffer").Buffer)},{buffer:47}],7:[function(t,e,r){(function(r){"use strict";var n=t("readable-stream").Readable,i=t("util");function o(t,e){if(!(this instanceof o))return new o(t,e);n.call(this,e),null!==t&&void 0!==t||(t=String(t)),this._obj=t}e.exports=o,i.inherits(o,n),o.prototype._read=function(t){var e=this._obj;"string"==typeof e?this.push(new r(e)):r.isBuffer(e)?this.push(e):this.push(new r(JSON.stringify(e))),this.push(null)}}).call(this,t("buffer").Buffer)},{buffer:47,"readable-stream":13,util:150}],8:[function(t,e,r){(function(r){e.exports=s;var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},i=t("core-util-is");i.inherits=t("inherits");var o=t("./_stream_readable"),a=t("./_stream_writable");function s(t){if(!(this instanceof s))return new s(t);o.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",l)}function l(){this.allowHalfOpen||this._writableState.ended||r.nextTick(this.end.bind(this))}i.inherits(s,o),function(t,e){for(var r=0,n=t.length;r0?d(t):b(t)}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!a){var l=new Error("stream.push() after EOF");t.emit("error",l)}else if(e.endEmitted&&a){l=new Error("stream.unshift() after end event");t.emit("error",l)}else!e.decoder||a||o||(n=e.decoder.write(n)),e.length+=e.objectMode?1:n.length,a?e.buffer.unshift(n):(e.reading=!1,e.buffer.push(n)),e.needReadable&&d(t),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=h)t=h;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function d(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,e.sync?r.nextTick(function(){m(t)}):m(t))}function m(t){t.emit("readable")}function v(t){var e,r=t._readableState;function n(t,n,i){!1===t.write(e)&&r.awaitDrain++}for(r.awaitDrain=0;r.pipesCount&&null!==(e=t.read());)if(1===r.pipesCount?n(r.pipes):w(r.pipes,n),t.emit("data",e),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(o.listenerCount(t,"data")>0&&_(t));r.ranOut=!0}function g(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function _(t,e){if(t._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=e||!1,i=!1;t.readable=!0,t.pipe=s.prototype.pipe,t.on=t.addListener=s.prototype.on,t.on("readable",function(){var e;for(i=!0;!n&&null!==(e=t.read());)t.emit("data",e);null===e&&(i=!1,t._readableState.needReadable=!0)}),t.pause=function(){n=!0,this.emit("pause")},t.resume=function(){n=!1,i?r.nextTick(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function y(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");!e.endEmitted&&e.calledRead&&(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function w(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d(this),null;if(0===(t=p(t,e))&&e.ended)return r=null,e.length>0&&e.decoder&&(r=y(t,e),e.length-=r.length),0===e.length&&b(this),r;var i=e.needReadable;return e.length-t<=e.highWaterMark&&(i=!0),(e.ended||e.reading)&&(i=!1),i&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),i&&!e.reading&&(t=p(n,e)),null===(r=t>0?y(t,e):null)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&b(this),r},c.prototype._read=function(t){this.emit("error",new Error("not implemented"))},c.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1;var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?u:f;function l(t){t===i&&f()}function u(){t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",l);var c=function(t){return function(){var e=t._readableState;e.awaitDrain--,0===e.awaitDrain&&v(t)}}(i);function f(){t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",l),i.removeListener("end",u),i.removeListener("end",f),t._writableState&&!t._writableState.needDrain||c()}function h(e){m(),t.removeListener("error",h),0===o.listenerCount(t,"error")&&t.emit("error",e)}function p(){t.removeListener("finish",d),m()}function d(){t.removeListener("close",p),m()}function m(){i.unpipe(t)}return t.on("drain",c),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(h):t._events.error=[h,t._events.error]:t.on("error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",i),a.flowing||(this.on("readable",g),a.flowing=!0,r.nextTick(function(){v(i)})),t},c.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",g),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",g),e.flowing=!1;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":17}],16:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,o=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],u=[],c=0,f=0;for(n=0;n0&&l.push("var "+u.join(",")),n=o-1;n>=0;--n)c=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",c,"]"].join(""))),l.push("}")}return l.join("\n")}function o(t,e,r){for(var n=t.body,i=[],o=[],a=0;a0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){var y=new Array(r);for(l=0;l0&&g.push("var "+_.join(",")),l=0;l3&&g.push(o(t.pre,t,s));var x=o(t.body,t,s),B=function(t){for(var e=0,r=t[0].length;e0,u=[],c=0;c0;){"].join("")),u.push(["if(j",c,"<",s,"){"].join("")),u.push(["s",e[c],"=j",c].join("")),u.push(["j",c,"=0"].join("")),u.push(["}else{s",e[c],"=",s].join("")),u.push(["j",c,"-=",s,"}"].join("")),l&&u.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&g.push(o(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+g.join("\n")+"\n----------");var C=[t.funcName||"unnamed","_cwise_loop_",a[0].join("s"),"m",B,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",C,"(",v.join(","),"){",g.join("\n"),"} return ",C].join(""))()}},{uniq:146}],17:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],u=[],c=0;c0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),u.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;c0)return function(t,e){var r,n;for(r=new Array(t),n=0;n 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],24:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat correctionRadius = 0.5;\n\tfloat distance = sqrt(vPosition.x * vPosition.x + vPosition.y * vPosition.y) / correctionRadius;\n\tfloat theta = 1.0;\n\tif(distance != 0.0){\n\t\ttheta = atan(distance);\n\t}\n\tvec2 vMapping = theta * vPosition.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\t\t\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],25:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec3 uLensS;\nuniform vec2 uLensF;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord * vec2(1.0, -1.0)/ 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat scale = uLensS.z;\n\tvec3 vPos = vPosition;\n\tfloat Fx = uLensF.x;\n\tfloat Fy = uLensF.y;\n\tvec2 vMapping = vPos.xy;\n\tvMapping.x = vMapping.x + ((pow(vPos.y, 2.0)/scale)*vPos.x/scale)*-Fx;\n\tvMapping.y = vMapping.y + ((pow(vPos.x, 2.0)/scale)*vPos.y/scale)*-Fy;\n\tvMapping = vMapping * uLensS.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping/scale);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\tgl_FragColor = texture;\n}\n"},{}],26:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TODO insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],27:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TOD insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],28:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvoid main(void){\n\tvPosition = aVertexPosition;\n\tvTextureCoord = aTextureCoord;\n\tgl_Position = vec4(vPosition,1.0);\n}\n"},{}],29:[function(t,e,r){(function(r,n){"use strict";var i=t("path"),o=t("ndarray"),a=t("omggif").GifReader,s=(t("ndarray-pack"),t("through"),t("data-uri-to-buffer"));function l(t,e){var r;try{r=new a(t)}catch(t){return void e(t)}if(r.numFrames()>0){var n=[r.numFrames(),r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]*n[3]),s=o(i,n);try{for(var l=0;l=0&&(this.dispose=t)},l.prototype.setRepeat=function(t){this.repeat=t},l.prototype.setTransparent=function(t){this.transparent=t},l.prototype.analyzeImage=function(t){this.setImagePixels(this.removeAlphaChannel(t)),this.analyzePixels()},l.prototype.writeImageInfo=function(){this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.firstFrame=!1},l.prototype.outputImage=function(){this.writePixels()},l.prototype.addFrame=function(t){this.emit("frame#start"),this.analyzeImage(t),this.writeImageInfo(),this.outputImage(),this.emit("frame#stop")},l.prototype.finish=function(){this.emit("finish#start"),this.writeByte(59),this.emit("finish#stop")},l.prototype.setQuality=function(t){t<1&&(t=1),this.sample=t},l.prototype.writeHeader=function(){this.emit("writeHeader#start"),this.writeUTFBytes("GIF89a"),this.emit("writeHeader#stop")},l.prototype.analyzePixels=function(){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);var e=new o(this.pixels,this.sample);e.buildColormap(),this.colorTab=e.getColormap();for(var r=0,n=0;n>16,r=(65280&t)>>8,n=255&t,i=0,o=16777216,a=this.colorTab.length,s=0;s=0&&(e=7&dispose),e<<=2,this.writeByte(0|e|t),this.writeShort(this.delay),this.writeByte(this.transIndex),this.writeByte(0)},l.prototype.writeImageDesc=function(){this.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.writeByte(0):this.writeByte(128|this.palSize)},l.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.writeByte(240|this.palSize),this.writeByte(0),this.writeByte(0)},l.prototype.writeNetscapeExt=function(){this.writeByte(33),this.writeByte(255),this.writeByte(11),this.writeUTFBytes("NETSCAPE2.0"),this.writeByte(3),this.writeByte(1),this.writeShort(this.repeat),this.writeByte(0)},l.prototype.writePalette=function(){this.writeBytes(this.colorTab);for(var t=768-this.colorTab.length,e=0;e>8&255)},l.prototype.writePixels=function(){new a(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this)},l.prototype.stream=function(){return this},l.ByteCapacitor=s,e.exports=l}).call(this,t("buffer").Buffer)},{"./LZWEncoder.js":32,"./TypedNeuQuant.js":33,assert:40,buffer:47,events:48,"readable-stream":39,util:150}],32:[function(t,e,r){var n=-1,i=12,o=5003,a=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=function(t,e,r,s){var l,u,c,f,h,p,d,m,v,g=Math.max(2,s),_=new Uint8Array(256),y=new Int32Array(o),b=new Int32Array(o),w=0,k=0,x=!1;function B(t,e){_[u++]=t,u>=254&&P(e)}function C(t){E(o),k=m+2,x=!0,T(m,t)}function E(t){for(var e=0;e0&&(t.writeByte(u),t.writeBytes(_,0,u),u=0)}function j(t){return(1<0?l|=t<=8;)B(255&l,e),l>>=8,w-=8;if((k>c||x)&&(x?(c=j(p=d),x=!1):c=++p==i?1<0;)B(255&l,e),l>>=8,w-=8;P(e)}}this.encode=function(r){r.writeByte(g),f=t*e,h=0,function(t,e){var r,a,s,l,f,h,g;for(x=!1,c=j(p=d=t),v=1+(m=1<=0){f=h-s,0===s&&(f=1);do{if((s-=f)<0&&(s+=h),y[s]===r){l=b[s];continue t}}while(y[s]>=0)}T(l,e),l=a,k<1<>c,h=l<>3)*(1<u;)l=P[p++],fu&&((s=r[h--])[0]-=l*(s[0]-n)/_,s[1]-=l*(s[1]-o)/_,s[2]-=l*(s[2]-a)/_)}function T(t,e,n){var o,l,p,d,m,v=~(1<<31),g=v,_=-1,y=_;for(o=0;o>s-a))>c,E[o]-=m,C[o]+=m<>3),t=0;t>p;for(E<=1&&(E=0),r=0;r=c&&(M-=c),r++,0===_&&(_=1),r%_==0)for(B-=B/f,(E=(C-=C/m)>>p)<=1&&(E=0),u=0;u>=a,r[t][1]>>=a,r[t][2]>>=a,r[t][3]=t}(),function(){var t,e,n,a,s,l,u=0,c=0;for(t=0;t>1,e=u+1;e>1,e=u+1;e<256;e++)B[e]=o}()},this.getColormap=function(){for(var t=[],e=[],n=0;n=0;)c=l?c=i:(c++,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)=0&&((s=e-(a=r[f])[1])>=l?f=-1:(f--,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)0)if(e.ended&&!o){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&o){s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||o||i||(n=e.decoder.write(n)),o||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,o?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&m(t)),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=p)t=p;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function m(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(u("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(function(){v(t)}):v(t))}function v(t){u("emit readable"),t.emit("readable"),g(t)}function g(t){var e=t._readableState;if(u("flow",e.flowing),e.flowing)do{var r=t.read()}while(null!==r&&e.flowing)}function _(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");e.endEmitted||(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}f.prototype.read=function(t){u("read",t);var e=this._readableState,r=t;if((!l.isNumber(t)||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return u("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?y(this):m(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&y(this),null;var n,i=e.needReadable;return u("need readable",i),(0===e.length||e.length-t0?_(t,e):null,l.isNull(n)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&y(this),l.isNull(n)||this.emit("data",n),n},f.prototype._read=function(t){this.emit("error",new Error("not implemented"))},f.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,u("pipe count=%d opts=%j",a.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:h;function l(t){u("onunpipe"),t===i&&h()}function c(){u("onend"),t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",l);var f=function(t){return function(){var e=t._readableState;u("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o.listenerCount(t,"data")&&(e.flowing=!0,g(t))}}(i);function h(){u("cleanup"),t.removeListener("close",m),t.removeListener("finish",v),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",l),i.removeListener("end",c),i.removeListener("end",h),i.removeListener("data",p),!a.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}function p(e){u("ondata"),!1===t.write(e)&&(u("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function d(e){u("onerror",e),_(),t.removeListener("error",d),0===o.listenerCount(t,"error")&&t.emit("error",e)}function m(){t.removeListener("finish",v),_()}function v(){u("onfinish"),t.removeListener("close",m),_()}function _(){u("unpipe"),i.unpipe(t)}return t.on("drain",f),i.on("data",p),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(d):t._events.error=[d,t._events.error]:t.on("error",d),t.once("close",m),t.once("finish",v),t.emit("pipe",i),a.flowing||(u("pipe resume"),i.resume()),t},f.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n=0;u--)if(c[u]!==f[u])return!1;for(u=c.length-1;u>=0;u--)if(l=c[u],!_(t[l],e[l],r,n))return!1;return!0}(t,e,r,a))}return r?t===e:t==e}function y(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&v(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&o.isError(i),l=!t&&i&&!r;if((s&&a&&b(i,r)||l)&&v(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}f.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(m((e=this).actual),128)+" "+e.operator+" "+d(m(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||v;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=p(r),a=i.indexOf("\n"+o);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},o.inherits(f.AssertionError,Error),f.fail=v,f.ok=g,f.equal=function(t,e,r){t!=e&&v(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&v(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){_(t,e,!1)||v(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){_(t,e,!0)||v(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){_(t,e,!1)&&v(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){_(e,r,!0)&&v(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&v(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&v(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){w(!0,t,e,r)},f.doesNotThrow=function(t,e,r){w(!1,t,e,r)},f.ifError=function(t){if(t)throw t};var k=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":43}],41:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],42:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],43:[function(t,e,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(t){if(!g(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),l=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,t,n.depth)}function l(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function u(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&x(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return g(i)||(i=c(t,i,n)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(g(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(v(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(o)return o;var a=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),k(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(e);if(0===a.length){if(x(e)){var l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(y(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(w(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return f(e)}var u,b="",B=!1,C=["{","}"];(p(e)&&(B=!0,C=["[","]"]),x(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return y(e)&&(b=" "+RegExp.prototype.toString.call(e)),w(e)&&(b=" "+Date.prototype.toUTCString.call(e)),k(e)&&(b=" "+f(e)),0!==a.length||B&&0!=e.length?n<0?y(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),u=B?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(u,b,C)):C[0]+b+C[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,o){var a,s,l;if((l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),P(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(r)?c(t,l.value,null):c(t,l.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return"number"==typeof t}function g(t){return"string"==typeof t}function _(t){return void 0===t}function y(t){return b(t)&&"[object RegExp]"===B(t)}function b(t){return"object"==typeof t&&null!==t}function w(t){return b(t)&&"[object Date]"===B(t)}function k(t){return b(t)&&("[object Error]"===B(t)||t instanceof Error)}function x(t){return"function"==typeof t}function B(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(_(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var n=e.pid;a[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else a[t]=function(){};return a[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=m,r.isNullOrUndefined=function(t){return null==t},r.isNumber=v,r.isString=g,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=_,r.isRegExp=y,r.isObject=b,r.isDate=w,r.isError=k,r.isFunction=x,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":42,_process:117,inherits:41}],44:[function(t,e,r){(function(e,n){"use strict";var i=t("assert"),o=t("pako/lib/zlib/zstream"),a=t("pako/lib/zlib/deflate.js"),s=t("pako/lib/zlib/inflate.js"),l=t("pako/lib/zlib/constants");for(var u in l)r[u]=l[u];r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7;function c(t){if("number"!=typeof t||tr.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(t,e,r,n,i,o,a){return this._write(!0,t,e,r,n,i,o,a)},c.prototype.writeSync=function(t,e,r,n,i,o,a){return this._write(!1,t,e,r,n,i,o,a)},c.prototype._write=function(t,o,a,s,l,u,c,f){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==r.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===o,"must provide flush value"),this.write_in_progress=!0,o!==r.Z_NO_FLUSH&&o!==r.Z_PARTIAL_FLUSH&&o!==r.Z_SYNC_FLUSH&&o!==r.Z_FULL_FLUSH&&o!==r.Z_FINISH&&o!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=n.alloc(0),l=0,s=0),this.strm.avail_in=l,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=u,this.strm.next_out=c,this.flush=o,!t)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return e.nextTick(function(){h._process(),h._after()}),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,e,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(t>=8&&t<=15,"invalid windowBits"),i(e>=-1&&e<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===r.Z_FILTERED||o===r.Z_HUFFMAN_ONLY||o===r.Z_RLE||o===r.Z_FIXED||o===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(e,t,n,o,a),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,e,n,i,l){switch(this.level=t,this.windowBits=e,this.memLevel=n,this.strategy=i,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=l,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=a.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this,t("_process"),t("buffer").Buffer)},{_process:117,assert:40,buffer:47,"pako/lib/zlib/constants":51,"pako/lib/zlib/deflate.js":53,"pako/lib/zlib/inflate.js":55,"pako/lib/zlib/zstream":59}],45:[function(t,e,r){(function(e){"use strict";var n=t("buffer").Buffer,i=t("stream").Transform,o=t("./binding"),a=t("util"),s=t("assert").ok,l=t("buffer").kMaxLength,u="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),f=0;f=l?a=new RangeError(u):e=n.concat(i,o),i=[],t.close(),r(a,e)}t.on("error",function(e){t.removeListener("end",s),t.removeListener("readable",a),r(e)}),t.on("end",s),t.end(e),a()}function _(t,e){if("string"==typeof e&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function y(t){if(!(this instanceof y))return new y(t);P.call(this,t,o.DEFLATE)}function b(t){if(!(this instanceof b))return new b(t);P.call(this,t,o.INFLATE)}function w(t){if(!(this instanceof w))return new w(t);P.call(this,t,o.GZIP)}function k(t){if(!(this instanceof k))return new k(t);P.call(this,t,o.GUNZIP)}function x(t){if(!(this instanceof x))return new x(t);P.call(this,t,o.DEFLATERAW)}function B(t){if(!(this instanceof B))return new B(t);P.call(this,t,o.INFLATERAW)}function C(t){if(!(this instanceof C))return new C(t);P.call(this,t,o.UNZIP)}function E(t){return t===o.Z_NO_FLUSH||t===o.Z_PARTIAL_FLUSH||t===o.Z_SYNC_FLUSH||t===o.Z_FULL_FLUSH||t===o.Z_FINISH||t===o.Z_BLOCK}function P(t,e){var a=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,t),t.flush&&!E(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!E(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:o.Z_FINISH,t.chunkSize&&(t.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=r.Z_FILTERED&&t.strategy!=r.Z_HUFFMAN_ONLY&&t.strategy!=r.Z_RLE&&t.strategy!=r.Z_FIXED&&t.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!n.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(e);var s=this;this._hadError=!1,this._handle.onerror=function(t,e){j(s),s._hadError=!0;var n=new Error(t);n.errno=e,n.code=r.codes[e],s.emit("error",n)};var l=r.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(l=t.level);var u=r.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(u=t.strategy),this._handle.init(t.windowBits||r.Z_DEFAULT_WINDOWBITS,l,t.memLevel||r.Z_DEFAULT_MEMLEVEL,u,t.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=l,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!a._handle},configurable:!0,enumerable:!0})}function j(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function S(t){t.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),r.Deflate=y,r.Inflate=b,r.Gzip=w,r.Gunzip=k,r.DeflateRaw=x,r.InflateRaw=B,r.Unzip=C,r.createDeflate=function(t){return new y(t)},r.createInflate=function(t){return new b(t)},r.createDeflateRaw=function(t){return new x(t)},r.createInflateRaw=function(t){return new B(t)},r.createGzip=function(t){return new w(t)},r.createGunzip=function(t){return new k(t)},r.createUnzip=function(t){return new C(t)},r.deflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new y(e),t,r)},r.deflateSync=function(t,e){return _(new y(e),t)},r.gzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new w(e),t,r)},r.gzipSync=function(t,e){return _(new w(e),t)},r.deflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new x(e),t,r)},r.deflateRawSync=function(t,e){return _(new x(e),t)},r.unzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new C(e),t,r)},r.unzipSync=function(t,e){return _(new C(e),t)},r.inflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new b(e),t,r)},r.inflateSync=function(t,e){return _(new b(e),t)},r.gunzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new k(e),t,r)},r.gunzipSync=function(t,e){return _(new k(e),t)},r.inflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),g(new B(e),t,r)},r.inflateRawSync=function(t,e){return _(new B(e),t)},a.inherits(P,i),P.prototype.params=function(t,n,i){if(tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(n!=r.Z_FILTERED&&n!=r.Z_HUFFMAN_ONLY&&n!=r.Z_RLE&&n!=r.Z_FIXED&&n!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==t||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,function(){s(a._handle,"zlib binding closed"),a._handle.params(t,n),a._hadError||(a._level=t,a._strategy=n,i&&i())})}else e.nextTick(i)},P.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},P.prototype._flush=function(t){this._transform(n.alloc(0),"",t)},P.prototype.flush=function(t,r){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),a.ended?r&&e.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",function(){return i.flush(t,r)}):(this._flushFlag=t,this.write(n.alloc(0),"",r))},P.prototype.close=function(t){j(this,t),e.nextTick(S,this)},P.prototype._transform=function(t,e,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!t||a.length===t.length);return null===t||n.isBuffer(t)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(t,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},P.prototype._processChunk=function(t,e,r){var i=t&&t.length,o=this._chunkSize-this._offset,a=0,c=this,f="function"==typeof r;if(!f){var h,p=[],d=0;this.on("error",function(t){h=t}),s(this._handle,"zlib binding closed");do{var m=this._handle.writeSync(e,t,a,i,this._buffer,this._offset,o)}while(!this._hadError&&_(m[0],m[1]));if(this._hadError)throw h;if(d>=l)throw j(this),new RangeError(u);var v=n.concat(p,d);return j(this),v}s(this._handle,"zlib binding closed");var g=this._handle.write(e,t,a,i,this._buffer,this._offset,o);function _(l,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=o-u;if(s(h>=0,"have should not go down"),h>0){var m=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,f?c.push(m):(p.push(m),d+=m.length)}if((0===u||c._offset>=c._chunkSize)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===u){if(a+=i-l,i=l,!f)return!0;var v=c._handle.write(e,t,a,i,c._buffer,c._offset,c._chunkSize);return v.callback=_,void(v.buffer=t)}if(!f)return!1;r()}}g.buffer=t,g.callback=_},a.inherits(y,P),a.inherits(b,P),a.inherits(w,P),a.inherits(k,P),a.inherits(x,P),a.inherits(B,P),a.inherits(C,P)}).call(this,t("_process"))},{"./binding":44,_process:117,assert:40,buffer:47,stream:139,util:150}],46:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],47:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return l(t,e,r)}function l(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return U(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(z(t)||U(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,r/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-l),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:u>223?3:u>191?2:1;if(i+f<=r)switch(f){case 1:u<128&&(c=u);break;case 2:128==(192&(o=t[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(c=l)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,l=Math.min(o,a),u=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function A(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,o){return e=+e,r>>>=0,o||A(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||A(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||M(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return n.toByteArray(function(t){if((t=t.trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function U(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function z(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function q(t){return t!=t}},{"base64-js":1,ieee754:60}],48:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},o=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,l=10;try{var u={};Object.defineProperty&&Object.defineProperty(u,"x",{value:0}),s=0===u.x}catch(t){s=!1}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function f(t,e,r,i){var o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),s=a[e]):(a=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=a[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(o=c(t))&&o>0&&s.length>o){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",l.name,l.message)}}else s=a[e]=r,++t._eventsCount;return t}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var l=new Error('Unhandled "error" event. ('+e+")");throw l.context=e,l}if(!(r=a[t]))return!1;var u="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=v(t,n),o=0;o=0;a--)if(r[a]===e||r[a].listener===e){s=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;o--)this.removeListener(t,e[o]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],49:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],51:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],52:[function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s>>8^o[255&(t^e[s])];return-1^t}},{}],53:[function(t,e,r){"use strict";var n,i=t("../utils/common"),o=t("./trees"),a=t("./adler32"),s=t("./crc32"),l=t("./messages"),u=0,c=1,f=3,h=4,p=5,d=0,m=1,v=-2,g=-3,_=-5,y=-1,b=1,w=2,k=3,x=4,B=0,C=2,E=8,P=9,j=15,S=8,T=286,M=30,A=19,I=2*T+1,R=15,L=3,O=258,F=O+L+1,D=32,N=42,U=69,z=73,q=91,V=103,G=113,H=666,W=1,Z=2,X=3,Y=4,$=3;function J(t,e){return t.msg=l[e],e}function K(t){return(t<<1)-(t>4?9:0)}function Q(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,l=t.strstart>t.w_size-F?t.strstart-(t.w_size-F):0,u=t.window,c=t.w_mask,f=t.prev,h=t.strstart+O,p=u[o+a-1],d=u[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(u[(r=e)+a]===d&&u[r+a-1]===p&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;p=u[o+a-1],d=u[o+a]}}}while((e=f[e&c])>l&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ot(t){var e,r,n,o,l,u,c,f,h,p,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-F)){i.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--r);e=r=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--r);o+=d}if(0===t.strm.avail_in)break;if(u=t.strm,c=t.window,f=t.strstart+t.lookahead,h=o,p=void 0,(p=u.avail_in)>h&&(p=h),r=0===p?0:(u.avail_in-=p,i.arraySet(c,u.input,u.next_in,p,f),1===u.state.wrap?u.adler=a(u.adler,c,p,f):2===u.state.wrap&&(u.adler=s(u.adler,c,p,f)),u.next_in+=p,u.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=L)for(l=t.strstart-t.insert,t.ins_h=t.window[l],t.ins_h=(t.ins_h<=L&&(t.ins_h=(t.ins_h<=L)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-L),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=L){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=L&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=L-1)),t.prev_length>=L&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-L,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-L),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>P||r!==E||n<8||n>15||e<0||e>9||a<0||a>x)return J(t,v);8===n&&(n=9);var l=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=E,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*I),this.dyn_dtree=new i.Buf16(2*(2*M+1)),this.bl_tree=new i.Buf16(2*(2*A+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(R+1),this.heap=new i.Buf16(2*T+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*T+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=n,l.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===u)return W;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,et(t,!1),0===t.strm.avail_out))return W;if(t.strstart-t.block_start>=t.w_size-F&&(et(t,!1),0===t.strm.avail_out))return W}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?X:Y):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),W)}),new lt(4,4,8,4,at),new lt(4,5,16,8,at),new lt(4,6,32,32,at),new lt(4,4,16,16,st),new lt(8,16,32,32,st),new lt(8,16,128,128,st),new lt(8,32,128,256,st),new lt(32,128,258,1024,st),new lt(32,258,258,4096,st)],r.deflateInit=function(t,e){return ft(t,e,E,j,S,B)},r.deflateInit2=ft,r.deflateReset=ct,r.deflateResetKeep=ut,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?v:(t.state.gzhead=e,d):v},r.deflate=function(t,e){var r,i,a,l;if(!t||!t.state||e>p||e<0)return t?J(t,v):v;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===H&&e!==h)return J(t,0===t.avail_out?_:v);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===N)if(2===i.wrap)t.adler=0,rt(i,31),rt(i,139),rt(i,8),i.gzhead?(rt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),rt(i,255&i.gzhead.time),rt(i,i.gzhead.time>>8&255),rt(i,i.gzhead.time>>16&255),rt(i,i.gzhead.time>>24&255),rt(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),rt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(rt(i,255&i.gzhead.extra.length),rt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),rt(i,$),i.status=G);else{var g=E+(i.w_bits-8<<4)<<8;g|=(i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(g|=D),g+=31-g%31,i.status=G,nt(i,g),0!==i.strstart&&(nt(i,t.adler>>>16),nt(i,65535&t.adler)),t.adler=1}if(i.status===U)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending!==i.pending_buf_size));)rt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=z)}else i.status=z;if(i.status===z)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.gzindex=0,i.status=q)}else i.status=q;if(i.status===q)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===l&&(i.status=V)}else i.status=V;if(i.status===V&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&tt(t),i.pending+2<=i.pending_buf_size&&(rt(i,255&t.adler),rt(i,t.adler>>8&255),t.adler=0,i.status=G)):i.status=G),0!==i.pending){if(tt(t),0===t.avail_out)return i.last_flush=-1,d}else if(0===t.avail_in&&K(e)<=K(r)&&e!==h)return J(t,_);if(i.status===H&&0!==t.avail_in)return J(t,_);if(0!==t.avail_in||0!==i.lookahead||e!==u&&i.status!==H){var y=i.strategy===w?function(t,e){for(var r;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===u)return W;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(et(t,!1),0===t.strm.avail_out))return W}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?X:Y):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?W:Z}(i,e):i.strategy===k?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=O){if(ot(t),t.lookahead<=O&&e===u)return W;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=L&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+O;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=L?(r=o._tr_tally(t,1,t.match_length-L),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(et(t,!1),0===t.strm.avail_out))return W}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?X:Y):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?W:Z}(i,e):n[i.level].func(i,e);if(y!==X&&y!==Y||(i.status=H),y===W||y===X)return 0===t.avail_out&&(i.last_flush=-1),d;if(y===Z&&(e===c?o._tr_align(i):e!==p&&(o._tr_stored_block(i,0,0,!1),e===f&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),tt(t),0===t.avail_out))return i.last_flush=-1,d}return e!==h?d:i.wrap<=0?m:(2===i.wrap?(rt(i,255&t.adler),rt(i,t.adler>>8&255),rt(i,t.adler>>16&255),rt(i,t.adler>>24&255),rt(i,255&t.total_in),rt(i,t.total_in>>8&255),rt(i,t.total_in>>16&255),rt(i,t.total_in>>24&255)):(nt(i,t.adler>>>16),nt(i,65535&t.adler)),tt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:m)},r.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==N&&e!==U&&e!==z&&e!==q&&e!==V&&e!==G&&e!==H?J(t,v):(t.state=null,e===G?J(t,g):d):v},r.deflateSetDictionary=function(t,e){var r,n,o,s,l,u,c,f,h=e.length;if(!t||!t.state)return v;if(2===(s=(r=t.state).wrap)||1===s&&r.status!==N||r.lookahead)return v;for(1===s&&(t.adler=a(t.adler,e,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,h-r.w_size,r.w_size,0),e=f,h=r.w_size),l=t.avail_in,u=t.next_in,c=t.input,t.avail_in=h,t.next_in=0,t.input=e,ot(r);r.lookahead>=L;){n=r.strstart,o=r.lookahead-(L-1);do{r.ins_h=(r.ins_h<>>=b=y>>>24,d-=b,0===(b=y>>>16&255))E[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=m[(65535&y)+(p&(1<>>=b,d-=b),d<15&&(p+=C[n++]<>>=b=y>>>24,d-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=v[(65535&y)+(p&(1<l){t.msg="invalid distance too far back",r.mode=30;break t}if(p>>>=b,d-=b,k>(b=o-a)){if((b=k-b)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(x=0,B=h,0===f){if(x+=u-b,b2;)E[o++]=B[x++],E[o++]=B[x++],E[o++]=B[x++],w-=3;w&&(E[o++]=B[x++],w>1&&(E[o++]=B[x++]))}else{x=o-k;do{E[o++]=E[x++],E[o++]=E[x++],E[o++]=E[x++],w-=3}while(w>2);w&&(E[o++]=E[x++],w>1&&(E[o++]=E[x++]))}break}}break}}while(n>3,p&=(1<<(d-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function it(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=k,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(tt),e.distcode=e.distdyn=new n.Buf32(et),e.sane=1,e.back=-1,d):g}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,it(t)):g}function at(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?g:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ot(t))):g}function st(t,e){var r,i;return t?(i=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=i,i.window=null,(r=at(t,e))!==d&&(t.state=null),r):g}var lt,ut,ct=!0;function ft(t){if(ct){var e;for(lt=new n.Buf32(512),ut=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(u,t.lens,0,288,lt,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,ut,0,t.work,{bits:5}),ct=!1}t.lencode=lt,t.lenbits=9,t.distcode=ut,t.distbits=5}function ht(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,Pt,2,0),st=0,lt=0,r.mode=x;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&st)<<8)+(st>>8))%31){t.msg="incorrect header check",r.mode=J;break}if((15&st)!==w){t.msg="unknown compression method",r.mode=J;break}if(lt-=4,kt=8+(15&(st>>>=4)),0===r.wbits)r.wbits=kt;else if(kt>r.wbits){t.msg="invalid window size",r.mode=J;break}r.dmax=1<>8&1),512&r.flags&&(Pt[0]=255&st,Pt[1]=st>>>8&255,r.check=o(r.check,Pt,2,0)),st=0,lt=0,r.mode=B;case B:for(;lt<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,Pt[2]=st>>>16&255,Pt[3]=st>>>24&255,r.check=o(r.check,Pt,4,0)),st=0,lt=0,r.mode=C;case C:for(;lt<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>8),512&r.flags&&(Pt[0]=255&st,Pt[1]=st>>>8&255,r.check=o(r.check,Pt,2,0)),st=0,lt=0,r.mode=E;case E:if(1024&r.flags){for(;lt<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,r.check=o(r.check,Pt,2,0)),st=0,lt=0}else r.head&&(r.head.extra=null);r.mode=P;case P:if(1024&r.flags&&((pt=r.length)>ot&&(pt=ot),pt&&(r.head&&(kt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,tt,rt,pt,kt)),512&r.flags&&(r.check=o(r.check,tt,pt,rt)),ot-=pt,rt+=pt,r.length-=pt),r.length))break t;r.length=0,r.mode=j;case j:if(2048&r.flags){if(0===ot)break t;pt=0;do{kt=tt[rt+pt++],r.head&&kt&&r.length<65536&&(r.head.name+=String.fromCharCode(kt))}while(kt&&pt>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=I;break;case M:for(;lt<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=7<,lt-=7<,r.mode=X;break}for(;lt<3;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=1)){case 0:r.mode=L;break;case 1:if(ft(r),r.mode=z,e===p){st>>>=2,lt-=2;break t}break;case 2:r.mode=D;break;case 3:t.msg="invalid block type",r.mode=J}st>>>=2,lt-=2;break;case L:for(st>>>=7<,lt-=7<lt<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=J;break}if(r.length=65535&st,st=0,lt=0,r.mode=O,e===p)break t;case O:r.mode=F;case F:if(pt=r.length){if(pt>ot&&(pt=ot),pt>at&&(pt=at),0===pt)break t;n.arraySet(et,tt,rt,pt,it),ot-=pt,rt+=pt,at-=pt,it+=pt,r.length-=pt;break}r.mode=I;break;case D:for(;lt<14;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=5,lt-=5,r.ndist=1+(31&st),st>>>=5,lt-=5,r.ncode=4+(15&st),st>>>=4,lt-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=J;break}r.have=0,r.mode=N;case N:for(;r.have>>=3,lt-=3}for(;r.have<19;)r.lens[jt[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Bt={bits:r.lenbits},xt=s(l,r.lens,0,19,r.lencode,0,r.work,Bt),r.lenbits=Bt.bits,xt){t.msg="invalid code lengths set",r.mode=J;break}r.have=0,r.mode=U;case U:for(;r.have>>16&255,_t=65535&Et,!((vt=Et>>>24)<=lt);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=vt,lt-=vt,r.lens[r.have++]=_t;else{if(16===_t){for(Ct=vt+2;lt>>=vt,lt-=vt,0===r.have){t.msg="invalid bit length repeat",r.mode=J;break}kt=r.lens[r.have-1],pt=3+(3&st),st>>>=2,lt-=2}else if(17===_t){for(Ct=vt+3;lt>>=vt)),st>>>=3,lt-=3}else{for(Ct=vt+7;lt>>=vt)),st>>>=7,lt-=7}if(r.have+pt>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=J;break}for(;pt--;)r.lens[r.have++]=kt}}if(r.mode===J)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=J;break}if(r.lenbits=9,Bt={bits:r.lenbits},xt=s(u,r.lens,0,r.nlen,r.lencode,0,r.work,Bt),r.lenbits=Bt.bits,xt){t.msg="invalid literal/lengths set",r.mode=J;break}if(r.distbits=6,r.distcode=r.distdyn,Bt={bits:r.distbits},xt=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Bt),r.distbits=Bt.bits,xt){t.msg="invalid distances set",r.mode=J;break}if(r.mode=z,e===p)break t;case z:r.mode=q;case q:if(ot>=6&&at>=258){t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=lt,a(t,ct),it=t.next_out,et=t.output,at=t.avail_out,rt=t.next_in,tt=t.input,ot=t.avail_in,st=r.hold,lt=r.bits,r.mode===I&&(r.back=-1);break}for(r.back=0;gt=(Et=r.lencode[st&(1<>>16&255,_t=65535&Et,!((vt=Et>>>24)<=lt);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&Et,!(yt+(vt=Et>>>24)<=lt);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,lt-=yt,r.back+=yt}if(st>>>=vt,lt-=vt,r.back+=vt,r.length=_t,0===gt){r.mode=Z;break}if(32>){r.back=-1,r.mode=I;break}if(64>){t.msg="invalid literal/length code",r.mode=J;break}r.extra=15>,r.mode=V;case V:if(r.extra){for(Ct=r.extra;lt>>=r.extra,lt-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=G;case G:for(;gt=(Et=r.distcode[st&(1<>>16&255,_t=65535&Et,!((vt=Et>>>24)<=lt);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&Et,!(yt+(vt=Et>>>24)<=lt);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,lt-=yt,r.back+=yt}if(st>>>=vt,lt-=vt,r.back+=vt,64>){t.msg="invalid distance code",r.mode=J;break}r.offset=_t,r.extra=15>,r.mode=H;case H:if(r.extra){for(Ct=r.extra;lt>>=r.extra,lt-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=J;break}r.mode=W;case W:if(0===at)break t;if(pt=ct-at,r.offset>pt){if((pt=r.offset-pt)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=J;break}pt>r.wnext?(pt-=r.wnext,dt=r.wsize-pt):dt=r.wnext-pt,pt>r.length&&(pt=r.length),mt=r.window}else mt=et,dt=it-r.offset,pt=r.length;pt>at&&(pt=at),at-=pt,r.length-=pt;do{et[it++]=mt[dt++]}while(--pt);0===r.length&&(r.mode=q);break;case Z:if(0===at)break t;et[it++]=r.length,at--,r.mode=q;break;case X:if(r.wrap){for(;lt<32;){if(0===ot)break t;ot--,st|=tt[rt++]<=1&&0===L[E];E--);if(P>E&&(P=E),0===E)return u[c++]=20971520,u[c++]=20971520,h.bits=1,0;for(C=1;C0&&(0===t||1!==E))return-1;for(O[1]=0,x=1;x<15;x++)O[x+1]=O[x]+L[x];for(B=0;B852||2===t&&M>592)return 1;for(;;){y=x-S,f[B]<_?(b=0,w=f[B]):f[B]>_?(b=F[D+f[B]],w=I[R+f[B]]):(b=96,w=0),p=1<>S)+(d-=p)]=y<<24|b<<16|w|0}while(0!==d);for(p=1<>=1;if(0!==p?(A&=p-1,A+=p):A=0,B++,0==--L[x]){if(x===E)break;x=e[r+f[B]]}if(x>P&&(A&v)!==m){for(0===S&&(S=P),g+=C,T=1<<(j=x-S);j+S852||2===t&&M>592)return 1;u[m=A&v]=P<<24|j<<16|g-c|0}}return 0!==A&&(u[g+A]=x-S<<24|64<<16|0),h.bits=P,0}},{"../utils/common":49}],57:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],58:[function(t,e,r){"use strict";var n=t("../utils/common"),i=4,o=0,a=1,s=2;function l(t){for(var e=t.length;--e>=0;)t[e]=0}var u=0,c=1,f=2,h=29,p=256,d=p+1+h,m=30,v=19,g=2*d+1,_=15,y=16,b=7,w=256,k=16,x=17,B=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(d+2));l(S);var T=new Array(2*m);l(T);var M=new Array(512);l(M);var A=new Array(256);l(A);var I=new Array(h);l(I);var R,L,O,F=new Array(m);function D(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function N(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function U(t){return t<256?M[t]:M[256+(t>>>7)]}function z(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function q(t,e,r){t.bi_valid>y-r?(t.bi_buf|=e<>y-t.bi_valid,t.bi_valid+=r-y):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function H(t,e,r){var n,i,o=new Array(_+1),a=0;for(n=1;n<=_;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=G(o[s]++,s))}}function W(t){var e;for(e=0;e8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function X(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)Y(t,o,r);i=l;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Y(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,Y(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,l=e.dyn_tree,u=e.max_code,c=e.stat_desc.static_tree,f=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=_;o++)t.bl_count[o]=0;for(l[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rd&&(o=d,m++),l[2*n+1]=o,n>u||(t.bl_count[o]++,a=0,n>=p&&(a=h[n-p]),s=l[2*n],t.opt_len+=s*(o+a),f&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>u||(l[2*i+1]!==o&&(t.opt_len+=(o-l[2*i+1])*l[2*i],l[2*i+1]=o),n--)}}(t,e),H(o,u,t.bl_count)}function K(t,e,r){var n,i,o=-1,a=e[1],s=0,l=7,u=4;for(0===a&&(l=138,u=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s>=7;n0?(t.strm.data_type===s&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return a;for(e=32;e=3&&0===t.bl_tree[2*j[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),l=t.opt_len+3+7>>>3,(u=t.static_len+3+7>>>3)<=l&&(l=u)):l=u=r+5,r+4<=l&&-1!==e?et(t,e,r,n):t.strategy===i||u===l?(q(t,(c<<1)+(n?1:0),3),$(t,S,T)):(q(t,(f<<1)+(n?1:0),3),function(t,e,r,n){var i;for(q(t,e-257,5),q(t,r-1,5),q(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(A[r]+p+1)]++,t.dyn_dtree[2*U(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){q(t,c<<1,3),V(t,w,S),function(t){16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":49}],59:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],60:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+f],f+=h,c-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*l-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,u-=8);t[r+p-d]|=128*m}},{}],61:[function(t,e,r){e.exports=[function(t,e){return{options:t,draw:function(e,r,n){n.stop(!0),n.overrideFlag=!0;var i=this;return e.pixelManipulation({output:function(t,e,r){i.output={src:e,format:r}},changePixel:function(t,e,r,n){return[255-t,255-e,255-r,n]},format:e.format,image:t.image,inBrowser:t.inBrowser,callback:r})},output:void 0,UI:e}},{name:"Invert",description:"Inverts the image.",inputs:{}}]},{}],62:[function(t,e,r){"use strict";var n=t("underscore"),i=e.exports={Bitmap:t("./lib/bitmap")};n.extend(i,t("./lib/enums"))},{"./lib/bitmap":63,"./lib/enums":64,underscore:145}],63:[function(t,e,r){(function(r){"use strict";var n=t("fs"),i=(t("underscore"),t("bluebird")),o=t("jpeg-js"),a=t("node-png").PNG,s=t("./enums"),l=t("./utils"),u=t("./resize"),c={r:0,g:0,b:0,a:0},f=e.exports=function(t){t&&(t instanceof f?this._data={data:new r(t.data.data),width:t.width,height:t.height}:t.data?this._data=t:t.width&&t.height&&(this._data={data:new r(4*t.width*t.height),width:t.width,height:t.height},t.color&&this._fill(t.color)))};f.prototype={get width(){return this._data.width},get height(){return this._data.height},attach:function(t){var e=this._data;return this._data=t,e},detach:function(){var t=this._data;return delete this._data,t},_deduceFileType:function(t){if(!t)throw new Error("Can't determine image type");switch(t.substr(-4).toLowerCase()){case".jpg":return s.ImageType.JPG;case".png":return s.ImageType.PNG}if(".jpeg"==t.substr(-5).toLowerCase())return s.ImageType.JPG;throw new Error("Can't recognise image type: "+t)},_readStream:function(t){var e=i.defer(),n=[];return t.on("data",function(t){n.push(t)}),t.on("end",function(){var t=r.concat(n);e.resolve(t)}),t.on("error",function(t){e.reject(t)}),e.promise},_readPNG:function(t){var e=i.defer(),r=new a({filterType:4});return r.on("parsed",function(){e.resolve(r)}),r.on("error",function(t){e.rejecyt(t)}),t.pipe(r),e.promise},_parseOptions:function(t,e){return"number"==typeof(t=t||{})&&(t={type:t}),t.type=t.type||this._deduceFileType(e),t},read:function(t,e){var r=this;switch((e=this._parseOptions(e)).type){case s.ImageType.JPG:return this._readStream(t).then(function(t){r._data=o.decode(t)});case s.ImageType.PNG:return this._readPNG(t).then(function(t){r._data={data:t.data,width:t.width,height:t.height}});default:return i.reject(new Error("Not supported: ImageType "+e.type))}},readFile:function(t,e){var r=this;return l.fs.exists(t).then(function(i){if(i){e=r._parseOptions(e,t);var o=n.createReadStream(t);return r.read(o,e)}throw new Error("File Not Found: "+t)})},write:function(t,e){e=this._parseOptions(e);var r=i.defer();try{switch(t.on("finish",function(){r.resolve()}),t.on("error",function(t){r.reject(t)}),e.type){case s.ImageType.JPG:var n=o.encode(this._data,e.quality||90).data;t.write(n),t.end();break;case s.ImageType.PNG:var l=new a;l.width=this.width,l.height=this.height,l.data=this._data.data,l.on("end",function(){r.resolve()}),l.on("error",function(t){r.reject(t)}),l.pack().pipe(t);break;default:throw new Error("Not supported: ImageType "+e.type)}}catch(t){r.reject(t)}return r.promise},writeFile:function(t,e){e=this._parseOptions(e,t);var r=n.createWriteStream(t);return this.write(r,e)},clone:function(){return new f({width:this.width,height:this.height,data:new r(this._data.data)})},setPixel:function(t,e,r,n,i,o){if(void 0===n){var a=r;r=a.r,n=a.g,i=a.b,o=a.a}void 0===o&&(o=255);var s=4*(e*this.width+t),l=this._data.data;l[s++]=r,l[s++]=n,l[s++]=i,l[s++]=o},getPixel:function(t,e,r){var n=4*(e*this.width+t);r=r||{};var i=this._data.data;return r.r=i[n++],r.g=i[n++],r.b=i[n++],r.a=i[n++],r},negative:function(){for(var t=new f({width:this.width,height:this.height}),e=this.width*this.height,r=this._data.data,n=t._data.data,i=0,o=0,a=0;a-1&&S-1&&T=0&&T>=0?w[O]:F)+D*(v=S=0?w[O+4]:F),z=(1-D)*(g=S>=0&&T0?a:0)-(c>0?4:0)]+2*s[p-(u>0?a:0)]+1*s[p-(u>0?a:0)+(c0?4:0)]+4*s[p]+2*s[p+(c0?4:0)]+2*s[p+(u0?o[k-4]:2*o[k]-o[k+4],B=o[k],C=o[k+4],E=z0?m[k-4*h]:2*m[k]-m[k+4*h],T=m[k],M=m[k+4*h],A=N1)for(v=0;v0&&!t[a-1];)a--;o.push({children:[],index:0});var s,l=o[0];for(r=0;r0;)l=o.pop();for(l.index++,o.push(l);o.length<=r;)o.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s;i++}r+10)return p>>--d&1;if(255==(p=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(p<<8|t).toString(16)}return d=7,p>>>7}function v(t){for(var e,r=t;null!==(e=m());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function g(t){for(var e=0;t>0;){var r=m();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=g(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=v(e.huffmanTableAC),l=15&o,c=o>>4;if(0!==l)r[t[n+=c]]=_(l)*(1<>4,0===f)o<15?(y=g(o)+(1<>4;if(0!==s)r[t[o+=l]]=_(s),o++;else{if(l<15)break;o+=16}}};var M,A,I,R,L=0;for(A=1==T?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=A);L=65488&&M<=65495))break;r+=2}return r-h}function h(t,u){var c,f,h=[],p=u.blocksPerLine,d=u.blocksPerColumn,m=p<<3,v=new Int32Array(64),g=new Uint8Array(64);function _(t,c,f){var h,p,d,m,v,g,_,y,b,w,k=u.quantizationTable,x=f;for(w=0;w<64;w++)x[w]=t[w]*k[w];for(w=0;w<8;++w){var B=8*w;0!=x[1+B]||0!=x[2+B]||0!=x[3+B]||0!=x[4+B]||0!=x[5+B]||0!=x[6+B]||0!=x[7+B]?(h=s*x[0+B]+128>>8,p=s*x[4+B]+128>>8,d=x[2+B],m=x[6+B],v=l*(x[1+B]-x[7+B])+128>>8,y=l*(x[1+B]+x[7+B])+128>>8,g=x[3+B]<<4,_=x[5+B]<<4,b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+m*o+128>>8,d=d*o-m*a+128>>8,m=b,b=v-_+1>>1,v=v+_+1>>1,_=b,b=y+g+1>>1,g=y-g+1>>1,y=b,b=h-m+1>>1,h=h+m+1>>1,m=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=v*i+y*n+2048>>12,v=v*n-y*i+2048>>12,y=b,b=g*r+_*e+2048>>12,g=g*e-_*r+2048>>12,_=b,x[0+B]=h+y,x[7+B]=h-y,x[1+B]=p+_,x[6+B]=p-_,x[2+B]=d+g,x[5+B]=d-g,x[3+B]=m+v,x[4+B]=m-v):(b=s*x[0+B]+512>>10,x[0+B]=b,x[1+B]=b,x[2+B]=b,x[3+B]=b,x[4+B]=b,x[5+B]=b,x[6+B]=b,x[7+B]=b)}for(w=0;w<8;++w){var C=w;0!=x[8+C]||0!=x[16+C]||0!=x[24+C]||0!=x[32+C]||0!=x[40+C]||0!=x[48+C]||0!=x[56+C]?(h=s*x[0+C]+2048>>12,p=s*x[32+C]+2048>>12,d=x[16+C],m=x[48+C],v=l*(x[8+C]-x[56+C])+2048>>12,y=l*(x[8+C]+x[56+C])+2048>>12,g=x[24+C],_=x[40+C],b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+m*o+2048>>12,d=d*o-m*a+2048>>12,m=b,b=v-_+1>>1,v=v+_+1>>1,_=b,b=y+g+1>>1,g=y-g+1>>1,y=b,b=h-m+1>>1,h=h+m+1>>1,m=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=v*i+y*n+2048>>12,v=v*n-y*i+2048>>12,y=b,b=g*r+_*e+2048>>12,g=g*e-_*r+2048>>12,_=b,x[0+C]=h+y,x[56+C]=h-y,x[8+C]=p+_,x[48+C]=p-_,x[16+C]=d+g,x[40+C]=d-g,x[24+C]=m+v,x[32+C]=m-v):(b=s*f[w+0]+8192>>14,x[0+C]=b,x[8+C]=b,x[16+C]=b,x[24+C]=b,x[32+C]=b,x[40+C]=b,x[48+C]=b,x[56+C]=b)}for(w=0;w<64;++w){var E=128+(x[w]+8>>4);c[w]=E<0?0:E>255?255:E}}for(var y=0;y255?255:t}return u.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(z=0;z<64;z++){w[t[z]]=e[r++]}else{if(b>>4!=1)throw"DQT: invalid table spec";for(z=0;z<64;z++){w[t[z]]=n()}}p[15&b]=w}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===g,a.progressive=65474===g,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var k,x=e[r++];for(N=0;N>4,C=15&e[r+1],E=e[r+2];a.componentsOrder.push(k),a.components[k]={h:B,v:C,quantizationIdx:E},r+=3}o(a),d.push(a);break;case 65476:var P=n();for(N=2;N>4==0?v:m)[15&j]=c(S,M)}break;case 65501:n(),s=n();break;case 65498:n();var A=e[r++],I=[];for(N=0;N>4],q.huffmanTableAC=m[15&R],I.push(q)}var L=e[r++],O=e[r++],F=e[r++],D=f(e,r,a,I,s,L,O,F>>4,15&F);r+=D;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+g.toString(16)}g=n()}if(1!=d.length)throw"only single frame JPEGs supported";for(var N=0;N=0;)e&1<>8&255),L(255&t)}function F(t,e,r,n,i){var o,a=i[0],s=i[240];for(var l=function(t,e){var r,n,i,o,a,s,l,u,c,f,h=0;for(c=0;c<8;++c){r=t[h],n=t[h+1],i=t[h+2],o=t[h+3],a=t[h+4],s=t[h+5],l=t[h+6];var p=r+(u=t[h+7]),m=r-u,v=n+l,g=n-l,_=i+s,y=i-s,b=o+a,w=o-a,k=p+b,x=p-b,B=v+_,C=v-_;t[h]=k+B,t[h+4]=k-B;var E=.707106781*(C+x);t[h+2]=x+E,t[h+6]=x-E;var P=.382683433*((k=w+y)-(C=g+m)),j=.5411961*k+P,S=1.306562965*C+P,T=.707106781*(B=y+g),M=m+T,A=m-T;t[h+5]=A+j,t[h+3]=A-j,t[h+1]=M+S,t[h+7]=M-S,h+=8}for(h=0,c=0;c<8;++c){r=t[h],n=t[h+8],i=t[h+16],o=t[h+24],a=t[h+32],s=t[h+40],l=t[h+48];var I=r+(u=t[h+56]),R=r-u,L=n+l,O=n-l,F=i+s,D=i-s,N=o+a,U=o-a,z=I+N,q=I-N,V=L+F,G=L-F;t[h]=z+V,t[h+32]=z-V;var H=.707106781*(G+q);t[h+16]=q+H,t[h+48]=q-H;var W=.382683433*((z=U+D)-(G=O+R)),Z=.5411961*z+W,X=1.306562965*G+W,Y=.707106781*(V=D+O),$=R+Y,J=R-Y;t[h+40]=J+Z,t[h+24]=J-Z,t[h+8]=$+X,t[h+56]=$-X,h++}for(c=0;c<64;++c)f=t[c]*e[c],d[c]=f>0?f+.5|0:f-.5|0;return d}(t,e),u=0;u<64;++u)m[B[u]]=l[u];var c=m[0]-r;r=m[0],0==c?R(n[0]):(R(n[p[o=32767+c]]),R(h[o]));for(var f=63;f>0&&0==m[f];f--);if(0==f)return R(a),r;for(var v,g=1;g<=f;){for(var _=g;0==m[g]&&g<=f;++g);var y=g-_;if(y>=16){v=y>>4;for(var b=1;b<=v;++b)R(s);y&=15}o=32767+m[g],R(i[(y<<4)+p[o]]),R(h[o]),g++}return 63!=f&&R(a),r}function D(t){if(t<=0&&(t=1),t>100&&(t=100),a!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=s((e[r]*t+50)/100);n<1?n=1:n>255&&(n=255),l[B[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=s((i[o]*t+50)/100);a<1?a=1:a>255&&(a=255),u[B[o]]=a}for(var h=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],p=0,d=0;d<8;d++)for(var m=0;m<8;m++)c[p]=1/(l[B[p]]*h[d]*h[m]*8),f[p]=1/(u[B[p]]*h[d]*h[m]*8),p++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t}}this.encode=function(e,a){(new Date).getTime();a&&D(a),v=new Array,g=0,_=7,O(65496),O(65504),O(16),L(74),L(70),L(73),L(70),L(0),L(1),L(1),L(0),O(1),O(1),L(0),L(0),function(){O(65499),O(132),L(0);for(var t=0;t<64;t++)L(l[t]);L(1);for(var e=0;e<64;e++)L(u[e])}(),function(t,e){O(65472),O(17),L(8),O(e),O(t),L(3),L(1),L(17),L(0),L(2),L(17),L(1),L(3),L(17),L(1)}(e.width,e.height),function(){O(65476),O(418),L(0);for(var t=0;t<16;t++)L(C[t+1]);for(var e=0;e<=11;e++)L(E[e]);L(16);for(var r=0;r<16;r++)L(P[r+1]);for(var n=0;n<=161;n++)L(j[n]);L(1);for(var i=0;i<16;i++)L(S[i+1]);for(var o=0;o<=11;o++)L(T[o]);L(17);for(var a=0;a<16;a++)L(M[a+1]);for(var s=0;s<=161;s++)L(A[s])}(),O(65498),O(12),L(3),L(1),L(0),L(2),L(17),L(3),L(17),L(0),L(63),L(0);var s=0,h=0,p=0;g=0,_=7,this.encode.displayName="_encode_";for(var d,m,k,B,I,N,U,z,q,V=e.data,G=e.width,H=e.height,W=4*G,Z=0;Z>3)*W+(U=4*(7&q)),Z+z>=H&&(N-=W*(Z+1+z-H)),d+U>=W&&(N-=d+U-W+4),m=V[N++],k=V[N++],B=V[N++],y[q]=(x[m]+x[k+256>>0]+x[B+512>>0]>>16)-128,b[q]=(x[m+768>>0]+x[k+1024>>0]+x[B+1280>>0]>>16)-128,w[q]=(x[m+1280>>0]+x[k+1536>>0]+x[B+1792>>0]>>16)-128;s=F(y,c,s,r,i),h=F(b,f,h,n,o),p=F(w,f,p,n,o),d+=32}Z+=8}if(_>=0){var X=[];X[1]=_+1,X[0]=(1<<_+1)-1,R(X)}return O(65497),new t(v)},function(){(new Date).getTime();e||(e=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)k[e]=t(e)}(),r=I(C,E),n=I(S,T),i=I(P,j),o=I(M,A),function(){for(var t=1,e=2,r=1;r<=15;r++){for(var n=t;n>0]=38470*t,x[t+512>>0]=7471*t+32768,x[t+768>>0]=-11059*t,x[t+1024>>0]=-21709*t,x[t+1280>>0]=32768*t+8421375,x[t+1536>>0]=-27439*t,x[t+1792>>0]=-5329*t}(),D(e),(new Date).getTime()}()}e.exports=function(t,e){void 0===e&&(e=50);return{data:new r(e).encode(t,e),width:t.width,height:t.height}}}).call(this,t("buffer").Buffer)},{buffer:47}],70:[function(t,e,r){arguments[4][41][0].apply(r,arguments)},{dup:41}],71:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r=this.width||e<0||e>=this.height)&&!!this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r?1:0},t.prototype.setRegion=function(t,e,r,n,i){for(var o=e;o=this.size&&(i=(i^this.primitive)&this.size-1);for(o=0;o1&&0===e[0]){for(var n=1;ni.length&&(r=(o=[i,r])[0],i=o[1]);for(var o,a=new Uint8ClampedArray(i.length),s=i.length-r.length,l=0;lr?r:t}var s=function(){function t(t,e){this.width=t,this.data=new Uint8ClampedArray(t*e)}return t.prototype.get=function(t,e){return this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r},t}();e.binarize=function(t,e,r,l){if(t.length!==e*r*4)throw new Error("Malformed data passed to binarizer.");for(var u=new s(e,r),c=0;c0&&y>0)){var C=(g.get(y,_-1)+2*g.get(y-1,_)+g.get(y-1,_-1))/4;w6&&(r.setRegion(e-11,0,3,6,!0),r.setRegion(0,e-11,6,3,!0)),r}(e),s=[],u=0,f=0,h=!0,p=o-1;p>0;p-=2){6===p&&p--;for(var d=0;d=0;i--)for(var o=e-9;o>=e-11;o--)n=l(t.get(o,i),n);var u=0;for(o=5;o>=0;o--)for(i=e-9;i>=e-11;i--)u=l(t.get(o,i),u);for(var c,f=1/0,h=0,p=a.VERSIONS;h=0;n--)6!==n&&(e=l(t.get(8,n),e));var i=t.height,o=0;for(n=i-1;n>=i-7;n--)o=l(t.get(8,n),o);for(r=i-8;r1){var c=n.ecBlocks[0].numBlocks,f=n.ecBlocks[1].numBlocks;for(s=0;s0;)for(var h=0,p=i;h=3;){if((u=t.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(u/100),s=Math.floor(u/10)%10,l=u%10;r.push(48+a,48+s,48+l),n+=a.toString()+s.toString()+l.toString(),o-=3}if(2===o){if((u=t.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(u/10),s=u%10;r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===o){var u;if((u=t.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+u),n+=u.toString()}return{bytes:r,text:n}}!function(t){t.Numeric="numeric",t.Alphanumeric="alphanumeric",t.Byte="byte",t.Kanji="kanji",t.ECI="eci"}(n=e.Mode||(e.Mode={})),function(t){t[t.Terminator=0]="Terminator",t[t.Numeric=1]="Numeric",t[t.Alphanumeric=2]="Alphanumeric",t[t.Byte=4]="Byte",t[t.Kanji=8]="Kanji",t[t.ECI=7]="ECI"}(i||(i={}));var l=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function u(t,e){for(var r=[],n="",i=[9,11,13][e],o=t.readBits(i);o>=2;){var a=t.readBits(11),s=Math.floor(a/45),u=a%45;r.push(l[s].charCodeAt(0),l[u].charCodeAt(0)),n+=l[s]+l[u],o-=2}if(1===o){s=t.readBits(6);r.push(l[s].charCodeAt(0)),n+=l[s]}return{bytes:r,text:n}}function c(t,e){for(var r=[],n="",i=[8,16,16][e],o=t.readBits(i),a=0;a>8,255&u),n+=String.fromCharCode(a.shiftJISTable[u])}return{bytes:r,text:n}}e.decode=function(t,e){for(var r,a,l,h,p=new o.BitStream(t),d=e<=9?0:e<=26?1:2,m={text:"",bytes:[],chunks:[]};p.available()>=4;){var v=p.readBits(4);if(v===i.Terminator)return m;if(v===i.ECI)0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?m.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):m.chunks.push({type:n.ECI,assignmentNumber:-1});else if(v===i.Numeric){var g=s(p,d);m.text+=g.text,(r=m.bytes).push.apply(r,g.bytes),m.chunks.push({type:n.Numeric,text:g.text})}else if(v===i.Alphanumeric){var _=u(p,d);m.text+=_.text,(a=m.bytes).push.apply(a,_.bytes),m.chunks.push({type:n.Alphanumeric,text:_.text})}else if(v===i.Byte){var y=c(p,d);m.text+=y.text,(l=m.bytes).push.apply(l,y.bytes),m.chunks.push({type:n.Byte,bytes:y.bytes,text:y.text})}else if(v===i.Kanji){var b=f(p,d);m.text+=b.text,(h=m.bytes).push.apply(h,b.bytes),m.chunks.push({type:n.Kanji,bytes:b.bytes,text:b.text})}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.byteOffset=0,this.bitOffset=0,this.bytes=t}return t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Error("Cannot read "+t.toString()+" bits");var e=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=t>8-n<<(o=r-n);e=(this.bytes[this.byteOffset]&i)>>o,t-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(t>0){for(;t>=8;)e=e<<8|255&this.bytes[this.byteOffset],this.byteOffset++,t-=8;if(t>0){var o;i=255>>(o=8-t)<>o,this.bitOffset+=t}}return e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();e.BitStream=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35000:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36000:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37000:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38000:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39000:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,40000:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58000:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59000:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,60000:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),i=r(2);e.decode=function(t,e){var r=new Uint8ClampedArray(t.length);r.set(t);for(var o=new n.default(285,256,0),a=new i.default(o,r),s=new Uint8ClampedArray(e),l=!1,u=0;u=n/2;){var l=i,u=a;if(a=s,(i=o).isZero())return null;o=l;for(var c=t.zero,f=i.getCoefficient(i.degree()),h=t.inverse(f);o.degree()>=i.degree()&&!o.isZero();){var p=o.degree()-i.degree(),d=t.multiply(o.getCoefficient(o.degree()),h);c=c.addOrSubtract(t.buildMonomial(p,d)),o=o.addOrSubtract(i.multiplyByMonomial(p,d))}if(s=c.multiplyPoly(a).addOrSubtract(u),o.degree()>=i.degree())return null}var m=s.getCoefficient(0);if(0===m)return null;var v,g=t.inverse(m);return[s.multiply(g),o.multiply(g)]}(o,o.buildMonomial(e,1),f,e);if(null===h)return null;var p=function(t,e){var r=e.degree();if(1===r)return[e.getCoefficient(1)];for(var n=new Array(r),i=0,o=1;oMath.abs(e.x-t.x);c?(i=Math.floor(t.y),o=Math.floor(t.x),s=Math.floor(e.y),l=Math.floor(e.x)):(i=Math.floor(t.x),o=Math.floor(t.y),s=Math.floor(e.x),l=Math.floor(e.y));for(var f=Math.abs(s-i),h=Math.abs(l-o),p=Math.floor(-f/2),d=i0){if(_===l)break;_+=m,p-=f}}for(var w=[],k=0;k=t.bottom.startX&&g<=t.bottom.endX||v>=t.bottom.startX&&g<=t.bottom.endX||g<=t.bottom.startX&&v>=t.bottom.endX&&f[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:r.push({top:_,bottom:_})}if(m){var y,b=e-f[4],w=b-f[3];_={startX:w,y:n,endX:b},(y=c.filter(function(t){return w>=t.bottom.startX&&w<=t.bottom.endX||b>=t.bottom.startX&&w<=t.bottom.endX||w<=t.bottom.startX&&b>=t.bottom.endX&&f[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:c.push({top:_,bottom:_})}}},p=-1;p<=t.width;p++)h(p);e.push.apply(e,r.filter(function(t){return t.bottom.y!==n&&t.bottom.y-t.top.y>=2})),r=r.filter(function(t){return t.bottom.y===n}),l.push.apply(l,c.filter(function(t){return t.bottom.y!==n})),c=c.filter(function(t){return t.bottom.y===n})},p=0;p<=t.height;p++)h(p);e.push.apply(e,r.filter(function(t){return t.bottom.y-t.top.y>=2})),l.push.apply(l,c);var d=e.filter(function(t){return t.bottom.y-t.top.y>=2}).map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.round(r),Math.round(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1],o=s(i)/i.length;return{score:f({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],t),x:r,y:n,size:o}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}).map(function(t,e,r){if(e>n)return null;var i=r.filter(function(t,r){return e!==r}).map(function(e){return{x:e.x,y:e.y,score:e.score+Math.pow(e.size-t.size,2)/t.size,size:e.size}}).sort(function(t,e){return t.score-e.score});if(i.length<2)return null;var o=t.score+i[0].score+i[1].score;return{points:[t].concat(i.slice(0,2)),score:o}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score});if(0===d.length)return null;var m,v,g=function(t,e,r){var n,i,o,s,l,u,c,f=a(t,e),h=a(e,r),p=a(t,r);return h>=f&&h>=p?(n=(s=[e,t,r])[0],i=s[1],o=s[2]):p>=h&&p>=f?(n=(l=[t,e,r])[0],i=l[1],o=l[2]):(n=(u=[t,r,e])[0],i=u[1],o=u[2]),(o.x-i.x)*(n.y-i.y)-(o.y-i.y)*(n.x-i.x)<0&&(n=(c=[o,n])[0],o=c[1]),{bottomLeft:n,topLeft:i,topRight:o}}(d[0].points[0],d[0].points[1],d[0].points[2]),_=g.topRight,y=g.topLeft,b=g.bottomLeft;try{w=function(t,e,r,n){var i=(s(u(t,r,n,5))/7+s(u(t,e,n,5))/7+s(u(r,t,n,5))/7+s(u(e,t,n,5))/7)/4;if(i<1)throw new Error("Invalid module size");var o=Math.round(a(t,e)/i),l=Math.round(a(t,r)/i),c=Math.floor((o+l)/2)+7;switch(c%4){case 0:c++;break;case 2:c--}return{dimension:c,moduleSize:i}}(y,_,b,t),m=w.dimension,v=w.moduleSize}catch(t){return null}var w,k=_.x-y.x+b.x,x=_.y-y.y+b.y,B=(a(y,b)+a(y,_))/2/v,C=1-3/B,E={x:y.x+C*(k-y.x),y:y.y+C*(x-y.y)},P=l.map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.floor(r),Math.floor(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1];return s(i),{x:r,y:n,score:f({x:Math.floor(r),y:Math.floor(n)},[1,1,1],t)+a({x:r,y:n},E)}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}),j=B>=15&&P.length?P[0]:E;return{alignmentPattern:{x:j.x,y:j.y},bottomLeft:{x:b.x,y:b.y},dimension:m,topLeft:{x:y.x,y:y.y},topRight:{x:_.x,y:_.y}}}}]).default},"object"==typeof r&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof r?r.jsQR=i():n.jsQR=i()},{}],75:[function(t,e,r){(function(t){(function(){var n,i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="__lodash_hash_undefined__",l=500,u="__lodash_placeholder__",c=1,f=2,h=4,p=1,d=2,m=1,v=2,g=4,_=8,y=16,b=32,w=64,k=128,x=256,B=512,C=30,E="...",P=800,j=16,S=1,T=2,M=1/0,A=9007199254740991,I=1.7976931348623157e308,R=NaN,L=4294967295,O=L-1,F=L>>>1,D=[["ary",k],["bind",m],["bindKey",v],["curry",_],["curryRight",y],["flip",B],["partial",b],["partialRight",w],["rearg",x]],N="[object Arguments]",U="[object Array]",z="[object AsyncFunction]",q="[object Boolean]",V="[object Date]",G="[object DOMException]",H="[object Error]",W="[object Function]",Z="[object GeneratorFunction]",X="[object Map]",Y="[object Number]",$="[object Null]",J="[object Object]",K="[object Proxy]",Q="[object RegExp]",tt="[object Set]",et="[object String]",rt="[object Symbol]",nt="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",at="[object ArrayBuffer]",st="[object DataView]",lt="[object Float32Array]",ut="[object Float64Array]",ct="[object Int8Array]",ft="[object Int16Array]",ht="[object Int32Array]",pt="[object Uint8Array]",dt="[object Uint8ClampedArray]",mt="[object Uint16Array]",vt="[object Uint32Array]",gt=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,wt=/[&<>"']/g,kt=RegExp(bt.source),xt=RegExp(wt.source),Bt=/<%-([\s\S]+?)%>/g,Ct=/<%([\s\S]+?)%>/g,Et=/<%=([\s\S]+?)%>/g,Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jt=/^\w*$/,St=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tt=/[\\^$.*+?()[\]{}|]/g,Mt=RegExp(Tt.source),At=/^\s+|\s+$/g,It=/^\s+/,Rt=/\s+$/,Lt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ot=/\{\n\/\* \[wrapped with (.+)\] \*/,Ft=/,? & /,Dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Vt=/^0b[01]+$/i,Gt=/^\[object .+?Constructor\]$/,Ht=/^0o[0-7]+$/i,Wt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,Yt=/['\n\r\u2028\u2029\\]/g,$t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Jt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Kt="[\\ud800-\\udfff]",Qt="["+Jt+"]",te="["+$t+"]",ee="\\d+",re="[\\u2700-\\u27bf]",ne="[a-z\\xdf-\\xf6\\xf8-\\xff]",ie="[^\\ud800-\\udfff"+Jt+ee+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",oe="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",le="[\\ud800-\\udbff][\\udc00-\\udfff]",ue="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ce="(?:"+ne+"|"+ie+")",fe="(?:"+ue+"|"+ie+")",he="(?:"+te+"|"+oe+")"+"?",pe="[\\ufe0e\\ufe0f]?"+he+("(?:\\u200d(?:"+[ae,se,le].join("|")+")[\\ufe0e\\ufe0f]?"+he+")*"),de="(?:"+[re,se,le].join("|")+")"+pe,me="(?:"+[ae+te+"?",te,se,le,Kt].join("|")+")",ve=RegExp("['’]","g"),ge=RegExp(te,"g"),_e=RegExp(oe+"(?="+oe+")|"+me+pe,"g"),ye=RegExp([ue+"?"+ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Qt,ue,"$"].join("|")+")",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Qt,ue+ce,"$"].join("|")+")",ue+"?"+ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ue+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ee,de].join("|"),"g"),be=RegExp("[\\u200d\\ud800-\\udfff"+$t+"\\ufe0e\\ufe0f]"),we=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ke=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,Be={};Be[lt]=Be[ut]=Be[ct]=Be[ft]=Be[ht]=Be[pt]=Be[dt]=Be[mt]=Be[vt]=!0,Be[N]=Be[U]=Be[at]=Be[q]=Be[st]=Be[V]=Be[H]=Be[W]=Be[X]=Be[Y]=Be[J]=Be[Q]=Be[tt]=Be[et]=Be[it]=!1;var Ce={};Ce[N]=Ce[U]=Ce[at]=Ce[st]=Ce[q]=Ce[V]=Ce[lt]=Ce[ut]=Ce[ct]=Ce[ft]=Ce[ht]=Ce[X]=Ce[Y]=Ce[J]=Ce[Q]=Ce[tt]=Ce[et]=Ce[rt]=Ce[pt]=Ce[dt]=Ce[mt]=Ce[vt]=!0,Ce[H]=Ce[W]=Ce[it]=!1;var Ee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Pe=parseFloat,je=parseInt,Se="object"==typeof t&&t&&t.Object===Object&&t,Te="object"==typeof self&&self&&self.Object===Object&&self,Me=Se||Te||Function("return this")(),Ae="object"==typeof r&&r&&!r.nodeType&&r,Ie=Ae&&"object"==typeof e&&e&&!e.nodeType&&e,Re=Ie&&Ie.exports===Ae,Le=Re&&Se.process,Oe=function(){try{var t=Ie&&Ie.require&&Ie.require("util").types;return t||Le&&Le.binding&&Le.binding("util")}catch(t){}}(),Fe=Oe&&Oe.isArrayBuffer,De=Oe&&Oe.isDate,Ne=Oe&&Oe.isMap,Ue=Oe&&Oe.isRegExp,ze=Oe&&Oe.isSet,qe=Oe&&Oe.isTypedArray;function Ve(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Ge(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function $e(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function _r(t,e){for(var r=t.length;r--&&or(e,t[r],0)>-1;);return r}var yr=cr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),br=cr({"&":"&","<":"<",">":">",'"':""","'":"'"});function wr(t){return"\\"+Ee[t]}function kr(t){return be.test(t)}function xr(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function Br(t,e){return function(r){return t(e(r))}}function Cr(t,e){for(var r=-1,n=t.length,i=0,o=[];++r",""":'"',"'":"'"});var Mr=function t(e){var r,$t=(e=null==e?Me:Mr.defaults(Me.Object(),e,Mr.pick(Me,ke))).Array,Jt=e.Date,Kt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ie=e.TypeError,oe=$t.prototype,ae=Qt.prototype,se=ee.prototype,le=e["__core-js_shared__"],ue=ae.toString,ce=se.hasOwnProperty,fe=0,he=(r=/[^.]+$/.exec(le&&le.keys&&le.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",pe=se.toString,de=ue.call(ee),me=Me._,_e=re("^"+ue.call(ce).replace(Tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Re?e.Buffer:n,Ee=e.Symbol,Se=e.Uint8Array,Te=be?be.allocUnsafe:n,Ae=Br(ee.getPrototypeOf,ee),Ie=ee.create,Le=se.propertyIsEnumerable,Oe=oe.splice,rr=Ee?Ee.isConcatSpreadable:n,cr=Ee?Ee.iterator:n,Ar=Ee?Ee.toStringTag:n,Ir=function(){try{var t=No(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Rr=e.clearTimeout!==Me.clearTimeout&&e.clearTimeout,Lr=Jt&&Jt.now!==Me.Date.now&&Jt.now,Or=e.setTimeout!==Me.setTimeout&&e.setTimeout,Fr=te.ceil,Dr=te.floor,Nr=ee.getOwnPropertySymbols,Ur=be?be.isBuffer:n,zr=e.isFinite,qr=oe.join,Vr=Br(ee.keys,ee),Gr=te.max,Hr=te.min,Wr=Jt.now,Zr=e.parseInt,Xr=te.random,Yr=oe.reverse,$r=No(e,"DataView"),Jr=No(e,"Map"),Kr=No(e,"Promise"),Qr=No(e,"Set"),tn=No(e,"WeakMap"),en=No(ee,"create"),rn=tn&&new tn,nn={},on=fa($r),an=fa(Jr),sn=fa(Kr),ln=fa(Qr),un=fa(tn),cn=Ee?Ee.prototype:n,fn=cn?cn.valueOf:n,hn=cn?cn.toString:n;function pn(t){if(js(t)&&!gs(t)&&!(t instanceof gn)){if(t instanceof vn)return t;if(ce.call(t,"__wrapped__"))return ha(t)}return new vn(t)}var dn=function(){function t(){}return function(e){if(!Ps(e))return{};if(Ie)return Ie(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function mn(){}function vn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function gn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=L,this.__views__=[]}function _n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Ln(t,e,r,i,o,a){var s,l=e&c,u=e&f,p=e&h;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!Ps(t))return t;var d=gs(t);if(d){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!l)return ro(t,s)}else{var m=qo(t),v=m==W||m==Z;if(ws(t))return $i(t,l);if(m==J||m==N||v&&!o){if(s=u||v?{}:Go(t),!l)return u?function(t,e){return no(t,zo(t),e)}(t,function(t,e){return t&&no(e,ol(e),t)}(s,t)):function(t,e){return no(t,Uo(t),e)}(t,Mn(s,t))}else{if(!Ce[m])return o?t:{};s=function(t,e,r){var n,i,o,a=t.constructor;switch(e){case at:return Ji(t);case q:case V:return new a(+t);case st:return function(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case lt:case ut:case ct:case ft:case ht:case pt:case dt:case mt:case vt:return Ki(t,r);case X:return new a;case Y:case et:return new a(t);case Q:return(o=new(i=t).constructor(i.source,zt.exec(i))).lastIndex=i.lastIndex,o;case tt:return new a;case rt:return n=t,fn?ee(fn.call(n)):{}}}(t,m,l)}}a||(a=new kn);var g=a.get(t);if(g)return g;if(a.set(t,s),Is(t))return t.forEach(function(n){s.add(Ln(n,e,r,n,t,a))}),s;if(Ss(t))return t.forEach(function(n,i){s.set(i,Ln(n,e,r,i,t,a))}),s;var _=d?n:(p?u?Ao:Mo:u?ol:il)(t);return He(_||t,function(n,i){_&&(n=t[i=n]),jn(s,i,Ln(n,e,r,i,t,a))}),s}function On(t,e,r){var i=r.length;if(null==t)return!i;for(t=ee(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function Fn(t,e,r){if("function"!=typeof t)throw new ie(a);return ia(function(){t.apply(n,r)},e)}function Dn(t,e,r,n){var o=-1,a=Ye,s=!0,l=t.length,u=[],c=e.length;if(!l)return u;r&&(e=Je(e,dr(r))),n?(a=$e,s=!1):e.length>=i&&(a=vr,s=!1,e=new wn(e));t:for(;++o-1},yn.prototype.set=function(t,e){var r=this.__data__,n=Sn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new _n,map:new(Jr||yn),string:new _n}},bn.prototype.delete=function(t){var e=Fo(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Fo(this,t).get(t)},bn.prototype.has=function(t){return Fo(this,t).has(t)},bn.prototype.set=function(t,e){var r=Fo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},wn.prototype.add=wn.prototype.push=function(t){return this.__data__.set(t,s),this},wn.prototype.has=function(t){return this.__data__.has(t)},kn.prototype.clear=function(){this.__data__=new yn,this.size=0},kn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},kn.prototype.get=function(t){return this.__data__.get(t)},kn.prototype.has=function(t){return this.__data__.has(t)},kn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof yn){var n=r.__data__;if(!Jr||n.length0&&r(s)?e>1?Gn(s,e-1,r,n,i):Ke(i,s):n||(i[i.length]=s)}return i}var Hn=so(),Wn=so(!0);function Zn(t,e){return t&&Hn(t,e,il)}function Xn(t,e){return t&&Wn(t,e,il)}function Yn(t,e){return Xe(e,function(e){return Bs(t[e])})}function $n(t,e){for(var r=0,i=(e=Wi(e,t)).length;null!=t&&re}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ri(t,e,r){for(var i=r?$e:Ye,o=t[0].length,a=t.length,s=a,l=$t(a),u=1/0,c=[];s--;){var f=t[s];s&&e&&(f=Je(f,dr(e))),u=Hr(f.length,u),l[s]=!r&&(e||o>=120&&f.length>=120)?new wn(s&&f):n}f=t[0];var h=-1,p=l[0];t:for(;++h=s)return l;var u=r[n];return l*("desc"==u?-1:1)}}return t.index-e.index}(t,e,r)})}function _i(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Oe.call(s,l,1),Oe.call(t,l,1);return t}function bi(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;Wo(i)?Oe.call(t,i,1):Di(t,i)}}return t}function wi(t,e){return t+Dr(Xr()*(e-t+1))}function ki(t,e){var r="";if(!t||e<1||e>A)return r;do{e%2&&(r+=t),(e=Dr(e/2))&&(t+=t)}while(e);return r}function xi(t,e){return oa(ta(t,e,Tl),t+"")}function Bi(t){return Bn(pl(t))}function Ci(t,e){var r=pl(t);return la(r,Rn(e,0,r.length))}function Ei(t,e,r,i){if(!Ps(t))return t;for(var o=-1,a=(e=Wi(e,t)).length,s=a-1,l=t;null!=l&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=$t(i);++n>>1,a=t[o];null!==a&&!Ls(a)&&(r?a<=e:a=i){var c=e?null:xo(t);if(c)return Er(c);s=!1,o=vr,u=new wn}else u=e?[]:l;t:for(;++n=i?t:Ti(t,e,r)}var Yi=Rr||function(t){return Me.clearTimeout(t)};function $i(t,e){if(e)return t.slice();var r=t.length,n=Te?Te(r):new t.constructor(r);return t.copy(n),n}function Ji(t){var e=new t.constructor(t.byteLength);return new Se(e).set(new Se(t)),e}function Ki(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=Ls(t),s=e!==n,l=null===e,u=e==e,c=Ls(e);if(!l&&!c&&!a&&t>e||a&&s&&u&&!l&&!c||i&&s&&u||!r&&u||!o)return 1;if(!i&&!a&&!c&&t1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&Zo(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=ee(e);++i-1?o[a?e[s]:s]:n}}function ho(t){return To(function(e){var r=e.length,i=r,o=vn.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new ie(a);if(o&&!l&&"wrapper"==Ro(s))var l=new vn([],!0)}for(i=l?i:r;++i1&&_.reverse(),f&&ul))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,h=!0,m=r&d?new wn:n;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Lt,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return He(D,function(r){var n="_."+r[0];e&r[1]&&!Ye(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(Ot);return e?e[1].split(Ft):[]}(n),r)))}function sa(t){var e=0,r=0;return function(){var i=Wr(),o=j-(i-r);if(r=i,o>0){if(++e>=P)return arguments[0]}else e=0;return t.apply(n,arguments)}}function la(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r1?t[e-1]:n;return Aa(t,r="function"==typeof r?(t.pop(),r):n)});function Na(t){var e=pn(t);return e.__chain__=!0,e}function Ua(t,e){return e(t)}var za=To(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return In(e,t)};return!(e>1||this.__actions__.length)&&i instanceof gn&&Wo(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:Ua,args:[o],thisArg:n}),new vn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(n),t})):this.thru(o)});var qa=io(function(t,e,r){ce.call(t,r)?++t[r]:An(t,r,1)});var Va=fo(va),Ga=fo(ga);function Ha(t,e){return(gs(t)?He:Nn)(t,Oo(e,3))}function Wa(t,e){return(gs(t)?We:Un)(t,Oo(e,3))}var Za=io(function(t,e,r){ce.call(t,r)?t[r].push(e):An(t,r,[e])});var Xa=xi(function(t,e,r){var n=-1,i="function"==typeof e,o=ys(t)?$t(t.length):[];return Nn(t,function(t){o[++n]=i?Ve(e,t,r):ni(t,e,r)}),o}),Ya=io(function(t,e,r){An(t,r,e)});function $a(t,e){return(gs(t)?Je:hi)(t,Oo(e,3))}var Ja=io(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});var Ka=xi(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Zo(t,e[0],e[1])?e=[]:r>2&&Zo(e[0],e[1],e[2])&&(e=[e[0]]),gi(t,Gn(e,1),[])}),Qa=Lr||function(){return Me.Date.now()};function ts(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Co(t,k,n,n,n,n,e)}function es(t,e){var r;if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var rs=xi(function(t,e,r){var n=m;if(r.length){var i=Cr(r,Lo(rs));n|=b}return Co(t,n,e,r,i)}),ns=xi(function(t,e,r){var n=m|v;if(r.length){var i=Cr(r,Lo(ns));n|=b}return Co(e,n,t,r,i)});function is(t,e,r){var i,o,s,l,u,c,f=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new ie(a);function m(e){var r=i,a=o;return i=o=n,f=e,l=t.apply(a,r)}function v(t){var r=t-c;return c===n||r>=e||r<0||p&&t-f>=s}function g(){var t=Qa();if(v(t))return _(t);u=ia(g,function(t){var r=e-(t-c);return p?Hr(r,s-(t-f)):r}(t))}function _(t){return u=n,d&&i?m(t):(i=o=n,l)}function y(){var t=Qa(),r=v(t);if(i=arguments,o=this,c=t,r){if(u===n)return function(t){return f=t,u=ia(g,e),h?m(t):l}(c);if(p)return u=ia(g,e),m(c)}return u===n&&(u=ia(g,e)),l}return e=Vs(e)||0,Ps(r)&&(h=!!r.leading,s=(p="maxWait"in r)?Gr(Vs(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d),y.cancel=function(){u!==n&&Yi(u),f=0,i=c=o=u=n},y.flush=function(){return u===n?l:_(Qa())},y}var os=xi(function(t,e){return Fn(t,1,e)}),as=xi(function(t,e,r){return Fn(t,Vs(e)||0,r)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ss.Cache||bn),r}function ls(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var us=Zi(function(t,e){var r=(e=1==e.length&&gs(e[0])?Je(e[0],dr(Oo())):Je(Gn(e,1),dr(Oo()))).length;return xi(function(n){for(var i=-1,o=Hr(n.length,r);++i=e}),vs=ii(function(){return arguments}())?ii:function(t){return js(t)&&ce.call(t,"callee")&&!Le.call(t,"callee")},gs=$t.isArray,_s=Fe?dr(Fe):function(t){return js(t)&&Kn(t)==at};function ys(t){return null!=t&&Es(t.length)&&!Bs(t)}function bs(t){return js(t)&&ys(t)}var ws=Ur||Vl,ks=De?dr(De):function(t){return js(t)&&Kn(t)==V};function xs(t){if(!js(t))return!1;var e=Kn(t);return e==H||e==G||"string"==typeof t.message&&"string"==typeof t.name&&!Ms(t)}function Bs(t){if(!Ps(t))return!1;var e=Kn(t);return e==W||e==Z||e==z||e==K}function Cs(t){return"number"==typeof t&&t==zs(t)}function Es(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=A}function Ps(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function js(t){return null!=t&&"object"==typeof t}var Ss=Ne?dr(Ne):function(t){return js(t)&&qo(t)==X};function Ts(t){return"number"==typeof t||js(t)&&Kn(t)==Y}function Ms(t){if(!js(t)||Kn(t)!=J)return!1;var e=Ae(t);if(null===e)return!0;var r=ce.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&ue.call(r)==de}var As=Ue?dr(Ue):function(t){return js(t)&&Kn(t)==Q};var Is=ze?dr(ze):function(t){return js(t)&&qo(t)==tt};function Rs(t){return"string"==typeof t||!gs(t)&&js(t)&&Kn(t)==et}function Ls(t){return"symbol"==typeof t||js(t)&&Kn(t)==rt}var Os=qe?dr(qe):function(t){return js(t)&&Es(t.length)&&!!Be[Kn(t)]};var Fs=bo(fi),Ds=bo(function(t,e){return t<=e});function Ns(t){if(!t)return[];if(ys(t))return Rs(t)?Sr(t):ro(t);if(cr&&t[cr])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[cr]());var e=qo(t);return(e==X?xr:e==tt?Er:pl)(t)}function Us(t){return t?(t=Vs(t))===M||t===-M?(t<0?-1:1)*I:t==t?t:0:0===t?t:0}function zs(t){var e=Us(t),r=e%1;return e==e?r?e-r:e:0}function qs(t){return t?Rn(zs(t),0,L):0}function Vs(t){if("number"==typeof t)return t;if(Ls(t))return R;if(Ps(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ps(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(At,"");var r=Vt.test(t);return r||Ht.test(t)?je(t.slice(2),r?2:8):qt.test(t)?R:+t}function Gs(t){return no(t,ol(t))}function Hs(t){return null==t?"":Oi(t)}var Ws=oo(function(t,e){if(Jo(e)||ys(e))no(e,il(e),t);else for(var r in e)ce.call(e,r)&&jn(t,r,e[r])}),Zs=oo(function(t,e){no(e,ol(e),t)}),Xs=oo(function(t,e,r,n){no(e,ol(e),t,n)}),Ys=oo(function(t,e,r,n){no(e,il(e),t,n)}),$s=To(In);var Js=xi(function(t,e){t=ee(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&Zo(e[0],e[1],o)&&(i=1);++r1),e}),no(t,Ao(t),r),n&&(r=Ln(r,c|f|h,jo));for(var i=e.length;i--;)Di(r,e[i]);return r});var ul=To(function(t,e){return null==t?{}:function(t,e){return _i(t,e,function(e,r){return tl(t,r)})}(t,e)});function cl(t,e){if(null==t)return{};var r=Je(Ao(t),function(t){return[t]});return e=Oo(e),_i(t,r,function(t,r){return e(t,r[0])})}var fl=Bo(il),hl=Bo(ol);function pl(t){return null==t?[]:mr(t,il(t))}var dl=uo(function(t,e,r){return e=e.toLowerCase(),t+(r?ml(e):e)});function ml(t){return xl(Hs(t).toLowerCase())}function vl(t){return(t=Hs(t))&&t.replace(Zt,yr).replace(ge,"")}var gl=uo(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),_l=uo(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),yl=lo("toLowerCase");var bl=uo(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});var wl=uo(function(t,e,r){return t+(r?" ":"")+xl(e)});var kl=uo(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),xl=lo("toUpperCase");function Bl(t,e,r){return t=Hs(t),(e=r?n:e)===n?function(t){return we.test(t)}(t)?function(t){return t.match(ye)||[]}(t):function(t){return t.match(Dt)||[]}(t):t.match(e)||[]}var Cl=xi(function(t,e){try{return Ve(t,n,e)}catch(t){return xs(t)?t:new Kt(t)}}),El=To(function(t,e){return He(e,function(e){e=ca(e),An(t,e,rs(t[e],t))}),t});function Pl(t){return function(){return t}}var jl=ho(),Sl=ho(!0);function Tl(t){return t}function Ml(t){return li("function"==typeof t?t:Ln(t,c))}var Al=xi(function(t,e){return function(r){return ni(r,t,e)}}),Il=xi(function(t,e){return function(r){return ni(t,r,e)}});function Rl(t,e,r){var n=il(e),i=Yn(e,n);null!=r||Ps(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Yn(e,il(e)));var o=!(Ps(r)&&"chain"in r&&!r.chain),a=Bs(t);return He(i,function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=ro(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Ke([this.value()],arguments))})}),t}function Ll(){}var Ol=go(Je),Fl=go(Ze),Dl=go(er);function Nl(t){return Xo(t)?ur(ca(t)):function(t){return function(e){return $n(e,t)}}(t)}var Ul=yo(),zl=yo(!0);function ql(){return[]}function Vl(){return!1}var Gl=vo(function(t,e){return t+e},0),Hl=ko("ceil"),Wl=vo(function(t,e){return t/e},1),Zl=ko("floor");var Xl,Yl=vo(function(t,e){return t*e},1),$l=ko("round"),Jl=vo(function(t,e){return t-e},0);return pn.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){if(--t<1)return e.apply(this,arguments)}},pn.ary=ts,pn.assign=Ws,pn.assignIn=Zs,pn.assignInWith=Xs,pn.assignWith=Ys,pn.at=$s,pn.before=es,pn.bind=rs,pn.bindAll=El,pn.bindKey=ns,pn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return gs(t)?t:[t]},pn.chain=Na,pn.chunk=function(t,e,r){e=(r?Zo(t,e,r):e===n)?1:Gr(zs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=$t(Fr(i/e));oo?0:o+r),(i=i===n||i>o?o:zs(i))<0&&(i+=o),i=r>i?0:qs(i);r>>0)?(t=Hs(t))&&("string"==typeof e||null!=e&&!As(e))&&!(e=Oi(e))&&kr(t)?Xi(Sr(t),0,r):t.split(e,r):[]},pn.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Gr(zs(e),0),xi(function(r){var n=r[e],i=Xi(r,0,e);return n&&Ke(i,n),Ve(t,this,i)})},pn.tail=function(t){var e=null==t?0:t.length;return e?Ti(t,1,e):[]},pn.take=function(t,e,r){return t&&t.length?Ti(t,0,(e=r||e===n?1:zs(e))<0?0:e):[]},pn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?Ti(t,(e=i-(e=r||e===n?1:zs(e)))<0?0:e,i):[]},pn.takeRightWhile=function(t,e){return t&&t.length?Ui(t,Oo(e,3),!1,!0):[]},pn.takeWhile=function(t,e){return t&&t.length?Ui(t,Oo(e,3)):[]},pn.tap=function(t,e){return e(t),t},pn.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new ie(a);return Ps(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),is(t,e,{leading:n,maxWait:e,trailing:i})},pn.thru=Ua,pn.toArray=Ns,pn.toPairs=fl,pn.toPairsIn=hl,pn.toPath=function(t){return gs(t)?Je(t,ca):Ls(t)?[t]:ro(ua(Hs(t)))},pn.toPlainObject=Gs,pn.transform=function(t,e,r){var n=gs(t),i=n||ws(t)||Os(t);if(e=Oo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:Ps(t)&&Bs(o)?dn(Ae(t)):{}}return(i?He:Zn)(t,function(t,n,i){return e(r,t,n,i)}),r},pn.unary=function(t){return ts(t,1)},pn.union=ja,pn.unionBy=Sa,pn.unionWith=Ta,pn.uniq=function(t){return t&&t.length?Fi(t):[]},pn.uniqBy=function(t,e){return t&&t.length?Fi(t,Oo(e,2)):[]},pn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?Fi(t,n,e):[]},pn.unset=function(t,e){return null==t||Di(t,e)},pn.unzip=Ma,pn.unzipWith=Aa,pn.update=function(t,e,r){return null==t?t:Ni(t,e,Hi(r))},pn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:Ni(t,e,Hi(r),i)},pn.values=pl,pn.valuesIn=function(t){return null==t?[]:mr(t,ol(t))},pn.without=Ia,pn.words=Bl,pn.wrap=function(t,e){return cs(Hi(e),t)},pn.xor=Ra,pn.xorBy=La,pn.xorWith=Oa,pn.zip=Fa,pn.zipObject=function(t,e){return Vi(t||[],e||[],jn)},pn.zipObjectDeep=function(t,e){return Vi(t||[],e||[],Ei)},pn.zipWith=Da,pn.entries=fl,pn.entriesIn=hl,pn.extend=Zs,pn.extendWith=Xs,Rl(pn,pn),pn.add=Gl,pn.attempt=Cl,pn.camelCase=dl,pn.capitalize=ml,pn.ceil=Hl,pn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=Vs(r))==r?r:0),e!==n&&(e=(e=Vs(e))==e?e:0),Rn(Vs(t),e,r)},pn.clone=function(t){return Ln(t,h)},pn.cloneDeep=function(t){return Ln(t,c|h)},pn.cloneDeepWith=function(t,e){return Ln(t,c|h,e="function"==typeof e?e:n)},pn.cloneWith=function(t,e){return Ln(t,h,e="function"==typeof e?e:n)},pn.conformsTo=function(t,e){return null==e||On(t,e,il(e))},pn.deburr=vl,pn.defaultTo=function(t,e){return null==t||t!=t?e:t},pn.divide=Wl,pn.endsWith=function(t,e,r){t=Hs(t),e=Oi(e);var i=t.length,o=r=r===n?i:Rn(zs(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},pn.eq=ps,pn.escape=function(t){return(t=Hs(t))&&xt.test(t)?t.replace(wt,br):t},pn.escapeRegExp=function(t){return(t=Hs(t))&&Mt.test(t)?t.replace(Tt,"\\$&"):t},pn.every=function(t,e,r){var i=gs(t)?Ze:zn;return r&&Zo(t,e,r)&&(e=n),i(t,Oo(e,3))},pn.find=Va,pn.findIndex=va,pn.findKey=function(t,e){return nr(t,Oo(e,3),Zn)},pn.findLast=Ga,pn.findLastIndex=ga,pn.findLastKey=function(t,e){return nr(t,Oo(e,3),Xn)},pn.floor=Zl,pn.forEach=Ha,pn.forEachRight=Wa,pn.forIn=function(t,e){return null==t?t:Hn(t,Oo(e,3),ol)},pn.forInRight=function(t,e){return null==t?t:Wn(t,Oo(e,3),ol)},pn.forOwn=function(t,e){return t&&Zn(t,Oo(e,3))},pn.forOwnRight=function(t,e){return t&&Xn(t,Oo(e,3))},pn.get=Qs,pn.gt=ds,pn.gte=ms,pn.has=function(t,e){return null!=t&&Vo(t,e,ti)},pn.hasIn=tl,pn.head=ya,pn.identity=Tl,pn.includes=function(t,e,r,n){t=ys(t)?t:pl(t),r=r&&!n?zs(r):0;var i=t.length;return r<0&&(r=Gr(i+r,0)),Rs(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&or(t,e,r)>-1},pn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:zs(r);return i<0&&(i=Gr(n+i,0)),or(t,e,i)},pn.inRange=function(t,e,r){return e=Us(e),r===n?(r=e,e=0):r=Us(r),function(t,e,r){return t>=Hr(e,r)&&t=-A&&t<=A},pn.isSet=Is,pn.isString=Rs,pn.isSymbol=Ls,pn.isTypedArray=Os,pn.isUndefined=function(t){return t===n},pn.isWeakMap=function(t){return js(t)&&qo(t)==it},pn.isWeakSet=function(t){return js(t)&&Kn(t)==ot},pn.join=function(t,e){return null==t?"":qr.call(t,e)},pn.kebabCase=gl,pn.last=xa,pn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=zs(r))<0?Gr(i+o,0):Hr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ir(t,sr,o,!0)},pn.lowerCase=_l,pn.lowerFirst=yl,pn.lt=Fs,pn.lte=Ds,pn.max=function(t){return t&&t.length?qn(t,Tl,Qn):n},pn.maxBy=function(t,e){return t&&t.length?qn(t,Oo(e,2),Qn):n},pn.mean=function(t){return lr(t,Tl)},pn.meanBy=function(t,e){return lr(t,Oo(e,2))},pn.min=function(t){return t&&t.length?qn(t,Tl,fi):n},pn.minBy=function(t,e){return t&&t.length?qn(t,Oo(e,2),fi):n},pn.stubArray=ql,pn.stubFalse=Vl,pn.stubObject=function(){return{}},pn.stubString=function(){return""},pn.stubTrue=function(){return!0},pn.multiply=Yl,pn.nth=function(t,e){return t&&t.length?vi(t,zs(e)):n},pn.noConflict=function(){return Me._===this&&(Me._=me),this},pn.noop=Ll,pn.now=Qa,pn.pad=function(t,e,r){t=Hs(t);var n=(e=zs(e))?jr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return _o(Dr(i),r)+t+_o(Fr(i),r)},pn.padEnd=function(t,e,r){t=Hs(t);var n=(e=zs(e))?jr(t):0;return e&&ne){var i=t;t=e,e=i}if(r||t%1||e%1){var o=Xr();return Hr(t+o*(e-t+Pe("1e-"+((o+"").length-1))),e)}return wi(t,e)},pn.reduce=function(t,e,r){var n=gs(t)?Qe:fr,i=arguments.length<3;return n(t,Oo(e,4),r,i,Nn)},pn.reduceRight=function(t,e,r){var n=gs(t)?tr:fr,i=arguments.length<3;return n(t,Oo(e,4),r,i,Un)},pn.repeat=function(t,e,r){return e=(r?Zo(t,e,r):e===n)?1:zs(e),ki(Hs(t),e)},pn.replace=function(){var t=arguments,e=Hs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},pn.result=function(t,e,r){var i=-1,o=(e=Wi(e,t)).length;for(o||(o=1,t=n);++iA)return[];var r=L,n=Hr(t,L);e=Oo(e),t-=L;for(var i=pr(n,e);++r=a)return t;var l=r-jr(i);if(l<1)return i;var u=s?Xi(s,0,l).join(""):t.slice(0,l);if(o===n)return u+i;if(s&&(l+=u.length-l),As(o)){if(t.slice(l).search(o)){var c,f=u;for(o.global||(o=re(o.source,Hs(zt.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;u=u.slice(0,h===n?l:h)}}else if(t.indexOf(Oi(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+i},pn.unescape=function(t){return(t=Hs(t))&&kt.test(t)?t.replace(bt,Tr):t},pn.uniqueId=function(t){var e=++fe;return Hs(t)+e},pn.upperCase=kl,pn.upperFirst=xl,pn.each=Ha,pn.eachRight=Wa,pn.first=ya,Rl(pn,(Xl={},Zn(pn,function(t,e){ce.call(pn.prototype,e)||(Xl[e]=t)}),Xl),{chain:!1}),pn.VERSION="4.17.11",He(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pn[t].placeholder=pn}),He(["drop","take"],function(t,e){gn.prototype[t]=function(r){r=r===n?1:Gr(zs(r),0);var i=this.__filtered__&&!e?new gn(this):this.clone();return i.__filtered__?i.__takeCount__=Hr(r,i.__takeCount__):i.__views__.push({size:Hr(r,L),type:t+(i.__dir__<0?"Right":"")}),i},gn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),He(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==S||3==r;gn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Oo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),He(["head","last"],function(t,e){var r="take"+(e?"Right":"");gn.prototype[t]=function(){return this[r](1).value()[0]}}),He(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");gn.prototype[t]=function(){return this.__filtered__?new gn(this):this[r](1)}}),gn.prototype.compact=function(){return this.filter(Tl)},gn.prototype.find=function(t){return this.filter(t).head()},gn.prototype.findLast=function(t){return this.reverse().find(t)},gn.prototype.invokeMap=xi(function(t,e){return"function"==typeof t?new gn(this):this.map(function(r){return ni(r,t,e)})}),gn.prototype.reject=function(t){return this.filter(ls(Oo(t)))},gn.prototype.slice=function(t,e){t=zs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new gn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=zs(e))<0?r.dropRight(-e):r.take(e-t)),r)},gn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},gn.prototype.toArray=function(){return this.take(L)},Zn(gn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=pn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(pn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,l=e instanceof gn,u=s[0],c=l||gs(e),f=function(t){var e=o.apply(pn,Ke([t],s));return i&&h?e[0]:e};c&&r&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=a&&!h,m=l&&!p;if(!a&&c){e=m?e:new gn(this);var v=t.apply(e,s);return v.__actions__.push({func:Ua,args:[f],thisArg:n}),new vn(v,h)}return d&&m?t.apply(this,s):(v=this.thru(f),d?i?v.value()[0]:v.value():v)})}),He(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);pn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(gs(i)?i:[],t)}return this[r](function(r){return e.apply(gs(r)?r:[],t)})}}),Zn(gn.prototype,function(t,e){var r=pn[e];if(r){var n=r.name+"";(nn[n]||(nn[n]=[])).push({name:e,func:r})}}),nn[po(n,v).name]=[{name:"wrapper",func:n}],gn.prototype.clone=function(){var t=new gn(this.__wrapped__);return t.__actions__=ro(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ro(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ro(this.__views__),t},gn.prototype.reverse=function(){if(this.__filtered__){var t=new gn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},gn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=gs(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},pn.prototype.plant=function(t){for(var e,r=this;r instanceof mn;){var i=ha(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},pn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof gn){var e=t;return this.__actions__.length&&(e=new gn(this)),(e=e.reverse()).__actions__.push({func:Ua,args:[Pa],thisArg:n}),new vn(e,this.__chain__)}return this.thru(Pa)},pn.prototype.toJSON=pn.prototype.valueOf=pn.prototype.value=function(){return zi(this.__wrapped__,this.__actions__)},pn.prototype.first=pn.prototype.head,cr&&(pn.prototype[cr]=function(){return this}),pn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Me._=Mr,define(function(){return Mr})):Ie?((Ie.exports=Mr)._=Mr,Ae._=Mr):Me._=Mr}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],76:[function(t,e,r){(function(r){t("path");var n=t("fs");function i(){this.types=Object.create(null),this.extensions=Object.create(null)}i.prototype.define=function(t){for(var e in t){for(var n=t[e],i=0;i=0;--s)if(h[s]=f,f*=u[s],p=Math.max(p,a.scratchMemory(u[s])),e.shape[s]!==r.shape[s])throw new Error("Shape mismatch, real and imaginary arrays must have same size");var d,m=4*f+p;d="array"===e.dtype||"float64"===e.dtype||"custom"===e.dtype?o.mallocDouble(m):o.mallocFloat(m);var v,g,_,y,b=i(d,u.slice(0),h,0),w=i(d,u.slice(0),h.slice(0),f),k=i(d,u.slice(0),h.slice(0),2*f),x=i(d,u.slice(0),h.slice(0),3*f),B=4*f;for(n.assign(b,e),n.assign(w,r),s=c-1;s>=0&&(a(t,f/u[s],u[s],d,b.offset,w.offset,B),0!==s);--s){for(g=1,_=k.stride,y=x.stride,l=s-1;l=0;--l)y[l]=_[l]=g,g*=u[l];n.assign(k,b),n.assign(x,w),v=b,b=k,k=v,v=w,w=x,x=v}n.assign(e,b),n.assign(r,w),o.free(d)}},{"./lib/fft-matrix.js":79,ndarray:84,"ndarray-ops":81,"typedarray-pool":144}],79:[function(t,e,r){var n=t("bit-twiddle");function i(t,e,r,i,o,a){var s,l,u,c,f,h,p,d,m,v,g,_,y,b,w,k,x,B,C,E,P,j,S,T;for(t|=0,e|=0,o|=0,a|=0,s=r|=0,l=n.log2(s),B=0;B>1,f=0,u=0;u>=1;f+=h}for(g=-1,_=0,v=1,d=0;d>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":15}],82:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],o=t,a=1;Array.isArray(o);)r.push(o.length),a*=o.length,o=o[0];return 0===r.length?n():(e||(e=n(new Float64Array(a),r)),i(e,t),e)}},{"./doConvert.js":83,ndarray:84}],83:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":15}],84:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),o="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+l.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",l.join(),"){return "+c+"}"),o.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+a.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+a.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=a.map(function(t){return"a"+t+"=this.shape["+t+"]"}),d=a.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");o.push("return new "+r+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"c"+t}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+a.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+a.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+a.map(function(t){return"shape["+t+"]"}).join(",")+","+a.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(u[t],s)}var u={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,u.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var a=e.length;if(void 0===r){r=new Array(a);for(var s=a-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}},{}],86:[function(t,e,r){(function(r,n){"use strict";var i=t("util"),o=t("stream"),a=e.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};i.inherits(a,o),a.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),r.nextTick(function(){this._process(),this._paused&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(n.isBuffer(t)||(t=new n(t,e||this._encoding)),this._buffers.push(t),this._buffered+=t.length,this._process(),this._reads&&0==this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1)},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0==this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._process=function(){for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess){this._reads.shift(),(o=this._buffers[0]).length>t.length?(this._buffered-=t.length,this._buffers[0]=o.slice(t.length),t.func.call(this,o.slice(0,t.length))):(this._buffered-=o.length,this._buffers.shift(),t.func.call(this,o))}else{if(!(this._buffered>=t.length))break;this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)}}this._buffers&&this._buffers.length>0&&null==this._buffers[0]&&this._end()}}).call(this,t("_process"),t("buffer").Buffer)},{_process:117,buffer:47,stream:139,util:150}],87:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLOR_PALETTE:1,COLOR_COLOR:2,COLOR_ALPHA:4}},{}],88:[function(t,e,r){"use strict";var n=t("util"),i=t("stream"),o=e.exports=function(){i.call(this),this._crc=-1,this.writable=!0};n.inherits(o,i),o.prototype.write=function(t){for(var e=0;e>>8;return!0},o.prototype.end=function(t){t&&this.write(t),this.emit("crc",this.crc32())},o.prototype.crc32=function(){return-1^this._crc},o.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e};for(var a=[],s=0;s<256;s++){for(var l=s,u=0;u<8;u++)1&l?l=3988292384^l>>>1:l>>>=1;a[s]=l}},{stream:139,util:150}],89:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=(t("zlib"),t("./chunkstream")),o=e.exports=function(t,e,r,n,o){i.call(this),this._width=t,this._height=e,this._Bpp=r,this._data=n,this._options=o,this._line=0,"filterType"in o&&-1!=o.filterType?"number"==typeof o.filterType&&(o.filterType=[o.filterType]):o.filterType=[0,1,2,3,4],this._filters={0:this._filterNone.bind(this),1:this._filterSub.bind(this),2:this._filterUp.bind(this),3:this._filterAvg.bind(this),4:this._filterPaeth.bind(this)},this.read(this._width*r+1,this._reverseFilterLine.bind(this))};n.inherits(o,i);var a={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};o.prototype._reverseFilterLine=function(t){var e=this._data,r=this._width<<2,n=this._line*r,i=t[0];if(0==i)for(var o=0;o0?e[l+c-4]:0;e[l+c]=255!=f?t[u+f]+h:255}else if(2==i)for(o=0;o0?e[l-r+c]:0;e[l+c]=255!=f?t[u+f]+p:255}else if(3==i)for(o=0;o0?e[l+c-4]:0,p=this._line>0?e[l-r+c]:0;var d=Math.floor((h+p)/2);e[l+c]=255!=f?t[u+f]+d:255}else if(4==i)for(o=0;o0?e[l+c-4]:0,p=this._line>0?e[l-r+c]:0;var m=o>0&&this._line>0?e[l-r+c-4]:0;d=s(h,p,m);e[l+c]=255!=f?t[u+f]+d:255}this._line++,this._line=4?t[e*n+a-4]:0,l=t[e*n+a]-s;r?r[e*i+1+a]=l:o+=Math.abs(l)}return o},o.prototype._filterUp=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=2);for(var a=0;a0?t[(e-1)*n+a]:0,l=t[e*n+a]-s;r?r[e*i+1+a]=l:o+=Math.abs(l)}return o},o.prototype._filterAvg=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=3);for(var a=0;a=4?t[e*n+a-4]:0,l=e>0?t[(e-1)*n+a]:0,u=t[e*n+a]-(s+l>>1);r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterPaeth=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=4);for(var a=0;a=4?t[e*n+a-4]:0,u=e>0?t[(e-1)*n+a]:0,c=a>=4&&e>0?t[(e-1)*n+a-4]:0,f=t[e*n+a]-s(l,u,c);r?r[e*i+1+a]=f:o+=Math.abs(f)}return o};var s=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}}).call(this,t("buffer").Buffer)},{"./chunkstream":86,buffer:47,util:150,zlib:45}],90:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("zlib"),a=t("./filter"),s=t("./crc"),l=t("./constants"),u=e.exports=function(t){i.call(this),this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=t.deflateLevel||9,t.deflateStrategy=t.deflateStrategy||3,this.readable=!0};n.inherits(u,i),u.prototype.pack=function(t,e,n){this.emit("data",new r(l.PNG_SIGNATURE)),this.emit("data",this._packIHDR(e,n));t=new a(e,n,4,t,this._options).filter();var i=o.createDeflate({chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy});i.on("error",this.emit.bind(this,"error")),i.on("data",function(t){this.emit("data",this._packIDAT(t))}.bind(this)),i.on("end",function(){this.emit("data",this._packIEND()),this.emit("end")}.bind(this)),i.end(t)},u.prototype._packChunk=function(t,e){var n=e?e.length:0,i=new r(n+12);return i.writeUInt32BE(n,0),i.writeUInt32BE(t,4),e&&e.copy(i,8),i.writeInt32BE(s.crc32(i.slice(4,i.length-4)),i.length-4),i},u.prototype._packIHDR=function(t,e){var n=new r(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=8,n[9]=6,n[10]=0,n[11]=0,n[12]=0,this._packChunk(l.TYPE_IHDR,n)},u.prototype._packIDAT=function(t){return this._packChunk(l.TYPE_IDAT,t)},u.prototype._packIEND=function(){return this._packChunk(l.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./constants":87,"./crc":88,"./filter":89,buffer:47,stream:139,util:150,zlib:45}],91:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("zlib"),o=t("./crc"),a=t("./chunkstream"),s=t("./constants"),l=t("./filter"),u=e.exports=function(t){a.call(this),this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._inflate=null,this._filter=null,this._crc=null,this._palette=[],this._colorType=0,this._chunks={},this._chunks[s.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[s.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[s.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[s.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[s.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[s.TYPE_gAMA]=this._handleGAMA.bind(this),this.writable=!0,this.on("error",this._handleError.bind(this)),this._handleSignature()};n.inherits(u,a),u.prototype._handleError=function(){this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy()},u.prototype._handleSignature=function(){this.read(s.PNG_SIGNATURE.length,this._parseSignature.bind(this))},u.prototype._parseSignature=function(t){for(var e=s.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.emit("error",new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(t):this._handleChunkEnd()},u.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},u.prototype._parseIEND=function(t){this._crc.write(t),this._inflate.end(),this._hasIEND=!0,this._handleChunkEnd()};var c={0:1,2:3,3:1,4:2,6:4};u.prototype._reverseFiltered=function(t,e,r){if(3==this._colorType)for(var n=e<<2,i=0;i0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t||{}),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(l,o),l.prototype.pack=function(){return e.nextTick(function(){this._packer.pack(this.data,this.width,this.height)}.bind(this)),this},l.prototype.parse=function(t,e){if(e){var r,n=null;this.once("parsed",r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this)),this.once("error",n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this))}return this.end(t),this},l.prototype.write=function(t){return this._parser.write(t),!0},l.prototype.end=function(t){this._parser.end(t)},l.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.data=t.data,delete t.data,this.emit("metadata",t)},l.prototype._gamma=function(t){this.gamma=t},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.prototype.bitblt=function(t,e,r,n,i,o,a){if(e>this.width||r>this.height||e+n>this.width||r+i>this.height)throw new Error("bitblt reading outside image");if(o>t.width||a>t.height||o+n>t.width||a+i>t.height)throw new Error("bitblt writing outside image");for(var s=0;s>=l,c-=l,v!==o){if(v===a)break;for(var g=vo;)y=d[y]>>8,++_;var b=y;if(h+_+(g!==v?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[h++]=b;var w=h+=_;for(g!==v&&(r[h++]=b),y=g;_--;)y=d[y],r[--w]=255&y,y>>=8;null!==m&&s<4096&&(d[s++]=m<<8|b,s>=u+1&&l<12&&(++l,u=u<<1|1)),m=v}else s=a+1,u=(1<<(l=i+1))-1,m=null}return h!==n&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(t,e,r,n){var i=0,o=void 0===(n=void 0===n?{}:n).loop?null:n.loop,a=void 0===n.palette?null:n.palette;if(e<=0||r<=0||e>65535||r>65535)throw new Error("Width/Height invalid.");function s(t){var e=t.length;if(e<2||e>256||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;var l=0,u=0;if(null!==a){for(var c=s(a);c>>=1;)++l;if(c=1<=c)throw new Error("Background index out of range.");if(0===u)throw new Error("Background index explicitly passed as 0.")}}if(t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=(null!==a?128:0)|l,t[i++]=u,t[i++]=0,null!==a)for(var f=0,h=a.length;f>16&255,t[i++]=p>>8&255,t[i++]=255&p}if(null!==o){if(o<0||o>65535)throw new Error("Loop count invalid.");t[i++]=33,t[i++]=255,t[i++]=11,t[i++]=78,t[i++]=69,t[i++]=84,t[i++]=83,t[i++]=67,t[i++]=65,t[i++]=80,t[i++]=69,t[i++]=50,t[i++]=46,t[i++]=48,t[i++]=3,t[i++]=1,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=0}var d=!1;this.addFrame=function(e,r,n,o,l,u){if(!0===d&&(--i,d=!1),u=void 0===u?{}:u,e<0||r<0||e>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||o<=0||n>65535||o>65535)throw new Error("Width/Height invalid.");if(l.length>=1;)++p;h=1<3)throw new Error("Disposal out of range.");var g=!1,_=0;if(void 0!==u.transparent&&null!==u.transparent&&(g=!0,(_=u.transparent)<0||_>=h))throw new Error("Transparent color index.");if((0!==v||g||0!==m)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=v<<2|(!0===g?1:0),t[i++]=255&m,t[i++]=m>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=255&n,t[i++]=n>>8&255,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=!0===c?128|p-1:0,!0===c)for(var y=0,b=f.length;y>16&255,t[i++]=w>>8&255,t[i++]=255&w}return i=function(t,e,r,n){t[e++]=r;var i=e++,o=1<=r;)t[e++]=255&f,f>>=8,c-=8,e===i+256&&(t[i]=255,i=e++)}function p(t){f|=t<=8;)t[e++]=255&f,f>>=8,c-=8,e===i+256&&(t[i]=255,i=e++);4096===l?(p(o),l=s+1,u=r+1,m={}):(l>=1<>7,s=1<<1+(7&o);t[e++],t[e++];var l=null,u=null;a&&(l=e,u=s,e+=3*s);var c=!0,f=[],h=0,p=null,d=0,m=null;for(this.width=r,this.height=i;c&&e=0))throw Error("Invalid block size");if(0===j)break;e+=j}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var v=t[e++];h=t[e++]|t[e++]<<8,p=t[e++],0==(1&v)&&(p=null),d=v>>2&7,e++;break;case 254:for(;;){if(!((j=t[e++])>=0))throw Error("Invalid block size");if(0===j)break;e+=j}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var g=t[e++]|t[e++]<<8,_=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,w=t[e++],k=w>>6&1,x=1<<1+(7&w),B=l,C=u,E=!1;w>>7&&(E=!0,B=e,C=x,e+=3*x);var P=e;for(e++;;){var j;if(!((j=t[e++])>=0))throw Error("Invalid block size");if(0===j)break;e+=j}f.push({x:g,y:_,width:y,height:b,has_local_palette:E,palette_offset:B,palette_size:C,data_offset:P,data_length:e-P,transparent_index:p,interlaced:!!k,delay:h,disposal:d});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return m},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameBGRA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var l=o.palette_offset,u=o.transparent_index;null===u&&(u=256);var c=o.width,f=r-c,h=c,p=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),m=p,v=4*f;!0===o.interlaced&&(v+=4*r*7);for(var g=8,_=0,y=s.length;_=d&&(v=4*f+4*r*(g-1),m=p+(c+f)*(g<<1),g>>=1)),b===u)m+=4;else{var w=t[l+3*b],k=t[l+3*b+1],x=t[l+3*b+2];i[m++]=x,i[m++]=k,i[m++]=w,i[m++]=255}--h}},this.decodeAndBlitFrameRGBA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var l=o.palette_offset,u=o.transparent_index;null===u&&(u=256);var c=o.width,f=r-c,h=c,p=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),m=p,v=4*f;!0===o.interlaced&&(v+=4*r*7);for(var g=8,_=0,y=s.length;_=d&&(v=4*f+4*r*(g-1),m=p+(c+f)*(g<<1),g>>=1)),b===u)m+=4;else{var w=t[l+3*b],k=t[l+3*b+1],x=t[l+3*b+2];i[m++]=w,i[m++]=k,i[m++]=x,i[m++]=255}--h}}}}catch(t){}},{}],94:[function(t,e,r){(function(r){var n=t("charm");function i(t){if(!(t=t||{}).total)throw new Error("You MUST specify the total number of operations that will be processed.");this.total=t.total,this.current=0,this.max_burden=t.maxBurden||.5,this.show_burden=t.showBurden||!1,this.started=!1,this.size=50,this.inner_time=0,this.outer_time=0,this.elapsed=0,this.time_start=0,this.time_end=0,this.time_left=0,this.time_burden=0,this.skip_steps=0,this.skipped=0,this.aborted=!1,this.charm=n(),this.charm.pipe(r.stdout),this.charm.write("\n\n\n")}function o(t,e,r){for(r=r||" ";t.length3&&(l[0]=l[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(l[1]||"").length=this.total&&this.finished(),this.time_end=(new Date).getTime(),this.inner_time=this.time_end-this.time_start)},i.prototype.updateTimes=function(){this.elapsed=this.time_start-this.started,this.time_end>0&&(this.outer_time=this.time_start-this.time_end),this.inner_time>0&&this.outer_time>0&&(this.time_burden=this.inner_time/(this.inner_time+this.outer_time)*100,this.time_left=this.elapsed/this.current*(this.total-this.current),this.time_left<0&&(this.time_left=0)),this.time_burden>this.max_burden&&this.skip_steps0&&this.current=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-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&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var o=r.isAbsolute(t),a="/"===i(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!o).join("/"))||o||(t="."),t&&a&&(t+="/"),(o?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,l=0;l=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},r.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,n=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){r=e+1;break}}else-1===n&&(i=!1,n=e+1);return-1===n?"":t.slice(r,n)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)};var i="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:117}],96:[function(t,e,r){(function(e){"use strict";var n=t("./interlace"),i={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};function o(t,e,r,n,o,a){for(var s=t.width,l=t.height,u=t.index,c=0;c>4,r.push(f,c);break;case 2:l=3&h,u=h>>2&3,c=h>>4&3,f=h>>6&3,r.push(f,c,u,l);break;case 1:i=1&h,o=h>>1&1,a=h>>2&1,s=h>>3&1,l=h>>4&1,u=h>>5&1,c=h>>6&1,f=h>>7&1,r.push(f,c,u,l,s,a,o,i)}}return{get:function(t){for(;r.length0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(r=n.isBuffer(t)?t:new n(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var r},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},a.prototype._processRead=function(t){this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)},a.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&this._buffers.length>0&&null===this._buffers[0]&&this._end()}catch(t){this.emit("error",t)}}}).call(this,t("_process"),t("buffer").Buffer)},{_process:117,buffer:47,stream:139,util:150}],99:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],100:[function(t,e,r){"use strict";var n=[];!function(){for(var t=0;t<256;t++){for(var e=t,r=0;r<8;r++)1&e?e=3988292384^e>>>1:e>>>=1;n[t]=e}}();var i=e.exports=function(){this._crc=-1};i.prototype.write=function(t){for(var e=0;e>>8;return!0},i.prototype.crc32=function(){return-1^this._crc},i.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e}},{}],101:[function(t,e,r){(function(r){"use strict";var n=t("./paeth-predictor");var i={0:function(t,e,r,n,i){t.copy(n,i,e,e+r)},1:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,l=t[e+a]-s;n[i+a]=l}},2:function(t,e,r,n,i){for(var o=0;o0?t[e+o-r]:0,s=t[e+o]-a;n[i+o]=s}},3:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,l=e>0?t[e+a-r]:0,u=t[e+a]-(s+l>>1);n[i+a]=u}},4:function(t,e,r,i,o,a){for(var s=0;s=a?t[e+s-a]:0,u=e>0?t[e+s-r]:0,c=e>0&&s>=a?t[e+s-(r+a)]:0,f=t[e+s]-n(l,u,c);i[o+s]=f}}},o={0:function(t,e,r){for(var n=0,i=e+r,o=e;o=n?t[e+o-n]:0,s=t[e+o]-a;i+=Math.abs(s)}return i},2:function(t,e,r){for(var n=0,i=e+r,o=e;o0?t[o-r]:0,s=t[o]-a;n+=Math.abs(s)}return n},3:function(t,e,r,n){for(var i=0,o=0;o=n?t[e+o-n]:0,s=e>0?t[e+o-r]:0,l=t[e+o]-(a+s>>1);i+=Math.abs(l)}return i},4:function(t,e,r,i){for(var o=0,a=0;a=i?t[e+a-i]:0,l=e>0?t[e+a-r]:0,u=e>0&&a>=i?t[e+a-(r+i)]:0,c=t[e+a]-n(s,l,u);o+=Math.abs(c)}return o}};e.exports=function(t,e,n,a,s){var l;if("filterType"in a&&-1!==a.filterType){if("number"!=typeof a.filterType)throw new Error("unrecognised filter types");l=[a.filterType]}else l=[0,1,2,3,4];for(var u=e*s,c=0,f=0,h=new r((u+1)*n),p=l[0],d=0;d1)for(var m=1/0,v=0;vi?e[o-n]:0;e[o]=a+s}},a.prototype._unFilterType2=function(t,e,r){for(var n=this._lastLine,i=0;ii?e[a-n]:0,c=Math.floor((u+l)/2);e[a]=s+c}},a.prototype._unFilterType4=function(t,e,r){for(var n=this._xComparison,o=n-1,a=this._lastLine,s=0;so?e[s-n]:0,f=s>o&&a?a[s-n]:0,h=i(c,u,f);e[s]=l+h}},a.prototype._reverseFilterLine=function(t){var e,n=t[0],i=this._images[this._imageIndex],o=i.byteWidth;if(0===n)e=t.slice(1,o+1);else switch(e=new r(o),n){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=e,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,t("buffer").Buffer)},{"./interlace":106,"./paeth-predictor":110,buffer:47}],105:[function(t,e,r){(function(t){"use strict";e.exports=function(e,r){var n=r.depth,i=r.width,o=r.height,a=r.colorType,s=r.transColor,l=r.palette,u=e;return 3===a?function(t,e,r,n,i){for(var o=0,a=0;a0&&f>0&&r.push({width:c,height:f,index:l})}return r},r.getInterlaceIterator=function(t){return function(e,r,i){var o=e%n[i].x.length,a=(e-o)/n[i].x.length*8+n[i].x[o],s=r%n[i].y.length;return 4*a+((r-s)/n[i].y.length*8+n[i].y[s])*t*4}}},{}],107:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("./constants"),a=t("./packer"),s=e.exports=function(t){i.call(this);var e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,i),s.prototype.pack=function(t,e,n,i){this.emit("data",new r(o.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),i&&this.emit("data",this._packer.packGAMA(i));var a=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(a)}}).call(this,t("buffer").Buffer)},{"./constants":99,"./packer":109,buffer:47,stream:139,util:150}],108:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./constants"),a=t("./packer");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var s=new a(e||{}),l=[];l.push(new r(o.PNG_SIGNATURE)),l.push(s.packIHDR(t.width,t.height)),t.gamma&&l.push(s.packGAMA(t.gamma));var u=s.filterData(t.data,t.width,t.height),c=i.deflateSync(u,s.getDeflateOptions());if(u=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return l.push(s.packIDAT(c)),l.push(s.packIEND()),r.concat(l)}}).call(this,t("buffer").Buffer)},{"./constants":99,"./packer":109,buffer:47,zlib:45}],109:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=t("./bitpacker"),a=t("./filter-pack"),s=t("zlib"),l=e.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.colorType!==n.COLORTYPE_COLOR&&t.colorType!==n.COLORTYPE_COLOR_ALPHA)throw new Error("option color type:"+t.colorType+" is not supported at present");if(8!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};l.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},l.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},l.prototype.filterData=function(t,e,r){var i=o(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(i,e,r,this._options,s)},l.prototype._packChunk=function(t,e){var n=e?e.length:0,o=new r(n+12);return o.writeUInt32BE(n,0),o.writeUInt32BE(t,4),e&&e.copy(o,8),o.writeInt32BE(i.crc32(o.slice(4,o.length-4)),o.length-4),o},l.prototype.packGAMA=function(t){var e=new r(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},l.prototype.packIHDR=function(t,e){var i=new r(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(n.TYPE_IHDR,i)},l.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},l.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./bitpacker":97,"./constants":99,"./crc":100,"./filter-pack":101,buffer:47,zlib:45}],110:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}},{}],111:[function(t,e,r){"use strict";var n=t("util"),i=t("zlib"),o=t("./chunkstream"),a=t("./filter-parse-async"),s=t("./parser"),l=t("./bitmapper"),u=t("./format-normaliser"),c=e.exports=function(t){o.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(c,o),c.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this.errord=!0},c.prototype._inflateData=function(t){this._inflate||(this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter)),this._inflate.write(t)},c.prototype._handleMetaData=function(t){this.emit("metadata",t),this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},c.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},c.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},c.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},c.prototype._complete=function(t){if(!this.errord){try{var e=l.dataToBitMap(t,this._bitmapInfo),r=u(e,this._bitmapInfo);e=null}catch(t){return void this._handleError(t)}this.emit("parsed",r)}}},{"./bitmapper":96,"./chunkstream":98,"./filter-parse-async":102,"./format-normaliser":105,"./parser":113,util:150,zlib:45}],112:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./sync-reader"),a=t("./filter-parse-sync"),s=t("./parser"),l=t("./bitmapper"),u=t("./format-normaliser");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var c,f,h;var p=[];var d=new o(t);if(new s(e,{read:d.read.bind(d),error:function(t){c=t},metadata:function(t){f=t},gamma:function(t){h=t},palette:function(t){f.palette=t},transColor:function(t){f.transColor=t},inflateData:function(t){p.push(t)}}).start(),d.process(),c)throw c;var m=r.concat(p);p.length=0;var v=i.inflateSync(m);if(m=null,!v||!v.length)throw new Error("bad png - invalid inflate data response");var g=a.process(v,f);m=null;var _=l.dataToBitMap(g,f);g=null;var y=u(_,f);return f.data=y,f.gamma=h||0,f}}).call(this,t("buffer").Buffer)},{"./bitmapper":96,"./filter-parse-sync":103,"./format-normaliser":105,"./parser":113,"./sync-reader":116,buffer:47,zlib:45}],113:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=e.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.inflateData=e.inflateData,this.finished=e.finished};o.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},o.prototype._parseSignature=function(t){for(var e=n.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(r):this._handleChunkEnd()},o.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},o.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,t("buffer").Buffer)},{"./constants":99,"./crc":100,buffer:47}],114:[function(t,e,r){"use strict";var n=t("./parser-sync"),i=t("./packer-sync");r.read=function(t,e){return n(t,e||{})},r.write=function(t){return i(t)}},{"./packer-sync":108,"./parser-sync":112}],115:[function(t,e,r){(function(e,n){"use strict";var i=t("util"),o=t("stream"),a=t("./parser-async"),s=t("./packer-async"),l=t("./png-sync"),u=r.PNG=function(t){o.call(this),t=t||{},this.width=t.width||0,this.height=t.height||0,this.data=this.width>0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(u,o),u.sync=l,u.prototype.pack=function(){return this.data&&this.data.length?(e.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},u.prototype.parse=function(t,e){var r,n;e&&(r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this),this.once("parsed",r),this.once("error",n));return this.end(t),this},u.prototype.write=function(t){return this._parser.write(t),!0},u.prototype.end=function(t){this._parser.end(t)},u.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},u.prototype._gamma=function(t){this.gamma=t},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.bitblt=function(t,e,r,n,i,o,a,s){if(r>t.width||n>t.height||r+i>t.width||n+o>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+i>e.width||s+o>e.height)throw new Error("bitblt writing outside image");for(var l=0;l0&&this._buffer.length;){var t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},{}],117:[function(t,e,r){var n,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,c=[],f=!1,h=-1;function p(){f&&u&&(f=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!f){var t=l(p);f=!0;for(var e=c.length;e;){for(u=c,c=[];++h1)for(var r=1;r0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):E(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function B(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(C,t):C(t))}function C(t){p("emit readable"),t.emit("readable"),T(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(P,t,e))}function P(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=u.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function A(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(I,e,t))}function I(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?A(this):B(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&A(this),null;var n,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&A(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var l=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:y;function u(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",g),t.removeListener("finish",_),t.removeListener("drain",f),t.removeListener("error",v),t.removeListener("unpipe",u),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",m),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function c(){p("onend"),t.end()}o.endEmitted?i.nextTick(l):n.once("end",l),t.on("unpipe",u);var f=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,T(t))}}(n);t.on("drain",f);var h=!1;var d=!1;function m(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!h&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function v(e){p("onerror",e),y(),t.removeListener("error",v),0===s(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",_),y()}function _(){p("onfinish"),t.removeListener("close",g),y()}function y(){p("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",v),t.once("close",g),t.once("finish",_),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?i:o.nextTick;_.WritableState=g;var u=t("core-util-is");u.inherits=t("inherits");var c={deprecate:t("util-deprecate")},f=t("./internal/streams/stream"),h=t("safe-buffer").Buffer,p=n.Uint8Array||function(){};var d,m=t("./internal/streams/destroy");function v(){}function g(e,r){s=s||t("./_stream_duplex"),e=e||{};var n=r instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,u=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(u||0===u)?u:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(B,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),B(t,e))}(t,r,n,e,i);else{var a=k(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?l(b,t,r,a,i):b(t,r,a,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function _(e){if(s=s||t("./_stream_duplex"),!(d.call(_,this)||this instanceof s))return new _(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function y(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function b(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),B(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)i[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;i.allBuffers=l,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,f=r.callback;if(y(t,e,!1,e.objectMode?1:u.length,u,c,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),B(t,e)})}function B(t,e){var r=k(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(x,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}u.inherits(_,f),g.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(g.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===_&&(t&&t._writableState instanceof g)}})):d=function(t){return t instanceof this},_.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},_.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof p);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=v),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var l=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,B(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=m.destroy,_.prototype._undestroy=m.undestroy,_.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":119,"./internal/streams/destroy":125,"./internal/streams/stream":126,_process:117,"core-util-is":14,inherits:70,"process-nextick-args":128,"safe-buffer":134,timers:142,"util-deprecate":148}],124:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":134,util:4}],125:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":128}],126:[function(t,e,r){e.exports=t("events").EventEmitter},{events:48}],127:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],128:[function(t,e,r){(function(t){"use strict";!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function l(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function u(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":134}],130:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":131}],131:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123}],132:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":131}],133:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":123}],134:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:47}],135:[function(t,e,r){arguments[4][67][0].apply(r,arguments)},{"./lib/decoder":136,"./lib/encoder":137,dup:67}],136:[function(t,e,r){(function(t){var r=function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),e=4017,r=799,n=3406,i=2276,o=1567,a=3784,s=5793,l=2896;function u(){}function c(t,e){for(var r,n,i=0,o=[],a=16;a>0&&!t[a-1];)a--;o.push({children:[],index:0});var s,l=o[0];for(r=0;r0;)l=o.pop();for(l.index++,o.push(l);o.length<=r;)o.push(s={children:[],index:0}),l.children[l.index]=s.children,l=s;i++}r+10)return p>>--d&1;if(255==(p=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(p<<8|t).toString(16)}return d=7,p>>>7}function v(t){for(var e,r=t;null!==(e=m());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function g(t){for(var e=0;t>0;){var r=m();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=g(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=v(e.huffmanTableAC),l=15&o,c=o>>4;if(0!==l)r[t[n+=c]]=_(l)*(1<>4,0===f)o<15?(y=g(o)+(1<>4;if(0!==s)r[t[o+=l]]=_(s),o++;else{if(l<15)break;o+=16}}};var M,A,I,R,L=0;for(A=1==T?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=A);L=65488&&M<=65495))break;r+=2}return r-h}function h(t,u){var c,f,h=[],p=u.blocksPerLine,d=u.blocksPerColumn,m=p<<3,v=new Int32Array(64),g=new Uint8Array(64);function _(t,c,f){var h,p,d,m,v,g,_,y,b,w,k=u.quantizationTable,x=f;for(w=0;w<64;w++)x[w]=t[w]*k[w];for(w=0;w<8;++w){var B=8*w;0!=x[1+B]||0!=x[2+B]||0!=x[3+B]||0!=x[4+B]||0!=x[5+B]||0!=x[6+B]||0!=x[7+B]?(h=s*x[0+B]+128>>8,p=s*x[4+B]+128>>8,d=x[2+B],m=x[6+B],v=l*(x[1+B]-x[7+B])+128>>8,y=l*(x[1+B]+x[7+B])+128>>8,g=x[3+B]<<4,_=x[5+B]<<4,b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+m*o+128>>8,d=d*o-m*a+128>>8,m=b,b=v-_+1>>1,v=v+_+1>>1,_=b,b=y+g+1>>1,g=y-g+1>>1,y=b,b=h-m+1>>1,h=h+m+1>>1,m=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=v*i+y*n+2048>>12,v=v*n-y*i+2048>>12,y=b,b=g*r+_*e+2048>>12,g=g*e-_*r+2048>>12,_=b,x[0+B]=h+y,x[7+B]=h-y,x[1+B]=p+_,x[6+B]=p-_,x[2+B]=d+g,x[5+B]=d-g,x[3+B]=m+v,x[4+B]=m-v):(b=s*x[0+B]+512>>10,x[0+B]=b,x[1+B]=b,x[2+B]=b,x[3+B]=b,x[4+B]=b,x[5+B]=b,x[6+B]=b,x[7+B]=b)}for(w=0;w<8;++w){var C=w;0!=x[8+C]||0!=x[16+C]||0!=x[24+C]||0!=x[32+C]||0!=x[40+C]||0!=x[48+C]||0!=x[56+C]?(h=s*x[0+C]+2048>>12,p=s*x[32+C]+2048>>12,d=x[16+C],m=x[48+C],v=l*(x[8+C]-x[56+C])+2048>>12,y=l*(x[8+C]+x[56+C])+2048>>12,g=x[24+C],_=x[40+C],b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+m*o+2048>>12,d=d*o-m*a+2048>>12,m=b,b=v-_+1>>1,v=v+_+1>>1,_=b,b=y+g+1>>1,g=y-g+1>>1,y=b,b=h-m+1>>1,h=h+m+1>>1,m=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=v*i+y*n+2048>>12,v=v*n-y*i+2048>>12,y=b,b=g*r+_*e+2048>>12,g=g*e-_*r+2048>>12,_=b,x[0+C]=h+y,x[56+C]=h-y,x[8+C]=p+_,x[48+C]=p-_,x[16+C]=d+g,x[40+C]=d-g,x[24+C]=m+v,x[32+C]=m-v):(b=s*f[w+0]+8192>>14,x[0+C]=b,x[8+C]=b,x[16+C]=b,x[24+C]=b,x[32+C]=b,x[40+C]=b,x[48+C]=b,x[56+C]=b)}for(w=0;w<64;++w){var E=128+(x[w]+8>>4);c[w]=E<0?0:E>255?255:E}}for(var y=0;y255?255:t}return u.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(_=0;_<64;_++){k[t[_]]=e[r++]}else{if(w>>4!=1)throw"DQT: invalid table spec";for(_=0;_<64;_++){k[t[_]]=n()}}p[15&w]=k}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===g,a.progressive=65474===g,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var x,B=e[r++];for(U=0;U>4,E=15&e[r+1],P=e[r+2];a.componentsOrder.push(x),a.components[x]={h:C,v:E,quantizationTable:p[P]},r+=3}o(a),d.push(a);break;case 65476:var j=n();for(U=2;U>4==0?v:m)[15&S]=c(T,A)}break;case 65501:n(),s=n();break;case 65498:n();var I=e[r++],R=[];for(U=0;U>4],z.huffmanTableAC=m[15&L],R.push(z)}var O=e[r++],F=e[r++],D=e[r++],N=f(e,r,a,R,s,O,F,D>>4,15&D);r+=N;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+g.toString(16)}g=n()}if(1!=d.length)throw"only single frame JPEGs supported";this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=l,this.adobe=u,this.components=[];for(var U=0;U=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},o.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},o.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:47}],141:[function(t,e,r){(function(r){var n=t("stream");function i(t,e,i){t=t||function(t){this.queue(t)},e=e||function(){this.queue(null)};var o=!1,a=!1,s=[],l=!1,u=new n;function c(){for(;s.length&&!u.paused;){var t=s.shift();if(null===t)return u.emit("end");u.emit("data",t)}}return u.readable=u.writable=!0,u.paused=!1,u.autoDestroy=!(i&&!1===i.autoDestroy),u.write=function(e){return t.call(this,e),!u.paused},u.queue=u.push=function(t){return l?u:(null===t&&(l=!0),s.push(t),c(),u)},u.on("end",function(){u.readable=!1,!u.writable&&u.autoDestroy&&r.nextTick(function(){u.destroy()})}),u.end=function(t){if(!o)return o=!0,arguments.length&&u.write(t),u.writable=!1,e.call(u),!u.readable&&u.autoDestroy&&u.destroy(),u},u.destroy=function(){if(!a)return a=!0,o=!0,s.length=0,u.writable=u.readable=!1,u.emit("close"),u},u.pause=function(){if(!u.paused)return u.paused=!0,u},u.resume=function(){return u.paused&&(u.paused=!1,u.emit("resume")),c(),u.paused||u.emit("drain"),u},u}e.exports=i,i.through=i}).call(this,t("_process"))},{_process:117,stream:139}],142:[function(t,e,r){(function(e,n){var i=t("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},l=0;function u(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new u(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new u(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},u.prototype.unref=u.prototype.ref=function(){},u.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r.setImmediate="function"==typeof e?e:function(t){var e=l++,n=!(arguments.length<2)&&a.call(arguments,1);return s[e]=!0,i(function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":117,timers:142}],143:[function(t,e,r){r.isatty=function(){return!1},r.ReadStream=function(){throw new Error("tty.ReadStream is not implemented")},r.WriteStream=function(){throw new Error("tty.WriteStream is not implemented")}},{}],144:[function(t,e,r){(function(e,n){"use strict";var i=t("bit-twiddle"),o=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:o([32,0]),UINT16:o([32,0]),UINT32:o([32,0]),INT8:o([32,0]),INT16:o([32,0]),INT32:o([32,0]),FLOAT:o([32,0]),DOUBLE:o([32,0]),DATA:o([32,0]),UINT8C:o([32,0]),BUFFER:o([32,0])});var a="undefined"!=typeof Uint8ClampedArray,s=e.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=o([32,0])),s.BUFFER||(s.BUFFER=o([32,0]));var l=s.DATA,u=s.BUFFER;function c(t){if(t){var e=t.length||t.byteLength,r=i.log2(e);l[r].push(t)}}function f(t){t=i.nextPow2(t);var e=i.log2(t),r=l[e];return r.length>0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function p(t){return new Uint16Array(f(2*t),0,t)}function d(t){return new Uint32Array(f(4*t),0,t)}function m(t){return new Int8Array(f(t),0,t)}function v(t){return new Int16Array(f(2*t),0,t)}function g(t){return new Int32Array(f(4*t),0,t)}function _(t){return new Float32Array(f(4*t),0,t)}function y(t){return new Float64Array(f(8*t),0,t)}function b(t){return a?new Uint8ClampedArray(f(t),0,t):h(t)}function w(t){return new DataView(f(t),0,t)}function k(t){t=i.nextPow2(t);var e=i.log2(t),r=u[e];return r.length>0?r.pop():new n(t)}r.free=function(t){if(n.isBuffer(t))u[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|i.log2(e);l[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){c(t.buffer)},r.freeArrayBuffer=c,r.freeBuffer=function(t){u[i.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return m(t);case"int16":return v(t);case"int32":return g(t);case"float":case"float32":return _(t);case"double":case"float64":return y(t);case"uint8_clamped":return b(t);case"buffer":return k(t);case"data":case"dataview":return w(t);default:return null}return null},r.mallocArrayBuffer=f,r.mallocUint8=h,r.mallocUint16=p,r.mallocUint32=d,r.mallocInt8=m,r.mallocInt16=v,r.mallocInt32=g,r.mallocFloat32=r.mallocFloat=_,r.mallocFloat64=r.mallocDouble=y,r.mallocUint8Clamped=b,r.mallocDataView=w,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,l[t].length=0,u[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":2,buffer:47,dup:20}],145:[function(t,e,r){(function(){var t=this,n=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,l=o.push,u=o.slice,c=o.concat,f=a.toString,h=a.hasOwnProperty,p=o.forEach,d=o.map,m=o.reduce,v=o.reduceRight,g=o.filter,_=o.every,y=o.some,b=o.indexOf,w=o.lastIndexOf,k=Array.isArray,x=Object.keys,B=s.bind,C=function(t){return t instanceof C?t:this instanceof C?void(this._wrapped=t):new C(t)};void 0!==r?(void 0!==e&&e.exports&&(r=e.exports=C),r._=C):t._=C,C.VERSION="1.4.4";var E=C.each=C.forEach=function(t,e,r){if(null!=t)if(p&&t.forEach===p)t.forEach(e,r);else if(t.length===+t.length){for(var n=0,o=t.length;n2;if(null==t&&(t=[]),m&&t.reduce===m)return n&&(e=C.bind(e,n)),i?t.reduce(e,r):t.reduce(e);if(E(t,function(t,o,a){i?r=e.call(n,r,t,o,a):(r=t,i=!0)}),!i)throw new TypeError(P);return r},C.reduceRight=C.foldr=function(t,e,r,n){var i=arguments.length>2;if(null==t&&(t=[]),v&&t.reduceRight===v)return n&&(e=C.bind(e,n)),i?t.reduceRight(e,r):t.reduceRight(e);var o=t.length;if(o!==+o){var a=C.keys(t);o=a.length}if(E(t,function(s,l,u){l=a?a[--o]:--o,i?r=e.call(n,r,t[l],l,u):(r=t[l],i=!0)}),!i)throw new TypeError(P);return r},C.find=C.detect=function(t,e,r){var n;return j(t,function(t,i,o){if(e.call(r,t,i,o))return n=t,!0}),n},C.filter=C.select=function(t,e,r){var n=[];return null==t?n:g&&t.filter===g?t.filter(e,r):(E(t,function(t,i,o){e.call(r,t,i,o)&&(n[n.length]=t)}),n)},C.reject=function(t,e,r){return C.filter(t,function(t,n,i){return!e.call(r,t,n,i)},r)},C.every=C.all=function(t,e,r){e||(e=C.identity);var n=!0;return null==t?n:_&&t.every===_?t.every(e,r):(E(t,function(t,o,a){if(!(n=n&&e.call(r,t,o,a)))return i}),!!n)};var j=C.some=C.any=function(t,e,r){e||(e=C.identity);var n=!1;return null==t?n:y&&t.some===y?t.some(e,r):(E(t,function(t,o,a){if(n||(n=e.call(r,t,o,a)))return i}),!!n)};C.contains=C.include=function(t,e){return null!=t&&(b&&t.indexOf===b?-1!=t.indexOf(e):j(t,function(t){return t===e}))},C.invoke=function(t,e){var r=u.call(arguments,2),n=C.isFunction(e);return C.map(t,function(t){return(n?e:t[e]).apply(t,r)})},C.pluck=function(t,e){return C.map(t,function(t){return t[e]})},C.where=function(t,e,r){return C.isEmpty(e)?r?null:[]:C[r?"find":"filter"](t,function(t){for(var r in e)if(e[r]!==t[r])return!1;return!0})},C.findWhere=function(t,e){return C.where(t,e,!0)},C.max=function(t,e,r){if(!e&&C.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&C.isEmpty(t))return-1/0;var n={computed:-1/0,value:-1/0};return E(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;a>=n.computed&&(n={value:t,computed:a})}),n.value},C.min=function(t,e,r){if(!e&&C.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&C.isEmpty(t))return 1/0;var n={computed:1/0,value:1/0};return E(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;an||void 0===r)return 1;if(r>>1;r.call(n,t[s])=0})})},C.difference=function(t){var e=c.apply(o,u.call(arguments,1));return C.filter(t,function(t){return!C.contains(e,t)})},C.zip=function(){for(var t=u.call(arguments),e=C.max(C.pluck(t,"length")),r=new Array(e),n=0;n=0;r--)e=[t[r].apply(this,e)];return e[0]}},C.after=function(t,e){return t<=0?e():function(){if(--t<1)return e.apply(this,arguments)}},C.keys=x||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)C.has(t,r)&&(e[e.length]=r);return e},C.values=function(t){var e=[];for(var r in t)C.has(t,r)&&e.push(t[r]);return e},C.pairs=function(t){var e=[];for(var r in t)C.has(t,r)&&e.push([r,t[r]]);return e},C.invert=function(t){var e={};for(var r in t)C.has(t,r)&&(e[t[r]]=r);return e},C.functions=C.methods=function(t){var e=[];for(var r in t)C.isFunction(t[r])&&e.push(r);return e.sort()},C.extend=function(t){return E(u.call(arguments,1),function(e){if(e)for(var r in e)t[r]=e[r]}),t},C.pick=function(t){var e={},r=c.apply(o,u.call(arguments,1));return E(r,function(r){r in t&&(e[r]=t[r])}),e},C.omit=function(t){var e={},r=c.apply(o,u.call(arguments,1));for(var n in t)C.contains(r,n)||(e[n]=t[n]);return e},C.defaults=function(t){return E(u.call(arguments,1),function(e){if(e)for(var r in e)null==t[r]&&(t[r]=e[r])}),t},C.clone=function(t){return C.isObject(t)?C.isArray(t)?t.slice():C.extend({},t):t},C.tap=function(t,e){return e(t),t};var A=function(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof C&&(t=t._wrapped),e instanceof C&&(e=e._wrapped);var i=f.call(t);if(i!=f.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=r.length;o--;)if(r[o]==t)return n[o]==e;r.push(t),n.push(e);var a=0,s=!0;if("[object Array]"==i){if(s=(a=t.length)==e.length)for(;a--&&(s=A(t[a],e[a],r,n)););}else{var l=t.constructor,u=e.constructor;if(l!==u&&!(C.isFunction(l)&&l instanceof l&&C.isFunction(u)&&u instanceof u))return!1;for(var c in t)if(C.has(t,c)&&(a++,!(s=C.has(e,c)&&A(t[c],e[c],r,n))))break;if(s){for(c in e)if(C.has(e,c)&&!a--)break;s=!a}}return r.pop(),n.pop(),s};C.isEqual=function(t,e){return A(t,e,[],[])},C.isEmpty=function(t){if(null==t)return!0;if(C.isArray(t)||C.isString(t))return 0===t.length;for(var e in t)if(C.has(t,e))return!1;return!0},C.isElement=function(t){return!(!t||1!==t.nodeType)},C.isArray=k||function(t){return"[object Array]"==f.call(t)},C.isObject=function(t){return t===Object(t)},E(["Arguments","Function","String","Number","Date","RegExp"],function(t){C["is"+t]=function(e){return f.call(e)=="[object "+t+"]"}}),C.isArguments(arguments)||(C.isArguments=function(t){return!(!t||!C.has(t,"callee"))}),"function"!=typeof/./&&(C.isFunction=function(t){return"function"==typeof t}),C.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},C.isNaN=function(t){return C.isNumber(t)&&t!=+t},C.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"==f.call(t)},C.isNull=function(t){return null===t},C.isUndefined=function(t){return void 0===t},C.has=function(t,e){return h.call(t,e)},C.noConflict=function(){return t._=n,this},C.identity=function(t){return t},C.times=function(t,e,r){for(var n=Array(t),i=0;i":">",'"':""","'":"'","/":"/"}};I.unescape=C.invert(I.escape);var R={escape:new RegExp("["+C.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+C.keys(I.unescape).join("|")+")","g")};C.each(["escape","unescape"],function(t){C[t]=function(e){return null==e?"":(""+e).replace(R[t],function(e){return I[t][e]})}}),C.result=function(t,e){if(null==t)return null;var r=t[e];return C.isFunction(r)?r.call(t):r},C.mixin=function(t){E(C.functions(t),function(e){var r=C[e]=t[e];C.prototype[e]=function(){var t=[this._wrapped];return l.apply(t,arguments),N.call(this,r.apply(C,t))}})};var L=0;C.uniqueId=function(t){var e=++L+"";return t?t+e:e},C.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var O=/(.)^/,F={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;C.template=function(t,e,r){var n;r=C.defaults({},r,C.templateSettings);var i=new RegExp([(r.escape||O).source,(r.interpolate||O).source,(r.evaluate||O).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,r,n,i,s){return a+=t.slice(o,s).replace(D,function(t){return"\\"+F[t]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),n&&(a+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(r.variable||"obj","_",a)}catch(t){throw t.source=a,t}if(e)return n(e,C);var s=function(t){return n.call(this,t,C)};return s.source="function("+(r.variable||"obj")+"){\n"+a+"}",s},C.chain=function(t){return C(t).chain()};var N=function(t){return this._chain?C(t).chain():t};C.mixin(C),E(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];C.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!=t&&"splice"!=t||0!==r.length||delete r[0],N.call(this,r)}}),E(["concat","join","slice"],function(t){var e=o[t];C.prototype[t]=function(){return N.call(this,e.apply(this._wrapped,arguments))}}),C.extend(C.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],146:[function(t,e,r){"use strict";e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],o=t[0],a=1;a=a?l+1:a}n.mkdir(e+"sequencer"+a,function(){var o=e+"sequencer"+a+"/";for(var s in r.images){var l=r.images[s].steps;if(i){var u=l.slice(-1)[0].output.src,c=l.slice(-1)[0].output.format,f=t("data-uri-to-buffer")(u);n.writeFile(o+s+"_"+(l.length-1)+"."+c,f,function(){})}else for(var h in l){u=l[h].output.src,c=l[h].output.format,f=t("data-uri-to-buffer")(u);n.writeFile(o+s+"_"+h+"."+c,f,function(){})}}})},n.readdir(c,function(t,e){var r=[];if(void 0===e||0==e.length)return f(r),[];for(var i=0;i0&&(thisStep=c[t].steps[e],thisStep.UI.onRemove(thisStep.options.step),c[t].steps.splice(e,1))}function m(){var e=[],r=this;for(var n in arguments)e.push(a(arguments[n]));var i=u.call(this,e,"l");f.push({method:"loadImages",json_q:a(i)});var o=this.copy(i.loadedimages),s={name:"ImageSequencer Wrapper",sequencer:this,addSteps:this.addSteps,removeSteps:this.removeSteps,insertSteps:this.insertSteps,run:this.run,UI:this.UI,setUI:this.setUI,images:o};!function e(n){if(n!=o.length){var a=o[n];t("./ui/LoadImage")(r,a,i.images[a],function(){e(++n)})}else i.callback.call(s)}(0)}function v(t){var e={};if("load-image"==t)return{};if(0==arguments.length){for(var r in this.modules)e[r]=s[r][1];for(var n in this.sequences)e[n]={name:n,steps:this.sequences[n]}}else e=s[t]?s[t][1]:{inputs:l[t].options};return e}function g(t){let e=v(t.options.name).inputs||{},r={};for(let n in e)t.options[n]&&t.options[n]!=e[n].default&&(r[n]=t.options[n],r[n]=encodeURIComponent(r[n]));var n=Object.keys(r).map(t=>t+":"+r[t]).join("|");return`${t.options.name}{${n}}`}function _(t){let e;return(e=t.includes(",")?t.split(","):[t]).map(y)}function y(t){var e;if(e=t.includes("{")?t.includes("(")&&t.indexOf("(")=e.images[l].steps.length?{options:{name:void 0}}:e.images[l].steps.slice(f+t)[0]},p.getIndex=function(){return f},n)n.hasOwnProperty(d)&&(p[d]=n[d]);p.UI.onDraw(p.options.step);var m=t("./RunToolkit")(e.copy(h));p.draw(m,function(){e.images[l].steps[f].options.step.output=e.images[l].steps[f].output.src,e.images[l].steps[f].UI.onComplete(e.images[l].steps[f].options.step),r(o,++s)},a)}}(s,o)}(r=function(t){for(var r in t)0==t[r]&&1==e.images[r].steps.length?delete t[r]:0==t[r]&&t[r]++;for(var r in t)for(var n=e.images[r].steps[t[r]-1];void 0===n||void 0===n.output;)n=e.images[r].steps[--t[r]-1];return t}(r))}},{"./RunToolkit":159,"./util/getStep.js":272}],159:[function(t,e,r){const n=t("get-pixels"),i=t("./modules/_nomodule/PixelManipulation"),o=t("lodash"),a=t("data-uri-to-buffer"),s=t("save-pixels");e.exports=function(t){return t.getPixels=n,t.pixelManipulation=i,t.lodash=o,t.dataUriToBuffer=a,t.savePixels=s,t}},{"./modules/_nomodule/PixelManipulation":264,"data-uri-to-buffer":19,"get-pixels":29,lodash:75,"save-pixels":138}],160:[function(t,e,r){e.exports={sample:[{name:"invert",options:{}},{name:"channel",options:{channel:"red"}},{name:"blur",options:{blur:"5"}}]}},{}],161:[function(t,e,r){e.exports=function(e,r){return e.step.metadata=e.step.metadata||{},{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(t){for(var r=0,n=[0,0,0,0];rAverages (r, g, b, a): "+n.join(", ")+"

"),t},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264}],162:[function(t,e,r){e.exports=[t("./Module"),t("./info.json")]},{"./Module":161,"./info.json":163}],163:[function(t,e,r){e.exports={name:"Average",description:"Average all pixel color",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],164:[function(require,module,exports){module.exports=function Dynamic(options,UI,util){var defaults=require("./../../util/getDefaults.js")(require("./info.json")),output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;"string"==typeof options.func&&eval("options.func = "+options.func);var getPixels=require("get-pixels");"string"==typeof options.offset&&(options.offset=parseInt(options.offset));var priorStep=this.getStep(options.offset);void 0===priorStep.output&&(this.output=input,UI.notify("Offset Unavailable","offset-notification"),callback()),getPixels(priorStep.output.src,function(t,e){return options.firstImagePixels=e,require("../_nomodule/PixelManipulation.js")(input,{output:function(t,e,r){step.output={src:e,format:r}},changePixel:function(t,e,r,n,i,o){let a=options.firstImagePixels;return options.func(t,e,r,n,a.get(i,o,0),a.get(i,o,1),a.get(i,o,2),a.get(i,o,3))},format:input.format,image:options.image,inBrowser:options.inBrowser,callback:callback})})}return options.func=options.func||defaults.blend,options.offset=options.offset||defaults.offset,{options:options,draw:draw,output:output,UI:UI}}},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":166,"get-pixels":29}],165:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":164,"./info.json":166,dup:162}],166:[function(t,e,r){e.exports={name:"Blend",description:"Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!",inputs:{offset:{type:"integer",desc:"Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.",default:-2},blend:{type:"input",desc:"Function to use to blend the two images.",default:"function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],167:[function(t,e,r){e.exports=function(e,r){let n=[[2/159,4/159,5/159,4/159,2/159],[4/159,9/159,12/159,9/159,4/159],[5/159,12/159,15/159,12/159,5/159],[4/159,9/159,12/159,9/159,4/159],[2/159,4/159,5/159,4/159,2/159]],i=t("lodash").cloneDeep(e);n=function(t){let e=[];for(let r=t.length-1;r>=0;r--){let n=[];for(let e=t[r].length-1;e>=0;e--)n.push(t[r][e]);e.push(n)}return e}(n);for(let t=0;tm;r=0<=m?++c:--c)n[r]=(e-i)/(o-i)*(l[r]-s[r])+s[r];return n}}e.exports=function(t,e){return e.colormap=e.colormap||i.default,"object"==typeof e.colormap?colormapFunction=n(e.colormap):i.hasOwnProperty(e.colormap)?colormapFunction=i[e.colormap]:colormapFunction=i.default,colormapFunction(t/255)};var i={greyscale:n([[0,[0,0,0],[255,255,255]],[1,[255,255,255],[255,255,255]]]),bluwhtgrngis:n([[0,[6,23,86],[6,25,84]],[.0625,[6,25,84],[6,25,84]],[.125,[6,25,84],[6,25,84]],[.1875,[6,25,84],[6,25,84]],[.25,[6,25,84],[6,25,84]],[.3125,[6,25,84],[9,24,84]],[.3438,[9,24,84],[119,120,162]],[.375,[119,129,162],[249,250,251]],[.406,[249,250,251],[255,255,255]],[.4375,[255,255,255],[255,255,255]],[.5,[255,255,255],[214,205,191]],[.52,[214,205,191],[178,175,96]],[.5625,[178,175,96],[151,176,53]],[.593,[151,176,53],[146,188,12]],[.625,[146,188,12],[96,161,1]],[.6875,[96,161,1],[30,127,3]],[.75,[30,127,3],[0,99,1]],[.8125,[0,99,1],[0,74,1]],[.875,[0,74,1],[0,52,0]],[.9375,[0,52,0],[0,34,0]],[.968,[0,34,0],[68,70,67]]]),brntogrn:n([[0,[110,12,3],[118,6,1]],[.0625,[118,6,1],[141,19,6]],[.125,[141,19,6],[165,35,13]],[.1875,[165,35,13],[177,59,25]],[.2188,[177,59,25],[192,91,36]],[.25,[192,91,36],[214,145,76]],[.3125,[214,145,76],[230,183,134]],[.375,[230,183,134],[243,224,194]],[.4375,[243,224,194],[250,252,229]],[.5,[250,252,229],[217,235,185]],[.5625,[217,235,185],[184,218,143]],[.625,[184,218,143],[141,202,89]],[.6875,[141,202,89],[80,176,61]],[.75,[80,176,61],[0,147,32]],[.8125,[0,147,32],[1,122,22]],[.875,[1,122,22],[0,114,19]],[.9,[0,114,19],[0,105,18]],[.9375,[0,105,18],[7,70,14]]]),blutoredjet:n([[0,[0,0,140],[1,1,186]],[.0625,[1,1,186],[0,1,248]],[.125,[0,1,248],[0,70,254]],[.1875,[0,70,254],[0,130,255]],[.25,[0,130,255],[2,160,255]],[.2813,[2,160,255],[0,187,255]],[.3125,[0,187,255],[6,250,255]],[.375,[8,252,251],[27,254,228]],[.406,[27,254,228],[70,255,187]],[.4375,[70,255,187],[104,254,151]],[.47,[104,254,151],[132,255,19]],[.5,[132,255,19],[195,255,60]],[.5625,[195,255,60],[231,254,25]],[.5976,[231,254,25],[253,246,1]],[.625,[253,246,1],[252,210,1]],[.657,[252,210,1],[255,183,0]],[.6875,[255,183,0],[255,125,2]],[.75,[255,125,2],[255,65,1]],[.8125,[255,65,1],[247,1,1]],[.875,[247,1,1],[200,1,3]],[.9375,[200,1,3],[122,3,2]]]),colors16:n([[0,[0,0,0],[0,0,0]],[.0625,[3,1,172],[3,1,172]],[.125,[3,1,222],[3,1,222]],[.1875,[0,111,255],[0,111,255]],[.25,[3,172,255],[3,172,255]],[.3125,[1,226,255],[1,226,255]],[.375,[2,255,0],[2,255,0]],[.4375,[198,254,0],[190,254,0]],[.5,[252,255,0],[252,255,0]],[.5625,[255,223,3],[255,223,3]],[.625,[255,143,3],[255,143,3]],[.6875,[255,95,3],[255,95,3]],[.75,[242,0,1],[242,0,1]],[.8125,[245,0,170],[245,0,170]],[.875,[223,180,225],[223,180,225]],[.9375,[255,255,255],[255,255,255]]]),default:n([[0,[45,1,121],[25,1,137]],[.125,[25,1,137],[0,6,156]],[.1875,[0,6,156],[7,41,172]],[.25,[7,41,172],[22,84,187]],[.3125,[22,84,187],[25,125,194]],[.375,[25,125,194],[26,177,197]],[.4375,[26,177,197],[23,199,193]],[.47,[23,199,193],[25,200,170]],[.5,[25,200,170],[21,209,27]],[.5625,[21,209,27],[108,215,18]],[.625,[108,215,18],[166,218,19]],[.6875,[166,218,19],[206,221,20]],[.75,[206,221,20],[222,213,19]],[.7813,[222,213,19],[222,191,19]],[.8125,[222,191,19],[227,133,17]],[.875,[227,133,17],[231,83,16]],[.9375,[231,83,16],[220,61,48]]]),fastie:n([[0,[255,255,255],[0,0,0]],[.167,[0,0,0],[255,255,255]],[.33,[255,255,255],[0,0,0]],[.5,[0,0,0],[140,140,255]],[.55,[140,140,255],[0,255,0]],[.63,[0,255,0],[255,255,0]],[.75,[255,255,0],[255,0,0]],[.95,[255,0,0],[255,0,255]]]),stretched:n([[0,[0,0,255],[0,0,255]],[.1,[0,0,255],[38,195,195]],[.5,[0,150,0],[255,255,0]],[.7,[255,255,0],[255,50,50]],[.9,[255,50,50],[255,50,50]]])}},{}],181:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(r,n,i,o){var a=(r+n+i)/3,s=t("./Colormap")(a,e);return[s[0],s[1],s[2],255]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264,"./Colormap":180}],182:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":181,"./info.json":183,dup:162}],183:[function(t,e,r){e.exports={name:"Colormap",description:"Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.",inputs:{colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],184:[function(t,e,r){var n=t("lodash");e.exports=function(t,e){let r=n.cloneDeep(t);(e=Number(e))<-100&&(e=-100),e>100&&(e=100),e=(100+e)/100,e*=e;for(let n=0;n255&&(i=255);var o=r.get(n,s,1)/255;o-=.5,o*=e,o+=.5,(o*=255)<0&&(o=0),o>255&&(o=255);var a=r.get(n,s,2)/255;a-=.5,a*=e,a+=.5,(a*=255)<0&&(a=0),a>255&&(a=255),t.set(n,s,0,i),t.set(n,s,1,o),t.set(n,s,2,a)}return t}},{lodash:75}],185:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.contrast=e.contrast||n.contrast,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(r){return r=t("./Contrast")(r,e.contrast)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Contrast":184,"./info.json":187}],186:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":185,"./info.json":187,dup:162}],187:[function(t,e,r){e.exports={name:"Contrast",description:"Change the contrast of the image by given value",inputs:{contrast:{type:"range",desc:"contrast for the new image, typically -100 to 100",default:"70",min:"-100",max:"100",step:"1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],188:[function(t,e,r){var n=t("lodash");e.exports=function(t,e,r){let o=function(t,e){for(e=e.split(" "),i=0;i<9;i++)e[i]=Number(e[i])*t;let r=0,n=[];for(i=0;i<3;i++){let t=[];for(j=0;j<3;j++)t.push(e[r]),r+=1;n.push(t)}return n}(e,r),a=n.cloneDeep(t);o=function(t){let e=[];for(let r=t.length-1;r>=0;r--){let n=[];for(let e=t[r].length-1;e>=0;e--)n.push(t[r][e]);e.push(n)}return e}(o);for(let e=0;eRead more",inputs:{constantFactor:{type:"Float",desc:"a constant factor, multiplies all the kernel values by that factor",default:.1111,placeholder:.1111},kernelValues:{type:"String",desc:"nine space separated numbers representing the kernel values in left to right and top to bottom format.",default:"1 1 1 1 1 1 1 1 1",placeholder:"1 1 1 1 1 1 1 1 1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],192:[function(t,e,r){(function(r){e.exports=function(e,n,i){var o=t("./../../util/getDefaults.js")(t("./info.json")),a=t("get-pixels"),s=t("save-pixels");n.x=parseInt(n.x)||o.x,n.y=parseInt(n.y)||o.y,a(e.src,function(t,a){n.w=parseInt(n.w)||Math.floor(a.shape[0]),n.h=parseInt(n.h)||Math.floor(a.shape[1]),n.backgroundColor=n.backgroundColor||o.backgroundColor;var l=n.x,u=n.y,c=n.w,f=n.h,h=a.shape[0],p=a.shape[1],d=[];backgroundColor=n.backgroundColor.split(" ");for(var m=0;mRead more",inputs:{dither:{type:"select",desc:"Name of the Dithering Algorithm",default:"none",values:["none","floydsteinberg","bayer","Atkinson"]}}}},{}],204:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));r.startingX=r.startingX||n.startingX,r.startingY=r.startingY||n.startingY;var i=Number(r.startingX),o=Number(r.startingY),a=e.shape[0],s=e.shape[1],l=Number(r.thickness)||n.thickness,u=r.endX=Number(r.endX)-l||a-1,c=r.endY=Number(r.endY)-l||s-1,f=r.color||n.color;f=f.split(" ");var h=function(t,r,n,i){for(var o=t;o<=n+l;o++)for(var a=r;a<=i+l;a++)e.set(o,a,0,f[0]),e.set(o,a,1,f[1]),e.set(o,a,2,f[2]),e.set(o,a,3,f[3])};return h(i,o,i,c),h(u,o,u,c),h(i,o,u,o),h(i,c,u,c),e}},{"./../../util/getDefaults.js":271,"./info.json":207}],205:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r){return r=t("./DrawRectangle")(r,e)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264,"./DrawRectangle":204}],206:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":205,"./info.json":207,dup:162}],207:[function(t,e,r){e.exports={name:"Draw Rectangle",description:"It draws a rectangle on the image",inputs:{startingX:{type:"Number",desc:"starting x position of the rectangle",default:0},startingY:{type:"Number",desc:"starting y position of the rectangle",default:0},endX:{type:"integer",desc:"last x position of the rectangle",default:"width"},endY:{type:"integer",desc:"last y position of the rectangle",default:"height"},thickness:{type:"integer",desc:"thickness of border",default:1},color:{type:"String",desc:"RGBA values separated by a space",default:"0 0 0 255"}}}},{}],208:[function(require,module,exports){module.exports=function Dynamic(options,UI){var output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;function generator(expression){var func="f = function (r, g, b, a) { var R = r, G = g, B = b, A = a;",f;return func+="return ",func=func+expression+"}",eval(func),f}options.monochrome=options.monochrome||"(R+G+B)/3";var channels=["red","green","blue","alpha"];function changePixel(t,e,r,n){return[options.red_function(t,e,r,n),options.green_function(t,e,r,n),options.blue_function(t,e,r,n),options.alpha_function(t,e,r,n)]}function getNeighbourPixel(t,e,r,n,i){return[t.get(e+n,r+i,0),t.get(e+n,r+i,1),t.get(e+n,r+i,2),t.get(e+n,r+i,3)]}function map(t,e,r,n,i,o){var a=(t-e)/(r-e)*(i-n)+n;if(!o)return a;function s(t,e,r){return Math.max(Math.min(t,r),e)}return nInfragrammar.",inputs:{red:{type:"input",desc:"Expression to return for red channel with R, G, B, and A inputs",default:"r"},green:{type:"input",desc:"Expression to return for green channel with R, G, B, and A inputs",default:"g"},blue:{type:"input",desc:"Expression to return for blue channel with R, G, B, and A inputs",default:"b"},"monochrome (fallback)":{type:"input",desc:"Expression to return with R, G, B, and A inputs; fallback for other channels if none provided",default:"r + g + b"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],211:[function(t,e,r){t("lodash");const n=[[-1,0,1],[-2,0,2],[-1,0,1]],i=[[-1,-2,-1],[0,0,0],[1,2,1]];function o(t,e,r,o,a){let s=0;for(let e=0;e<3;e++)for(let r=0;r<3;r++){let i=o+e-1,l=a+r-1;s+=t.get(i,l,0)*n[e][r]}let l=0;for(let e=0;e<3;e++)for(let r=0;r<3;r++){let n=o+e-1,s=a+r-1;l+=t.get(n,s,0)*i[e][r]}return{pixel:[e,e,e,Math.sqrt(Math.pow(s,2)+Math.pow(l,2))],angle:Math.atan2(l,s)}}e.exports=function(t,e,r,n){let i=[],l=[];for(var u=0;ut.map(a));for(let n=1;n=-22.5&&o<=22.5||o<-157.5&&o>=-180?e[n][i]>=e[n][i+1]&&e[n][i]>=e[n][i-1]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0):o>=22.5&&o<=67.5||o<-112.5&&o>=-157.5?e[n][i]>=e[n+1][i+1]&&e[n][i]>=e[n-1][i-1]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0):o>=67.5&&o<=112.5||o<-67.5&&o>=-112.5?e[n][n]>=e[n+1][i]&&e[n][i]>=e[n][i]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0):(o>=112.5&&o<=157.5||o<-22.5&&o>=-67.5)&&(e[n][i]>=e[n+1][i-1]&&e[n][i]>=e[n-1][i+1]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0))}}(t,l,i),function(t,e,r,n,i,o){const a=s(n)*e,l=a*r;for(let e=0;el?n[e][r]>a?i.push(s):o.push(s):t.set(e,r,3,0)}i.forEach(e=>t.set(e[0],e[1],3,255))}(t,e,r,l,[],[]),t};var a=t=>180*t/Math.PI,s=t=>Math.max(...t.map(t=>t.map(t=>t||0)).map(t=>Math.max(...t)))},{lodash:75}],212:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.blur=e.blur||n.blur,e.highThresholdRatio=e.highThresholdRatio||n.highThresholdRatio,e.lowThresholdRatio=e.lowThresholdRatio||n.lowThresholdRatio,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[(t+e+r)/3,(t+e+r)/3,(t+e+r)/3,n]},extraManipulation:function(r){return r=t("ndarray-gaussian-filter")(r,e.blur),r=t("./EdgeUtils")(r,e.highThresholdRatio,e.lowThresholdRatio,e.inBrowser)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./EdgeUtils":211,"./info.json":214,"ndarray-gaussian-filter":80}],213:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":212,"./info.json":214,dup:162}],214:[function(t,e,r){e.exports={name:"Detect Edges",description:"This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ",inputs:{blur:{type:"range",desc:"Amount of gaussian blur(Less blur gives more detail, typically 0-5)",default:"2",min:"0",max:"5",step:"0.25"},highThresholdRatio:{type:"float",desc:"The high threshold ratio for the image",default:.2},lowThresholdRatio:{type:"float",desc:"The low threshold value for the image",default:.15}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],215:[function(t,e,r){e.exports=function(e,r){return t("fisheyegl"),{options:e,draw:function(t,r){var n=this;if(e.inBrowser){if(document.querySelector("#image-sequencer-canvas"))var i=document.querySelector("#image-sequencer-canvas");else(i=document.createElement("canvas")).style.display="none",i.setAttribute("id","image-sequencer-canvas"),document.body.append(i);distorter=FisheyeGl({selector:"#image-sequencer-canvas"}),e.a=parseFloat(e.a)||distorter.lens.a,e.b=parseFloat(e.b)||distorter.lens.b,e.Fx=parseFloat(e.Fx)||distorter.lens.Fx,e.Fy=parseFloat(e.Fy)||distorter.lens.Fy,e.scale=parseFloat(e.scale)||distorter.lens.scale,e.x=parseFloat(e.x)||distorter.fov.x,e.y=parseFloat(e.y)||distorter.fov.y,distorter.lens.a=e.a,distorter.lens.b=e.b,distorter.lens.Fx=e.Fx,distorter.lens.Fy=e.Fy,distorter.lens.scale=e.scale,distorter.fov.x=e.x,distorter.fov.y=e.y,distorter.setImage(t.src,function(){n.output={src:i.toDataURL(),format:t.format},r()})}else this.output=t,r()},output:void 0,UI:r}}},{fisheyegl:21}],216:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":215,"./info.json":217,dup:162}],217:[function(t,e,r){e.exports={name:"Fisheye GL",description:"Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).",requires:["webgl"],inputs:{a:{type:"float",desc:"a parameter",default:1,min:1,max:4},b:{type:"float",desc:"b parameter",default:1,min:1,max:4},Fx:{type:"float",desc:"Fx parameter",default:0,min:0,max:4},Fy:{type:"float",desc:"Fy parameter",default:0,min:0,max:4},scale:{type:"float",desc:"Image Scaling",default:1.5,min:0,max:20},x:{type:"float",desc:"FOV x parameter",default:1.5,min:0,max:20},y:{type:"float",desc:"FOV y parameter",default:1.5,min:0,max:20},fragmentSrc:{type:"PATH",desc:"Path to a WebGL fragment shader file",default:"(inbuilt)"},vertexSrc:{type:"PATH",desc:"Path to a WebGL vertex shader file",default:"(inbuilt)"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],218:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this,a=t("./../../util/getDefaults.js")(t("./info.json")),s=(e.adjustment||a.adjustment)/a.adjustment;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t=255*Math.pow(t/255,s),e=255*Math.pow(e/255,s),r=255*Math.pow(r/255,s),n]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./info.json":220}],219:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":218,"./info.json":220,dup:162}],220:[function(t,e,r){e.exports={name:"Gamma Correction",description:"Apply gamma correction on the image Read more",inputs:{adjustment:{type:"float",desc:"gamma correction (inverse of actual gamma factor) for the new image",default:.2}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],221:[function(t,e,r){(function(r){e.exports=function(e,n){return{options:e,draw:function(e,n,i){var o=t("get-pixels"),a=t("save-pixels"),s=this;o(e.src,function(t,i){if(t)console.log("Bad Image path");else{for(var o=i.shape[0],l=0;l

Select or drag in an image to overlay.

';$(t.ui).find(".details").prepend(i),sequencer.setInputStep({dropZoneSelector:"#"+n,fileInputSelector:"#"+n+" .file-input",onLoad:function(e){var r=e.target;t.options.imageUrl=r.result,t.options.url=r.result,sequencer.run(),setUrlHashParameter("steps",sequencer.toString())}}),$(t.ui).find(".btn-save").on("click",function(){var e=$(t.ui).find(".det input").val();t.options.imageUrl=e,sequencer.run()})}}}},{}],229:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":227,"./info.json":230,dup:162}],230:[function(t,e,r){e.exports={name:"Import Image",description:"Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{url:{type:"string",desc:"URL of image to import",default:"./images/monarch.png"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],231:[function(t,e,r){e.exports=t("../../util/createMetaModule.js")(function(t){return[{name:"ndvi",options:{}},{name:"colormap",options:{colormap:t.colormap}}]},{infoJson:t("./info.json")})[0]},{"../../util/createMetaModule.js":270,"./info.json":233}],232:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":231,"./info.json":233,dup:162}],233:[function(t,e,r){e.exports={name:"NDVI-Colormap",description:"Sequentially Applies NDVI and Colormap steps",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],234:[function(t,e,r){e.exports=function(e,r){if(e.step.inBrowser)var n=t("./Ui.js")(e.step,r);var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.filter=e.filter||i.filter,{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},changePixel:function(t,r,n,i){if("red"==e.filter)var o=(n-t)/(1*n+t);"blue"==e.filter&&(o=(t-n)/(1*n+t));var a=255*(o+1)/2;return[a,a,a,i]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:function(){e.step.inBrowser&&n.setup(),i()}})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":264,"./../../util/getDefaults.js":271,"./Ui.js":235,"./info.json":237}],235:[function(t,e,r){e.exports=function(t,e){return{setup:function(){var e=$(t.imgElement);e.mousemove(function(t){var r=document.createElement("canvas");r.width=e.width(),r.height=e.height(),r.getContext("2d").drawImage(this,0,0);var n=$(this).offset(),i=t.pageX-n.left,o=t.pageY-n.top,a=r.getContext("2d").getImageData(i,o,1,1).data[0];a=(a=a/127.5-1).toFixed(2),e[0].title="NDVI: "+a})}}}},{}],236:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{"./Module":234,"./info.json":237,dup:162}],237:[function(t,e,r){e.exports={name:"NDVI",description:"Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters",inputs:{filter:{type:"select",desc:"Filter color",default:"red",values:["red","blue"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],238:[function(t,e,r){e.exports=function(e,r,n){var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.x=e.x||i.x,e.y=e.y||i.y,{options:e,draw:function(r,n,i){e.offset=e.offset||-2,i.stop(!0),i.overrideFlag=!0;var o=this;t("../../util/ParseInputCoordinates")(e,{src:r.src,x:{valInp:e.x,type:"horizontal"},y:{valInp:e.y,type:"vertical"}},function(t,e){t.x=parseInt(e.x.valInp),t.y=parseInt(e.y.valInp)});var a=this.getStep(e.offset).image,s=this.getOutput(e.offset);t("get-pixels")(r.src,function(r,i){return e.secondImagePixels=i,t("../_nomodule/PixelManipulation.js")(s,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,r,n,i,o,a){var s=e.secondImagePixels;return o>=e.x&&o=e.y&&a=p*w&&e.get(t,r,0)<=p*b&&e.get(t,r,1)>=d*w&&e.get(t,r,1)<=d*b&&e.get(t,r,2)>=m*w&&e.get(t,r,2)<=m*b&&e.get(t,r,3)>=v*w&&e.get(t,r,3)<=v*b}for(u=u.split(" ");_.length;)if(k(i=g.pop(),n=_.pop())){o=a=n;do{o-=1}while(k(i,o)&&o>=0);do{a+=1}while(k(i,a)&&aa&&(a=f,s=l)}return s}(n));for(var c=0;c<=u;c+=4)e.data[c]=e.data[c]"40000"?"40000":e.temperature,i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(t){let r,n,i,o=parseInt(e.temperature);(o/=100)<=66?(r=255,n=Math.min(Math.max(99.4708025861*Math.log(o)-161.1195681661,0),255)):(r=Math.min(Math.max(329.698727446*Math.pow(o-60,-.1332047592),0),255),n=Math.min(Math.max(288.1221695283*Math.pow(o-60,-.0755148492),0),255)),o>=66?i=255:o<=19?i=0:(i=o-10,i=Math.min(Math.max(138.5177312231*Math.log(i)-305.0447927307,0),255));for(let e=0;e
To work with a new or different image, drag one into the drop zone.",ID:e.options.sequencerCounter++,imageName:t,inBrowser:e.options.inBrowser,ui:e.options.ui},a={src:r,steps:[{options:{id:n.ID,name:"load-image",description:"This initial step loads and displays the original image without any modifications.",title:"Load Image",step:n},UI:e.events,draw:function(){return UI.onDraw(options.step),1==arguments.length?(this.output=o(arguments[0]),options.step.output=this.output,UI.onComplete(options.step),!0):2==arguments.length&&(this.output=o(arguments[0]),options.step.output=this.output,arguments[1](),UI.onComplete(options.step),!0)}}]};o(r,function(r){var n=function(t){return{src:t,format:t.split(":")[1].split(";")[0].split("/")[1]}}(r);e.images[t]=a;var o=e.images[t].steps[0];return o.output=n,o.options.step.output=o.output.src,o.UI.onSetup(o.options.step),o.UI.onDraw(o.options.step),o.UI.onComplete(o.options.step),i(),!0})}(r,n)}},{urify:147}],266:[function(t,e,r){e.exports=function(){return function(t){var e=$(t.dropZoneSelector),r=$(t.fileInputSelector),n=$(t.takePhotoSelector),i=t.onLoad;function o(t){if(t.preventDefault(),t.stopPropagation(),t.target&&t.target.files)var e=t.target.files[0];else e=t.dataTransfer.files[0];if(e){var r=new FileReader;r.onload=i,r.readAsDataURL(e)}}t.onTakePhoto,new FileReader,r.on("change",o),n.on("click",function(){document.getElementById("video").style.display="inline",document.getElementById("capture").style.display="inline",document.getElementById("close").style.display="inline";var e=document.getElementById("video");canvas=document.getElementById("canvas"),context=canvas.getContext("2d"),vendorUrl=window.URL||window.webkitURL,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(t){window.stream=t,e.srcObject=t,e.onloadedmetadata=function(t){e.play()},document.getElementById("close").addEventListener("click",function(){!function(t){t.getVideoTracks().forEach(function(t){t.stop()}),document.getElementById("video").style.display="none",document.getElementById("capture").style.display="none",document.getElementById("close").style.display="none"}(t)})}).catch(function(t){console.log("navigator.getUserMedia error: ",t)}),document.getElementById("capture").addEventListener("click",function(r){context.drawImage(e,0,0,400,300),t.onTakePhoto(canvas.toDataURL())})}),e[0].addEventListener("drop",o,!1),e.on("dragover",function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},!1),e.on("dragenter",function(t){e.addClass("hover")}),e.on("dragleave",function(t){e.removeClass("hover")})}}},{}],267:[function(t,e,r){e.exports=function(t={}){return t.onSetup=t.onSetup||function(t){0==t.ui||(t.inBrowser?console.log('Added Step "'+t.name+'" to "'+t.imageName+'".'):console.log("%s",'Added Step "'+t.name+'" to "'+t.imageName+'".'))},t.onDraw=t.onDraw||function(t){0==t.ui||(t.inBrowser?console.log('Drawing Step "'+t.name+'" on "'+t.imageName+'".'):console.log("%s",'Drawing Step "'+t.name+'" on "'+t.imageName+'".'))},t.onComplete=t.onComplete||function(t){0==t.ui||(t.inBrowser?console.log('Drawn Step "'+t.name+'" on "'+t.imageName+'".'):console.log("%s",'Drawn Step "'+t.name+'" on "'+t.imageName+'".'))},t.onRemove=t.onRemove||function(t){0==t.ui||(t.inBrowser?console.log('Removing Step "'+t.name+'" of "'+t.imageName+'".'):console.log("%s",'Removing Step "'+t.name+'" of "'+t.imageName+'".'))},t.notify=t.notify||function(t){console.log(t)},t}},{}],268:[function(t,e,r){e.exports=function(t){var e=void 0;return"jpeg"===(e=(e=function(t){return"data:image"===t.substr(0,10)}(t)?t.split(";")[0].split("/").pop():t.split(".").pop()).toLowerCase())&&(e="jpg"),["jpg","jpeg","png","gif","canvas"].includes(e)?e:"jpg"}},{}],269:[function(t,e,r){e.exports=function(e,r,n){t("get-pixels")(r.src,function(t,i){var o=i.shape[0],a=i.shape[1];if(r.x.valInp){Object.keys(r).forEach(function(t){var e=r[t];e.valInp&&"%"===e.valInp.slice(-1)&&(e.valInp=parseInt(e.valInp,10),"horizontal"===e.type?e.valInp=e.valInp*o/100:e.valInp=e.valInp*a/100)});n(e,r)}})}},{"get-pixels":29}],270:[function(t,e,r){e.exports=function(e,r){return(r=r||{}).infoJson=r.infoJson||{},[function(n,i){var o=t("./getDefaults.js")(r.infoJson);for(key in r.infoJson.inputs)r.infoJson.inputs.hasOwnProperty(key)&&(n[key]=n[key]||o[key]);var a=e(n),s=ImageSequencer({inBrowser:!1,ui:!1});return{options:n,draw:function(t,e){var r=this;s.loadImage(t.src,function(){s.importJSON(a),s.run(function(n){r.output={src:n,format:t.format},e()})})},output:void 0,UI:i}},r.infoJson]}},{"./getDefaults.js":271}],271:[function(t,e,r){e.exports=function(t){var e={};for(var r in t.inputs)t.inputs.hasOwnProperty(r)&&(e[r]=t.inputs[r].default);return e}},{}],272:[function(t,e,r){e.exports={getPreviousStep:function(){return this.getStep(-1)},getNextStep:function(){return this.getStep(1)},getInput:function(t){return t+this.getIndex()===0&&t++,this.getStep(t-1).output},getOutput:function(t){return this.getStep(t).output},getOptions:function(){return this.getStep(0).options},setOptions:function(t){let e=this.getStep(0).options;for(let r in t)e[r]&&(e[r]=t[r])},getFormat:function(){return this.getStep(-1).output.format},getHeight:function(t){let e=new Image;e.onload=function(){t(e.height)},e.src=this.getInput(0).src},getWidth:function(t){let e=new Image;e.onload=function(){t(e.width)},e.src=this.getInput(0).src}}},{}]},{},[154]); \ No newline at end of file +!function(){return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){return i(e[a][1][t]||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a0?n-4:n,f=0;f>16&255,s[u++]=e>>8&255,s[u++]=255&e;2===a&&(e=i[t.charCodeAt(f)]<<2|i[t.charCodeAt(f+1)]>>4,s[u++]=255&e);1===a&&(e=i[t.charCodeAt(f)]<<10|i[t.charCodeAt(f+1)]<<4|i[t.charCodeAt(f+2)]>>2,s[u++]=e>>8&255,s[u++]=255&e);return s},r.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,r){for(var i,o,a=[],s=e;s>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],2:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],3:[function(t,e,r){(function(t,n,i){!function(t){if("object"==typeof r&&void 0!==e)e.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;"undefined"!=typeof window?i=window:void 0!==n?i=n:"undefined"!=typeof self&&(i=self),i.Promise=t()}}(function(){var e,r,o;return function t(e,r,n){function i(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof _dereq_&&_dereq_;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[a]={exports:{}};e[a][0].call(c.exports,function(t){var r=e[a][1][t];return i(r||t)},c,c.exports,t,e,r,n)}return r[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;)p(t)}function p(t){var e=t.shift();if("function"!=typeof e)e._settlePromises();else{var r=t.shift(),n=t.shift();e.call(r,n)}}u.prototype.setScheduler=function(t){var e=this._schedule;return this._schedule=t,this._customScheduler=!0,e},u.prototype.hasCustomScheduler=function(){return this._customScheduler},u.prototype.enableTrampoline=function(){this._trampolineEnabled=!0},u.prototype.disableTrampolineIfNecessary=function(){s.hasDevTools&&(this._trampolineEnabled=!1)},u.prototype.haveItemsQueued=function(){return this._isTickUsed||this._haveDrainedQueues},u.prototype.fatalError=function(e,r){r?(t.stderr.write("Fatal "+(e instanceof Error?e.stack:e)+"\n"),t.exit(2)):this.throwLater(e)},u.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(t){throw new Error("No async scheduler available\n\n See http://goo.gl/MqrFmX\n")}},s.hasDevTools?(u.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?l.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},u.prototype.invoke=function(t,e,r){this._trampolineEnabled?c.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},u.prototype.settlePromises=function(t){this._trampolineEnabled?f.call(this,t):this._schedule(function(){t._settlePromises()})}):(u.prototype.invokeLater=l,u.prototype.invoke=c,u.prototype.settlePromises=f),u.prototype._drainQueues=function(){h(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,h(this._lateQueue)},u.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},u.prototype._reset=function(){this._isTickUsed=!1},r.exports=u,r.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var l=r(o),c=new t(e);c._propagateFrom(this,1);var f=this._target();if(c._setBoundTo(l),l instanceof t){var h={promiseRejectionQueued:!1,promise:c,target:f,bindingPromise:l};f._then(e,a,void 0,c,h),l._then(s,u,void 0,c,h),c._setOnCancel(l)}else c._resolveCallback(f);return c},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField},t.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(t){}return i},e.exports=i},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){var r,n=t("./util"),i=n.canEvaluate;n.isIdentifier;function o(t,r){var i;if(null!=t&&(i=t[r]),"function"!=typeof i){var o="Object "+n.classString(t)+" has no method '"+n.toString(r)+"'";throw new e.TypeError(o)}return i}function a(t){return o(t,this.pop()).apply(t,this)}function s(t){return t[this]}function u(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(a,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e;if("number"==typeof t)e=u;else if(i){var n=r(t);e=null!==n?n:s}else e=s;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return r[t]}return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var t=r.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},n.CapturedTrace=null,n.create=function(){if(e)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;n.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,e=!1},e=!0,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},n}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){var i,o,a,s=r._getDomain,u=r._async,l=e("./errors").Warning,c=e("./util"),f=e("./es5"),h=c.canAttachTrace,p=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,g=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,m=null,v=null,_=!1,y=!(0==c.env("BLUEBIRD_DEBUG")),b=!(0==c.env("BLUEBIRD_WARNINGS")||!y&&!c.env("BLUEBIRD_WARNINGS")),w=!(0==c.env("BLUEBIRD_LONG_STACK_TRACES")||!y&&!c.env("BLUEBIRD_LONG_STACK_TRACES")),k=0!=c.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!c.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=-1048577&t._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var t=this;setTimeout(function(){t._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){G("rejectionHandled",i,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),G("unhandledRejection",o,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return z(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=s();o="function"==typeof t?null===e?t:c.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=s();i="function"==typeof t?null===e?t:c.domainBind(e,t):void 0};var x=function(){};r.longStackTraces=function(){if(u.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!Q.longStackTraces&&Z()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace,i=r.prototype._dereferenceTrace;Q.longStackTraces=!0,x=function(){if(u.haveItemsQueued()&&!Q.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,r.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),u.enableTrampoline(),Q.longStackTraces=!1},r.prototype._captureStackTrace=D,r.prototype._attachExtraTrace=N,r.prototype._dereferenceTrace=U,n.activateLongStackTraces(),u.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return Q.longStackTraces&&Z()};var B=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r={detail:e,cancelable:!0};f.defineProperty(r,"promise",{value:e.promise}),f.defineProperty(r,"reason",{value:e.reason});var n=new CustomEvent(t.toLowerCase(),r);return!c.global.dispatchEvent(n)}}if("function"==typeof Event){t=new Event("CustomEvent");return c.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,f.defineProperty(r,"promise",{value:e.promise}),f.defineProperty(r,"reason",{value:e.reason}),!c.global.dispatchEvent(r)}}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),c.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!c.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),C=c.isNode?function(){return t.emit.apply(t,arguments)}:c.global?function(t){var e="on"+t.toLowerCase(),r=c.global[e];return!!r&&(r.apply(c.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function E(t,e){return{promise:e}}var P={promiseCreated:E,promiseFulfilled:E,promiseRejected:E,promiseResolved:E,promiseCancelled:E,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:E},j=function(t){var e=!1;try{e=C.apply(null,arguments)}catch(t){u.throwLater(t),e=!0}var r=!1;try{r=B(t,P[t].apply(null,arguments))}catch(t){u.throwLater(t),r=!0}return r||e};function S(){return!1}function T(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+c.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function A(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?c.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function M(){return this._onCancelField}function I(t){this._onCancelField=t}function R(){this._cancellationParent=void 0,this._onCancelField=void 0}function L(t,e){if(0!=(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}r.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&x()),"warnings"in t){var e=t.warnings;Q.warnings=!!e,k=Q.warnings,c.isObject(e)&&"wForgottenReturn"in e&&(k=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Q.cancellation){if(u.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=R,r.prototype._propagateFrom=L,r.prototype._onCancel=M,r.prototype._setOnCancel=I,r.prototype._attachCancellationCallback=A,r.prototype._execute=T,F=L,Q.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Q.monitoring?(Q.monitoring=!0,r.prototype._fireEvent=j):!t.monitoring&&Q.monitoring&&(Q.monitoring=!1,r.prototype._fireEvent=S)),r},r.prototype._fireEvent=S,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._dereferenceTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var F=function(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)};function O(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function D(){this._trace=new J(this._peekContext())}function N(t,e){if(h(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=V(t);c.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),c.notEnumerableProp(t,"__stackCleaned__",!0)}}}function U(){this._trace=void 0}function z(t,e,n){if(Q.warnings){var i,o=new l(t);if(e)n._attachExtraTrace(o);else if(Q.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=V(o);o.stack=a.message+"\n"+a.stack.join("\n")}j("warning",o)||H(o,"",!0)}}function q(t){for(var e=[],r=0;r0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=t.name&&(e=e.slice(r)),e}(t):[" (No stack trace)"],{message:r,stack:"SyntaxError"==t.name?e:q(e)}}function H(t,e,r){if("undefined"!=typeof console){var n;if(c.isObject(t)){var i=t.stack;n=e+v(i,t)}else n=e+String(t);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function G(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){u.throwLater(t)}"unhandledRejection"===t?j(t,r,n)||i||H(r,"Unhandled rejection "):j(t,n)}function W(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():c.toString(t);if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+function(t){if(t.length<41)return t;return t.substr(0,38)+"..."}(e)+">, no stack trace)"}function Z(){return"function"==typeof K}var Y=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function $(t){var e=t.match(X);if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function J(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);K(this,J),e>32&&this.uncycle()}c.inherits(J,Error),n.CapturedTrace=J,J.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;for(n=(t=this._length=n)-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(n=0;n0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var s=n>0?e[n-1]:this;a=0;--l)e[l]._length=u,u++;return}}}},J.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=V(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(q(i.stack.split("\n"))),i=i._parent;!function(t){for(var e=t[0],r=1;r=0;--s)if(n[s]===o){a=s;break}for(s=a;s>=0;--s){var u=n[s];if(e[i]!==u)break;e.pop(),i--}e=n}}(n),function(t){for(var e=0;e=0)return m=/@/,v=e,_=!0,function(t){t.stack=(new Error).stack};try{throw new Error}catch(t){n="stack"in t}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?W(e):e.toString()},null):(m=t,v=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(t){console.warn(t)},c.isNode&&t.stderr.isTTY?a=function(t,e){var r=e?"":"";console.warn(r+t+"\n")}:c.isNode||"string"!=typeof(new Error).stack||(a=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var Q={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return w&&r.longStackTraces(),{longStackTraces:function(){return Q.longStackTraces},warnings:function(){return Q.warnings},cancellation:function(){return Q.cancellation},monitoring:function(){return Q.monitoring},propagateFromFunction:function(){return F},boundValueFunction:function(){return O},checkForgottenReturns:function(t,e,r,n,i){if(void 0===t&&null!==e&&k){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=q(s),l=u.length-1;l>=0;--l){var c=u[l];if(!d.test(c)){var f=c.match(g);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0){var h=u[0];for(l=0;l0&&(a="\n"+s[l-1]);break}}}var p="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(p,!0,e)}},setBounds:function(t,e){if(Z()){for(var r,n,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,u=0;u=s||(Y=function(t){if(p.test(t))return!0;var e=$(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}},warn:z,deprecated:function(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),z(r)},CapturedTrace:J,fireDomEvent:B,fireGlobalEvent:C}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1];return this.caught(t,function(){throw e})},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();return this.caught(r,function(){return n})}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.reduce,n=t.all;function i(){return n(this)}t.prototype.each=function(t){return r(this,t,e,0)._then(i,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return r(this,t,e,e)},t.each=function(t,n){return r(t,n,e,0)._then(i,void 0,void 0,t,void 0)},t.mapSeries=function(t,n){return r(t,n,e,e)}}},{}],12:[function(t,e,r){"use strict";var n,i,o=t("./es5"),a=o.freeze,s=t("./util"),u=s.inherits,l=s.notEnumerableProp;function c(t,e){function r(n){if(!(this instanceof r))return new r(n);l(this,"message","string"==typeof n?n:e),l(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return u(r,Error),r}var f=c("Warning","warning"),h=c("CancellationError","cancellation error"),p=c("TimeoutError","timeout error"),d=c("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(t){n=c("TypeError","type error"),i=c("RangeError","range error")}for(var g="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),m=0;m1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function f(){return p.call(this,this.promise._target()._settledValue())}function h(t){if(!c(this,t))return a.e=t,a}function p(t){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var u=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t);if(u===n)return u;if(void 0!==u){i._setReturnedNonUndefined();var p=r(u,i);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var d=new o("late cancellation observer");return i._attachExtraTrace(d),a.e=d,a}p.isPending()&&p._attachCancellationCallback(new l(this))}return p._then(f,h,void 0,this,void 0)}}}return i.isRejected()?(c(this),a.e=t,a):(c(this),t)}return u.prototype.isFinallyHandler=function(){return 0===this.type},l.prototype._resultCancelled=function(){c(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,n){return"function"!=typeof t?this.then():this._then(r,n,void 0,new u(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,p,p)},e.prototype.tap=function(t){return this._passThrough(t,1,p)},e.prototype.tapCatch=function(t){var r=arguments.length;if(1===r)return this._passThrough(t,1,void 0,p);var n,o=new Array(r-1),a=0;for(n=0;n0&&"function"==typeof arguments[e]&&(t=arguments[e]);var n=[].slice.call(arguments);t&&n.pop();var i=new r(n).promise();return void 0!==t?i.spread(t):i}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=e._getDomain,u=t("./util"),l=u.tryCatch,c=u.errorObj,f=e._async;function h(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=s();this._callback=null===i?e:u.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],f.invoke(this._asyncInit,this,void 0)}function p(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+u.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+u.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+u.classString(i.concurrency)));a=i.concurrency}return new h(t,r,a="number"==typeof a&&isFinite(a)&&a>=1?a:0,o).promise()}u.inherits(h,r),h.prototype._asyncInit=function(){this._init$(void 0,-2)},h.prototype._init=function(){},h.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(n[r=-1*r-1]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var f=this._promise,h=this._callback,p=f._boundValue();f._pushContext();var d=l(h).call(p,t,r,o),g=f._popContext();if(a.checkForgottenReturns(d,g,null!==s?"Promise.filter":"Promise.map",f),d===c)return this._reject(d.e),!0;var m=i(d,this._promise);if(m instanceof e){var v=(m=m._target())._bitField;if(0==(50397184&v))return u>=1&&this._inFlight++,n[r]=m,m._proxy(this,-1*(r+1)),!1;if(0==(33554432&v))return 0!=(16777216&v)?(this._reject(m._reason()),!0):(this._cancel(),!0);d=m._value()}n[r]=d}return++this._totalResolved>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},h.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var l=arguments[1],c=arguments[2];n=a.isArray(l)?s(t).apply(c,l):s(t).call(c,l)}else n=s(t)();var f=u._popContext();return o.checkForgottenReturns(n,f,"Promise.try",u),u._resolveFromSyncValue(n),u},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";var n=t("./util"),i=n.maybeWrapAsError,o=t("./errors").OperationalError,a=t("./es5");var s=/^(?:name|message|stack|cause)$/;function u(t){var e;if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack;for(var r=a.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+l.classString(t);arguments.length>1&&(r+=", "+l.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},S.prototype.done=function(t,e){this._then(t,e,void 0,void 0,void 0)._setIsFinal()},S.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+l.classString(t)):this.all()._then(t,void 0,void 0,v,void 0)},S.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},S.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new b(this).promise()},S.prototype.error=function(t){return this.caught(l.originatesFromRejection,t)},S.getNewLibraryCopy=r.exports,S.is=function(t){return t instanceof S},S.fromNode=S.fromCallback=function(t){var e=new S(m);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=j(t)(E(e,r));return n===P&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},S.all=function(t){return new b(t).promise()},S.cast=function(t){var e=y(t);return e instanceof S||((e=new S(m))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},S.resolve=S.fulfilled=S.cast,S.reject=S.rejected=function(t){var e=new S(m);return e._captureStackTrace(),e._rejectCallback(t,!0),e},S.setScheduler=function(t){if("function"!=typeof t)throw new d("expecting a function but got "+l.classString(t));return h.setScheduler(t)},S.prototype._then=function(t,e,r,n,i){var o=void 0!==i,a=o?i:new S(m),u=this._target(),c=u._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&c)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var f=s();if(0!=(50397184&c)){var p,d,v=u._settlePromiseCtx;0!=(33554432&c)?(d=u._rejectionHandler0,p=t):0!=(16777216&c)?(d=u._fulfillmentHandler0,p=e,u._unsetRejectionIsUnhandled()):(v=u._settlePromiseLateCancellationObserver,d=new g("late cancellation observer"),u._attachExtraTrace(d),p=e),h.invoke(v,u,{handler:null===f?p:"function"==typeof p&&l.domainBind(f,p),promise:a,receiver:n,value:d})}else u._addCallbacks(t,e,a,n,f);return a},S.prototype._length=function(){return 65535&this._bitField},S.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},S.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},S.prototype._setLength=function(t){this._bitField=-65536&this._bitField|65535&t},S.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},S.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},S.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},S.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},S.prototype._isFinal=function(){return(4194304&this._bitField)>0},S.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},S.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},S.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},S.prototype._setAsyncGuaranteed=function(){h.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},S.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==u)return void 0===e&&this._isBound()?this._boundValue():e},S.prototype._promiseAt=function(t){return this[4*t-4+2]},S.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},S.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},S.prototype._boundValue=function(){},S.prototype._migrateCallback0=function(t){t._bitField;var e=t._fulfillmentHandler0,r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=u),this._addCallbacks(e,r,n,i,null)},S.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=u),this._addCallbacks(r,n,i,o,null)},S.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:l.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:l.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:l.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:l.domainBind(i,e))}return this._setLength(o+1),o},S.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},S.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(n(),!1);var r=y(t,this);if(!(r instanceof S))return this._fulfill(t);e&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():h.settlePromises(this),this._dereferenceTrace())}},S.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return h.fatalError(t,l.isNode);(65535&e)>0?h.settlePromises(this):this._ensurePossibleRejectionHandled()}},S.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!=(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},S.prototype._settledValue=function(){var t=this._bitField;return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0},S.defer=S.pending=function(){return x.deprecated("Promise.defer","new Promise"),{promise:new S(m),resolve:T,reject:A}},l.notEnumerableProp(S,"_makeSelfResolutionError",n),e("./method")(S,m,y,o,x),e("./bind")(S,m,y,x),e("./cancel")(S,b,o,x),e("./direct_resolve")(S),e("./synchronous_inspection")(S),e("./join")(S,b,y,m,h,s),S.Promise=S,S.version="3.5.3",e("./map.js")(S,b,o,y,m,x),e("./call_get.js")(S),e("./using.js")(S,o,y,k,m,x),e("./timers.js")(S,m,x),e("./generators.js")(S,o,m,y,a,x),e("./nodeify.js")(S),e("./promisify.js")(S,m),e("./props.js")(S,b,y,o),e("./race.js")(S,m,y,o),e("./reduce.js")(S,b,o,y,m,x),e("./settle.js")(S,b,x),e("./some.js")(S,b,o),e("./filter.js")(S,m),e("./each.js")(S,m),e("./any.js")(S),l.toFastProperties(S),l.toFastProperties(S.prototype),M({a:1}),M({b:2}),M({c:3}),M(1),M(function(){}),M(void 0),M(!1),M(new S(m)),x.setBounds(f.firstLineError,l.lastLineError),S}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){var a=t("./util");a.isArray;function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){var u=(s=s._target())._bitField;if(this._values=s,0==(50397184&u))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0==(33554432&u))return 0!=(16777216&u)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(t){switch(t){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var l=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(l,!1)}},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var r;if(this._isMap)r=function(t){for(var e=new o,r=t.length/2|0,n=0;n>1},e.prototype.props=function(){return f(this)},e.props=function(t){return f(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity=this._length&&(this._resolve(this._values),!0)},o.prototype._promiseFulfilled=function(t,e){var r=new i;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},o.prototype._promiseRejected=function(t,e){var r=new i;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new o(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=t("./errors").RangeError,a=t("./errors").AggregateError,s=i.isArray,u={};function l(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function c(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new l(t),i=r.promise();return r.setHowMany(e),r.init(),i}i.inherits(l,r),l.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var t=s(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},l.prototype.init=function(){this._initialized=!0,this._init()},l.prototype.setUnwrap=function(){this._unwrap=!0},l.prototype.howMany=function(){return this._howMany},l.prototype.setHowMany=function(t){this._howMany=t},l.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},l.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},l.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(u),this._checkOutcome())},l.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new a,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},l.prototype._fulfilled=function(){return this._totalResolved},l.prototype._rejected=function(){return this._values.length-this.length()},l.prototype._addRejected=function(t){this._values.push(t)},l.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},l.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},l.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new o(e)},l.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return c(t,e)},e.prototype.some=function(t){return c(this,t)},e._SomePromiseArray=l}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){var n=t("./util"),i=n.errorObj,o=n.isObject;var a={}.hasOwnProperty;return function(t,s){if(o(t)){if(t instanceof e)return t;var u=function(t){try{return function(t){return t.then}(t)}catch(t){return i.e=t,i}}(t);if(u===i){s&&s._pushContext();var l=e.reject(u.e);return s&&s._popContext(),l}if("function"==typeof u)return function(t){try{return a.call(t,"_promise0")}catch(t){return!1}}(t)?(l=new e(r),t._then(l._fulfill,l._reject,void 0,l,null),l):function(t,o,a){var s=new e(r),u=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var l=!0,c=n.tryCatch(o).call(t,function(t){s&&(s._resolveCallback(t),s=null)},function(t){s&&(s._rejectCallback(t,l,!0),s=null)});return l=!1,s&&c===i&&(s._rejectCallback(c.e,!0,!0),s=null),u}(t,u,s)}return t}}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){var i=t("./util"),o=e.TimeoutError;function a(t){this.handle=t}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(t){return u(+this).thenReturn(t)},u=e.delay=function(t,i){var o,u;return void 0!==i?(o=e.resolve(i)._then(s,null,null,t,void 0),n.cancellation()&&i instanceof e&&o._setOnCancel(i)):(o=new e(r),u=setTimeout(function(){o._fulfill()},+t),n.cancellation()&&o._setOnCancel(new a(u)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};e.prototype.delay=function(t){return u(t,this)};function l(t){return clearTimeout(this.handle),t}function c(t){throw clearTimeout(this.handle),t}e.prototype.timeout=function(t,e){var r,s;t=+t;var u=new a(setTimeout(function(){r.isPending()&&function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new o("operation timed out"):new o(e),i.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()}(r,e,s)},t));return n.cancellation()?(s=this.then(),(r=s._then(l,c,void 0,u,void 0))._setOnCancel(u)):r=this._then(l,c,void 0,u,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){var s=t("./util"),u=t("./errors").TypeError,l=t("./util").inherits,c=s.errorObj,f=s.tryCatch,h={};function p(t){setTimeout(function(){throw t},0)}function d(t,r){var i=0,a=t.length,s=new e(o);return function o(){if(i>=a)return s._fulfill();var u=function(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}(t[i++]);if(u instanceof e&&u._isDisposable()){try{u=n(u._getDisposer().tryDispose(r),t.promise)}catch(t){return p(t)}if(u instanceof e)return u._then(o,p,null,null,null)}o()}(),s}function g(t,e,r){this._data=t,this._promise=e,this._context=r}function m(t,e,r){this.constructor$(t,e,r)}function v(t){return g.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function _(t){this.length=t,this.promise=null,this[t-1]=null}g.prototype.data=function(){return this._data},g.prototype.promise=function(){return this._promise},g.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():h},g.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==h?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},g.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},l(m,g),m.prototype.doDispose=function(t,e){return this.data().call(t,t,e)},_.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new m(t,this,i());throw new u}}},{"./errors":12,"./util":36}],36:[function(e,r,i){"use strict";var o=e("./es5"),a="undefined"==typeof navigator,s={e:{}},u,l="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==this?this:null;function c(){try{var t=u;return u=null,t.apply(this,arguments)}catch(t){return s.e=t,s}}function f(t){return u=t,c}var h=function(t,e){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=t,this.constructor$=e,e.prototype)r.call(e.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=e.prototype[n])}return n.prototype=e.prototype,t.prototype=new n,t.prototype};function p(t){return null==t||!0===t||!1===t||"string"==typeof t||"number"==typeof t}function d(t){return"function"==typeof t||"object"==typeof t&&null!==t}function g(t){return p(t)?new Error(P(t)):t}function m(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=w.test(t+"")&&o.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function x(t){function e(){}e.prototype=t;var r=new e;function n(){return typeof r.foo}return n(),n(),t}var B=/^[a-z$_][a-z$_0-9]*$/i;function C(t){return B.test(t)}function E(t,e,r){for(var n=new Array(t),i=0;i10||V[0]>0),q.isNode&&q.toFastProperties(t);try{throw new Error}catch(t){q.lastLineError=t}r.exports=q},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{_process:118,timers:172}],4:[function(t,e,r){},{}],5:[function(t,e,r){(function(r){var n=t("tty"),i=t("./lib/encode"),o=t("stream").Stream,a=e.exports=function(){var t=null;function e(e){if(t)throw new Error("multiple inputs specified");t=e}var i=null;function o(t){if(i)throw new Error("multiple outputs specified");i=t}for(var a=0;a0&&this.down(e),t>0?this.right(t):t<0&&this.left(-t),this},s.prototype.up=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"A")),this},s.prototype.down=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"B")),this},s.prototype.right=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"C")),this},s.prototype.left=function(t){return void 0===t&&(t=1),this.write(i("["+Math.floor(t)+"D")),this},s.prototype.column=function(t){return this.write(i("["+Math.floor(t)+"G")),this},s.prototype.push=function(t){return this.write(i(t?"7":"[s")),this},s.prototype.pop=function(t){return this.write(i(t?"8":"[u")),this},s.prototype.erase=function(t){return"end"===t||"$"===t?this.write(i("[K")):"start"===t||"^"===t?this.write(i("[1K")):"line"===t?this.write(i("[2K")):"down"===t?this.write(i("[J")):"up"===t?this.write(i("[1J")):"screen"===t?this.write(i("[1J")):this.emit("error",new Error("Unknown erase type: "+t)),this},s.prototype.display=function(t){var e={reset:0,bright:1,dim:2,underscore:4,blink:5,reverse:7,hidden:8}[t];return void 0===e&&this.emit("error",new Error("Unknown attribute: "+t)),this.write(i("["+e+"m")),this},s.prototype.foreground=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[38;5;"+t+"m"));else{var e={black:30,red:31,green:32,yellow:33,blue:34,magenta:35,cyan:36,white:37}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.background=function(t){if("number"==typeof t)(t<0||t>=256)&&this.emit("error",new Error("Color out of range: "+t)),this.write(i("[48;5;"+t+"m"));else{var e={black:40,red:41,green:42,yellow:43,blue:44,magenta:45,cyan:46,white:47}[t.toLowerCase()];e||this.emit("error",new Error("Unknown color: "+t)),this.write(i("["+e+"m"))}return this},s.prototype.cursor=function(t){return this.write(i(t?"[?25h":"[?25l")),this};var u=a.extractCodes=function(t){for(var e=[],r=-1,n=0;n=0&&e.push(t.slice(r,n)),r=n):r>=0&&n===t.length-1&&e.push(t.slice(r));return e}}).call(this,t("_process"))},{"./lib/encode":6,_process:118,stream:169,tty:173}],6:[function(t,e,r){(function(t){var r=(e.exports=function(e){return new t([27].concat(function t(e){return"string"==typeof e?e.split("").map(r):Array.isArray(e)?e.reduce(function(e,r){return e.concat(t(r))},[]):void 0}(e)))}).ord=function(t){return t.charCodeAt(0)}}).call(this,t("buffer").Buffer)},{buffer:48}],7:[function(t,e,r){(function(r){"use strict";var n=t("readable-stream").Readable,i=t("util");function o(t,e){if(!(this instanceof o))return new o(t,e);n.call(this,e),null!==t&&void 0!==t||(t=String(t)),this._obj=t}e.exports=o,i.inherits(o,n),o.prototype._read=function(t){var e=this._obj;"string"==typeof e?this.push(new r(e)):r.isBuffer(e)?this.push(e):this.push(new r(JSON.stringify(e))),this.push(null)}}).call(this,t("buffer").Buffer)},{buffer:48,"readable-stream":13,util:180}],8:[function(t,e,r){(function(r){e.exports=s;var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e},i=t("core-util-is");i.inherits=t("inherits");var o=t("./_stream_readable"),a=t("./_stream_writable");function s(t){if(!(this instanceof s))return new s(t);o.call(this,t),a.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",u)}function u(){this.allowHalfOpen||this._writableState.ended||r.nextTick(this.end.bind(this))}i.inherits(s,o),function(t,e){for(var r=0,n=t.length;r0?d(t):b(t)}(t,e);else if(e.objectMode||n&&n.length>0)if(e.ended&&!a){var u=new Error("stream.push() after EOF");t.emit("error",u)}else if(e.endEmitted&&a){u=new Error("stream.unshift() after end event");t.emit("error",u)}else!e.decoder||a||o||(n=e.decoder.write(n)),e.length+=e.objectMode?1:n.length,a?e.buffer.unshift(n):(e.reading=!1,e.buffer.push(n)),e.needReadable&&d(t),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=h)t=h;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function d(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,e.sync?r.nextTick(function(){g(t)}):g(t))}function g(t){t.emit("readable")}function m(t){var e,r=t._readableState;function n(t,n,i){!1===t.write(e)&&r.awaitDrain++}for(r.awaitDrain=0;r.pipesCount&&null!==(e=t.read());)if(1===r.pipesCount?n(r.pipes):w(r.pipes,n),t.emit("data",e),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(o.listenerCount(t,"data")>0&&_(t));r.ranOut=!0}function v(){this._readableState.ranOut&&(this._readableState.ranOut=!1,m(this))}function _(t,e){if(t._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=e||!1,i=!1;t.readable=!0,t.pipe=s.prototype.pipe,t.on=t.addListener=s.prototype.on,t.on("readable",function(){var e;for(i=!0;!n&&null!==(e=t.read());)t.emit("data",e);null===e&&(i=!1,t._readableState.needReadable=!0)}),t.pause=function(){n=!0,this.emit("pause")},t.resume=function(){n=!1,i?r.nextTick(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function y(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");!e.endEmitted&&e.calledRead&&(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function w(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return d(this),null;if(0===(t=p(t,e))&&e.ended)return r=null,e.length>0&&e.decoder&&(r=y(t,e),e.length-=r.length),0===e.length&&b(this),r;var i=e.needReadable;return e.length-t<=e.highWaterMark&&(i=!0),(e.ended||e.reading)&&(i=!1),i&&(e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1),i&&!e.reading&&(t=p(n,e)),null===(r=t>0?y(t,e):null)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),e.ended&&!e.endEmitted&&0===e.length&&b(this),r},c.prototype._read=function(t){this.emit("error",new Error("not implemented"))},c.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1;var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?l:f;function u(t){t===i&&f()}function l(){t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",u);var c=function(t){return function(){var e=t._readableState;e.awaitDrain--,0===e.awaitDrain&&m(t)}}(i);function f(){t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",u),i.removeListener("end",l),i.removeListener("end",f),t._writableState&&!t._writableState.needDrain||c()}function h(e){g(),t.removeListener("error",h),0===o.listenerCount(t,"error")&&t.emit("error",e)}function p(){t.removeListener("finish",d),g()}function d(){t.removeListener("close",p),g()}function g(){i.unpipe(t)}return t.on("drain",c),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(h):t._events.error=[h,t._events.error]:t.on("error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",i),a.flowing||(this.on("readable",v),a.flowing=!0,r.nextTick(function(){m(i)})),t},c.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,this.removeListener("readable",v),e.flowing=!1;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":17}],16:[function(t,e,r){"use strict";var n=t("uniq");function i(t,e,r){var n,i,o=t.length,a=e.arrayArgs.length,s=e.indexArgs.length>0,u=[],l=[],c=0,f=0;for(n=0;n0&&u.push("var "+l.join(",")),n=o-1;n>=0;--n)c=t[n],u.push(["for(i",n,"=0;i",n,"0&&u.push(["index[",f,"]-=s",f].join("")),u.push(["++index[",c,"]"].join(""))),u.push("}")}return u.join("\n")}function o(t,e,r){for(var n=t.body,i=[],o=[],a=0;a0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){var y=new Array(r);for(u=0;u0&&v.push("var "+_.join(",")),u=0;u3&&v.push(o(t.pre,t,s));var x=o(t.body,t,s),B=function(t){for(var e=0,r=t[0].length;e0,l=[],c=0;c0;){"].join("")),l.push(["if(j",c,"<",s,"){"].join("")),l.push(["s",e[c],"=j",c].join("")),l.push(["j",c,"=0"].join("")),l.push(["}else{s",e[c],"=",s].join("")),l.push(["j",c,"-=",s,"}"].join("")),u&&l.push(["index[",e[c],"]=j",c].join(""));for(c=0;c3&&v.push(o(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var C=[t.funcName||"unnamed","_cwise_loop_",a[0].join("s"),"m",B,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",C,"(",m.join(","),"){",v.join("\n"),"} return ",C].join(""))()}},{uniq:176}],17:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var o=[],a=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],u=[],l=[],c=0;c0&&(u.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[c]))),l.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[c])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+u.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),c=0;cf)&&(o[u]=f,p.push(u,f),i[u]=s));if(void 0!==r&&void 0===o[r]){var d=["Could not find a path from ",e," to ",r,"."].join("");throw new Error(d)}return i},extract_shortest_path_from_predecessor_list:function(t,e){for(var r=[],n=e;n;)r.push(n),t[n],n=t[n];return r.reverse(),r},find_path:function(t,e,r){var i=n.single_source_shortest_paths(t,e,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(t){var e,r=n.PriorityQueue,i={};for(e in t=t||{},r)r.hasOwnProperty(e)&&(i[e]=r[e]);return i.queue=[],i.sorter=t.sorter||r.default_sorter,i},default_sorter:function(t,e){return t.cost-e.cost},push:function(t,e){var r={value:t,cost:e};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};void 0!==e&&(e.exports=n)},{}],21:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],25:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat correctionRadius = 0.5;\n\tfloat distance = sqrt(vPosition.x * vPosition.x + vPosition.y * vPosition.y) / correctionRadius;\n\tfloat theta = 1.0;\n\tif(distance != 0.0){\n\t\ttheta = atan(distance);\n\t}\n\tvec2 vMapping = theta * vPosition.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\t\t\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],26:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec3 uLensS;\nuniform vec2 uLensF;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord * vec2(1.0, -1.0)/ 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tfloat scale = uLensS.z;\n\tvec3 vPos = vPosition;\n\tfloat Fx = uLensF.x;\n\tfloat Fy = uLensF.y;\n\tvec2 vMapping = vPos.xy;\n\tvMapping.x = vMapping.x + ((pow(vPos.y, 2.0)/scale)*vPos.x/scale)*-Fx;\n\tvMapping.y = vMapping.y + ((pow(vPos.x, 2.0)/scale)*vPos.y/scale)*-Fy;\n\tvMapping = vMapping * uLensS.xy;\n\tvMapping = GLCoord2TextureCoord(vMapping/scale);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t}\n\tgl_FragColor = texture;\n}\n"},{}],27:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TODO insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],28:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec4 uLens;\nuniform vec2 uFov;\nuniform sampler2D uSampler;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvec2 TextureCoord2GLCoord(vec2 textureCoord) {\n\treturn (textureCoord - vec2(0.5, 0.5)) * 2.0;\n}\nvec2 GLCoord2TextureCoord(vec2 glCoord) {\n\treturn glCoord / 2.0 + vec2(0.5, 0.5);\n}\nvoid main(void){\n\tvec2 vMapping = vec2(vTextureCoord.x, 1.0 - vTextureCoord.y);\n\tvMapping = TextureCoord2GLCoord(vMapping);\n\t//TOD insert Code\n\tfloat F = uLens.x/ uLens.w;\n\tfloat seta = length(vMapping) / F;\n\tvMapping = sin(seta) * F / length(vMapping) * vMapping;\n\tvMapping *= uLens.w * 1.414;\n\tvMapping = GLCoord2TextureCoord(vMapping);\n\tvec4 texture = texture2D(uSampler, vMapping);\n\tif(vMapping.x > 0.99 || vMapping.x < 0.01 || vMapping.y > 0.99 || vMapping.y < 0.01){\n\t\ttexture = vec4(0.0, 0.0, 0.0, 1.0);\n\t} \n\tgl_FragColor = texture;\n}\n"},{}],29:[function(t,e,r){e.exports="#ifdef GL_ES\nprecision highp float;\n#endif\nattribute vec3 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying vec3 vPosition;\nvarying vec2 vTextureCoord;\nvoid main(void){\n\tvPosition = aVertexPosition;\n\tvTextureCoord = aTextureCoord;\n\tgl_Position = vec4(vPosition,1.0);\n}\n"},{}],30:[function(t,e,r){(function(r,n){"use strict";var i=t("path"),o=t("ndarray"),a=t("omggif").GifReader,s=(t("ndarray-pack"),t("through"),t("data-uri-to-buffer"));function u(t,e){var r;try{r=new a(t)}catch(t){return void e(t)}if(r.numFrames()>0){var n=[r.numFrames(),r.height,r.width,4],i=new Uint8Array(n[0]*n[1]*n[2]*n[3]),s=o(i,n);try{for(var u=0;u=0&&(this.dispose=t)},u.prototype.setRepeat=function(t){this.repeat=t},u.prototype.setTransparent=function(t){this.transparent=t},u.prototype.analyzeImage=function(t){this.setImagePixels(this.removeAlphaChannel(t)),this.analyzePixels()},u.prototype.writeImageInfo=function(){this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.writePalette(),this.firstFrame=!1},u.prototype.outputImage=function(){this.writePixels()},u.prototype.addFrame=function(t){this.emit("frame#start"),this.analyzeImage(t),this.writeImageInfo(),this.outputImage(),this.emit("frame#stop")},u.prototype.finish=function(){this.emit("finish#start"),this.writeByte(59),this.emit("finish#stop")},u.prototype.setQuality=function(t){t<1&&(t=1),this.sample=t},u.prototype.writeHeader=function(){this.emit("writeHeader#start"),this.writeUTFBytes("GIF89a"),this.emit("writeHeader#stop")},u.prototype.analyzePixels=function(){var t=this.pixels.length/3;this.indexedPixels=new Uint8Array(t);var e=new o(this.pixels,this.sample);e.buildColormap(),this.colorTab=e.getColormap();for(var r=0,n=0;n>16,r=(65280&t)>>8,n=255&t,i=0,o=16777216,a=this.colorTab.length,s=0;s=0&&(e=7&dispose),e<<=2,this.writeByte(0|e|t),this.writeShort(this.delay),this.writeByte(this.transIndex),this.writeByte(0)},u.prototype.writeImageDesc=function(){this.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame?this.writeByte(0):this.writeByte(128|this.palSize)},u.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.writeByte(240|this.palSize),this.writeByte(0),this.writeByte(0)},u.prototype.writeNetscapeExt=function(){this.writeByte(33),this.writeByte(255),this.writeByte(11),this.writeUTFBytes("NETSCAPE2.0"),this.writeByte(3),this.writeByte(1),this.writeShort(this.repeat),this.writeByte(0)},u.prototype.writePalette=function(){this.writeBytes(this.colorTab);for(var t=768-this.colorTab.length,e=0;e>8&255)},u.prototype.writePixels=function(){new a(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this)},u.prototype.stream=function(){return this},u.ByteCapacitor=s,e.exports=u}).call(this,t("buffer").Buffer)},{"./LZWEncoder.js":33,"./TypedNeuQuant.js":34,assert:41,buffer:48,events:49,"readable-stream":40,util:180}],33:[function(t,e,r){var n=-1,i=12,o=5003,a=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];e.exports=function(t,e,r,s){var u,l,c,f,h,p,d,g,m,v=Math.max(2,s),_=new Uint8Array(256),y=new Int32Array(o),b=new Int32Array(o),w=0,k=0,x=!1;function B(t,e){_[l++]=t,l>=254&&P(e)}function C(t){E(o),k=g+2,x=!0,T(g,t)}function E(t){for(var e=0;e0&&(t.writeByte(l),t.writeBytes(_,0,l),l=0)}function j(t){return(1<0?u|=t<=8;)B(255&u,e),u>>=8,w-=8;if((k>c||x)&&(x?(c=j(p=d),x=!1):c=++p==i?1<0;)B(255&u,e),u>>=8,w-=8;P(e)}}this.encode=function(r){r.writeByte(v),f=t*e,h=0,function(t,e){var r,a,s,u,f,h,v;for(x=!1,c=j(p=d=t),m=1+(g=1<=0){f=h-s,0===s&&(f=1);do{if((s-=f)<0&&(s+=h),y[s]===r){u=b[s];continue t}}while(y[s]>=0)}T(u,e),u=a,k<1<>c,h=u<>3)*(1<l;)u=P[p++],fl&&((s=r[h--])[0]-=u*(s[0]-n)/_,s[1]-=u*(s[1]-o)/_,s[2]-=u*(s[2]-a)/_)}function T(t,e,n){var o,u,p,d,g,m=~(1<<31),v=m,_=-1,y=_;for(o=0;o>s-a))>c,E[o]-=g,C[o]+=g<>3),t=0;t>p;for(E<=1&&(E=0),r=0;r=c&&(A-=c),r++,0===_&&(_=1),r%_==0)for(B-=B/f,(E=(C-=C/g)>>p)<=1&&(E=0),l=0;l>=a,r[t][1]>>=a,r[t][2]>>=a,r[t][3]=t}(),function(){var t,e,n,a,s,u,l=0,c=0;for(t=0;t>1,e=l+1;e>1,e=l+1;e<256;e++)B[e]=o}()},this.getColormap=function(){for(var t=[],e=[],n=0;n=0;)c=u?c=i:(c++,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)=0&&((s=e-(a=r[f])[1])>=u?f=-1:(f--,s<0&&(s=-s),(o=a[0]-t)<0&&(o=-o),(s+=o)0)if(e.ended&&!o){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&o){s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||o||i||(n=e.decoder.write(n)),o||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,o?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&g(t)),function(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(function(){!function(t,e){var r=e.length;for(;!e.reading&&!e.flowing&&!e.ended&&e.lengthe.highWaterMark&&(e.highWaterMark=function(t){if(t>=p)t=p;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function g(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(function(){m(t)}):m(t))}function m(t){l("emit readable"),t.emit("readable"),v(t)}function v(t){var e=t._readableState;if(l("flow",e.flowing),e.flowing)do{var r=t.read()}while(null!==r&&e.flowing)}function _(t,e){var r,n=e.buffer,o=e.length,a=!!e.decoder,s=!!e.objectMode;if(0===n.length)return null;if(0===o)r=null;else if(s)r=n.shift();else if(!t||t>=o)r=a?n.join(""):i.concat(n,o),n.length=0;else{if(t0)throw new Error("endReadable called on non-empty stream");e.endEmitted||(e.ended=!0,r.nextTick(function(){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}))}f.prototype.read=function(t){l("read",t);var e=this._readableState,r=t;if((!u.isNumber(t)||t>0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?y(this):g(this),null;if(0===(t=d(t,e))&&e.ended)return 0===e.length&&y(this),null;var n,i=e.needReadable;return l("need readable",i),(0===e.length||e.length-t0?_(t,e):null,u.isNull(n)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&y(this),u.isNull(n)||this.emit("data",n),n},f.prototype._read=function(t){this.emit("error",new Error("not implemented"))},f.prototype.pipe=function(t,e){var i=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=t;break;case 1:a.pipes=[a.pipes,t];break;default:a.pipes.push(t)}a.pipesCount+=1,l("pipe count=%d opts=%j",a.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:h;function u(t){l("onunpipe"),t===i&&h()}function c(){l("onend"),t.end()}a.endEmitted?r.nextTick(s):i.once("end",s),t.on("unpipe",u);var f=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o.listenerCount(t,"data")&&(e.flowing=!0,v(t))}}(i);function h(){l("cleanup"),t.removeListener("close",g),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",u),i.removeListener("end",c),i.removeListener("end",h),i.removeListener("data",p),!a.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}function p(e){l("ondata"),!1===t.write(e)&&(l("false write response, pause",i._readableState.awaitDrain),i._readableState.awaitDrain++,i.pause())}function d(e){l("onerror",e),_(),t.removeListener("error",d),0===o.listenerCount(t,"error")&&t.emit("error",e)}function g(){t.removeListener("finish",m),_()}function m(){l("onfinish"),t.removeListener("close",g),_()}function _(){l("unpipe"),i.unpipe(t)}return t.on("drain",f),i.on("data",p),t._events&&t._events.error?n(t._events.error)?t._events.error.unshift(d):t._events.error=[d,t._events.error]:t.on("error",d),t.once("close",g),t.once("finish",m),t.emit("pipe",i),a.flowing||(l("pipe resume"),i.resume()),t},f.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n=0;l--)if(c[l]!==f[l])return!1;for(l=c.length-1;l>=0;l--)if(u=c[l],!_(t[u],e[u],r,n))return!1;return!0}(t,e,r,a))}return r?t===e:t==e}function y(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function b(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function w(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&m(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&o.isError(i),u=!t&&i&&!r;if((s&&a&&b(i,r)||u)&&m(i,r,"Got unwanted exception"+n),t&&i&&r&&!b(i,r)||!t&&i)throw i}f.AssertionError=function(t){var e;this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=d(g((e=this).actual),128)+" "+e.operator+" "+d(g(e.expected),128),this.generatedMessage=!0);var r=t.stackStartFunction||m;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var n=new Error;if(n.stack){var i=n.stack,o=p(r),a=i.indexOf("\n"+o);if(a>=0){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},o.inherits(f.AssertionError,Error),f.fail=m,f.ok=v,f.equal=function(t,e,r){t!=e&&m(t,e,r,"==",f.equal)},f.notEqual=function(t,e,r){t==e&&m(t,e,r,"!=",f.notEqual)},f.deepEqual=function(t,e,r){_(t,e,!1)||m(t,e,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(t,e,r){_(t,e,!0)||m(t,e,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(t,e,r){_(t,e,!1)&&m(t,e,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function t(e,r,n){_(e,r,!0)&&m(e,r,n,"notDeepStrictEqual",t)},f.strictEqual=function(t,e,r){t!==e&&m(t,e,r,"===",f.strictEqual)},f.notStrictEqual=function(t,e,r){t===e&&m(t,e,r,"!==",f.notStrictEqual)},f.throws=function(t,e,r){w(!0,t,e,r)},f.doesNotThrow=function(t,e,r){w(!1,t,e,r)},f.ifError=function(t){if(t)throw t};var k=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":44}],42:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],43:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],44:[function(t,e,r){(function(e,n){var i=/%[sdj%]/g;r.format=function(t){if(!v(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),c(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function l(t,e){return t}function c(t,e,n){if(t.customInspect&&e&&x(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return v(i)||(i=c(t,i,n)),i}var o=function(t,e){if(_(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(m(e))return t.stylize(""+e,"number");if(d(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,e);if(o)return o;var a=Object.keys(e),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),k(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return f(e);if(0===a.length){if(x(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(y(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(w(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return f(e)}var l,b="",B=!1,C=["{","}"];(p(e)&&(B=!0,C=["[","]"]),x(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return y(e)&&(b=" "+RegExp.prototype.toString.call(e)),w(e)&&(b=" "+Date.prototype.toUTCString.call(e)),k(e)&&(b=" "+f(e)),0!==a.length||B&&0!=e.length?n<0?y(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=B?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(l,b,C)):C[0]+b+C[1]}function f(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),P(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=g(r)?c(t,u.value,null):c(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),_(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t){return Array.isArray(t)}function d(t){return"boolean"==typeof t}function g(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function _(t){return void 0===t}function y(t){return b(t)&&"[object RegExp]"===B(t)}function b(t){return"object"==typeof t&&null!==t}function w(t){return b(t)&&"[object Date]"===B(t)}function k(t){return b(t)&&("[object Error]"===B(t)||t instanceof Error)}function x(t){return"function"==typeof t}function B(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}r.debuglog=function(t){if(_(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var n=e.pid;a[t]=function(){var e=r.format.apply(r,arguments);console.error("%s %d: %s",t,n,e)}}else a[t]=function(){};return a[t]},r.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=p,r.isBoolean=d,r.isNull=g,r.isNullOrUndefined=function(t){return null==t},r.isNumber=m,r.isString=v,r.isSymbol=function(t){return"symbol"==typeof t},r.isUndefined=_,r.isRegExp=y,r.isObject=b,r.isDate=w,r.isError=k,r.isFunction=x,r.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},r.isBuffer=t("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.log=function(){var t,e;console.log("%s - %s",(t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":"),[t.getDate(),E[t.getMonth()],e].join(" ")),r.format.apply(r,arguments))},r.inherits=t("inherits"),r._extend=function(t,e){if(!e||!b(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":43,_process:118,inherits:42}],45:[function(t,e,r){(function(e,n){"use strict";var i=t("assert"),o=t("pako/lib/zlib/zstream"),a=t("pako/lib/zlib/deflate.js"),s=t("pako/lib/zlib/inflate.js"),u=t("pako/lib/zlib/constants");for(var l in u)r[l]=u[l];r.NONE=0,r.DEFLATE=1,r.INFLATE=2,r.GZIP=3,r.GUNZIP=4,r.DEFLATERAW=5,r.INFLATERAW=6,r.UNZIP=7;function c(t){if("number"!=typeof t||tr.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=r.UNZIP),this.mode===r.DEFLATE||this.mode===r.GZIP||this.mode===r.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==r.INFLATE&&this.mode!==r.GUNZIP&&this.mode!==r.INFLATERAW&&this.mode!==r.UNZIP||s.inflateEnd(this.strm),this.mode=r.NONE,this.dictionary=null)},c.prototype.write=function(t,e,r,n,i,o,a){return this._write(!0,t,e,r,n,i,o,a)},c.prototype.writeSync=function(t,e,r,n,i,o,a){return this._write(!1,t,e,r,n,i,o,a)},c.prototype._write=function(t,o,a,s,u,l,c,f){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==r.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===o,"must provide flush value"),this.write_in_progress=!0,o!==r.Z_NO_FLUSH&&o!==r.Z_PARTIAL_FLUSH&&o!==r.Z_SYNC_FLUSH&&o!==r.Z_FULL_FLUSH&&o!==r.Z_FINISH&&o!==r.Z_BLOCK)throw new Error("Invalid flush value");if(null==a&&(a=n.alloc(0),u=0,s=0),this.strm.avail_in=u,this.strm.input=a,this.strm.next_in=s,this.strm.avail_out=f,this.strm.output=l,this.strm.next_out=c,this.flush=o,!t)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return e.nextTick(function(){h._process(),h._after()}),this},c.prototype._afterSync=function(){var t=this.strm.avail_out,e=this.strm.avail_in;return this.write_in_progress=!1,[e,t]},c.prototype._process=function(){var t=null;switch(this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case r.UNZIP:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(31!==this.strm.input[t]){this.mode=r.INFLATE;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;139===this.strm.input[t]?(this.gzip_id_bytes_read=2,this.mode=r.GUNZIP):this.mode=r.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===r.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===r.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===r.Z_DATA_ERROR&&(this.err=r.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===r.GUNZIP&&this.err===r.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case r.Z_OK:case r.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===r.Z_FINISH)return this._error("unexpected end of file"),!1;break;case r.Z_STREAM_END:break;case r.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,e=this.strm.avail_in;this.write_in_progress=!1,this.callback(e,t),this.pending_close&&this.close()}},c.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(t,e,n,o,a){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(t>=8&&t<=15,"invalid windowBits"),i(e>=-1&&e<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===r.Z_FILTERED||o===r.Z_HUFFMAN_ONLY||o===r.Z_RLE||o===r.Z_FIXED||o===r.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(e,t,n,o,a),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(t,e,n,i,u){switch(this.level=t,this.windowBits=e,this.memLevel=n,this.strategy=i,this.flush=r.Z_NO_FLUSH,this.err=r.Z_OK,this.mode!==r.GZIP&&this.mode!==r.GUNZIP||(this.windowBits+=16),this.mode===r.UNZIP&&(this.windowBits+=32),this.mode!==r.DEFLATERAW&&this.mode!==r.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case r.DEFLATE:case r.GZIP:case r.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,r.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case r.INFLATE:case r.GUNZIP:case r.INFLATERAW:case r.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==r.Z_OK&&this._error("Init error"),this.dictionary=u,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==r.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=r.Z_OK,this.mode){case r.DEFLATE:case r.DEFLATERAW:case r.GZIP:this.err=a.deflateReset(this.strm);break;case r.INFLATE:case r.INFLATERAW:case r.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==r.Z_OK&&this._error("Failed to reset stream")},r.Zlib=c}).call(this,t("_process"),t("buffer").Buffer)},{_process:118,assert:41,buffer:48,"pako/lib/zlib/constants":52,"pako/lib/zlib/deflate.js":54,"pako/lib/zlib/inflate.js":56,"pako/lib/zlib/zstream":60}],46:[function(t,e,r){(function(e){"use strict";var n=t("buffer").Buffer,i=t("stream").Transform,o=t("./binding"),a=t("util"),s=t("assert").ok,u=t("buffer").kMaxLength,l="Cannot create final Buffer. It would be larger than 0x"+u.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var c=Object.keys(o),f=0;f=u?a=new RangeError(l):e=n.concat(i,o),i=[],t.close(),r(a,e)}t.on("error",function(e){t.removeListener("end",s),t.removeListener("readable",a),r(e)}),t.on("end",s),t.end(e),a()}function _(t,e){if("string"==typeof e&&(e=n.from(e)),!n.isBuffer(e))throw new TypeError("Not a string or buffer");var r=t._finishFlushFlag;return t._processChunk(e,r)}function y(t){if(!(this instanceof y))return new y(t);P.call(this,t,o.DEFLATE)}function b(t){if(!(this instanceof b))return new b(t);P.call(this,t,o.INFLATE)}function w(t){if(!(this instanceof w))return new w(t);P.call(this,t,o.GZIP)}function k(t){if(!(this instanceof k))return new k(t);P.call(this,t,o.GUNZIP)}function x(t){if(!(this instanceof x))return new x(t);P.call(this,t,o.DEFLATERAW)}function B(t){if(!(this instanceof B))return new B(t);P.call(this,t,o.INFLATERAW)}function C(t){if(!(this instanceof C))return new C(t);P.call(this,t,o.UNZIP)}function E(t){return t===o.Z_NO_FLUSH||t===o.Z_PARTIAL_FLUSH||t===o.Z_SYNC_FLUSH||t===o.Z_FULL_FLUSH||t===o.Z_FINISH||t===o.Z_BLOCK}function P(t,e){var a=this;if(this._opts=t=t||{},this._chunkSize=t.chunkSize||r.Z_DEFAULT_CHUNK,i.call(this,t),t.flush&&!E(t.flush))throw new Error("Invalid flush flag: "+t.flush);if(t.finishFlush&&!E(t.finishFlush))throw new Error("Invalid flush flag: "+t.finishFlush);if(this._flushFlag=t.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==t.finishFlush?t.finishFlush:o.Z_FINISH,t.chunkSize&&(t.chunkSizer.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+t.chunkSize);if(t.windowBits&&(t.windowBitsr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+t.windowBits);if(t.level&&(t.levelr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+t.level);if(t.memLevel&&(t.memLevelr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+t.memLevel);if(t.strategy&&t.strategy!=r.Z_FILTERED&&t.strategy!=r.Z_HUFFMAN_ONLY&&t.strategy!=r.Z_RLE&&t.strategy!=r.Z_FIXED&&t.strategy!=r.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+t.strategy);if(t.dictionary&&!n.isBuffer(t.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(e);var s=this;this._hadError=!1,this._handle.onerror=function(t,e){j(s),s._hadError=!0;var n=new Error(t);n.errno=e,n.code=r.codes[e],s.emit("error",n)};var u=r.Z_DEFAULT_COMPRESSION;"number"==typeof t.level&&(u=t.level);var l=r.Z_DEFAULT_STRATEGY;"number"==typeof t.strategy&&(l=t.strategy),this._handle.init(t.windowBits||r.Z_DEFAULT_WINDOWBITS,u,t.memLevel||r.Z_DEFAULT_MEMLEVEL,l,t.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=l,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!a._handle},configurable:!0,enumerable:!0})}function j(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function S(t){t.emit("close")}Object.defineProperty(r,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),r.Deflate=y,r.Inflate=b,r.Gzip=w,r.Gunzip=k,r.DeflateRaw=x,r.InflateRaw=B,r.Unzip=C,r.createDeflate=function(t){return new y(t)},r.createInflate=function(t){return new b(t)},r.createDeflateRaw=function(t){return new x(t)},r.createInflateRaw=function(t){return new B(t)},r.createGzip=function(t){return new w(t)},r.createGunzip=function(t){return new k(t)},r.createUnzip=function(t){return new C(t)},r.deflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new y(e),t,r)},r.deflateSync=function(t,e){return _(new y(e),t)},r.gzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new w(e),t,r)},r.gzipSync=function(t,e){return _(new w(e),t)},r.deflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new x(e),t,r)},r.deflateRawSync=function(t,e){return _(new x(e),t)},r.unzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new C(e),t,r)},r.unzipSync=function(t,e){return _(new C(e),t)},r.inflate=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new b(e),t,r)},r.inflateSync=function(t,e){return _(new b(e),t)},r.gunzip=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new k(e),t,r)},r.gunzipSync=function(t,e){return _(new k(e),t)},r.inflateRaw=function(t,e,r){return"function"==typeof e&&(r=e,e={}),v(new B(e),t,r)},r.inflateRawSync=function(t,e){return _(new B(e),t)},a.inherits(P,i),P.prototype.params=function(t,n,i){if(tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+t);if(n!=r.Z_FILTERED&&n!=r.Z_HUFFMAN_ONLY&&n!=r.Z_RLE&&n!=r.Z_FIXED&&n!=r.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==t||this._strategy!==n){var a=this;this.flush(o.Z_SYNC_FLUSH,function(){s(a._handle,"zlib binding closed"),a._handle.params(t,n),a._hadError||(a._level=t,a._strategy=n,i&&i())})}else e.nextTick(i)},P.prototype.reset=function(){return s(this._handle,"zlib binding closed"),this._handle.reset()},P.prototype._flush=function(t){this._transform(n.alloc(0),"",t)},P.prototype.flush=function(t,r){var i=this,a=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),a.ended?r&&e.nextTick(r):a.ending?r&&this.once("end",r):a.needDrain?r&&this.once("drain",function(){return i.flush(t,r)}):(this._flushFlag=t,this.write(n.alloc(0),"",r))},P.prototype.close=function(t){j(this,t),e.nextTick(S,this)},P.prototype._transform=function(t,e,r){var i,a=this._writableState,s=(a.ending||a.ended)&&(!t||a.length===t.length);return null===t||n.isBuffer(t)?this._handle?(s?i=this._finishFlushFlag:(i=this._flushFlag,t.length>=a.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(t,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},P.prototype._processChunk=function(t,e,r){var i=t&&t.length,o=this._chunkSize-this._offset,a=0,c=this,f="function"==typeof r;if(!f){var h,p=[],d=0;this.on("error",function(t){h=t}),s(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(e,t,a,i,this._buffer,this._offset,o)}while(!this._hadError&&_(g[0],g[1]));if(this._hadError)throw h;if(d>=u)throw j(this),new RangeError(l);var m=n.concat(p,d);return j(this),m}s(this._handle,"zlib binding closed");var v=this._handle.write(e,t,a,i,this._buffer,this._offset,o);function _(u,l){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var h=o-l;if(s(h>=0,"have should not go down"),h>0){var g=c._buffer.slice(c._offset,c._offset+h);c._offset+=h,f?c.push(g):(p.push(g),d+=g.length)}if((0===l||c._offset>=c._chunkSize)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===l){if(a+=i-u,i=u,!f)return!0;var m=c._handle.write(e,t,a,i,c._buffer,c._offset,c._chunkSize);return m.callback=_,void(m.buffer=t)}if(!f)return!1;r()}}v.buffer=t,v.callback=_},a.inherits(y,P),a.inherits(b,P),a.inherits(w,P),a.inherits(k,P),a.inherits(x,P),a.inherits(B,P),a.inherits(C,P)}).call(this,t("_process"))},{"./binding":45,_process:118,assert:41,buffer:48,stream:169,util:180}],47:[function(t,e,r){arguments[4][4][0].apply(r,arguments)},{dup:4}],48:[function(t,e,r){"use strict";var n=t("base64-js"),i=t("ieee754");r.Buffer=s,r.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},r.INSPECT_MAX_BYTES=50;var o=2147483647;function a(t){if(t>o)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=s.prototype,e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(t)}return u(t,e,r)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return U(t)?function(t,e,r){if(e<0||t.byteLength=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(z(t)||U(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return O(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(n)return O(t).length;e=(""+e).toLowerCase(),n=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var c=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function B(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return B(this,e,r);case"ascii":return E(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,r,n,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,u=Math.min(o,a),l=this.slice(n,i),c=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return b(this,t,e,r);case"base64":return w(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function E(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function A(t,e,r,n,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function M(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function R(t,e,r,n,o){return e=+e,r>>>=0,o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}s.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},s.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||T(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n)||A(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);A(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);A(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||A(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return R(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return R(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function D(t){return n.toByteArray(function(t){if((t=t.trim().replace(L,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function N(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function U(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function z(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function q(t){return t!=t}},{"base64-js":1,ieee754:61}],49:[function(t,e,r){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},i=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return r},o=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var s,u=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),s=0===l.x}catch(t){s=!1}function c(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function f(t,e,r,i){var o,a,s;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),a=t._events),s=a[e]):(a=t._events=n(null),t._eventsCount=0),s){if("function"==typeof s?s=a[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),!s.warned&&(o=c(t))&&o>0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else s=a[e]=r,++t._eventsCount;return t}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(!(r=a[t]))return!1;var l="function"==typeof r;switch(n=arguments.length){case 1:!function(t,e,r){if(e)t.call(r);else for(var n=t.length,i=m(t,n),o=0;o=0;a--)if(r[a]===e||r[a].listener===e){s=r[a].listener,o=a;break}if(o<0)return this;0===o?r.shift():function(t,e){for(var r=e,n=r+1,i=t.length;n=0;o--)this.removeListener(t,e[o]);return this},a.prototype.listeners=function(t){return d(this,t,!0)},a.prototype.rawListeners=function(t){return d(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],50:[function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},r.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var o=0;o>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+e[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],52:[function(t,e,r){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],53:[function(t,e,r){"use strict";var n=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}();e.exports=function(t,e,r,i){var o=n,a=i+r;t^=-1;for(var s=i;s>>8^o[255&(t^e[s])];return-1^t}},{}],54:[function(t,e,r){"use strict";var n,i=t("../utils/common"),o=t("./trees"),a=t("./adler32"),s=t("./crc32"),u=t("./messages"),l=0,c=1,f=3,h=4,p=5,d=0,g=1,m=-2,v=-3,_=-5,y=-1,b=1,w=2,k=3,x=4,B=0,C=2,E=8,P=9,j=15,S=8,T=286,A=30,M=19,I=2*T+1,R=15,L=3,F=258,O=F+L+1,D=32,N=42,U=69,z=73,q=91,V=103,H=113,G=666,W=1,Z=2,Y=3,X=4,$=3;function J(t,e){return t.msg=u[e],e}function K(t){return(t<<1)-(t>4?9:0)}function Q(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var r,n,i=t.max_chain_length,o=t.strstart,a=t.prev_length,s=t.nice_match,u=t.strstart>t.w_size-O?t.strstart-(t.w_size-O):0,l=t.window,c=t.w_mask,f=t.prev,h=t.strstart+F,p=l[o+a-1],d=l[o+a];t.prev_length>=t.good_match&&(i>>=2),s>t.lookahead&&(s=t.lookahead);do{if(l[(r=e)+a]===d&&l[r+a-1]===p&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(t.match_start=e,a=n,n>=s)break;p=l[o+a-1],d=l[o+a]}}}while((e=f[e&c])>u&&0!=--i);return a<=t.lookahead?a:t.lookahead}function ot(t){var e,r,n,o,u,l,c,f,h,p,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-O)){i.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--r);e=r=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--r);o+=d}if(0===t.strm.avail_in)break;if(l=t.strm,c=t.window,f=t.strstart+t.lookahead,h=o,p=void 0,(p=l.avail_in)>h&&(p=h),r=0===p?0:(l.avail_in-=p,i.arraySet(c,l.input,l.next_in,p,f),1===l.state.wrap?l.adler=a(l.adler,c,p,f):2===l.state.wrap&&(l.adler=s(l.adler,c,p,f)),l.next_in+=p,l.total_in+=p,p),t.lookahead+=r,t.lookahead+t.insert>=L)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=L&&(t.ins_h=(t.ins_h<=L)if(n=o._tr_tally(t,t.strstart-t.match_start,t.match_length-L),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=L){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=L&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=L-1)),t.prev_length>=L&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-L,n=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-L),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=(t.ins_h<15&&(s=2,n-=16),o<1||o>P||r!==E||n<8||n>15||e<0||e>9||a<0||a>x)return J(t,m);8===n&&(n=9);var u=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=E,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*I),this.dyn_dtree=new i.Buf16(2*(2*A+1)),this.bl_tree=new i.Buf16(2*(2*M+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(R+1),this.heap=new i.Buf16(2*T+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*T+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=u,u.strm=t,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===l)return W;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,et(t,!1),0===t.strm.avail_out))return W;if(t.strstart-t.block_start>=t.w_size-O&&(et(t,!1),0===t.strm.avail_out))return W}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?Y:X):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),W)}),new ut(4,4,8,4,at),new ut(4,5,16,8,at),new ut(4,6,32,32,at),new ut(4,4,16,16,st),new ut(8,16,32,32,st),new ut(8,16,128,128,st),new ut(8,32,128,256,st),new ut(32,128,258,1024,st),new ut(32,258,258,4096,st)],r.deflateInit=function(t,e){return ft(t,e,E,j,S,B)},r.deflateInit2=ft,r.deflateReset=ct,r.deflateResetKeep=lt,r.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?m:(t.state.gzhead=e,d):m},r.deflate=function(t,e){var r,i,a,u;if(!t||!t.state||e>p||e<0)return t?J(t,m):m;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===G&&e!==h)return J(t,0===t.avail_out?_:m);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===N)if(2===i.wrap)t.adler=0,rt(i,31),rt(i,139),rt(i,8),i.gzhead?(rt(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),rt(i,255&i.gzhead.time),rt(i,i.gzhead.time>>8&255),rt(i,i.gzhead.time>>16&255),rt(i,i.gzhead.time>>24&255),rt(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),rt(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(rt(i,255&i.gzhead.extra.length),rt(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=s(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=U):(rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,0),rt(i,9===i.level?2:i.strategy>=w||i.level<2?4:0),rt(i,$),i.status=H);else{var v=E+(i.w_bits-8<<4)<<8;v|=(i.strategy>=w||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(v|=D),v+=31-v%31,i.status=H,nt(i,v),0!==i.strstart&&(nt(i,t.adler>>>16),nt(i,65535&t.adler)),t.adler=1}if(i.status===U)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending!==i.pending_buf_size));)rt(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=z)}else i.status=z;if(i.status===z)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=q)}else i.status=q;if(i.status===q)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),tt(t),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexa&&(t.adler=s(t.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=V)}else i.status=V;if(i.status===V&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&tt(t),i.pending+2<=i.pending_buf_size&&(rt(i,255&t.adler),rt(i,t.adler>>8&255),t.adler=0,i.status=H)):i.status=H),0!==i.pending){if(tt(t),0===t.avail_out)return i.last_flush=-1,d}else if(0===t.avail_in&&K(e)<=K(r)&&e!==h)return J(t,_);if(i.status===G&&0!==t.avail_in)return J(t,_);if(0!==t.avail_in||0!==i.lookahead||e!==l&&i.status!==G){var y=i.strategy===w?function(t,e){for(var r;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===l)return W;break}if(t.match_length=0,r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(et(t,!1),0===t.strm.avail_out))return W}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?Y:X):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?W:Z}(i,e):i.strategy===k?function(t,e){for(var r,n,i,a,s=t.window;;){if(t.lookahead<=F){if(ot(t),t.lookahead<=F&&e===l)return W;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=L&&t.strstart>0&&(n=s[i=t.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=t.strstart+F;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&it.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=L?(r=o._tr_tally(t,1,t.match_length-L),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(et(t,!1),0===t.strm.avail_out))return W}return t.insert=0,e===h?(et(t,!0),0===t.strm.avail_out?Y:X):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?W:Z}(i,e):n[i.level].func(i,e);if(y!==Y&&y!==X||(i.status=G),y===W||y===Y)return 0===t.avail_out&&(i.last_flush=-1),d;if(y===Z&&(e===c?o._tr_align(i):e!==p&&(o._tr_stored_block(i,0,0,!1),e===f&&(Q(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),tt(t),0===t.avail_out))return i.last_flush=-1,d}return e!==h?d:i.wrap<=0?g:(2===i.wrap?(rt(i,255&t.adler),rt(i,t.adler>>8&255),rt(i,t.adler>>16&255),rt(i,t.adler>>24&255),rt(i,255&t.total_in),rt(i,t.total_in>>8&255),rt(i,t.total_in>>16&255),rt(i,t.total_in>>24&255)):(nt(i,t.adler>>>16),nt(i,65535&t.adler)),tt(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:g)},r.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==N&&e!==U&&e!==z&&e!==q&&e!==V&&e!==H&&e!==G?J(t,m):(t.state=null,e===H?J(t,v):d):m},r.deflateSetDictionary=function(t,e){var r,n,o,s,u,l,c,f,h=e.length;if(!t||!t.state)return m;if(2===(s=(r=t.state).wrap)||1===s&&r.status!==N||r.lookahead)return m;for(1===s&&(t.adler=a(t.adler,e,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(Q(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new i.Buf8(r.w_size),i.arraySet(f,e,h-r.w_size,r.w_size,0),e=f,h=r.w_size),u=t.avail_in,l=t.next_in,c=t.input,t.avail_in=h,t.next_in=0,t.input=e,ot(r);r.lookahead>=L;){n=r.strstart,o=r.lookahead-(L-1);do{r.ins_h=(r.ins_h<>>=b=y>>>24,d-=b,0===(b=y>>>16&255))E[o++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=g[(65535&y)+(p&(1<>>=b,d-=b),d<15&&(p+=C[n++]<>>=b=y>>>24,d-=b,!(16&(b=y>>>16&255))){if(0==(64&b)){y=m[(65535&y)+(p&(1<u){t.msg="invalid distance too far back",r.mode=30;break t}if(p>>>=b,d-=b,k>(b=o-a)){if((b=k-b)>c&&r.sane){t.msg="invalid distance too far back",r.mode=30;break t}if(x=0,B=h,0===f){if(x+=l-b,b2;)E[o++]=B[x++],E[o++]=B[x++],E[o++]=B[x++],w-=3;w&&(E[o++]=B[x++],w>1&&(E[o++]=B[x++]))}else{x=o-k;do{E[o++]=E[x++],E[o++]=E[x++],E[o++]=E[x++],w-=3}while(w>2);w&&(E[o++]=E[x++],w>1&&(E[o++]=E[x++]))}break}}break}}while(n>3,p&=(1<<(d-=w<<3))-1,t.next_in=n,t.next_out=o,t.avail_in=n>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function it(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=k,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new n.Buf32(tt),e.distcode=e.distdyn=new n.Buf32(et),e.sane=1,e.back=-1,d):v}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,it(t)):v}function at(t,e){var r,n;return t&&t.state?(n=t.state,e<0?(r=0,e=-e):(r=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?v:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,ot(t))):v}function st(t,e){var r,i;return t?(i=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=i,i.window=null,(r=at(t,e))!==d&&(t.state=null),r):v}var ut,lt,ct=!0;function ft(t){if(ct){var e;for(ut=new n.Buf32(512),lt=new n.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(s(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;s(c,t.lens,0,32,lt,0,t.work,{bits:5}),ct=!1}t.lencode=ut,t.lenbits=9,t.distcode=lt,t.distbits=5}function ht(t,e,r,i){var o,a=t.state;return null===a.window&&(a.wsize=1<=a.wsize?(n.arraySet(a.window,e,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,e,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,e,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave>>8&255,r.check=o(r.check,Pt,2,0),st=0,ut=0,r.mode=x;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&st)<<8)+(st>>8))%31){t.msg="incorrect header check",r.mode=J;break}if((15&st)!==w){t.msg="unknown compression method",r.mode=J;break}if(ut-=4,kt=8+(15&(st>>>=4)),0===r.wbits)r.wbits=kt;else if(kt>r.wbits){t.msg="invalid window size",r.mode=J;break}r.dmax=1<>8&1),512&r.flags&&(Pt[0]=255&st,Pt[1]=st>>>8&255,r.check=o(r.check,Pt,2,0)),st=0,ut=0,r.mode=B;case B:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,Pt[2]=st>>>16&255,Pt[3]=st>>>24&255,r.check=o(r.check,Pt,4,0)),st=0,ut=0,r.mode=C;case C:for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>8),512&r.flags&&(Pt[0]=255&st,Pt[1]=st>>>8&255,r.check=o(r.check,Pt,2,0)),st=0,ut=0,r.mode=E;case E:if(1024&r.flags){for(;ut<16;){if(0===ot)break t;ot--,st+=tt[rt++]<>>8&255,r.check=o(r.check,Pt,2,0)),st=0,ut=0}else r.head&&(r.head.extra=null);r.mode=P;case P:if(1024&r.flags&&((pt=r.length)>ot&&(pt=ot),pt&&(r.head&&(kt=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,tt,rt,pt,kt)),512&r.flags&&(r.check=o(r.check,tt,pt,rt)),ot-=pt,rt+=pt,r.length-=pt),r.length))break t;r.length=0,r.mode=j;case j:if(2048&r.flags){if(0===ot)break t;pt=0;do{kt=tt[rt+pt++],r.head&&kt&&r.length<65536&&(r.head.name+=String.fromCharCode(kt))}while(kt&&pt>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=I;break;case A:for(;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=7&ut,ut-=7&ut,r.mode=Y;break}for(;ut<3;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=1)){case 0:r.mode=L;break;case 1:if(ft(r),r.mode=z,e===p){st>>>=2,ut-=2;break t}break;case 2:r.mode=D;break;case 3:t.msg="invalid block type",r.mode=J}st>>>=2,ut-=2;break;case L:for(st>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,st+=tt[rt++]<>>16^65535)){t.msg="invalid stored block lengths",r.mode=J;break}if(r.length=65535&st,st=0,ut=0,r.mode=F,e===p)break t;case F:r.mode=O;case O:if(pt=r.length){if(pt>ot&&(pt=ot),pt>at&&(pt=at),0===pt)break t;n.arraySet(et,tt,rt,pt,it),ot-=pt,rt+=pt,at-=pt,it+=pt,r.length-=pt;break}r.mode=I;break;case D:for(;ut<14;){if(0===ot)break t;ot--,st+=tt[rt++]<>>=5,ut-=5,r.ndist=1+(31&st),st>>>=5,ut-=5,r.ncode=4+(15&st),st>>>=4,ut-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=J;break}r.have=0,r.mode=N;case N:for(;r.have>>=3,ut-=3}for(;r.have<19;)r.lens[jt[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Bt={bits:r.lenbits},xt=s(u,r.lens,0,19,r.lencode,0,r.work,Bt),r.lenbits=Bt.bits,xt){t.msg="invalid code lengths set",r.mode=J;break}r.have=0,r.mode=U;case U:for(;r.have>>16&255,_t=65535&Et,!((mt=Et>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=mt,ut-=mt,r.lens[r.have++]=_t;else{if(16===_t){for(Ct=mt+2;ut>>=mt,ut-=mt,0===r.have){t.msg="invalid bit length repeat",r.mode=J;break}kt=r.lens[r.have-1],pt=3+(3&st),st>>>=2,ut-=2}else if(17===_t){for(Ct=mt+3;ut>>=mt)),st>>>=3,ut-=3}else{for(Ct=mt+7;ut>>=mt)),st>>>=7,ut-=7}if(r.have+pt>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=J;break}for(;pt--;)r.lens[r.have++]=kt}}if(r.mode===J)break;if(0===r.lens[256]){t.msg="invalid code -- missing end-of-block",r.mode=J;break}if(r.lenbits=9,Bt={bits:r.lenbits},xt=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,Bt),r.lenbits=Bt.bits,xt){t.msg="invalid literal/lengths set",r.mode=J;break}if(r.distbits=6,r.distcode=r.distdyn,Bt={bits:r.distbits},xt=s(c,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Bt),r.distbits=Bt.bits,xt){t.msg="invalid distances set",r.mode=J;break}if(r.mode=z,e===p)break t;case z:r.mode=q;case q:if(ot>=6&&at>=258){t.next_out=it,t.avail_out=at,t.next_in=rt,t.avail_in=ot,r.hold=st,r.bits=ut,a(t,ct),it=t.next_out,et=t.output,at=t.avail_out,rt=t.next_in,tt=t.input,ot=t.avail_in,st=r.hold,ut=r.bits,r.mode===I&&(r.back=-1);break}for(r.back=0;vt=(Et=r.lencode[st&(1<>>16&255,_t=65535&Et,!((mt=Et>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&Et,!(yt+(mt=Et>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,ut-=yt,r.back+=yt}if(st>>>=mt,ut-=mt,r.back+=mt,r.length=_t,0===vt){r.mode=Z;break}if(32&vt){r.back=-1,r.mode=I;break}if(64&vt){t.msg="invalid literal/length code",r.mode=J;break}r.extra=15&vt,r.mode=V;case V:if(r.extra){for(Ct=r.extra;ut>>=r.extra,ut-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=H;case H:for(;vt=(Et=r.distcode[st&(1<>>16&255,_t=65535&Et,!((mt=Et>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>yt)])>>>16&255,_t=65535&Et,!(yt+(mt=Et>>>24)<=ut);){if(0===ot)break t;ot--,st+=tt[rt++]<>>=yt,ut-=yt,r.back+=yt}if(st>>>=mt,ut-=mt,r.back+=mt,64&vt){t.msg="invalid distance code",r.mode=J;break}r.offset=_t,r.extra=15&vt,r.mode=G;case G:if(r.extra){for(Ct=r.extra;ut>>=r.extra,ut-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=J;break}r.mode=W;case W:if(0===at)break t;if(pt=ct-at,r.offset>pt){if((pt=r.offset-pt)>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=J;break}pt>r.wnext?(pt-=r.wnext,dt=r.wsize-pt):dt=r.wnext-pt,pt>r.length&&(pt=r.length),gt=r.window}else gt=et,dt=it-r.offset,pt=r.length;pt>at&&(pt=at),at-=pt,r.length-=pt;do{et[it++]=gt[dt++]}while(--pt);0===r.length&&(r.mode=q);break;case Z:if(0===at)break t;et[it++]=r.length,at--,r.mode=q;break;case Y:if(r.wrap){for(;ut<32;){if(0===ot)break t;ot--,st|=tt[rt++]<=1&&0===L[E];E--);if(P>E&&(P=E),0===E)return l[c++]=20971520,l[c++]=20971520,h.bits=1,0;for(C=1;C0&&(0===t||1!==E))return-1;for(F[1]=0,x=1;x<15;x++)F[x+1]=F[x]+L[x];for(B=0;B852||2===t&&A>592)return 1;for(;;){y=x-S,f[B]<_?(b=0,w=f[B]):f[B]>_?(b=O[D+f[B]],w=I[R+f[B]]):(b=96,w=0),p=1<>S)+(d-=p)]=y<<24|b<<16|w|0}while(0!==d);for(p=1<>=1;if(0!==p?(M&=p-1,M+=p):M=0,B++,0==--L[x]){if(x===E)break;x=e[r+f[B]]}if(x>P&&(M&m)!==g){for(0===S&&(S=P),v+=C,T=1<<(j=x-S);j+S852||2===t&&A>592)return 1;l[g=M&m]=P<<24|j<<16|v-c|0}}return 0!==M&&(l[v+M]=x-S<<24|64<<16|0),h.bits=P,0}},{"../utils/common":50}],58:[function(t,e,r){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],59:[function(t,e,r){"use strict";var n=t("../utils/common"),i=4,o=0,a=1,s=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var l=0,c=1,f=2,h=29,p=256,d=p+1+h,g=30,m=19,v=2*d+1,_=15,y=16,b=7,w=256,k=16,x=17,B=18,C=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S=new Array(2*(d+2));u(S);var T=new Array(2*g);u(T);var A=new Array(512);u(A);var M=new Array(256);u(M);var I=new Array(h);u(I);var R,L,F,O=new Array(g);function D(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function N(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function U(t){return t<256?A[t]:A[256+(t>>>7)]}function z(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function q(t,e,r){t.bi_valid>y-r?(t.bi_buf|=e<>y-t.bi_valid,t.bi_valid+=r-y):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1}function G(t,e,r){var n,i,o=new Array(_+1),a=0;for(n=1;n<=_;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=e;i++){var s=t[2*i+1];0!==s&&(t[2*i]=H(o[s]++,s))}}function W(t){var e;for(e=0;e8?z(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Y(t,e,r,n){var i=2*e,o=2*r;return t[i]>1;r>=1;r--)X(t,o,r);i=u;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],X(t,o,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,o[2*i]=o[2*r]+o[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,o[2*r+1]=o[2*n+1]=i,t.heap[1]=i++,X(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,o,a,s,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,f=e.stat_desc.has_stree,h=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,d=e.stat_desc.max_length,g=0;for(o=0;o<=_;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rd&&(o=d,g++),u[2*n+1]=o,n>l||(t.bl_count[o]++,a=0,n>=p&&(a=h[n-p]),s=u[2*n],t.opt_len+=s*(o+a),f&&(t.static_len+=s*(c[2*n+1]+a)));if(0!==g){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,g-=2}while(g>0);for(o=d;0!==o;o--)for(n=t.bl_count[o];0!==n;)(i=t.heap[--r])>l||(u[2*i+1]!==o&&(t.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),n--)}}(t,e),G(o,l,t.bl_count)}function K(t,e,r){var n,i,o=-1,a=e[1],s=0,u=7,l=4;for(0===a&&(u=138,l=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=e[2*(n+1)+1],++s>=7;n0?(t.strm.data_type===s&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return a;for(e=32;e=3&&0===t.bl_tree[2*j[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=r+5,r+4<=u&&-1!==e?et(t,e,r,n):t.strategy===i||l===u?(q(t,(c<<1)+(n?1:0),3),$(t,S,T)):(q(t,(f<<1)+(n?1:0),3),function(t,e,r,n){var i;for(q(t,e-257,5),q(t,r-1,5),q(t,n-4,4),i=0;i>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&r,t.last_lit++,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(M[r]+p+1)]++,t.dyn_dtree[2*U(e)]++),t.last_lit===t.lit_bufsize-1},r._tr_align=function(t){q(t,c<<1,3),V(t,w,S),function(t){16===t.bi_valid?(z(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},{"../utils/common":50}],60:[function(t,e,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],61:[function(t,e,r){r.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;c>0;o=256*o+t[e+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+t[e+f],f+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=l}return(p?-1:1)*a*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<0;t[r+p]=255&a,p+=d,a/=256,l-=8);t[r+p-d]|=128*g}},{}],62:[function(t,e,r){e.exports=[function(t,e){return{options:t,draw:function(e,r,n){n.stop(!0),n.overrideFlag=!0;var i=this;return e.pixelManipulation({output:function(t,e,r){i.output={src:e,format:r}},changePixel:function(t,e,r,n){return[255-t,255-e,255-r,n]},format:e.format,image:t.image,inBrowser:t.inBrowser,callback:r})},output:void 0,UI:e}},{name:"Invert",description:"Inverts the image.",inputs:{}}]},{}],63:[function(t,e,r){"use strict";var n=t("underscore"),i=e.exports={Bitmap:t("./lib/bitmap")};n.extend(i,t("./lib/enums"))},{"./lib/bitmap":64,"./lib/enums":65,underscore:175}],64:[function(t,e,r){(function(r){"use strict";var n=t("fs"),i=(t("underscore"),t("bluebird")),o=t("jpeg-js"),a=t("node-png").PNG,s=t("./enums"),u=t("./utils"),l=t("./resize"),c={r:0,g:0,b:0,a:0},f=e.exports=function(t){t&&(t instanceof f?this._data={data:new r(t.data.data),width:t.width,height:t.height}:t.data?this._data=t:t.width&&t.height&&(this._data={data:new r(4*t.width*t.height),width:t.width,height:t.height},t.color&&this._fill(t.color)))};f.prototype={get width(){return this._data.width},get height(){return this._data.height},attach:function(t){var e=this._data;return this._data=t,e},detach:function(){var t=this._data;return delete this._data,t},_deduceFileType:function(t){if(!t)throw new Error("Can't determine image type");switch(t.substr(-4).toLowerCase()){case".jpg":return s.ImageType.JPG;case".png":return s.ImageType.PNG}if(".jpeg"==t.substr(-5).toLowerCase())return s.ImageType.JPG;throw new Error("Can't recognise image type: "+t)},_readStream:function(t){var e=i.defer(),n=[];return t.on("data",function(t){n.push(t)}),t.on("end",function(){var t=r.concat(n);e.resolve(t)}),t.on("error",function(t){e.reject(t)}),e.promise},_readPNG:function(t){var e=i.defer(),r=new a({filterType:4});return r.on("parsed",function(){e.resolve(r)}),r.on("error",function(t){e.rejecyt(t)}),t.pipe(r),e.promise},_parseOptions:function(t,e){return"number"==typeof(t=t||{})&&(t={type:t}),t.type=t.type||this._deduceFileType(e),t},read:function(t,e){var r=this;switch((e=this._parseOptions(e)).type){case s.ImageType.JPG:return this._readStream(t).then(function(t){r._data=o.decode(t)});case s.ImageType.PNG:return this._readPNG(t).then(function(t){r._data={data:t.data,width:t.width,height:t.height}});default:return i.reject(new Error("Not supported: ImageType "+e.type))}},readFile:function(t,e){var r=this;return u.fs.exists(t).then(function(i){if(i){e=r._parseOptions(e,t);var o=n.createReadStream(t);return r.read(o,e)}throw new Error("File Not Found: "+t)})},write:function(t,e){e=this._parseOptions(e);var r=i.defer();try{switch(t.on("finish",function(){r.resolve()}),t.on("error",function(t){r.reject(t)}),e.type){case s.ImageType.JPG:var n=o.encode(this._data,e.quality||90).data;t.write(n),t.end();break;case s.ImageType.PNG:var u=new a;u.width=this.width,u.height=this.height,u.data=this._data.data,u.on("end",function(){r.resolve()}),u.on("error",function(t){r.reject(t)}),u.pack().pipe(t);break;default:throw new Error("Not supported: ImageType "+e.type)}}catch(t){r.reject(t)}return r.promise},writeFile:function(t,e){e=this._parseOptions(e,t);var r=n.createWriteStream(t);return this.write(r,e)},clone:function(){return new f({width:this.width,height:this.height,data:new r(this._data.data)})},setPixel:function(t,e,r,n,i,o){if(void 0===n){var a=r;r=a.r,n=a.g,i=a.b,o=a.a}void 0===o&&(o=255);var s=4*(e*this.width+t),u=this._data.data;u[s++]=r,u[s++]=n,u[s++]=i,u[s++]=o},getPixel:function(t,e,r){var n=4*(e*this.width+t);r=r||{};var i=this._data.data;return r.r=i[n++],r.g=i[n++],r.b=i[n++],r.a=i[n++],r},negative:function(){for(var t=new f({width:this.width,height:this.height}),e=this.width*this.height,r=this._data.data,n=t._data.data,i=0,o=0,a=0;a-1&&S-1&&T=0&&T>=0?w[F]:O)+D*(m=S=0?w[F+4]:O),z=(1-D)*(v=S>=0&&T0?a:0)-(c>0?4:0)]+2*s[p-(l>0?a:0)]+1*s[p-(l>0?a:0)+(c0?4:0)]+4*s[p]+2*s[p+(c0?4:0)]+2*s[p+(l0?o[k-4]:2*o[k]-o[k+4],B=o[k],C=o[k+4],E=z0?g[k-4*h]:2*g[k]-g[k+4*h],T=g[k],A=g[k+4*h],M=N1)for(m=0;m0&&!t[a-1];)a--;o.push({children:[],index:0});var s,u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;i++}r+10)return p>>--d&1;if(255==(p=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(p<<8|t).toString(16)}return d=7,p>>>7}function m(t){for(var e,r=t;null!==(e=g());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(t){for(var e=0;t>0;){var r=g();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=v(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=m(e.huffmanTableAC),u=15&o,c=o>>4;if(0!==u)r[t[n+=c]]=_(u)*(1<>4,0===f)o<15?(y=v(o)+(1<>4;if(0!==s)r[t[o+=u]]=_(s),o++;else{if(u<15)break;o+=16}}};var A,M,I,R,L=0;for(M=1==T?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=M);L=65488&&A<=65495))break;r+=2}return r-h}function h(t,l){var c,f,h=[],p=l.blocksPerLine,d=l.blocksPerColumn,g=p<<3,m=new Int32Array(64),v=new Uint8Array(64);function _(t,c,f){var h,p,d,g,m,v,_,y,b,w,k=l.quantizationTable,x=f;for(w=0;w<64;w++)x[w]=t[w]*k[w];for(w=0;w<8;++w){var B=8*w;0!=x[1+B]||0!=x[2+B]||0!=x[3+B]||0!=x[4+B]||0!=x[5+B]||0!=x[6+B]||0!=x[7+B]?(h=s*x[0+B]+128>>8,p=s*x[4+B]+128>>8,d=x[2+B],g=x[6+B],m=u*(x[1+B]-x[7+B])+128>>8,y=u*(x[1+B]+x[7+B])+128>>8,v=x[3+B]<<4,_=x[5+B]<<4,b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+g*o+128>>8,d=d*o-g*a+128>>8,g=b,b=m-_+1>>1,m=m+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=b,b=h-g+1>>1,h=h+g+1>>1,g=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=m*i+y*n+2048>>12,m=m*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,x[0+B]=h+y,x[7+B]=h-y,x[1+B]=p+_,x[6+B]=p-_,x[2+B]=d+v,x[5+B]=d-v,x[3+B]=g+m,x[4+B]=g-m):(b=s*x[0+B]+512>>10,x[0+B]=b,x[1+B]=b,x[2+B]=b,x[3+B]=b,x[4+B]=b,x[5+B]=b,x[6+B]=b,x[7+B]=b)}for(w=0;w<8;++w){var C=w;0!=x[8+C]||0!=x[16+C]||0!=x[24+C]||0!=x[32+C]||0!=x[40+C]||0!=x[48+C]||0!=x[56+C]?(h=s*x[0+C]+2048>>12,p=s*x[32+C]+2048>>12,d=x[16+C],g=x[48+C],m=u*(x[8+C]-x[56+C])+2048>>12,y=u*(x[8+C]+x[56+C])+2048>>12,v=x[24+C],_=x[40+C],b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+g*o+2048>>12,d=d*o-g*a+2048>>12,g=b,b=m-_+1>>1,m=m+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=b,b=h-g+1>>1,h=h+g+1>>1,g=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=m*i+y*n+2048>>12,m=m*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,x[0+C]=h+y,x[56+C]=h-y,x[8+C]=p+_,x[48+C]=p-_,x[16+C]=d+v,x[40+C]=d-v,x[24+C]=g+m,x[32+C]=g-m):(b=s*f[w+0]+8192>>14,x[0+C]=b,x[8+C]=b,x[16+C]=b,x[24+C]=b,x[32+C]=b,x[40+C]=b,x[48+C]=b,x[56+C]=b)}for(w=0;w<64;++w){var E=128+(x[w]+8>>4);c[w]=E<0?0:E>255?255:E}}for(var y=0;y255?255:t}return l.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(z=0;z<64;z++){w[t[z]]=e[r++]}else{if(b>>4!=1)throw"DQT: invalid table spec";for(z=0;z<64;z++){w[t[z]]=n()}}p[15&b]=w}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===v,a.progressive=65474===v,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var k,x=e[r++];for(N=0;N>4,C=15&e[r+1],E=e[r+2];a.componentsOrder.push(k),a.components[k]={h:B,v:C,quantizationIdx:E},r+=3}o(a),d.push(a);break;case 65476:var P=n();for(N=2;N>4==0?m:g)[15&j]=c(S,A)}break;case 65501:n(),s=n();break;case 65498:n();var M=e[r++],I=[];for(N=0;N>4],q.huffmanTableAC=g[15&R],I.push(q)}var L=e[r++],F=e[r++],O=e[r++],D=f(e,r,a,I,s,L,F,O>>4,15&O);r+=D;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+v.toString(16)}v=n()}if(1!=d.length)throw"only single frame JPEGs supported";for(var N=0;N=0;)e&1<>8&255),L(255&t)}function O(t,e,r,n,i){var o,a=i[0],s=i[240];for(var u=function(t,e){var r,n,i,o,a,s,u,l,c,f,h=0;for(c=0;c<8;++c){r=t[h],n=t[h+1],i=t[h+2],o=t[h+3],a=t[h+4],s=t[h+5],u=t[h+6];var p=r+(l=t[h+7]),g=r-l,m=n+u,v=n-u,_=i+s,y=i-s,b=o+a,w=o-a,k=p+b,x=p-b,B=m+_,C=m-_;t[h]=k+B,t[h+4]=k-B;var E=.707106781*(C+x);t[h+2]=x+E,t[h+6]=x-E;var P=.382683433*((k=w+y)-(C=v+g)),j=.5411961*k+P,S=1.306562965*C+P,T=.707106781*(B=y+v),A=g+T,M=g-T;t[h+5]=M+j,t[h+3]=M-j,t[h+1]=A+S,t[h+7]=A-S,h+=8}for(h=0,c=0;c<8;++c){r=t[h],n=t[h+8],i=t[h+16],o=t[h+24],a=t[h+32],s=t[h+40],u=t[h+48];var I=r+(l=t[h+56]),R=r-l,L=n+u,F=n-u,O=i+s,D=i-s,N=o+a,U=o-a,z=I+N,q=I-N,V=L+O,H=L-O;t[h]=z+V,t[h+32]=z-V;var G=.707106781*(H+q);t[h+16]=q+G,t[h+48]=q-G;var W=.382683433*((z=U+D)-(H=F+R)),Z=.5411961*z+W,Y=1.306562965*H+W,X=.707106781*(V=D+F),$=R+X,J=R-X;t[h+40]=J+Z,t[h+24]=J-Z,t[h+8]=$+Y,t[h+56]=$-Y,h++}for(c=0;c<64;++c)f=t[c]*e[c],d[c]=f>0?f+.5|0:f-.5|0;return d}(t,e),l=0;l<64;++l)g[B[l]]=u[l];var c=g[0]-r;r=g[0],0==c?R(n[0]):(R(n[p[o=32767+c]]),R(h[o]));for(var f=63;f>0&&0==g[f];f--);if(0==f)return R(a),r;for(var m,v=1;v<=f;){for(var _=v;0==g[v]&&v<=f;++v);var y=v-_;if(y>=16){m=y>>4;for(var b=1;b<=m;++b)R(s);y&=15}o=32767+g[v],R(i[(y<<4)+p[o]]),R(h[o]),v++}return 63!=f&&R(a),r}function D(t){if(t<=0&&(t=1),t>100&&(t=100),a!=t){(function(t){for(var e=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var n=s((e[r]*t+50)/100);n<1?n=1:n>255&&(n=255),u[B[r]]=n}for(var i=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],o=0;o<64;o++){var a=s((i[o]*t+50)/100);a<1?a=1:a>255&&(a=255),l[B[o]]=a}for(var h=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],p=0,d=0;d<8;d++)for(var g=0;g<8;g++)c[p]=1/(u[B[p]]*h[d]*h[g]*8),f[p]=1/(l[B[p]]*h[d]*h[g]*8),p++})(t<50?Math.floor(5e3/t):Math.floor(200-2*t)),a=t}}this.encode=function(e,a){(new Date).getTime();a&&D(a),m=new Array,v=0,_=7,F(65496),F(65504),F(16),L(74),L(70),L(73),L(70),L(0),L(1),L(1),L(0),F(1),F(1),L(0),L(0),function(){F(65499),F(132),L(0);for(var t=0;t<64;t++)L(u[t]);L(1);for(var e=0;e<64;e++)L(l[e])}(),function(t,e){F(65472),F(17),L(8),F(e),F(t),L(3),L(1),L(17),L(0),L(2),L(17),L(1),L(3),L(17),L(1)}(e.width,e.height),function(){F(65476),F(418),L(0);for(var t=0;t<16;t++)L(C[t+1]);for(var e=0;e<=11;e++)L(E[e]);L(16);for(var r=0;r<16;r++)L(P[r+1]);for(var n=0;n<=161;n++)L(j[n]);L(1);for(var i=0;i<16;i++)L(S[i+1]);for(var o=0;o<=11;o++)L(T[o]);L(17);for(var a=0;a<16;a++)L(A[a+1]);for(var s=0;s<=161;s++)L(M[s])}(),F(65498),F(12),L(3),L(1),L(0),L(2),L(17),L(3),L(17),L(0),L(63),L(0);var s=0,h=0,p=0;v=0,_=7,this.encode.displayName="_encode_";for(var d,g,k,B,I,N,U,z,q,V=e.data,H=e.width,G=e.height,W=4*H,Z=0;Z>3)*W+(U=4*(7&q)),Z+z>=G&&(N-=W*(Z+1+z-G)),d+U>=W&&(N-=d+U-W+4),g=V[N++],k=V[N++],B=V[N++],y[q]=(x[g]+x[k+256>>0]+x[B+512>>0]>>16)-128,b[q]=(x[g+768>>0]+x[k+1024>>0]+x[B+1280>>0]>>16)-128,w[q]=(x[g+1280>>0]+x[k+1536>>0]+x[B+1792>>0]>>16)-128;s=O(y,c,s,r,i),h=O(b,f,h,n,o),p=O(w,f,p,n,o),d+=32}Z+=8}if(_>=0){var Y=[];Y[1]=_+1,Y[0]=(1<<_+1)-1,R(Y)}return F(65497),new t(m)},function(){(new Date).getTime();e||(e=50),function(){for(var t=String.fromCharCode,e=0;e<256;e++)k[e]=t(e)}(),r=I(C,E),n=I(S,T),i=I(P,j),o=I(A,M),function(){for(var t=1,e=2,r=1;r<=15;r++){for(var n=t;n>0]=38470*t,x[t+512>>0]=7471*t+32768,x[t+768>>0]=-11059*t,x[t+1024>>0]=-21709*t,x[t+1280>>0]=32768*t+8421375,x[t+1536>>0]=-27439*t,x[t+1792>>0]=-5329*t}(),D(e),(new Date).getTime()}()}e.exports=function(t,e){void 0===e&&(e=50);return{data:new r(e).encode(t,e),width:t.width,height:t.height}}}).call(this,t("buffer").Buffer)},{buffer:48}],71:[function(t,e,r){arguments[4][42][0].apply(r,arguments)},{dup:42}],72:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r=this.width||e<0||e>=this.height)&&!!this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r?1:0},t.prototype.setRegion=function(t,e,r,n,i){for(var o=e;o=this.size&&(i=(i^this.primitive)&this.size-1);for(o=0;o1&&0===e[0]){for(var n=1;ni.length&&(r=(o=[i,r])[0],i=o[1]);for(var o,a=new Uint8ClampedArray(i.length),s=i.length-r.length,u=0;ur?r:t}var s=function(){function t(t,e){this.width=t,this.data=new Uint8ClampedArray(t*e)}return t.prototype.get=function(t,e){return this.data[e*this.width+t]},t.prototype.set=function(t,e,r){this.data[e*this.width+t]=r},t}();e.binarize=function(t,e,r,u){if(t.length!==e*r*4)throw new Error("Malformed data passed to binarizer.");for(var l=new s(e,r),c=0;c0&&y>0)){var C=(v.get(y,_-1)+2*v.get(y-1,_)+v.get(y-1,_-1))/4;w6&&(r.setRegion(e-11,0,3,6,!0),r.setRegion(0,e-11,6,3,!0)),r}(e),s=[],l=0,f=0,h=!0,p=o-1;p>0;p-=2){6===p&&p--;for(var d=0;d=0;i--)for(var o=e-9;o>=e-11;o--)n=u(t.get(o,i),n);var l=0;for(o=5;o>=0;o--)for(i=e-9;i>=e-11;i--)l=u(t.get(o,i),l);for(var c,f=1/0,h=0,p=a.VERSIONS;h=0;n--)6!==n&&(e=u(t.get(8,n),e));var i=t.height,o=0;for(n=i-1;n>=i-7;n--)o=u(t.get(8,n),o);for(r=i-8;r1){var c=n.ecBlocks[0].numBlocks,f=n.ecBlocks[1].numBlocks;for(s=0;s0;)for(var h=0,p=i;h=3;){if((l=t.readBits(10))>=1e3)throw new Error("Invalid numeric value above 999");var a=Math.floor(l/100),s=Math.floor(l/10)%10,u=l%10;r.push(48+a,48+s,48+u),n+=a.toString()+s.toString()+u.toString(),o-=3}if(2===o){if((l=t.readBits(7))>=100)throw new Error("Invalid numeric value above 99");a=Math.floor(l/10),s=l%10;r.push(48+a,48+s),n+=a.toString()+s.toString()}else if(1===o){var l;if((l=t.readBits(4))>=10)throw new Error("Invalid numeric value above 9");r.push(48+l),n+=l.toString()}return{bytes:r,text:n}}!function(t){t.Numeric="numeric",t.Alphanumeric="alphanumeric",t.Byte="byte",t.Kanji="kanji",t.ECI="eci"}(n=e.Mode||(e.Mode={})),function(t){t[t.Terminator=0]="Terminator",t[t.Numeric=1]="Numeric",t[t.Alphanumeric=2]="Alphanumeric",t[t.Byte=4]="Byte",t[t.Kanji=8]="Kanji",t[t.ECI=7]="ECI"}(i||(i={}));var u=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function l(t,e){for(var r=[],n="",i=[9,11,13][e],o=t.readBits(i);o>=2;){var a=t.readBits(11),s=Math.floor(a/45),l=a%45;r.push(u[s].charCodeAt(0),u[l].charCodeAt(0)),n+=u[s]+u[l],o-=2}if(1===o){s=t.readBits(6);r.push(u[s].charCodeAt(0)),n+=u[s]}return{bytes:r,text:n}}function c(t,e){for(var r=[],n="",i=[8,16,16][e],o=t.readBits(i),a=0;a>8,255&l),n+=String.fromCharCode(a.shiftJISTable[l])}return{bytes:r,text:n}}e.decode=function(t,e){for(var r,a,u,h,p=new o.BitStream(t),d=e<=9?0:e<=26?1:2,g={text:"",bytes:[],chunks:[]};p.available()>=4;){var m=p.readBits(4);if(m===i.Terminator)return g;if(m===i.ECI)0===p.readBits(1)?g.chunks.push({type:n.ECI,assignmentNumber:p.readBits(7)}):0===p.readBits(1)?g.chunks.push({type:n.ECI,assignmentNumber:p.readBits(14)}):0===p.readBits(1)?g.chunks.push({type:n.ECI,assignmentNumber:p.readBits(21)}):g.chunks.push({type:n.ECI,assignmentNumber:-1});else if(m===i.Numeric){var v=s(p,d);g.text+=v.text,(r=g.bytes).push.apply(r,v.bytes),g.chunks.push({type:n.Numeric,text:v.text})}else if(m===i.Alphanumeric){var _=l(p,d);g.text+=_.text,(a=g.bytes).push.apply(a,_.bytes),g.chunks.push({type:n.Alphanumeric,text:_.text})}else if(m===i.Byte){var y=c(p,d);g.text+=y.text,(u=g.bytes).push.apply(u,y.bytes),g.chunks.push({type:n.Byte,bytes:y.bytes,text:y.text})}else if(m===i.Kanji){var b=f(p,d);g.text+=b.text,(h=g.bytes).push.apply(h,b.bytes),g.chunks.push({type:n.Kanji,bytes:b.bytes,text:b.text})}}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.byteOffset=0,this.bitOffset=0,this.bytes=t}return t.prototype.readBits=function(t){if(t<1||t>32||t>this.available())throw new Error("Cannot read "+t.toString()+" bits");var e=0;if(this.bitOffset>0){var r=8-this.bitOffset,n=t>8-n<<(o=r-n);e=(this.bytes[this.byteOffset]&i)>>o,t-=n,this.bitOffset+=n,8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(t>0){for(;t>=8;)e=e<<8|255&this.bytes[this.byteOffset],this.byteOffset++,t-=8;if(t>0){var o;i=255>>(o=8-t)<>o,this.bitOffset+=t}}return e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();e.BitStream=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.shiftJISTable={32:32,33:33,34:34,35:35,36:36,37:37,38:38,39:39,40:40,41:41,42:42,43:43,44:44,45:45,46:46,47:47,48:48,49:49,50:50,51:51,52:52,53:53,54:54,55:55,56:56,57:57,58:58,59:59,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,70:70,71:71,72:72,73:73,74:74,75:75,76:76,77:77,78:78,79:79,80:80,81:81,82:82,83:83,84:84,85:85,86:86,87:87,88:88,89:89,90:90,91:91,92:165,93:93,94:94,95:95,96:96,97:97,98:98,99:99,100:100,101:101,102:102,103:103,104:104,105:105,106:106,107:107,108:108,109:109,110:110,111:111,112:112,113:113,114:114,115:115,116:116,117:117,118:118,119:119,120:120,121:121,122:122,123:123,124:124,125:125,126:8254,33088:12288,33089:12289,33090:12290,33091:65292,33092:65294,33093:12539,33094:65306,33095:65307,33096:65311,33097:65281,33098:12443,33099:12444,33100:180,33101:65344,33102:168,33103:65342,33104:65507,33105:65343,33106:12541,33107:12542,33108:12445,33109:12446,33110:12291,33111:20189,33112:12293,33113:12294,33114:12295,33115:12540,33116:8213,33117:8208,33118:65295,33119:92,33120:12316,33121:8214,33122:65372,33123:8230,33124:8229,33125:8216,33126:8217,33127:8220,33128:8221,33129:65288,33130:65289,33131:12308,33132:12309,33133:65339,33134:65341,33135:65371,33136:65373,33137:12296,33138:12297,33139:12298,33140:12299,33141:12300,33142:12301,33143:12302,33144:12303,33145:12304,33146:12305,33147:65291,33148:8722,33149:177,33150:215,33152:247,33153:65309,33154:8800,33155:65308,33156:65310,33157:8806,33158:8807,33159:8734,33160:8756,33161:9794,33162:9792,33163:176,33164:8242,33165:8243,33166:8451,33167:65509,33168:65284,33169:162,33170:163,33171:65285,33172:65283,33173:65286,33174:65290,33175:65312,33176:167,33177:9734,33178:9733,33179:9675,33180:9679,33181:9678,33182:9671,33183:9670,33184:9633,33185:9632,33186:9651,33187:9650,33188:9661,33189:9660,33190:8251,33191:12306,33192:8594,33193:8592,33194:8593,33195:8595,33196:12307,33208:8712,33209:8715,33210:8838,33211:8839,33212:8834,33213:8835,33214:8746,33215:8745,33224:8743,33225:8744,33226:172,33227:8658,33228:8660,33229:8704,33230:8707,33242:8736,33243:8869,33244:8978,33245:8706,33246:8711,33247:8801,33248:8786,33249:8810,33250:8811,33251:8730,33252:8765,33253:8733,33254:8757,33255:8747,33256:8748,33264:8491,33265:8240,33266:9839,33267:9837,33268:9834,33269:8224,33270:8225,33271:182,33276:9711,33359:65296,33360:65297,33361:65298,33362:65299,33363:65300,33364:65301,33365:65302,33366:65303,33367:65304,33368:65305,33376:65313,33377:65314,33378:65315,33379:65316,33380:65317,33381:65318,33382:65319,33383:65320,33384:65321,33385:65322,33386:65323,33387:65324,33388:65325,33389:65326,33390:65327,33391:65328,33392:65329,33393:65330,33394:65331,33395:65332,33396:65333,33397:65334,33398:65335,33399:65336,33400:65337,33401:65338,33409:65345,33410:65346,33411:65347,33412:65348,33413:65349,33414:65350,33415:65351,33416:65352,33417:65353,33418:65354,33419:65355,33420:65356,33421:65357,33422:65358,33423:65359,33424:65360,33425:65361,33426:65362,33427:65363,33428:65364,33429:65365,33430:65366,33431:65367,33432:65368,33433:65369,33434:65370,33439:12353,33440:12354,33441:12355,33442:12356,33443:12357,33444:12358,33445:12359,33446:12360,33447:12361,33448:12362,33449:12363,33450:12364,33451:12365,33452:12366,33453:12367,33454:12368,33455:12369,33456:12370,33457:12371,33458:12372,33459:12373,33460:12374,33461:12375,33462:12376,33463:12377,33464:12378,33465:12379,33466:12380,33467:12381,33468:12382,33469:12383,33470:12384,33471:12385,33472:12386,33473:12387,33474:12388,33475:12389,33476:12390,33477:12391,33478:12392,33479:12393,33480:12394,33481:12395,33482:12396,33483:12397,33484:12398,33485:12399,33486:12400,33487:12401,33488:12402,33489:12403,33490:12404,33491:12405,33492:12406,33493:12407,33494:12408,33495:12409,33496:12410,33497:12411,33498:12412,33499:12413,33500:12414,33501:12415,33502:12416,33503:12417,33504:12418,33505:12419,33506:12420,33507:12421,33508:12422,33509:12423,33510:12424,33511:12425,33512:12426,33513:12427,33514:12428,33515:12429,33516:12430,33517:12431,33518:12432,33519:12433,33520:12434,33521:12435,33600:12449,33601:12450,33602:12451,33603:12452,33604:12453,33605:12454,33606:12455,33607:12456,33608:12457,33609:12458,33610:12459,33611:12460,33612:12461,33613:12462,33614:12463,33615:12464,33616:12465,33617:12466,33618:12467,33619:12468,33620:12469,33621:12470,33622:12471,33623:12472,33624:12473,33625:12474,33626:12475,33627:12476,33628:12477,33629:12478,33630:12479,33631:12480,33632:12481,33633:12482,33634:12483,33635:12484,33636:12485,33637:12486,33638:12487,33639:12488,33640:12489,33641:12490,33642:12491,33643:12492,33644:12493,33645:12494,33646:12495,33647:12496,33648:12497,33649:12498,33650:12499,33651:12500,33652:12501,33653:12502,33654:12503,33655:12504,33656:12505,33657:12506,33658:12507,33659:12508,33660:12509,33661:12510,33662:12511,33664:12512,33665:12513,33666:12514,33667:12515,33668:12516,33669:12517,33670:12518,33671:12519,33672:12520,33673:12521,33674:12522,33675:12523,33676:12524,33677:12525,33678:12526,33679:12527,33680:12528,33681:12529,33682:12530,33683:12531,33684:12532,33685:12533,33686:12534,33695:913,33696:914,33697:915,33698:916,33699:917,33700:918,33701:919,33702:920,33703:921,33704:922,33705:923,33706:924,33707:925,33708:926,33709:927,33710:928,33711:929,33712:931,33713:932,33714:933,33715:934,33716:935,33717:936,33718:937,33727:945,33728:946,33729:947,33730:948,33731:949,33732:950,33733:951,33734:952,33735:953,33736:954,33737:955,33738:956,33739:957,33740:958,33741:959,33742:960,33743:961,33744:963,33745:964,33746:965,33747:966,33748:967,33749:968,33750:969,33856:1040,33857:1041,33858:1042,33859:1043,33860:1044,33861:1045,33862:1025,33863:1046,33864:1047,33865:1048,33866:1049,33867:1050,33868:1051,33869:1052,33870:1053,33871:1054,33872:1055,33873:1056,33874:1057,33875:1058,33876:1059,33877:1060,33878:1061,33879:1062,33880:1063,33881:1064,33882:1065,33883:1066,33884:1067,33885:1068,33886:1069,33887:1070,33888:1071,33904:1072,33905:1073,33906:1074,33907:1075,33908:1076,33909:1077,33910:1105,33911:1078,33912:1079,33913:1080,33914:1081,33915:1082,33916:1083,33917:1084,33918:1085,33920:1086,33921:1087,33922:1088,33923:1089,33924:1090,33925:1091,33926:1092,33927:1093,33928:1094,33929:1095,33930:1096,33931:1097,33932:1098,33933:1099,33934:1100,33935:1101,33936:1102,33937:1103,33951:9472,33952:9474,33953:9484,33954:9488,33955:9496,33956:9492,33957:9500,33958:9516,33959:9508,33960:9524,33961:9532,33962:9473,33963:9475,33964:9487,33965:9491,33966:9499,33967:9495,33968:9507,33969:9523,33970:9515,33971:9531,33972:9547,33973:9504,33974:9519,33975:9512,33976:9527,33977:9535,33978:9501,33979:9520,33980:9509,33981:9528,33982:9538,34975:20124,34976:21782,34977:23043,34978:38463,34979:21696,34980:24859,34981:25384,34982:23030,34983:36898,34984:33909,34985:33564,34986:31312,34987:24746,34988:25569,34989:28197,34990:26093,34991:33894,34992:33446,34993:39925,34994:26771,34995:22311,34996:26017,34997:25201,34998:23451,34999:22992,35000:34427,35001:39156,35002:32098,35003:32190,35004:39822,35005:25110,35006:31903,35007:34999,35008:23433,35009:24245,35010:25353,35011:26263,35012:26696,35013:38343,35014:38797,35015:26447,35016:20197,35017:20234,35018:20301,35019:20381,35020:20553,35021:22258,35022:22839,35023:22996,35024:23041,35025:23561,35026:24799,35027:24847,35028:24944,35029:26131,35030:26885,35031:28858,35032:30031,35033:30064,35034:31227,35035:32173,35036:32239,35037:32963,35038:33806,35039:34915,35040:35586,35041:36949,35042:36986,35043:21307,35044:20117,35045:20133,35046:22495,35047:32946,35048:37057,35049:30959,35050:19968,35051:22769,35052:28322,35053:36920,35054:31282,35055:33576,35056:33419,35057:39983,35058:20801,35059:21360,35060:21693,35061:21729,35062:22240,35063:23035,35064:24341,35065:39154,35066:28139,35067:32996,35068:34093,35136:38498,35137:38512,35138:38560,35139:38907,35140:21515,35141:21491,35142:23431,35143:28879,35144:32701,35145:36802,35146:38632,35147:21359,35148:40284,35149:31418,35150:19985,35151:30867,35152:33276,35153:28198,35154:22040,35155:21764,35156:27421,35157:34074,35158:39995,35159:23013,35160:21417,35161:28006,35162:29916,35163:38287,35164:22082,35165:20113,35166:36939,35167:38642,35168:33615,35169:39180,35170:21473,35171:21942,35172:23344,35173:24433,35174:26144,35175:26355,35176:26628,35177:27704,35178:27891,35179:27945,35180:29787,35181:30408,35182:31310,35183:38964,35184:33521,35185:34907,35186:35424,35187:37613,35188:28082,35189:30123,35190:30410,35191:39365,35192:24742,35193:35585,35194:36234,35195:38322,35196:27022,35197:21421,35198:20870,35200:22290,35201:22576,35202:22852,35203:23476,35204:24310,35205:24616,35206:25513,35207:25588,35208:27839,35209:28436,35210:28814,35211:28948,35212:29017,35213:29141,35214:29503,35215:32257,35216:33398,35217:33489,35218:34199,35219:36960,35220:37467,35221:40219,35222:22633,35223:26044,35224:27738,35225:29989,35226:20985,35227:22830,35228:22885,35229:24448,35230:24540,35231:25276,35232:26106,35233:27178,35234:27431,35235:27572,35236:29579,35237:32705,35238:35158,35239:40236,35240:40206,35241:40644,35242:23713,35243:27798,35244:33659,35245:20740,35246:23627,35247:25014,35248:33222,35249:26742,35250:29281,35251:20057,35252:20474,35253:21368,35254:24681,35255:28201,35256:31311,35257:38899,35258:19979,35259:21270,35260:20206,35261:20309,35262:20285,35263:20385,35264:20339,35265:21152,35266:21487,35267:22025,35268:22799,35269:23233,35270:23478,35271:23521,35272:31185,35273:26247,35274:26524,35275:26550,35276:27468,35277:27827,35278:28779,35279:29634,35280:31117,35281:31166,35282:31292,35283:31623,35284:33457,35285:33499,35286:33540,35287:33655,35288:33775,35289:33747,35290:34662,35291:35506,35292:22057,35293:36008,35294:36838,35295:36942,35296:38686,35297:34442,35298:20420,35299:23784,35300:25105,35301:29273,35302:30011,35303:33253,35304:33469,35305:34558,35306:36032,35307:38597,35308:39187,35309:39381,35310:20171,35311:20250,35312:35299,35313:22238,35314:22602,35315:22730,35316:24315,35317:24555,35318:24618,35319:24724,35320:24674,35321:25040,35322:25106,35323:25296,35324:25913,35392:39745,35393:26214,35394:26800,35395:28023,35396:28784,35397:30028,35398:30342,35399:32117,35400:33445,35401:34809,35402:38283,35403:38542,35404:35997,35405:20977,35406:21182,35407:22806,35408:21683,35409:23475,35410:23830,35411:24936,35412:27010,35413:28079,35414:30861,35415:33995,35416:34903,35417:35442,35418:37799,35419:39608,35420:28012,35421:39336,35422:34521,35423:22435,35424:26623,35425:34510,35426:37390,35427:21123,35428:22151,35429:21508,35430:24275,35431:25313,35432:25785,35433:26684,35434:26680,35435:27579,35436:29554,35437:30906,35438:31339,35439:35226,35440:35282,35441:36203,35442:36611,35443:37101,35444:38307,35445:38548,35446:38761,35447:23398,35448:23731,35449:27005,35450:38989,35451:38990,35452:25499,35453:31520,35454:27179,35456:27263,35457:26806,35458:39949,35459:28511,35460:21106,35461:21917,35462:24688,35463:25324,35464:27963,35465:28167,35466:28369,35467:33883,35468:35088,35469:36676,35470:19988,35471:39993,35472:21494,35473:26907,35474:27194,35475:38788,35476:26666,35477:20828,35478:31427,35479:33970,35480:37340,35481:37772,35482:22107,35483:40232,35484:26658,35485:33541,35486:33841,35487:31909,35488:21e3,35489:33477,35490:29926,35491:20094,35492:20355,35493:20896,35494:23506,35495:21002,35496:21208,35497:21223,35498:24059,35499:21914,35500:22570,35501:23014,35502:23436,35503:23448,35504:23515,35505:24178,35506:24185,35507:24739,35508:24863,35509:24931,35510:25022,35511:25563,35512:25954,35513:26577,35514:26707,35515:26874,35516:27454,35517:27475,35518:27735,35519:28450,35520:28567,35521:28485,35522:29872,35523:29976,35524:30435,35525:30475,35526:31487,35527:31649,35528:31777,35529:32233,35530:32566,35531:32752,35532:32925,35533:33382,35534:33694,35535:35251,35536:35532,35537:36011,35538:36996,35539:37969,35540:38291,35541:38289,35542:38306,35543:38501,35544:38867,35545:39208,35546:33304,35547:20024,35548:21547,35549:23736,35550:24012,35551:29609,35552:30284,35553:30524,35554:23721,35555:32747,35556:36107,35557:38593,35558:38929,35559:38996,35560:39e3,35561:20225,35562:20238,35563:21361,35564:21916,35565:22120,35566:22522,35567:22855,35568:23305,35569:23492,35570:23696,35571:24076,35572:24190,35573:24524,35574:25582,35575:26426,35576:26071,35577:26082,35578:26399,35579:26827,35580:26820,35648:27231,35649:24112,35650:27589,35651:27671,35652:27773,35653:30079,35654:31048,35655:23395,35656:31232,35657:32e3,35658:24509,35659:35215,35660:35352,35661:36020,35662:36215,35663:36556,35664:36637,35665:39138,35666:39438,35667:39740,35668:20096,35669:20605,35670:20736,35671:22931,35672:23452,35673:25135,35674:25216,35675:25836,35676:27450,35677:29344,35678:30097,35679:31047,35680:32681,35681:34811,35682:35516,35683:35696,35684:25516,35685:33738,35686:38816,35687:21513,35688:21507,35689:21931,35690:26708,35691:27224,35692:35440,35693:30759,35694:26485,35695:40653,35696:21364,35697:23458,35698:33050,35699:34384,35700:36870,35701:19992,35702:20037,35703:20167,35704:20241,35705:21450,35706:21560,35707:23470,35708:24339,35709:24613,35710:25937,35712:26429,35713:27714,35714:27762,35715:27875,35716:28792,35717:29699,35718:31350,35719:31406,35720:31496,35721:32026,35722:31998,35723:32102,35724:26087,35725:29275,35726:21435,35727:23621,35728:24040,35729:25298,35730:25312,35731:25369,35732:28192,35733:34394,35734:35377,35735:36317,35736:37624,35737:28417,35738:31142,35739:39770,35740:20136,35741:20139,35742:20140,35743:20379,35744:20384,35745:20689,35746:20807,35747:31478,35748:20849,35749:20982,35750:21332,35751:21281,35752:21375,35753:21483,35754:21932,35755:22659,35756:23777,35757:24375,35758:24394,35759:24623,35760:24656,35761:24685,35762:25375,35763:25945,35764:27211,35765:27841,35766:29378,35767:29421,35768:30703,35769:33016,35770:33029,35771:33288,35772:34126,35773:37111,35774:37857,35775:38911,35776:39255,35777:39514,35778:20208,35779:20957,35780:23597,35781:26241,35782:26989,35783:23616,35784:26354,35785:26997,35786:29577,35787:26704,35788:31873,35789:20677,35790:21220,35791:22343,35792:24062,35793:37670,35794:26020,35795:27427,35796:27453,35797:29748,35798:31105,35799:31165,35800:31563,35801:32202,35802:33465,35803:33740,35804:34943,35805:35167,35806:35641,35807:36817,35808:37329,35809:21535,35810:37504,35811:20061,35812:20534,35813:21477,35814:21306,35815:29399,35816:29590,35817:30697,35818:33510,35819:36527,35820:39366,35821:39368,35822:39378,35823:20855,35824:24858,35825:34398,35826:21936,35827:31354,35828:20598,35829:23507,35830:36935,35831:38533,35832:20018,35833:27355,35834:37351,35835:23633,35836:23624,35904:25496,35905:31391,35906:27795,35907:38772,35908:36705,35909:31402,35910:29066,35911:38536,35912:31874,35913:26647,35914:32368,35915:26705,35916:37740,35917:21234,35918:21531,35919:34219,35920:35347,35921:32676,35922:36557,35923:37089,35924:21350,35925:34952,35926:31041,35927:20418,35928:20670,35929:21009,35930:20804,35931:21843,35932:22317,35933:29674,35934:22411,35935:22865,35936:24418,35937:24452,35938:24693,35939:24950,35940:24935,35941:25001,35942:25522,35943:25658,35944:25964,35945:26223,35946:26690,35947:28179,35948:30054,35949:31293,35950:31995,35951:32076,35952:32153,35953:32331,35954:32619,35955:33550,35956:33610,35957:34509,35958:35336,35959:35427,35960:35686,35961:36605,35962:38938,35963:40335,35964:33464,35965:36814,35966:39912,35968:21127,35969:25119,35970:25731,35971:28608,35972:38553,35973:26689,35974:20625,35975:27424,35976:27770,35977:28500,35978:31348,35979:32080,35980:34880,35981:35363,35982:26376,35983:20214,35984:20537,35985:20518,35986:20581,35987:20860,35988:21048,35989:21091,35990:21927,35991:22287,35992:22533,35993:23244,35994:24314,35995:25010,35996:25080,35997:25331,35998:25458,35999:26908,36000:27177,36001:29309,36002:29356,36003:29486,36004:30740,36005:30831,36006:32121,36007:30476,36008:32937,36009:35211,36010:35609,36011:36066,36012:36562,36013:36963,36014:37749,36015:38522,36016:38997,36017:39443,36018:40568,36019:20803,36020:21407,36021:21427,36022:24187,36023:24358,36024:28187,36025:28304,36026:29572,36027:29694,36028:32067,36029:33335,36030:35328,36031:35578,36032:38480,36033:20046,36034:20491,36035:21476,36036:21628,36037:22266,36038:22993,36039:23396,36040:24049,36041:24235,36042:24359,36043:25144,36044:25925,36045:26543,36046:28246,36047:29392,36048:31946,36049:34996,36050:32929,36051:32993,36052:33776,36053:34382,36054:35463,36055:36328,36056:37431,36057:38599,36058:39015,36059:40723,36060:20116,36061:20114,36062:20237,36063:21320,36064:21577,36065:21566,36066:23087,36067:24460,36068:24481,36069:24735,36070:26791,36071:27278,36072:29786,36073:30849,36074:35486,36075:35492,36076:35703,36077:37264,36078:20062,36079:39881,36080:20132,36081:20348,36082:20399,36083:20505,36084:20502,36085:20809,36086:20844,36087:21151,36088:21177,36089:21246,36090:21402,36091:21475,36092:21521,36160:21518,36161:21897,36162:22353,36163:22434,36164:22909,36165:23380,36166:23389,36167:23439,36168:24037,36169:24039,36170:24055,36171:24184,36172:24195,36173:24218,36174:24247,36175:24344,36176:24658,36177:24908,36178:25239,36179:25304,36180:25511,36181:25915,36182:26114,36183:26179,36184:26356,36185:26477,36186:26657,36187:26775,36188:27083,36189:27743,36190:27946,36191:28009,36192:28207,36193:28317,36194:30002,36195:30343,36196:30828,36197:31295,36198:31968,36199:32005,36200:32024,36201:32094,36202:32177,36203:32789,36204:32771,36205:32943,36206:32945,36207:33108,36208:33167,36209:33322,36210:33618,36211:34892,36212:34913,36213:35611,36214:36002,36215:36092,36216:37066,36217:37237,36218:37489,36219:30783,36220:37628,36221:38308,36222:38477,36224:38917,36225:39321,36226:39640,36227:40251,36228:21083,36229:21163,36230:21495,36231:21512,36232:22741,36233:25335,36234:28640,36235:35946,36236:36703,36237:40633,36238:20811,36239:21051,36240:21578,36241:22269,36242:31296,36243:37239,36244:40288,36245:40658,36246:29508,36247:28425,36248:33136,36249:29969,36250:24573,36251:24794,36252:39592,36253:29403,36254:36796,36255:27492,36256:38915,36257:20170,36258:22256,36259:22372,36260:22718,36261:23130,36262:24680,36263:25031,36264:26127,36265:26118,36266:26681,36267:26801,36268:28151,36269:30165,36270:32058,36271:33390,36272:39746,36273:20123,36274:20304,36275:21449,36276:21766,36277:23919,36278:24038,36279:24046,36280:26619,36281:27801,36282:29811,36283:30722,36284:35408,36285:37782,36286:35039,36287:22352,36288:24231,36289:25387,36290:20661,36291:20652,36292:20877,36293:26368,36294:21705,36295:22622,36296:22971,36297:23472,36298:24425,36299:25165,36300:25505,36301:26685,36302:27507,36303:28168,36304:28797,36305:37319,36306:29312,36307:30741,36308:30758,36309:31085,36310:25998,36311:32048,36312:33756,36313:35009,36314:36617,36315:38555,36316:21092,36317:22312,36318:26448,36319:32618,36320:36001,36321:20916,36322:22338,36323:38442,36324:22586,36325:27018,36326:32948,36327:21682,36328:23822,36329:22524,36330:30869,36331:40442,36332:20316,36333:21066,36334:21643,36335:25662,36336:26152,36337:26388,36338:26613,36339:31364,36340:31574,36341:32034,36342:37679,36343:26716,36344:39853,36345:31545,36346:21273,36347:20874,36348:21047,36416:23519,36417:25334,36418:25774,36419:25830,36420:26413,36421:27578,36422:34217,36423:38609,36424:30352,36425:39894,36426:25420,36427:37638,36428:39851,36429:30399,36430:26194,36431:19977,36432:20632,36433:21442,36434:23665,36435:24808,36436:25746,36437:25955,36438:26719,36439:29158,36440:29642,36441:29987,36442:31639,36443:32386,36444:34453,36445:35715,36446:36059,36447:37240,36448:39184,36449:26028,36450:26283,36451:27531,36452:20181,36453:20180,36454:20282,36455:20351,36456:21050,36457:21496,36458:21490,36459:21987,36460:22235,36461:22763,36462:22987,36463:22985,36464:23039,36465:23376,36466:23629,36467:24066,36468:24107,36469:24535,36470:24605,36471:25351,36472:25903,36473:23388,36474:26031,36475:26045,36476:26088,36477:26525,36478:27490,36480:27515,36481:27663,36482:29509,36483:31049,36484:31169,36485:31992,36486:32025,36487:32043,36488:32930,36489:33026,36490:33267,36491:35222,36492:35422,36493:35433,36494:35430,36495:35468,36496:35566,36497:36039,36498:36060,36499:38604,36500:39164,36501:27503,36502:20107,36503:20284,36504:20365,36505:20816,36506:23383,36507:23546,36508:24904,36509:25345,36510:26178,36511:27425,36512:28363,36513:27835,36514:29246,36515:29885,36516:30164,36517:30913,36518:31034,36519:32780,36520:32819,36521:33258,36522:33940,36523:36766,36524:27728,36525:40575,36526:24335,36527:35672,36528:40235,36529:31482,36530:36600,36531:23437,36532:38635,36533:19971,36534:21489,36535:22519,36536:22833,36537:23241,36538:23460,36539:24713,36540:28287,36541:28422,36542:30142,36543:36074,36544:23455,36545:34048,36546:31712,36547:20594,36548:26612,36549:33437,36550:23649,36551:34122,36552:32286,36553:33294,36554:20889,36555:23556,36556:25448,36557:36198,36558:26012,36559:29038,36560:31038,36561:32023,36562:32773,36563:35613,36564:36554,36565:36974,36566:34503,36567:37034,36568:20511,36569:21242,36570:23610,36571:26451,36572:28796,36573:29237,36574:37196,36575:37320,36576:37675,36577:33509,36578:23490,36579:24369,36580:24825,36581:20027,36582:21462,36583:23432,36584:25163,36585:26417,36586:27530,36587:29417,36588:29664,36589:31278,36590:33131,36591:36259,36592:37202,36593:39318,36594:20754,36595:21463,36596:21610,36597:23551,36598:25480,36599:27193,36600:32172,36601:38656,36602:22234,36603:21454,36604:21608,36672:23447,36673:23601,36674:24030,36675:20462,36676:24833,36677:25342,36678:27954,36679:31168,36680:31179,36681:32066,36682:32333,36683:32722,36684:33261,36685:33311,36686:33936,36687:34886,36688:35186,36689:35728,36690:36468,36691:36655,36692:36913,36693:37195,36694:37228,36695:38598,36696:37276,36697:20160,36698:20303,36699:20805,36700:21313,36701:24467,36702:25102,36703:26580,36704:27713,36705:28171,36706:29539,36707:32294,36708:37325,36709:37507,36710:21460,36711:22809,36712:23487,36713:28113,36714:31069,36715:32302,36716:31899,36717:22654,36718:29087,36719:20986,36720:34899,36721:36848,36722:20426,36723:23803,36724:26149,36725:30636,36726:31459,36727:33308,36728:39423,36729:20934,36730:24490,36731:26092,36732:26991,36733:27529,36734:28147,36736:28310,36737:28516,36738:30462,36739:32020,36740:24033,36741:36981,36742:37255,36743:38918,36744:20966,36745:21021,36746:25152,36747:26257,36748:26329,36749:28186,36750:24246,36751:32210,36752:32626,36753:26360,36754:34223,36755:34295,36756:35576,36757:21161,36758:21465,36759:22899,36760:24207,36761:24464,36762:24661,36763:37604,36764:38500,36765:20663,36766:20767,36767:21213,36768:21280,36769:21319,36770:21484,36771:21736,36772:21830,36773:21809,36774:22039,36775:22888,36776:22974,36777:23100,36778:23477,36779:23558,36780:23567,36781:23569,36782:23578,36783:24196,36784:24202,36785:24288,36786:24432,36787:25215,36788:25220,36789:25307,36790:25484,36791:25463,36792:26119,36793:26124,36794:26157,36795:26230,36796:26494,36797:26786,36798:27167,36799:27189,36800:27836,36801:28040,36802:28169,36803:28248,36804:28988,36805:28966,36806:29031,36807:30151,36808:30465,36809:30813,36810:30977,36811:31077,36812:31216,36813:31456,36814:31505,36815:31911,36816:32057,36817:32918,36818:33750,36819:33931,36820:34121,36821:34909,36822:35059,36823:35359,36824:35388,36825:35412,36826:35443,36827:35937,36828:36062,36829:37284,36830:37478,36831:37758,36832:37912,36833:38556,36834:38808,36835:19978,36836:19976,36837:19998,36838:20055,36839:20887,36840:21104,36841:22478,36842:22580,36843:22732,36844:23330,36845:24120,36846:24773,36847:25854,36848:26465,36849:26454,36850:27972,36851:29366,36852:30067,36853:31331,36854:33976,36855:35698,36856:37304,36857:37664,36858:22065,36859:22516,36860:39166,36928:25325,36929:26893,36930:27542,36931:29165,36932:32340,36933:32887,36934:33394,36935:35302,36936:39135,36937:34645,36938:36785,36939:23611,36940:20280,36941:20449,36942:20405,36943:21767,36944:23072,36945:23517,36946:23529,36947:24515,36948:24910,36949:25391,36950:26032,36951:26187,36952:26862,36953:27035,36954:28024,36955:28145,36956:30003,36957:30137,36958:30495,36959:31070,36960:31206,36961:32051,36962:33251,36963:33455,36964:34218,36965:35242,36966:35386,36967:36523,36968:36763,36969:36914,36970:37341,36971:38663,36972:20154,36973:20161,36974:20995,36975:22645,36976:22764,36977:23563,36978:29978,36979:23613,36980:33102,36981:35338,36982:36805,36983:38499,36984:38765,36985:31525,36986:35535,36987:38920,36988:37218,36989:22259,36990:21416,36992:36887,36993:21561,36994:22402,36995:24101,36996:25512,36997:27700,36998:28810,36999:30561,37000:31883,37001:32736,37002:34928,37003:36930,37004:37204,37005:37648,37006:37656,37007:38543,37008:29790,37009:39620,37010:23815,37011:23913,37012:25968,37013:26530,37014:36264,37015:38619,37016:25454,37017:26441,37018:26905,37019:33733,37020:38935,37021:38592,37022:35070,37023:28548,37024:25722,37025:23544,37026:19990,37027:28716,37028:30045,37029:26159,37030:20932,37031:21046,37032:21218,37033:22995,37034:24449,37035:24615,37036:25104,37037:25919,37038:25972,37039:26143,37040:26228,37041:26866,37042:26646,37043:27491,37044:28165,37045:29298,37046:29983,37047:30427,37048:31934,37049:32854,37050:22768,37051:35069,37052:35199,37053:35488,37054:35475,37055:35531,37056:36893,37057:37266,37058:38738,37059:38745,37060:25993,37061:31246,37062:33030,37063:38587,37064:24109,37065:24796,37066:25114,37067:26021,37068:26132,37069:26512,37070:30707,37071:31309,37072:31821,37073:32318,37074:33034,37075:36012,37076:36196,37077:36321,37078:36447,37079:30889,37080:20999,37081:25305,37082:25509,37083:25666,37084:25240,37085:35373,37086:31363,37087:31680,37088:35500,37089:38634,37090:32118,37091:33292,37092:34633,37093:20185,37094:20808,37095:21315,37096:21344,37097:23459,37098:23554,37099:23574,37100:24029,37101:25126,37102:25159,37103:25776,37104:26643,37105:26676,37106:27849,37107:27973,37108:27927,37109:26579,37110:28508,37111:29006,37112:29053,37113:26059,37114:31359,37115:31661,37116:32218,37184:32330,37185:32680,37186:33146,37187:33307,37188:33337,37189:34214,37190:35438,37191:36046,37192:36341,37193:36984,37194:36983,37195:37549,37196:37521,37197:38275,37198:39854,37199:21069,37200:21892,37201:28472,37202:28982,37203:20840,37204:31109,37205:32341,37206:33203,37207:31950,37208:22092,37209:22609,37210:23720,37211:25514,37212:26366,37213:26365,37214:26970,37215:29401,37216:30095,37217:30094,37218:30990,37219:31062,37220:31199,37221:31895,37222:32032,37223:32068,37224:34311,37225:35380,37226:38459,37227:36961,37228:40736,37229:20711,37230:21109,37231:21452,37232:21474,37233:20489,37234:21930,37235:22766,37236:22863,37237:29245,37238:23435,37239:23652,37240:21277,37241:24803,37242:24819,37243:25436,37244:25475,37245:25407,37246:25531,37248:25805,37249:26089,37250:26361,37251:24035,37252:27085,37253:27133,37254:28437,37255:29157,37256:20105,37257:30185,37258:30456,37259:31379,37260:31967,37261:32207,37262:32156,37263:32865,37264:33609,37265:33624,37266:33900,37267:33980,37268:34299,37269:35013,37270:36208,37271:36865,37272:36973,37273:37783,37274:38684,37275:39442,37276:20687,37277:22679,37278:24974,37279:33235,37280:34101,37281:36104,37282:36896,37283:20419,37284:20596,37285:21063,37286:21363,37287:24687,37288:25417,37289:26463,37290:28204,37291:36275,37292:36895,37293:20439,37294:23646,37295:36042,37296:26063,37297:32154,37298:21330,37299:34966,37300:20854,37301:25539,37302:23384,37303:23403,37304:23562,37305:25613,37306:26449,37307:36956,37308:20182,37309:22810,37310:22826,37311:27760,37312:35409,37313:21822,37314:22549,37315:22949,37316:24816,37317:25171,37318:26561,37319:33333,37320:26965,37321:38464,37322:39364,37323:39464,37324:20307,37325:22534,37326:23550,37327:32784,37328:23729,37329:24111,37330:24453,37331:24608,37332:24907,37333:25140,37334:26367,37335:27888,37336:28382,37337:32974,37338:33151,37339:33492,37340:34955,37341:36024,37342:36864,37343:36910,37344:38538,37345:40667,37346:39899,37347:20195,37348:21488,37349:22823,37350:31532,37351:37261,37352:38988,37353:40441,37354:28381,37355:28711,37356:21331,37357:21828,37358:23429,37359:25176,37360:25246,37361:25299,37362:27810,37363:28655,37364:29730,37365:35351,37366:37944,37367:28609,37368:35582,37369:33592,37370:20967,37371:34552,37372:21482,37440:21481,37441:20294,37442:36948,37443:36784,37444:22890,37445:33073,37446:24061,37447:31466,37448:36799,37449:26842,37450:35895,37451:29432,37452:40008,37453:27197,37454:35504,37455:20025,37456:21336,37457:22022,37458:22374,37459:25285,37460:25506,37461:26086,37462:27470,37463:28129,37464:28251,37465:28845,37466:30701,37467:31471,37468:31658,37469:32187,37470:32829,37471:32966,37472:34507,37473:35477,37474:37723,37475:22243,37476:22727,37477:24382,37478:26029,37479:26262,37480:27264,37481:27573,37482:30007,37483:35527,37484:20516,37485:30693,37486:22320,37487:24347,37488:24677,37489:26234,37490:27744,37491:30196,37492:31258,37493:32622,37494:33268,37495:34584,37496:36933,37497:39347,37498:31689,37499:30044,37500:31481,37501:31569,37502:33988,37504:36880,37505:31209,37506:31378,37507:33590,37508:23265,37509:30528,37510:20013,37511:20210,37512:23449,37513:24544,37514:25277,37515:26172,37516:26609,37517:27880,37518:34411,37519:34935,37520:35387,37521:37198,37522:37619,37523:39376,37524:27159,37525:28710,37526:29482,37527:33511,37528:33879,37529:36015,37530:19969,37531:20806,37532:20939,37533:21899,37534:23541,37535:24086,37536:24115,37537:24193,37538:24340,37539:24373,37540:24427,37541:24500,37542:25074,37543:25361,37544:26274,37545:26397,37546:28526,37547:29266,37548:30010,37549:30522,37550:32884,37551:33081,37552:33144,37553:34678,37554:35519,37555:35548,37556:36229,37557:36339,37558:37530,37559:38263,37560:38914,37561:40165,37562:21189,37563:25431,37564:30452,37565:26389,37566:27784,37567:29645,37568:36035,37569:37806,37570:38515,37571:27941,37572:22684,37573:26894,37574:27084,37575:36861,37576:37786,37577:30171,37578:36890,37579:22618,37580:26626,37581:25524,37582:27131,37583:20291,37584:28460,37585:26584,37586:36795,37587:34086,37588:32180,37589:37716,37590:26943,37591:28528,37592:22378,37593:22775,37594:23340,37595:32044,37596:29226,37597:21514,37598:37347,37599:40372,37600:20141,37601:20302,37602:20572,37603:20597,37604:21059,37605:35998,37606:21576,37607:22564,37608:23450,37609:24093,37610:24213,37611:24237,37612:24311,37613:24351,37614:24716,37615:25269,37616:25402,37617:25552,37618:26799,37619:27712,37620:30855,37621:31118,37622:31243,37623:32224,37624:33351,37625:35330,37626:35558,37627:36420,37628:36883,37696:37048,37697:37165,37698:37336,37699:40718,37700:27877,37701:25688,37702:25826,37703:25973,37704:28404,37705:30340,37706:31515,37707:36969,37708:37841,37709:28346,37710:21746,37711:24505,37712:25764,37713:36685,37714:36845,37715:37444,37716:20856,37717:22635,37718:22825,37719:23637,37720:24215,37721:28155,37722:32399,37723:29980,37724:36028,37725:36578,37726:39003,37727:28857,37728:20253,37729:27583,37730:28593,37731:3e4,37732:38651,37733:20814,37734:21520,37735:22581,37736:22615,37737:22956,37738:23648,37739:24466,37740:26007,37741:26460,37742:28193,37743:30331,37744:33759,37745:36077,37746:36884,37747:37117,37748:37709,37749:30757,37750:30778,37751:21162,37752:24230,37753:22303,37754:22900,37755:24594,37756:20498,37757:20826,37758:20908,37760:20941,37761:20992,37762:21776,37763:22612,37764:22616,37765:22871,37766:23445,37767:23798,37768:23947,37769:24764,37770:25237,37771:25645,37772:26481,37773:26691,37774:26812,37775:26847,37776:30423,37777:28120,37778:28271,37779:28059,37780:28783,37781:29128,37782:24403,37783:30168,37784:31095,37785:31561,37786:31572,37787:31570,37788:31958,37789:32113,37790:21040,37791:33891,37792:34153,37793:34276,37794:35342,37795:35588,37796:35910,37797:36367,37798:36867,37799:36879,37800:37913,37801:38518,37802:38957,37803:39472,37804:38360,37805:20685,37806:21205,37807:21516,37808:22530,37809:23566,37810:24999,37811:25758,37812:27934,37813:30643,37814:31461,37815:33012,37816:33796,37817:36947,37818:37509,37819:23776,37820:40199,37821:21311,37822:24471,37823:24499,37824:28060,37825:29305,37826:30563,37827:31167,37828:31716,37829:27602,37830:29420,37831:35501,37832:26627,37833:27233,37834:20984,37835:31361,37836:26932,37837:23626,37838:40182,37839:33515,37840:23493,37841:37193,37842:28702,37843:22136,37844:23663,37845:24775,37846:25958,37847:27788,37848:35930,37849:36929,37850:38931,37851:21585,37852:26311,37853:37389,37854:22856,37855:37027,37856:20869,37857:20045,37858:20970,37859:34201,37860:35598,37861:28760,37862:25466,37863:37707,37864:26978,37865:39348,37866:32260,37867:30071,37868:21335,37869:26976,37870:36575,37871:38627,37872:27741,37873:20108,37874:23612,37875:24336,37876:36841,37877:21250,37878:36049,37879:32905,37880:34425,37881:24319,37882:26085,37883:20083,37884:20837,37952:22914,37953:23615,37954:38894,37955:20219,37956:22922,37957:24525,37958:35469,37959:28641,37960:31152,37961:31074,37962:23527,37963:33905,37964:29483,37965:29105,37966:24180,37967:24565,37968:25467,37969:25754,37970:29123,37971:31896,37972:20035,37973:24316,37974:20043,37975:22492,37976:22178,37977:24745,37978:28611,37979:32013,37980:33021,37981:33075,37982:33215,37983:36786,37984:35223,37985:34468,37986:24052,37987:25226,37988:25773,37989:35207,37990:26487,37991:27874,37992:27966,37993:29750,37994:30772,37995:23110,37996:32629,37997:33453,37998:39340,37999:20467,38000:24259,38001:25309,38002:25490,38003:25943,38004:26479,38005:30403,38006:29260,38007:32972,38008:32954,38009:36649,38010:37197,38011:20493,38012:22521,38013:23186,38014:26757,38016:26995,38017:29028,38018:29437,38019:36023,38020:22770,38021:36064,38022:38506,38023:36889,38024:34687,38025:31204,38026:30695,38027:33833,38028:20271,38029:21093,38030:21338,38031:25293,38032:26575,38033:27850,38034:30333,38035:31636,38036:31893,38037:33334,38038:34180,38039:36843,38040:26333,38041:28448,38042:29190,38043:32283,38044:33707,38045:39361,38046:40614,38047:20989,38048:31665,38049:30834,38050:31672,38051:32903,38052:31560,38053:27368,38054:24161,38055:32908,38056:30033,38057:30048,38058:20843,38059:37474,38060:28300,38061:30330,38062:37271,38063:39658,38064:20240,38065:32624,38066:25244,38067:31567,38068:38309,38069:40169,38070:22138,38071:22617,38072:34532,38073:38588,38074:20276,38075:21028,38076:21322,38077:21453,38078:21467,38079:24070,38080:25644,38081:26001,38082:26495,38083:27710,38084:27726,38085:29256,38086:29359,38087:29677,38088:30036,38089:32321,38090:33324,38091:34281,38092:36009,38093:31684,38094:37318,38095:29033,38096:38930,38097:39151,38098:25405,38099:26217,38100:30058,38101:30436,38102:30928,38103:34115,38104:34542,38105:21290,38106:21329,38107:21542,38108:22915,38109:24199,38110:24444,38111:24754,38112:25161,38113:25209,38114:25259,38115:26e3,38116:27604,38117:27852,38118:30130,38119:30382,38120:30865,38121:31192,38122:32203,38123:32631,38124:32933,38125:34987,38126:35513,38127:36027,38128:36991,38129:38750,38130:39131,38131:27147,38132:31800,38133:20633,38134:23614,38135:24494,38136:26503,38137:27608,38138:29749,38139:30473,38140:32654,38208:40763,38209:26570,38210:31255,38211:21305,38212:30091,38213:39661,38214:24422,38215:33181,38216:33777,38217:32920,38218:24380,38219:24517,38220:30050,38221:31558,38222:36924,38223:26727,38224:23019,38225:23195,38226:32016,38227:30334,38228:35628,38229:20469,38230:24426,38231:27161,38232:27703,38233:28418,38234:29922,38235:31080,38236:34920,38237:35413,38238:35961,38239:24287,38240:25551,38241:30149,38242:31186,38243:33495,38244:37672,38245:37618,38246:33948,38247:34541,38248:39981,38249:21697,38250:24428,38251:25996,38252:27996,38253:28693,38254:36007,38255:36051,38256:38971,38257:25935,38258:29942,38259:19981,38260:20184,38261:22496,38262:22827,38263:23142,38264:23500,38265:20904,38266:24067,38267:24220,38268:24598,38269:25206,38270:25975,38272:26023,38273:26222,38274:28014,38275:29238,38276:31526,38277:33104,38278:33178,38279:33433,38280:35676,38281:36e3,38282:36070,38283:36212,38284:38428,38285:38468,38286:20398,38287:25771,38288:27494,38289:33310,38290:33889,38291:34154,38292:37096,38293:23553,38294:26963,38295:39080,38296:33914,38297:34135,38298:20239,38299:21103,38300:24489,38301:24133,38302:26381,38303:31119,38304:33145,38305:35079,38306:35206,38307:28149,38308:24343,38309:25173,38310:27832,38311:20175,38312:29289,38313:39826,38314:20998,38315:21563,38316:22132,38317:22707,38318:24996,38319:25198,38320:28954,38321:22894,38322:31881,38323:31966,38324:32027,38325:38640,38326:25991,38327:32862,38328:19993,38329:20341,38330:20853,38331:22592,38332:24163,38333:24179,38334:24330,38335:26564,38336:20006,38337:34109,38338:38281,38339:38491,38340:31859,38341:38913,38342:20731,38343:22721,38344:30294,38345:30887,38346:21029,38347:30629,38348:34065,38349:31622,38350:20559,38351:22793,38352:29255,38353:31687,38354:32232,38355:36794,38356:36820,38357:36941,38358:20415,38359:21193,38360:23081,38361:24321,38362:38829,38363:20445,38364:33303,38365:37610,38366:22275,38367:25429,38368:27497,38369:29995,38370:35036,38371:36628,38372:31298,38373:21215,38374:22675,38375:24917,38376:25098,38377:26286,38378:27597,38379:31807,38380:33769,38381:20515,38382:20472,38383:21253,38384:21574,38385:22577,38386:22857,38387:23453,38388:23792,38389:23791,38390:23849,38391:24214,38392:25265,38393:25447,38394:25918,38395:26041,38396:26379,38464:27861,38465:27873,38466:28921,38467:30770,38468:32299,38469:32990,38470:33459,38471:33804,38472:34028,38473:34562,38474:35090,38475:35370,38476:35914,38477:37030,38478:37586,38479:39165,38480:40179,38481:40300,38482:20047,38483:20129,38484:20621,38485:21078,38486:22346,38487:22952,38488:24125,38489:24536,38490:24537,38491:25151,38492:26292,38493:26395,38494:26576,38495:26834,38496:20882,38497:32033,38498:32938,38499:33192,38500:35584,38501:35980,38502:36031,38503:37502,38504:38450,38505:21536,38506:38956,38507:21271,38508:20693,38509:21340,38510:22696,38511:25778,38512:26420,38513:29287,38514:30566,38515:31302,38516:37350,38517:21187,38518:27809,38519:27526,38520:22528,38521:24140,38522:22868,38523:26412,38524:32763,38525:20961,38526:30406,38528:25705,38529:30952,38530:39764,38531:40635,38532:22475,38533:22969,38534:26151,38535:26522,38536:27598,38537:21737,38538:27097,38539:24149,38540:33180,38541:26517,38542:39850,38543:26622,38544:40018,38545:26717,38546:20134,38547:20451,38548:21448,38549:25273,38550:26411,38551:27819,38552:36804,38553:20397,38554:32365,38555:40639,38556:19975,38557:24930,38558:28288,38559:28459,38560:34067,38561:21619,38562:26410,38563:39749,38564:24051,38565:31637,38566:23724,38567:23494,38568:34588,38569:28234,38570:34001,38571:31252,38572:33032,38573:22937,38574:31885,38575:27665,38576:30496,38577:21209,38578:22818,38579:28961,38580:29279,38581:30683,38582:38695,38583:40289,38584:26891,38585:23167,38586:23064,38587:20901,38588:21517,38589:21629,38590:26126,38591:30431,38592:36855,38593:37528,38594:40180,38595:23018,38596:29277,38597:28357,38598:20813,38599:26825,38600:32191,38601:32236,38602:38754,38603:40634,38604:25720,38605:27169,38606:33538,38607:22916,38608:23391,38609:27611,38610:29467,38611:30450,38612:32178,38613:32791,38614:33945,38615:20786,38616:26408,38617:40665,38618:30446,38619:26466,38620:21247,38621:39173,38622:23588,38623:25147,38624:31870,38625:36016,38626:21839,38627:24758,38628:32011,38629:38272,38630:21249,38631:20063,38632:20918,38633:22812,38634:29242,38635:32822,38636:37326,38637:24357,38638:30690,38639:21380,38640:24441,38641:32004,38642:34220,38643:35379,38644:36493,38645:38742,38646:26611,38647:34222,38648:37971,38649:24841,38650:24840,38651:27833,38652:30290,38720:35565,38721:36664,38722:21807,38723:20305,38724:20778,38725:21191,38726:21451,38727:23461,38728:24189,38729:24736,38730:24962,38731:25558,38732:26377,38733:26586,38734:28263,38735:28044,38736:29494,38737:29495,38738:30001,38739:31056,38740:35029,38741:35480,38742:36938,38743:37009,38744:37109,38745:38596,38746:34701,38747:22805,38748:20104,38749:20313,38750:19982,38751:35465,38752:36671,38753:38928,38754:20653,38755:24188,38756:22934,38757:23481,38758:24248,38759:25562,38760:25594,38761:25793,38762:26332,38763:26954,38764:27096,38765:27915,38766:28342,38767:29076,38768:29992,38769:31407,38770:32650,38771:32768,38772:33865,38773:33993,38774:35201,38775:35617,38776:36362,38777:36965,38778:38525,38779:39178,38780:24958,38781:25233,38782:27442,38784:27779,38785:28020,38786:32716,38787:32764,38788:28096,38789:32645,38790:34746,38791:35064,38792:26469,38793:33713,38794:38972,38795:38647,38796:27931,38797:32097,38798:33853,38799:37226,38800:20081,38801:21365,38802:23888,38803:27396,38804:28651,38805:34253,38806:34349,38807:35239,38808:21033,38809:21519,38810:23653,38811:26446,38812:26792,38813:29702,38814:29827,38815:30178,38816:35023,38817:35041,38818:37324,38819:38626,38820:38520,38821:24459,38822:29575,38823:31435,38824:33870,38825:25504,38826:30053,38827:21129,38828:27969,38829:28316,38830:29705,38831:30041,38832:30827,38833:31890,38834:38534,38835:31452,38836:40845,38837:20406,38838:24942,38839:26053,38840:34396,38841:20102,38842:20142,38843:20698,38844:20001,38845:20940,38846:23534,38847:26009,38848:26753,38849:28092,38850:29471,38851:30274,38852:30637,38853:31260,38854:31975,38855:33391,38856:35538,38857:36988,38858:37327,38859:38517,38860:38936,38861:21147,38862:32209,38863:20523,38864:21400,38865:26519,38866:28107,38867:29136,38868:29747,38869:33256,38870:36650,38871:38563,38872:40023,38873:40607,38874:29792,38875:22593,38876:28057,38877:32047,38878:39006,38879:20196,38880:20278,38881:20363,38882:20919,38883:21169,38884:23994,38885:24604,38886:29618,38887:31036,38888:33491,38889:37428,38890:38583,38891:38646,38892:38666,38893:40599,38894:40802,38895:26278,38896:27508,38897:21015,38898:21155,38899:28872,38900:35010,38901:24265,38902:24651,38903:24976,38904:28451,38905:29001,38906:31806,38907:32244,38908:32879,38976:34030,38977:36899,38978:37676,38979:21570,38980:39791,38981:27347,38982:28809,38983:36034,38984:36335,38985:38706,38986:21172,38987:23105,38988:24266,38989:24324,38990:26391,38991:27004,38992:27028,38993:28010,38994:28431,38995:29282,38996:29436,38997:31725,38998:32769,38999:32894,39000:34635,39001:37070,39002:20845,39003:40595,39004:31108,39005:32907,39006:37682,39007:35542,39008:20525,39009:21644,39010:35441,39011:27498,39012:36036,39013:33031,39014:24785,39015:26528,39016:40434,39017:20121,39018:20120,39019:39952,39020:35435,39021:34241,39022:34152,39023:26880,39024:28286,39025:30871,39026:33109,39071:24332,39072:19984,39073:19989,39074:20010,39075:20017,39076:20022,39077:20028,39078:20031,39079:20034,39080:20054,39081:20056,39082:20098,39083:20101,39084:35947,39085:20106,39086:33298,39087:24333,39088:20110,39089:20126,39090:20127,39091:20128,39092:20130,39093:20144,39094:20147,39095:20150,39096:20174,39097:20173,39098:20164,39099:20166,39100:20162,39101:20183,39102:20190,39103:20205,39104:20191,39105:20215,39106:20233,39107:20314,39108:20272,39109:20315,39110:20317,39111:20311,39112:20295,39113:20342,39114:20360,39115:20367,39116:20376,39117:20347,39118:20329,39119:20336,39120:20369,39121:20335,39122:20358,39123:20374,39124:20760,39125:20436,39126:20447,39127:20430,39128:20440,39129:20443,39130:20433,39131:20442,39132:20432,39133:20452,39134:20453,39135:20506,39136:20520,39137:20500,39138:20522,39139:20517,39140:20485,39141:20252,39142:20470,39143:20513,39144:20521,39145:20524,39146:20478,39147:20463,39148:20497,39149:20486,39150:20547,39151:20551,39152:26371,39153:20565,39154:20560,39155:20552,39156:20570,39157:20566,39158:20588,39159:20600,39160:20608,39161:20634,39162:20613,39163:20660,39164:20658,39232:20681,39233:20682,39234:20659,39235:20674,39236:20694,39237:20702,39238:20709,39239:20717,39240:20707,39241:20718,39242:20729,39243:20725,39244:20745,39245:20737,39246:20738,39247:20758,39248:20757,39249:20756,39250:20762,39251:20769,39252:20794,39253:20791,39254:20796,39255:20795,39256:20799,39257:20800,39258:20818,39259:20812,39260:20820,39261:20834,39262:31480,39263:20841,39264:20842,39265:20846,39266:20864,39267:20866,39268:22232,39269:20876,39270:20873,39271:20879,39272:20881,39273:20883,39274:20885,39275:20886,39276:20900,39277:20902,39278:20898,39279:20905,39280:20906,39281:20907,39282:20915,39283:20913,39284:20914,39285:20912,39286:20917,39287:20925,39288:20933,39289:20937,39290:20955,39291:20960,39292:34389,39293:20969,39294:20973,39296:20976,39297:20981,39298:20990,39299:20996,39300:21003,39301:21012,39302:21006,39303:21031,39304:21034,39305:21038,39306:21043,39307:21049,39308:21071,39309:21060,39310:21067,39311:21068,39312:21086,39313:21076,39314:21098,39315:21108,39316:21097,39317:21107,39318:21119,39319:21117,39320:21133,39321:21140,39322:21138,39323:21105,39324:21128,39325:21137,39326:36776,39327:36775,39328:21164,39329:21165,39330:21180,39331:21173,39332:21185,39333:21197,39334:21207,39335:21214,39336:21219,39337:21222,39338:39149,39339:21216,39340:21235,39341:21237,39342:21240,39343:21241,39344:21254,39345:21256,39346:30008,39347:21261,39348:21264,39349:21263,39350:21269,39351:21274,39352:21283,39353:21295,39354:21297,39355:21299,39356:21304,39357:21312,39358:21318,39359:21317,39360:19991,39361:21321,39362:21325,39363:20950,39364:21342,39365:21353,39366:21358,39367:22808,39368:21371,39369:21367,39370:21378,39371:21398,39372:21408,39373:21414,39374:21413,39375:21422,39376:21424,39377:21430,39378:21443,39379:31762,39380:38617,39381:21471,39382:26364,39383:29166,39384:21486,39385:21480,39386:21485,39387:21498,39388:21505,39389:21565,39390:21568,39391:21548,39392:21549,39393:21564,39394:21550,39395:21558,39396:21545,39397:21533,39398:21582,39399:21647,39400:21621,39401:21646,39402:21599,39403:21617,39404:21623,39405:21616,39406:21650,39407:21627,39408:21632,39409:21622,39410:21636,39411:21648,39412:21638,39413:21703,39414:21666,39415:21688,39416:21669,39417:21676,39418:21700,39419:21704,39420:21672,39488:21675,39489:21698,39490:21668,39491:21694,39492:21692,39493:21720,39494:21733,39495:21734,39496:21775,39497:21780,39498:21757,39499:21742,39500:21741,39501:21754,39502:21730,39503:21817,39504:21824,39505:21859,39506:21836,39507:21806,39508:21852,39509:21829,39510:21846,39511:21847,39512:21816,39513:21811,39514:21853,39515:21913,39516:21888,39517:21679,39518:21898,39519:21919,39520:21883,39521:21886,39522:21912,39523:21918,39524:21934,39525:21884,39526:21891,39527:21929,39528:21895,39529:21928,39530:21978,39531:21957,39532:21983,39533:21956,39534:21980,39535:21988,39536:21972,39537:22036,39538:22007,39539:22038,39540:22014,39541:22013,39542:22043,39543:22009,39544:22094,39545:22096,39546:29151,39547:22068,39548:22070,39549:22066,39550:22072,39552:22123,39553:22116,39554:22063,39555:22124,39556:22122,39557:22150,39558:22144,39559:22154,39560:22176,39561:22164,39562:22159,39563:22181,39564:22190,39565:22198,39566:22196,39567:22210,39568:22204,39569:22209,39570:22211,39571:22208,39572:22216,39573:22222,39574:22225,39575:22227,39576:22231,39577:22254,39578:22265,39579:22272,39580:22271,39581:22276,39582:22281,39583:22280,39584:22283,39585:22285,39586:22291,39587:22296,39588:22294,39589:21959,39590:22300,39591:22310,39592:22327,39593:22328,39594:22350,39595:22331,39596:22336,39597:22351,39598:22377,39599:22464,39600:22408,39601:22369,39602:22399,39603:22409,39604:22419,39605:22432,39606:22451,39607:22436,39608:22442,39609:22448,39610:22467,39611:22470,39612:22484,39613:22482,39614:22483,39615:22538,39616:22486,39617:22499,39618:22539,39619:22553,39620:22557,39621:22642,39622:22561,39623:22626,39624:22603,39625:22640,39626:27584,39627:22610,39628:22589,39629:22649,39630:22661,39631:22713,39632:22687,39633:22699,39634:22714,39635:22750,39636:22715,39637:22712,39638:22702,39639:22725,39640:22739,39641:22737,39642:22743,39643:22745,39644:22744,39645:22757,39646:22748,39647:22756,39648:22751,39649:22767,39650:22778,39651:22777,39652:22779,39653:22780,39654:22781,39655:22786,39656:22794,39657:22800,39658:22811,39659:26790,39660:22821,39661:22828,39662:22829,39663:22834,39664:22840,39665:22846,39666:31442,39667:22869,39668:22864,39669:22862,39670:22874,39671:22872,39672:22882,39673:22880,39674:22887,39675:22892,39676:22889,39744:22904,39745:22913,39746:22941,39747:20318,39748:20395,39749:22947,39750:22962,39751:22982,39752:23016,39753:23004,39754:22925,39755:23001,39756:23002,39757:23077,39758:23071,39759:23057,39760:23068,39761:23049,39762:23066,39763:23104,39764:23148,39765:23113,39766:23093,39767:23094,39768:23138,39769:23146,39770:23194,39771:23228,39772:23230,39773:23243,39774:23234,39775:23229,39776:23267,39777:23255,39778:23270,39779:23273,39780:23254,39781:23290,39782:23291,39783:23308,39784:23307,39785:23318,39786:23346,39787:23248,39788:23338,39789:23350,39790:23358,39791:23363,39792:23365,39793:23360,39794:23377,39795:23381,39796:23386,39797:23387,39798:23397,39799:23401,39800:23408,39801:23411,39802:23413,39803:23416,39804:25992,39805:23418,39806:23424,39808:23427,39809:23462,39810:23480,39811:23491,39812:23495,39813:23497,39814:23508,39815:23504,39816:23524,39817:23526,39818:23522,39819:23518,39820:23525,39821:23531,39822:23536,39823:23542,39824:23539,39825:23557,39826:23559,39827:23560,39828:23565,39829:23571,39830:23584,39831:23586,39832:23592,39833:23608,39834:23609,39835:23617,39836:23622,39837:23630,39838:23635,39839:23632,39840:23631,39841:23409,39842:23660,39843:23662,39844:20066,39845:23670,39846:23673,39847:23692,39848:23697,39849:23700,39850:22939,39851:23723,39852:23739,39853:23734,39854:23740,39855:23735,39856:23749,39857:23742,39858:23751,39859:23769,39860:23785,39861:23805,39862:23802,39863:23789,39864:23948,39865:23786,39866:23819,39867:23829,39868:23831,39869:23900,39870:23839,39871:23835,39872:23825,39873:23828,39874:23842,39875:23834,39876:23833,39877:23832,39878:23884,39879:23890,39880:23886,39881:23883,39882:23916,39883:23923,39884:23926,39885:23943,39886:23940,39887:23938,39888:23970,39889:23965,39890:23980,39891:23982,39892:23997,39893:23952,39894:23991,39895:23996,39896:24009,39897:24013,39898:24019,39899:24018,39900:24022,39901:24027,39902:24043,39903:24050,39904:24053,39905:24075,39906:24090,39907:24089,39908:24081,39909:24091,39910:24118,39911:24119,39912:24132,39913:24131,39914:24128,39915:24142,39916:24151,39917:24148,39918:24159,39919:24162,39920:24164,39921:24135,39922:24181,39923:24182,39924:24186,39925:40636,39926:24191,39927:24224,39928:24257,39929:24258,39930:24264,39931:24272,39932:24271,40000:24278,40001:24291,40002:24285,40003:24282,40004:24283,40005:24290,40006:24289,40007:24296,40008:24297,40009:24300,40010:24305,40011:24307,40012:24304,40013:24308,40014:24312,40015:24318,40016:24323,40017:24329,40018:24413,40019:24412,40020:24331,40021:24337,40022:24342,40023:24361,40024:24365,40025:24376,40026:24385,40027:24392,40028:24396,40029:24398,40030:24367,40031:24401,40032:24406,40033:24407,40034:24409,40035:24417,40036:24429,40037:24435,40038:24439,40039:24451,40040:24450,40041:24447,40042:24458,40043:24456,40044:24465,40045:24455,40046:24478,40047:24473,40048:24472,40049:24480,40050:24488,40051:24493,40052:24508,40053:24534,40054:24571,40055:24548,40056:24568,40057:24561,40058:24541,40059:24755,40060:24575,40061:24609,40062:24672,40064:24601,40065:24592,40066:24617,40067:24590,40068:24625,40069:24603,40070:24597,40071:24619,40072:24614,40073:24591,40074:24634,40075:24666,40076:24641,40077:24682,40078:24695,40079:24671,40080:24650,40081:24646,40082:24653,40083:24675,40084:24643,40085:24676,40086:24642,40087:24684,40088:24683,40089:24665,40090:24705,40091:24717,40092:24807,40093:24707,40094:24730,40095:24708,40096:24731,40097:24726,40098:24727,40099:24722,40100:24743,40101:24715,40102:24801,40103:24760,40104:24800,40105:24787,40106:24756,40107:24560,40108:24765,40109:24774,40110:24757,40111:24792,40112:24909,40113:24853,40114:24838,40115:24822,40116:24823,40117:24832,40118:24820,40119:24826,40120:24835,40121:24865,40122:24827,40123:24817,40124:24845,40125:24846,40126:24903,40127:24894,40128:24872,40129:24871,40130:24906,40131:24895,40132:24892,40133:24876,40134:24884,40135:24893,40136:24898,40137:24900,40138:24947,40139:24951,40140:24920,40141:24921,40142:24922,40143:24939,40144:24948,40145:24943,40146:24933,40147:24945,40148:24927,40149:24925,40150:24915,40151:24949,40152:24985,40153:24982,40154:24967,40155:25004,40156:24980,40157:24986,40158:24970,40159:24977,40160:25003,40161:25006,40162:25036,40163:25034,40164:25033,40165:25079,40166:25032,40167:25027,40168:25030,40169:25018,40170:25035,40171:32633,40172:25037,40173:25062,40174:25059,40175:25078,40176:25082,40177:25076,40178:25087,40179:25085,40180:25084,40181:25086,40182:25088,40183:25096,40184:25097,40185:25101,40186:25100,40187:25108,40188:25115,40256:25118,40257:25121,40258:25130,40259:25134,40260:25136,40261:25138,40262:25139,40263:25153,40264:25166,40265:25182,40266:25187,40267:25179,40268:25184,40269:25192,40270:25212,40271:25218,40272:25225,40273:25214,40274:25234,40275:25235,40276:25238,40277:25300,40278:25219,40279:25236,40280:25303,40281:25297,40282:25275,40283:25295,40284:25343,40285:25286,40286:25812,40287:25288,40288:25308,40289:25292,40290:25290,40291:25282,40292:25287,40293:25243,40294:25289,40295:25356,40296:25326,40297:25329,40298:25383,40299:25346,40300:25352,40301:25327,40302:25333,40303:25424,40304:25406,40305:25421,40306:25628,40307:25423,40308:25494,40309:25486,40310:25472,40311:25515,40312:25462,40313:25507,40314:25487,40315:25481,40316:25503,40317:25525,40318:25451,40320:25449,40321:25534,40322:25577,40323:25536,40324:25542,40325:25571,40326:25545,40327:25554,40328:25590,40329:25540,40330:25622,40331:25652,40332:25606,40333:25619,40334:25638,40335:25654,40336:25885,40337:25623,40338:25640,40339:25615,40340:25703,40341:25711,40342:25718,40343:25678,40344:25898,40345:25749,40346:25747,40347:25765,40348:25769,40349:25736,40350:25788,40351:25818,40352:25810,40353:25797,40354:25799,40355:25787,40356:25816,40357:25794,40358:25841,40359:25831,40360:33289,40361:25824,40362:25825,40363:25260,40364:25827,40365:25839,40366:25900,40367:25846,40368:25844,40369:25842,40370:25850,40371:25856,40372:25853,40373:25880,40374:25884,40375:25861,40376:25892,40377:25891,40378:25899,40379:25908,40380:25909,40381:25911,40382:25910,40383:25912,40384:30027,40385:25928,40386:25942,40387:25941,40388:25933,40389:25944,40390:25950,40391:25949,40392:25970,40393:25976,40394:25986,40395:25987,40396:35722,40397:26011,40398:26015,40399:26027,40400:26039,40401:26051,40402:26054,40403:26049,40404:26052,40405:26060,40406:26066,40407:26075,40408:26073,40409:26080,40410:26081,40411:26097,40412:26482,40413:26122,40414:26115,40415:26107,40416:26483,40417:26165,40418:26166,40419:26164,40420:26140,40421:26191,40422:26180,40423:26185,40424:26177,40425:26206,40426:26205,40427:26212,40428:26215,40429:26216,40430:26207,40431:26210,40432:26224,40433:26243,40434:26248,40435:26254,40436:26249,40437:26244,40438:26264,40439:26269,40440:26305,40441:26297,40442:26313,40443:26302,40444:26300,40512:26308,40513:26296,40514:26326,40515:26330,40516:26336,40517:26175,40518:26342,40519:26345,40520:26352,40521:26357,40522:26359,40523:26383,40524:26390,40525:26398,40526:26406,40527:26407,40528:38712,40529:26414,40530:26431,40531:26422,40532:26433,40533:26424,40534:26423,40535:26438,40536:26462,40537:26464,40538:26457,40539:26467,40540:26468,40541:26505,40542:26480,40543:26537,40544:26492,40545:26474,40546:26508,40547:26507,40548:26534,40549:26529,40550:26501,40551:26551,40552:26607,40553:26548,40554:26604,40555:26547,40556:26601,40557:26552,40558:26596,40559:26590,40560:26589,40561:26594,40562:26606,40563:26553,40564:26574,40565:26566,40566:26599,40567:27292,40568:26654,40569:26694,40570:26665,40571:26688,40572:26701,40573:26674,40574:26702,40576:26803,40577:26667,40578:26713,40579:26723,40580:26743,40581:26751,40582:26783,40583:26767,40584:26797,40585:26772,40586:26781,40587:26779,40588:26755,40589:27310,40590:26809,40591:26740,40592:26805,40593:26784,40594:26810,40595:26895,40596:26765,40597:26750,40598:26881,40599:26826,40600:26888,40601:26840,40602:26914,40603:26918,40604:26849,40605:26892,40606:26829,40607:26836,40608:26855,40609:26837,40610:26934,40611:26898,40612:26884,40613:26839,40614:26851,40615:26917,40616:26873,40617:26848,40618:26863,40619:26920,40620:26922,40621:26906,40622:26915,40623:26913,40624:26822,40625:27001,40626:26999,40627:26972,40628:27e3,40629:26987,40630:26964,40631:27006,40632:26990,40633:26937,40634:26996,40635:26941,40636:26969,40637:26928,40638:26977,40639:26974,40640:26973,40641:27009,40642:26986,40643:27058,40644:27054,40645:27088,40646:27071,40647:27073,40648:27091,40649:27070,40650:27086,40651:23528,40652:27082,40653:27101,40654:27067,40655:27075,40656:27047,40657:27182,40658:27025,40659:27040,40660:27036,40661:27029,40662:27060,40663:27102,40664:27112,40665:27138,40666:27163,40667:27135,40668:27402,40669:27129,40670:27122,40671:27111,40672:27141,40673:27057,40674:27166,40675:27117,40676:27156,40677:27115,40678:27146,40679:27154,40680:27329,40681:27171,40682:27155,40683:27204,40684:27148,40685:27250,40686:27190,40687:27256,40688:27207,40689:27234,40690:27225,40691:27238,40692:27208,40693:27192,40694:27170,40695:27280,40696:27277,40697:27296,40698:27268,40699:27298,40700:27299,40768:27287,40769:34327,40770:27323,40771:27331,40772:27330,40773:27320,40774:27315,40775:27308,40776:27358,40777:27345,40778:27359,40779:27306,40780:27354,40781:27370,40782:27387,40783:27397,40784:34326,40785:27386,40786:27410,40787:27414,40788:39729,40789:27423,40790:27448,40791:27447,40792:30428,40793:27449,40794:39150,40795:27463,40796:27459,40797:27465,40798:27472,40799:27481,40800:27476,40801:27483,40802:27487,40803:27489,40804:27512,40805:27513,40806:27519,40807:27520,40808:27524,40809:27523,40810:27533,40811:27544,40812:27541,40813:27550,40814:27556,40815:27562,40816:27563,40817:27567,40818:27570,40819:27569,40820:27571,40821:27575,40822:27580,40823:27590,40824:27595,40825:27603,40826:27615,40827:27628,40828:27627,40829:27635,40830:27631,40832:40638,40833:27656,40834:27667,40835:27668,40836:27675,40837:27684,40838:27683,40839:27742,40840:27733,40841:27746,40842:27754,40843:27778,40844:27789,40845:27802,40846:27777,40847:27803,40848:27774,40849:27752,40850:27763,40851:27794,40852:27792,40853:27844,40854:27889,40855:27859,40856:27837,40857:27863,40858:27845,40859:27869,40860:27822,40861:27825,40862:27838,40863:27834,40864:27867,40865:27887,40866:27865,40867:27882,40868:27935,40869:34893,40870:27958,40871:27947,40872:27965,40873:27960,40874:27929,40875:27957,40876:27955,40877:27922,40878:27916,40879:28003,40880:28051,40881:28004,40882:27994,40883:28025,40884:27993,40885:28046,40886:28053,40887:28644,40888:28037,40889:28153,40890:28181,40891:28170,40892:28085,40893:28103,40894:28134,40895:28088,40896:28102,40897:28140,40898:28126,40899:28108,40900:28136,40901:28114,40902:28101,40903:28154,40904:28121,40905:28132,40906:28117,40907:28138,40908:28142,40909:28205,40910:28270,40911:28206,40912:28185,40913:28274,40914:28255,40915:28222,40916:28195,40917:28267,40918:28203,40919:28278,40920:28237,40921:28191,40922:28227,40923:28218,40924:28238,40925:28196,40926:28415,40927:28189,40928:28216,40929:28290,40930:28330,40931:28312,40932:28361,40933:28343,40934:28371,40935:28349,40936:28335,40937:28356,40938:28338,40939:28372,40940:28373,40941:28303,40942:28325,40943:28354,40944:28319,40945:28481,40946:28433,40947:28748,40948:28396,40949:28408,40950:28414,40951:28479,40952:28402,40953:28465,40954:28399,40955:28466,40956:28364,161:65377,162:65378,163:65379,164:65380,165:65381,166:65382,167:65383,168:65384,169:65385,170:65386,171:65387,172:65388,173:65389,174:65390,175:65391,176:65392,177:65393,178:65394,179:65395,180:65396,181:65397,182:65398,183:65399,184:65400,185:65401,186:65402,187:65403,188:65404,189:65405,190:65406,191:65407,192:65408,193:65409,194:65410,195:65411,196:65412,197:65413,198:65414,199:65415,200:65416,201:65417,202:65418,203:65419,204:65420,205:65421,206:65422,207:65423,208:65424,209:65425,210:65426,211:65427,212:65428,213:65429,214:65430,215:65431,216:65432,217:65433,218:65434,219:65435,220:65436,221:65437,222:65438,223:65439,57408:28478,57409:28435,57410:28407,57411:28550,57412:28538,57413:28536,57414:28545,57415:28544,57416:28527,57417:28507,57418:28659,57419:28525,57420:28546,57421:28540,57422:28504,57423:28558,57424:28561,57425:28610,57426:28518,57427:28595,57428:28579,57429:28577,57430:28580,57431:28601,57432:28614,57433:28586,57434:28639,57435:28629,57436:28652,57437:28628,57438:28632,57439:28657,57440:28654,57441:28635,57442:28681,57443:28683,57444:28666,57445:28689,57446:28673,57447:28687,57448:28670,57449:28699,57450:28698,57451:28532,57452:28701,57453:28696,57454:28703,57455:28720,57456:28734,57457:28722,57458:28753,57459:28771,57460:28825,57461:28818,57462:28847,57463:28913,57464:28844,57465:28856,57466:28851,57467:28846,57468:28895,57469:28875,57470:28893,57472:28889,57473:28937,57474:28925,57475:28956,57476:28953,57477:29029,57478:29013,57479:29064,57480:29030,57481:29026,57482:29004,57483:29014,57484:29036,57485:29071,57486:29179,57487:29060,57488:29077,57489:29096,57490:29100,57491:29143,57492:29113,57493:29118,57494:29138,57495:29129,57496:29140,57497:29134,57498:29152,57499:29164,57500:29159,57501:29173,57502:29180,57503:29177,57504:29183,57505:29197,57506:29200,57507:29211,57508:29224,57509:29229,57510:29228,57511:29232,57512:29234,57513:29243,57514:29244,57515:29247,57516:29248,57517:29254,57518:29259,57519:29272,57520:29300,57521:29310,57522:29314,57523:29313,57524:29319,57525:29330,57526:29334,57527:29346,57528:29351,57529:29369,57530:29362,57531:29379,57532:29382,57533:29380,57534:29390,57535:29394,57536:29410,57537:29408,57538:29409,57539:29433,57540:29431,57541:20495,57542:29463,57543:29450,57544:29468,57545:29462,57546:29469,57547:29492,57548:29487,57549:29481,57550:29477,57551:29502,57552:29518,57553:29519,57554:40664,57555:29527,57556:29546,57557:29544,57558:29552,57559:29560,57560:29557,57561:29563,57562:29562,57563:29640,57564:29619,57565:29646,57566:29627,57567:29632,57568:29669,57569:29678,57570:29662,57571:29858,57572:29701,57573:29807,57574:29733,57575:29688,57576:29746,57577:29754,57578:29781,57579:29759,57580:29791,57581:29785,57582:29761,57583:29788,57584:29801,57585:29808,57586:29795,57587:29802,57588:29814,57589:29822,57590:29835,57591:29854,57592:29863,57593:29898,57594:29903,57595:29908,57596:29681,57664:29920,57665:29923,57666:29927,57667:29929,57668:29934,57669:29938,57670:29936,57671:29937,57672:29944,57673:29943,57674:29956,57675:29955,57676:29957,57677:29964,57678:29966,57679:29965,57680:29973,57681:29971,57682:29982,57683:29990,57684:29996,57685:30012,57686:30020,57687:30029,57688:30026,57689:30025,57690:30043,57691:30022,57692:30042,57693:30057,57694:30052,57695:30055,57696:30059,57697:30061,57698:30072,57699:30070,57700:30086,57701:30087,57702:30068,57703:30090,57704:30089,57705:30082,57706:30100,57707:30106,57708:30109,57709:30117,57710:30115,57711:30146,57712:30131,57713:30147,57714:30133,57715:30141,57716:30136,57717:30140,57718:30129,57719:30157,57720:30154,57721:30162,57722:30169,57723:30179,57724:30174,57725:30206,57726:30207,57728:30204,57729:30209,57730:30192,57731:30202,57732:30194,57733:30195,57734:30219,57735:30221,57736:30217,57737:30239,57738:30247,57739:30240,57740:30241,57741:30242,57742:30244,57743:30260,57744:30256,57745:30267,57746:30279,57747:30280,57748:30278,57749:30300,57750:30296,57751:30305,57752:30306,57753:30312,57754:30313,57755:30314,57756:30311,57757:30316,57758:30320,57759:30322,57760:30326,57761:30328,57762:30332,57763:30336,57764:30339,57765:30344,57766:30347,57767:30350,57768:30358,57769:30355,57770:30361,57771:30362,57772:30384,57773:30388,57774:30392,57775:30393,57776:30394,57777:30402,57778:30413,57779:30422,57780:30418,57781:30430,57782:30433,57783:30437,57784:30439,57785:30442,57786:34351,57787:30459,57788:30472,57789:30471,57790:30468,57791:30505,57792:30500,57793:30494,57794:30501,57795:30502,57796:30491,57797:30519,57798:30520,57799:30535,57800:30554,57801:30568,57802:30571,57803:30555,57804:30565,57805:30591,57806:30590,57807:30585,57808:30606,57809:30603,57810:30609,57811:30624,57812:30622,57813:30640,57814:30646,57815:30649,57816:30655,57817:30652,57818:30653,57819:30651,57820:30663,57821:30669,57822:30679,57823:30682,57824:30684,57825:30691,57826:30702,57827:30716,57828:30732,57829:30738,57830:31014,57831:30752,57832:31018,57833:30789,57834:30862,57835:30836,57836:30854,57837:30844,57838:30874,57839:30860,57840:30883,57841:30901,57842:30890,57843:30895,57844:30929,57845:30918,57846:30923,57847:30932,57848:30910,57849:30908,57850:30917,57851:30922,57852:30956,57920:30951,57921:30938,57922:30973,57923:30964,57924:30983,57925:30994,57926:30993,57927:31001,57928:31020,57929:31019,57930:31040,57931:31072,57932:31063,57933:31071,57934:31066,57935:31061,57936:31059,57937:31098,57938:31103,57939:31114,57940:31133,57941:31143,57942:40779,57943:31146,57944:31150,57945:31155,57946:31161,57947:31162,57948:31177,57949:31189,57950:31207,57951:31212,57952:31201,57953:31203,57954:31240,57955:31245,57956:31256,57957:31257,57958:31264,57959:31263,57960:31104,57961:31281,57962:31291,57963:31294,57964:31287,57965:31299,57966:31319,57967:31305,57968:31329,57969:31330,57970:31337,57971:40861,57972:31344,57973:31353,57974:31357,57975:31368,57976:31383,57977:31381,57978:31384,57979:31382,57980:31401,57981:31432,57982:31408,57984:31414,57985:31429,57986:31428,57987:31423,57988:36995,57989:31431,57990:31434,57991:31437,57992:31439,57993:31445,57994:31443,57995:31449,57996:31450,57997:31453,57998:31457,57999:31458,58000:31462,58001:31469,58002:31472,58003:31490,58004:31503,58005:31498,58006:31494,58007:31539,58008:31512,58009:31513,58010:31518,58011:31541,58012:31528,58013:31542,58014:31568,58015:31610,58016:31492,58017:31565,58018:31499,58019:31564,58020:31557,58021:31605,58022:31589,58023:31604,58024:31591,58025:31600,58026:31601,58027:31596,58028:31598,58029:31645,58030:31640,58031:31647,58032:31629,58033:31644,58034:31642,58035:31627,58036:31634,58037:31631,58038:31581,58039:31641,58040:31691,58041:31681,58042:31692,58043:31695,58044:31668,58045:31686,58046:31709,58047:31721,58048:31761,58049:31764,58050:31718,58051:31717,58052:31840,58053:31744,58054:31751,58055:31763,58056:31731,58057:31735,58058:31767,58059:31757,58060:31734,58061:31779,58062:31783,58063:31786,58064:31775,58065:31799,58066:31787,58067:31805,58068:31820,58069:31811,58070:31828,58071:31823,58072:31808,58073:31824,58074:31832,58075:31839,58076:31844,58077:31830,58078:31845,58079:31852,58080:31861,58081:31875,58082:31888,58083:31908,58084:31917,58085:31906,58086:31915,58087:31905,58088:31912,58089:31923,58090:31922,58091:31921,58092:31918,58093:31929,58094:31933,58095:31936,58096:31941,58097:31938,58098:31960,58099:31954,58100:31964,58101:31970,58102:39739,58103:31983,58104:31986,58105:31988,58106:31990,58107:31994,58108:32006,58176:32002,58177:32028,58178:32021,58179:32010,58180:32069,58181:32075,58182:32046,58183:32050,58184:32063,58185:32053,58186:32070,58187:32115,58188:32086,58189:32078,58190:32114,58191:32104,58192:32110,58193:32079,58194:32099,58195:32147,58196:32137,58197:32091,58198:32143,58199:32125,58200:32155,58201:32186,58202:32174,58203:32163,58204:32181,58205:32199,58206:32189,58207:32171,58208:32317,58209:32162,58210:32175,58211:32220,58212:32184,58213:32159,58214:32176,58215:32216,58216:32221,58217:32228,58218:32222,58219:32251,58220:32242,58221:32225,58222:32261,58223:32266,58224:32291,58225:32289,58226:32274,58227:32305,58228:32287,58229:32265,58230:32267,58231:32290,58232:32326,58233:32358,58234:32315,58235:32309,58236:32313,58237:32323,58238:32311,58240:32306,58241:32314,58242:32359,58243:32349,58244:32342,58245:32350,58246:32345,58247:32346,58248:32377,58249:32362,58250:32361,58251:32380,58252:32379,58253:32387,58254:32213,58255:32381,58256:36782,58257:32383,58258:32392,58259:32393,58260:32396,58261:32402,58262:32400,58263:32403,58264:32404,58265:32406,58266:32398,58267:32411,58268:32412,58269:32568,58270:32570,58271:32581,58272:32588,58273:32589,58274:32590,58275:32592,58276:32593,58277:32597,58278:32596,58279:32600,58280:32607,58281:32608,58282:32616,58283:32617,58284:32615,58285:32632,58286:32642,58287:32646,58288:32643,58289:32648,58290:32647,58291:32652,58292:32660,58293:32670,58294:32669,58295:32666,58296:32675,58297:32687,58298:32690,58299:32697,58300:32686,58301:32694,58302:32696,58303:35697,58304:32709,58305:32710,58306:32714,58307:32725,58308:32724,58309:32737,58310:32742,58311:32745,58312:32755,58313:32761,58314:39132,58315:32774,58316:32772,58317:32779,58318:32786,58319:32792,58320:32793,58321:32796,58322:32801,58323:32808,58324:32831,58325:32827,58326:32842,58327:32838,58328:32850,58329:32856,58330:32858,58331:32863,58332:32866,58333:32872,58334:32883,58335:32882,58336:32880,58337:32886,58338:32889,58339:32893,58340:32895,58341:32900,58342:32902,58343:32901,58344:32923,58345:32915,58346:32922,58347:32941,58348:20880,58349:32940,58350:32987,58351:32997,58352:32985,58353:32989,58354:32964,58355:32986,58356:32982,58357:33033,58358:33007,58359:33009,58360:33051,58361:33065,58362:33059,58363:33071,58364:33099,58432:38539,58433:33094,58434:33086,58435:33107,58436:33105,58437:33020,58438:33137,58439:33134,58440:33125,58441:33126,58442:33140,58443:33155,58444:33160,58445:33162,58446:33152,58447:33154,58448:33184,58449:33173,58450:33188,58451:33187,58452:33119,58453:33171,58454:33193,58455:33200,58456:33205,58457:33214,58458:33208,58459:33213,58460:33216,58461:33218,58462:33210,58463:33225,58464:33229,58465:33233,58466:33241,58467:33240,58468:33224,58469:33242,58470:33247,58471:33248,58472:33255,58473:33274,58474:33275,58475:33278,58476:33281,58477:33282,58478:33285,58479:33287,58480:33290,58481:33293,58482:33296,58483:33302,58484:33321,58485:33323,58486:33336,58487:33331,58488:33344,58489:33369,58490:33368,58491:33373,58492:33370,58493:33375,58494:33380,58496:33378,58497:33384,58498:33386,58499:33387,58500:33326,58501:33393,58502:33399,58503:33400,58504:33406,58505:33421,58506:33426,58507:33451,58508:33439,58509:33467,58510:33452,58511:33505,58512:33507,58513:33503,58514:33490,58515:33524,58516:33523,58517:33530,58518:33683,58519:33539,58520:33531,58521:33529,58522:33502,58523:33542,58524:33500,58525:33545,58526:33497,58527:33589,58528:33588,58529:33558,58530:33586,58531:33585,58532:33600,58533:33593,58534:33616,58535:33605,58536:33583,58537:33579,58538:33559,58539:33560,58540:33669,58541:33690,58542:33706,58543:33695,58544:33698,58545:33686,58546:33571,58547:33678,58548:33671,58549:33674,58550:33660,58551:33717,58552:33651,58553:33653,58554:33696,58555:33673,58556:33704,58557:33780,58558:33811,58559:33771,58560:33742,58561:33789,58562:33795,58563:33752,58564:33803,58565:33729,58566:33783,58567:33799,58568:33760,58569:33778,58570:33805,58571:33826,58572:33824,58573:33725,58574:33848,58575:34054,58576:33787,58577:33901,58578:33834,58579:33852,58580:34138,58581:33924,58582:33911,58583:33899,58584:33965,58585:33902,58586:33922,58587:33897,58588:33862,58589:33836,58590:33903,58591:33913,58592:33845,58593:33994,58594:33890,58595:33977,58596:33983,58597:33951,58598:34009,58599:33997,58600:33979,58601:34010,58602:34e3,58603:33985,58604:33990,58605:34006,58606:33953,58607:34081,58608:34047,58609:34036,58610:34071,58611:34072,58612:34092,58613:34079,58614:34069,58615:34068,58616:34044,58617:34112,58618:34147,58619:34136,58620:34120,58688:34113,58689:34306,58690:34123,58691:34133,58692:34176,58693:34212,58694:34184,58695:34193,58696:34186,58697:34216,58698:34157,58699:34196,58700:34203,58701:34282,58702:34183,58703:34204,58704:34167,58705:34174,58706:34192,58707:34249,58708:34234,58709:34255,58710:34233,58711:34256,58712:34261,58713:34269,58714:34277,58715:34268,58716:34297,58717:34314,58718:34323,58719:34315,58720:34302,58721:34298,58722:34310,58723:34338,58724:34330,58725:34352,58726:34367,58727:34381,58728:20053,58729:34388,58730:34399,58731:34407,58732:34417,58733:34451,58734:34467,58735:34473,58736:34474,58737:34443,58738:34444,58739:34486,58740:34479,58741:34500,58742:34502,58743:34480,58744:34505,58745:34851,58746:34475,58747:34516,58748:34526,58749:34537,58750:34540,58752:34527,58753:34523,58754:34543,58755:34578,58756:34566,58757:34568,58758:34560,58759:34563,58760:34555,58761:34577,58762:34569,58763:34573,58764:34553,58765:34570,58766:34612,58767:34623,58768:34615,58769:34619,58770:34597,58771:34601,58772:34586,58773:34656,58774:34655,58775:34680,58776:34636,58777:34638,58778:34676,58779:34647,58780:34664,58781:34670,58782:34649,58783:34643,58784:34659,58785:34666,58786:34821,58787:34722,58788:34719,58789:34690,58790:34735,58791:34763,58792:34749,58793:34752,58794:34768,58795:38614,58796:34731,58797:34756,58798:34739,58799:34759,58800:34758,58801:34747,58802:34799,58803:34802,58804:34784,58805:34831,58806:34829,58807:34814,58808:34806,58809:34807,58810:34830,58811:34770,58812:34833,58813:34838,58814:34837,58815:34850,58816:34849,58817:34865,58818:34870,58819:34873,58820:34855,58821:34875,58822:34884,58823:34882,58824:34898,58825:34905,58826:34910,58827:34914,58828:34923,58829:34945,58830:34942,58831:34974,58832:34933,58833:34941,58834:34997,58835:34930,58836:34946,58837:34967,58838:34962,58839:34990,58840:34969,58841:34978,58842:34957,58843:34980,58844:34992,58845:35007,58846:34993,58847:35011,58848:35012,58849:35028,58850:35032,58851:35033,58852:35037,58853:35065,58854:35074,58855:35068,58856:35060,58857:35048,58858:35058,58859:35076,58860:35084,58861:35082,58862:35091,58863:35139,58864:35102,58865:35109,58866:35114,58867:35115,58868:35137,58869:35140,58870:35131,58871:35126,58872:35128,58873:35148,58874:35101,58875:35168,58876:35166,58944:35174,58945:35172,58946:35181,58947:35178,58948:35183,58949:35188,58950:35191,58951:35198,58952:35203,58953:35208,58954:35210,58955:35219,58956:35224,58957:35233,58958:35241,58959:35238,58960:35244,58961:35247,58962:35250,58963:35258,58964:35261,58965:35263,58966:35264,58967:35290,58968:35292,58969:35293,58970:35303,58971:35316,58972:35320,58973:35331,58974:35350,58975:35344,58976:35340,58977:35355,58978:35357,58979:35365,58980:35382,58981:35393,58982:35419,58983:35410,58984:35398,58985:35400,58986:35452,58987:35437,58988:35436,58989:35426,58990:35461,58991:35458,58992:35460,58993:35496,58994:35489,58995:35473,58996:35493,58997:35494,58998:35482,58999:35491,59000:35524,59001:35533,59002:35522,59003:35546,59004:35563,59005:35571,59006:35559,59008:35556,59009:35569,59010:35604,59011:35552,59012:35554,59013:35575,59014:35550,59015:35547,59016:35596,59017:35591,59018:35610,59019:35553,59020:35606,59021:35600,59022:35607,59023:35616,59024:35635,59025:38827,59026:35622,59027:35627,59028:35646,59029:35624,59030:35649,59031:35660,59032:35663,59033:35662,59034:35657,59035:35670,59036:35675,59037:35674,59038:35691,59039:35679,59040:35692,59041:35695,59042:35700,59043:35709,59044:35712,59045:35724,59046:35726,59047:35730,59048:35731,59049:35734,59050:35737,59051:35738,59052:35898,59053:35905,59054:35903,59055:35912,59056:35916,59057:35918,59058:35920,59059:35925,59060:35938,59061:35948,59062:35960,59063:35962,59064:35970,59065:35977,59066:35973,59067:35978,59068:35981,59069:35982,59070:35988,59071:35964,59072:35992,59073:25117,59074:36013,59075:36010,59076:36029,59077:36018,59078:36019,59079:36014,59080:36022,59081:36040,59082:36033,59083:36068,59084:36067,59085:36058,59086:36093,59087:36090,59088:36091,59089:36100,59090:36101,59091:36106,59092:36103,59093:36111,59094:36109,59095:36112,59096:40782,59097:36115,59098:36045,59099:36116,59100:36118,59101:36199,59102:36205,59103:36209,59104:36211,59105:36225,59106:36249,59107:36290,59108:36286,59109:36282,59110:36303,59111:36314,59112:36310,59113:36300,59114:36315,59115:36299,59116:36330,59117:36331,59118:36319,59119:36323,59120:36348,59121:36360,59122:36361,59123:36351,59124:36381,59125:36382,59126:36368,59127:36383,59128:36418,59129:36405,59130:36400,59131:36404,59132:36426,59200:36423,59201:36425,59202:36428,59203:36432,59204:36424,59205:36441,59206:36452,59207:36448,59208:36394,59209:36451,59210:36437,59211:36470,59212:36466,59213:36476,59214:36481,59215:36487,59216:36485,59217:36484,59218:36491,59219:36490,59220:36499,59221:36497,59222:36500,59223:36505,59224:36522,59225:36513,59226:36524,59227:36528,59228:36550,59229:36529,59230:36542,59231:36549,59232:36552,59233:36555,59234:36571,59235:36579,59236:36604,59237:36603,59238:36587,59239:36606,59240:36618,59241:36613,59242:36629,59243:36626,59244:36633,59245:36627,59246:36636,59247:36639,59248:36635,59249:36620,59250:36646,59251:36659,59252:36667,59253:36665,59254:36677,59255:36674,59256:36670,59257:36684,59258:36681,59259:36678,59260:36686,59261:36695,59262:36700,59264:36706,59265:36707,59266:36708,59267:36764,59268:36767,59269:36771,59270:36781,59271:36783,59272:36791,59273:36826,59274:36837,59275:36834,59276:36842,59277:36847,59278:36999,59279:36852,59280:36869,59281:36857,59282:36858,59283:36881,59284:36885,59285:36897,59286:36877,59287:36894,59288:36886,59289:36875,59290:36903,59291:36918,59292:36917,59293:36921,59294:36856,59295:36943,59296:36944,59297:36945,59298:36946,59299:36878,59300:36937,59301:36926,59302:36950,59303:36952,59304:36958,59305:36968,59306:36975,59307:36982,59308:38568,59309:36978,59310:36994,59311:36989,59312:36993,59313:36992,59314:37002,59315:37001,59316:37007,59317:37032,59318:37039,59319:37041,59320:37045,59321:37090,59322:37092,59323:25160,59324:37083,59325:37122,59326:37138,59327:37145,59328:37170,59329:37168,59330:37194,59331:37206,59332:37208,59333:37219,59334:37221,59335:37225,59336:37235,59337:37234,59338:37259,59339:37257,59340:37250,59341:37282,59342:37291,59343:37295,59344:37290,59345:37301,59346:37300,59347:37306,59348:37312,59349:37313,59350:37321,59351:37323,59352:37328,59353:37334,59354:37343,59355:37345,59356:37339,59357:37372,59358:37365,59359:37366,59360:37406,59361:37375,59362:37396,59363:37420,59364:37397,59365:37393,59366:37470,59367:37463,59368:37445,59369:37449,59370:37476,59371:37448,59372:37525,59373:37439,59374:37451,59375:37456,59376:37532,59377:37526,59378:37523,59379:37531,59380:37466,59381:37583,59382:37561,59383:37559,59384:37609,59385:37647,59386:37626,59387:37700,59388:37678,59456:37657,59457:37666,59458:37658,59459:37667,59460:37690,59461:37685,59462:37691,59463:37724,59464:37728,59465:37756,59466:37742,59467:37718,59468:37808,59469:37804,59470:37805,59471:37780,59472:37817,59473:37846,59474:37847,59475:37864,59476:37861,59477:37848,59478:37827,59479:37853,59480:37840,59481:37832,59482:37860,59483:37914,59484:37908,59485:37907,59486:37891,59487:37895,59488:37904,59489:37942,59490:37931,59491:37941,59492:37921,59493:37946,59494:37953,59495:37970,59496:37956,59497:37979,59498:37984,59499:37986,59500:37982,59501:37994,59502:37417,59503:38e3,59504:38005,59505:38007,59506:38013,59507:37978,59508:38012,59509:38014,59510:38017,59511:38015,59512:38274,59513:38279,59514:38282,59515:38292,59516:38294,59517:38296,59518:38297,59520:38304,59521:38312,59522:38311,59523:38317,59524:38332,59525:38331,59526:38329,59527:38334,59528:38346,59529:28662,59530:38339,59531:38349,59532:38348,59533:38357,59534:38356,59535:38358,59536:38364,59537:38369,59538:38373,59539:38370,59540:38433,59541:38440,59542:38446,59543:38447,59544:38466,59545:38476,59546:38479,59547:38475,59548:38519,59549:38492,59550:38494,59551:38493,59552:38495,59553:38502,59554:38514,59555:38508,59556:38541,59557:38552,59558:38549,59559:38551,59560:38570,59561:38567,59562:38577,59563:38578,59564:38576,59565:38580,59566:38582,59567:38584,59568:38585,59569:38606,59570:38603,59571:38601,59572:38605,59573:35149,59574:38620,59575:38669,59576:38613,59577:38649,59578:38660,59579:38662,59580:38664,59581:38675,59582:38670,59583:38673,59584:38671,59585:38678,59586:38681,59587:38692,59588:38698,59589:38704,59590:38713,59591:38717,59592:38718,59593:38724,59594:38726,59595:38728,59596:38722,59597:38729,59598:38748,59599:38752,59600:38756,59601:38758,59602:38760,59603:21202,59604:38763,59605:38769,59606:38777,59607:38789,59608:38780,59609:38785,59610:38778,59611:38790,59612:38795,59613:38799,59614:38800,59615:38812,59616:38824,59617:38822,59618:38819,59619:38835,59620:38836,59621:38851,59622:38854,59623:38856,59624:38859,59625:38876,59626:38893,59627:40783,59628:38898,59629:31455,59630:38902,59631:38901,59632:38927,59633:38924,59634:38968,59635:38948,59636:38945,59637:38967,59638:38973,59639:38982,59640:38991,59641:38987,59642:39019,59643:39023,59644:39024,59712:39025,59713:39028,59714:39027,59715:39082,59716:39087,59717:39089,59718:39094,59719:39108,59720:39107,59721:39110,59722:39145,59723:39147,59724:39171,59725:39177,59726:39186,59727:39188,59728:39192,59729:39201,59730:39197,59731:39198,59732:39204,59733:39200,59734:39212,59735:39214,59736:39229,59737:39230,59738:39234,59739:39241,59740:39237,59741:39248,59742:39243,59743:39249,59744:39250,59745:39244,59746:39253,59747:39319,59748:39320,59749:39333,59750:39341,59751:39342,59752:39356,59753:39391,59754:39387,59755:39389,59756:39384,59757:39377,59758:39405,59759:39406,59760:39409,59761:39410,59762:39419,59763:39416,59764:39425,59765:39439,59766:39429,59767:39394,59768:39449,59769:39467,59770:39479,59771:39493,59772:39490,59773:39488,59774:39491,59776:39486,59777:39509,59778:39501,59779:39515,59780:39511,59781:39519,59782:39522,59783:39525,59784:39524,59785:39529,59786:39531,59787:39530,59788:39597,59789:39600,59790:39612,59791:39616,59792:39631,59793:39633,59794:39635,59795:39636,59796:39646,59797:39647,59798:39650,59799:39651,59800:39654,59801:39663,59802:39659,59803:39662,59804:39668,59805:39665,59806:39671,59807:39675,59808:39686,59809:39704,59810:39706,59811:39711,59812:39714,59813:39715,59814:39717,59815:39719,59816:39720,59817:39721,59818:39722,59819:39726,59820:39727,59821:39730,59822:39748,59823:39747,59824:39759,59825:39757,59826:39758,59827:39761,59828:39768,59829:39796,59830:39827,59831:39811,59832:39825,59833:39830,59834:39831,59835:39839,59836:39840,59837:39848,59838:39860,59839:39872,59840:39882,59841:39865,59842:39878,59843:39887,59844:39889,59845:39890,59846:39907,59847:39906,59848:39908,59849:39892,59850:39905,59851:39994,59852:39922,59853:39921,59854:39920,59855:39957,59856:39956,59857:39945,59858:39955,59859:39948,59860:39942,59861:39944,59862:39954,59863:39946,59864:39940,59865:39982,59866:39963,59867:39973,59868:39972,59869:39969,59870:39984,59871:40007,59872:39986,59873:40006,59874:39998,59875:40026,59876:40032,59877:40039,59878:40054,59879:40056,59880:40167,59881:40172,59882:40176,59883:40201,59884:40200,59885:40171,59886:40195,59887:40198,59888:40234,59889:40230,59890:40367,59891:40227,59892:40223,59893:40260,59894:40213,59895:40210,59896:40257,59897:40255,59898:40254,59899:40262,59900:40264,59968:40285,59969:40286,59970:40292,59971:40273,59972:40272,59973:40281,59974:40306,59975:40329,59976:40327,59977:40363,59978:40303,59979:40314,59980:40346,59981:40356,59982:40361,59983:40370,59984:40388,59985:40385,59986:40379,59987:40376,59988:40378,59989:40390,59990:40399,59991:40386,59992:40409,59993:40403,59994:40440,59995:40422,59996:40429,59997:40431,59998:40445,59999:40474,60000:40475,60001:40478,60002:40565,60003:40569,60004:40573,60005:40577,60006:40584,60007:40587,60008:40588,60009:40594,60010:40597,60011:40593,60012:40605,60013:40613,60014:40617,60015:40632,60016:40618,60017:40621,60018:38753,60019:40652,60020:40654,60021:40655,60022:40656,60023:40660,60024:40668,60025:40670,60026:40669,60027:40672,60028:40677,60029:40680,60030:40687,60032:40692,60033:40694,60034:40695,60035:40697,60036:40699,60037:40700,60038:40701,60039:40711,60040:40712,60041:30391,60042:40725,60043:40737,60044:40748,60045:40766,60046:40778,60047:40786,60048:40788,60049:40803,60050:40799,60051:40800,60052:40801,60053:40806,60054:40807,60055:40812,60056:40810,60057:40823,60058:40818,60059:40822,60060:40853,60061:40860,60062:40864,60063:22575,60064:27079,60065:36953,60066:29796,60067:20956,60068:29081}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(1),i=r(2);e.decode=function(t,e){var r=new Uint8ClampedArray(t.length);r.set(t);for(var o=new n.default(285,256,0),a=new i.default(o,r),s=new Uint8ClampedArray(e),u=!1,l=0;l=n/2;){var u=i,l=a;if(a=s,(i=o).isZero())return null;o=u;for(var c=t.zero,f=i.getCoefficient(i.degree()),h=t.inverse(f);o.degree()>=i.degree()&&!o.isZero();){var p=o.degree()-i.degree(),d=t.multiply(o.getCoefficient(o.degree()),h);c=c.addOrSubtract(t.buildMonomial(p,d)),o=o.addOrSubtract(i.multiplyByMonomial(p,d))}if(s=c.multiplyPoly(a).addOrSubtract(l),o.degree()>=i.degree())return null}var g=s.getCoefficient(0);if(0===g)return null;var m,v=t.inverse(g);return[s.multiply(v),o.multiply(v)]}(o,o.buildMonomial(e,1),f,e);if(null===h)return null;var p=function(t,e){var r=e.degree();if(1===r)return[e.getCoefficient(1)];for(var n=new Array(r),i=0,o=1;oMath.abs(e.x-t.x);c?(i=Math.floor(t.y),o=Math.floor(t.x),s=Math.floor(e.y),u=Math.floor(e.x)):(i=Math.floor(t.x),o=Math.floor(t.y),s=Math.floor(e.x),u=Math.floor(e.y));for(var f=Math.abs(s-i),h=Math.abs(u-o),p=Math.floor(-f/2),d=i0){if(_===u)break;_+=g,p-=f}}for(var w=[],k=0;k=t.bottom.startX&&v<=t.bottom.endX||m>=t.bottom.startX&&v<=t.bottom.endX||v<=t.bottom.startX&&m>=t.bottom.endX&&f[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:r.push({top:_,bottom:_})}if(g){var y,b=e-f[4],w=b-f[3];_={startX:w,y:n,endX:b},(y=c.filter(function(t){return w>=t.bottom.startX&&w<=t.bottom.endX||b>=t.bottom.startX&&w<=t.bottom.endX||w<=t.bottom.startX&&b>=t.bottom.endX&&f[2]/(t.bottom.endX-t.bottom.startX)i})).length>0?y[0].bottom=_:c.push({top:_,bottom:_})}}},p=-1;p<=t.width;p++)h(p);e.push.apply(e,r.filter(function(t){return t.bottom.y!==n&&t.bottom.y-t.top.y>=2})),r=r.filter(function(t){return t.bottom.y===n}),u.push.apply(u,c.filter(function(t){return t.bottom.y!==n})),c=c.filter(function(t){return t.bottom.y===n})},p=0;p<=t.height;p++)h(p);e.push.apply(e,r.filter(function(t){return t.bottom.y-t.top.y>=2})),u.push.apply(u,c);var d=e.filter(function(t){return t.bottom.y-t.top.y>=2}).map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.round(r),Math.round(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1],o=s(i)/i.length;return{score:f({x:Math.round(r),y:Math.round(n)},[1,1,3,1,1],t),x:r,y:n,size:o}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}).map(function(t,e,r){if(e>n)return null;var i=r.filter(function(t,r){return e!==r}).map(function(e){return{x:e.x,y:e.y,score:e.score+Math.pow(e.size-t.size,2)/t.size,size:e.size}}).sort(function(t,e){return t.score-e.score});if(i.length<2)return null;var o=t.score+i[0].score+i[1].score;return{points:[t].concat(i.slice(0,2)),score:o}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score});if(0===d.length)return null;var g,m,v=function(t,e,r){var n,i,o,s,u,l,c,f=a(t,e),h=a(e,r),p=a(t,r);return h>=f&&h>=p?(n=(s=[e,t,r])[0],i=s[1],o=s[2]):p>=h&&p>=f?(n=(u=[t,e,r])[0],i=u[1],o=u[2]):(n=(l=[t,r,e])[0],i=l[1],o=l[2]),(o.x-i.x)*(n.y-i.y)-(o.y-i.y)*(n.x-i.x)<0&&(n=(c=[o,n])[0],o=c[1]),{bottomLeft:n,topLeft:i,topRight:o}}(d[0].points[0],d[0].points[1],d[0].points[2]),_=v.topRight,y=v.topLeft,b=v.bottomLeft;try{w=function(t,e,r,n){var i=(s(l(t,r,n,5))/7+s(l(t,e,n,5))/7+s(l(r,t,n,5))/7+s(l(e,t,n,5))/7)/4;if(i<1)throw new Error("Invalid module size");var o=Math.round(a(t,e)/i),u=Math.round(a(t,r)/i),c=Math.floor((o+u)/2)+7;switch(c%4){case 0:c++;break;case 2:c--}return{dimension:c,moduleSize:i}}(y,_,b,t),g=w.dimension,m=w.moduleSize}catch(t){return null}var w,k=_.x-y.x+b.x,x=_.y-y.y+b.y,B=(a(y,b)+a(y,_))/2/m,C=1-3/B,E={x:y.x+C*(k-y.x),y:y.y+C*(x-y.y)},P=u.map(function(e){var r=(e.top.startX+e.top.endX+e.bottom.startX+e.bottom.endX)/4,n=(e.top.y+e.bottom.y+1)/2;if(t.get(Math.floor(r),Math.floor(n))){var i=[e.top.endX-e.top.startX,e.bottom.endX-e.bottom.startX,e.bottom.y-e.top.y+1];return s(i),{x:r,y:n,score:f({x:Math.floor(r),y:Math.floor(n)},[1,1,1],t)+a({x:r,y:n},E)}}}).filter(function(t){return!!t}).sort(function(t,e){return t.score-e.score}),j=B>=15&&P.length?P[0]:E;return{alignmentPattern:{x:j.x,y:j.y},bottomLeft:{x:b.x,y:b.y},dimension:g,topLeft:{x:y.x,y:y.y},topRight:{x:_.x,y:_.y}}}}]).default},"object"==typeof r&&"object"==typeof e?e.exports=i():"function"==typeof define&&define.amd?define([],i):"object"==typeof r?r.jsQR=i():n.jsQR=i()},{}],76:[function(t,e,r){(function(t){(function(){var n,i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="__lodash_hash_undefined__",u=500,l="__lodash_placeholder__",c=1,f=2,h=4,p=1,d=2,g=1,m=2,v=4,_=8,y=16,b=32,w=64,k=128,x=256,B=512,C=30,E="...",P=800,j=16,S=1,T=2,A=1/0,M=9007199254740991,I=1.7976931348623157e308,R=NaN,L=4294967295,F=L-1,O=L>>>1,D=[["ary",k],["bind",g],["bindKey",m],["curry",_],["curryRight",y],["flip",B],["partial",b],["partialRight",w],["rearg",x]],N="[object Arguments]",U="[object Array]",z="[object AsyncFunction]",q="[object Boolean]",V="[object Date]",H="[object DOMException]",G="[object Error]",W="[object Function]",Z="[object GeneratorFunction]",Y="[object Map]",X="[object Number]",$="[object Null]",J="[object Object]",K="[object Proxy]",Q="[object RegExp]",tt="[object Set]",et="[object String]",rt="[object Symbol]",nt="[object Undefined]",it="[object WeakMap]",ot="[object WeakSet]",at="[object ArrayBuffer]",st="[object DataView]",ut="[object Float32Array]",lt="[object Float64Array]",ct="[object Int8Array]",ft="[object Int16Array]",ht="[object Int32Array]",pt="[object Uint8Array]",dt="[object Uint8ClampedArray]",gt="[object Uint16Array]",mt="[object Uint32Array]",vt=/\b__p \+= '';/g,_t=/\b(__p \+=) '' \+/g,yt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,bt=/&(?:amp|lt|gt|quot|#39);/g,wt=/[&<>"']/g,kt=RegExp(bt.source),xt=RegExp(wt.source),Bt=/<%-([\s\S]+?)%>/g,Ct=/<%([\s\S]+?)%>/g,Et=/<%=([\s\S]+?)%>/g,Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,jt=/^\w*$/,St=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tt=/[\\^$.*+?()[\]{}|]/g,At=RegExp(Tt.source),Mt=/^\s+|\s+$/g,It=/^\s+/,Rt=/\s+$/,Lt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,Ot=/,? & /,Dt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Nt=/\\(\\)?/g,Ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Vt=/^0b[01]+$/i,Ht=/^\[object .+?Constructor\]$/,Gt=/^0o[0-7]+$/i,Wt=/^(?:0|[1-9]\d*)$/,Zt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yt=/($^)/,Xt=/['\n\r\u2028\u2029\\]/g,$t="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Jt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Kt="[\\ud800-\\udfff]",Qt="["+Jt+"]",te="["+$t+"]",ee="\\d+",re="[\\u2700-\\u27bf]",ne="[a-z\\xdf-\\xf6\\xf8-\\xff]",ie="[^\\ud800-\\udfff"+Jt+ee+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",oe="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",se="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",le="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ce="(?:"+ne+"|"+ie+")",fe="(?:"+le+"|"+ie+")",he="(?:"+te+"|"+oe+")"+"?",pe="[\\ufe0e\\ufe0f]?"+he+("(?:\\u200d(?:"+[ae,se,ue].join("|")+")[\\ufe0e\\ufe0f]?"+he+")*"),de="(?:"+[re,se,ue].join("|")+")"+pe,ge="(?:"+[ae+te+"?",te,se,ue,Kt].join("|")+")",me=RegExp("['’]","g"),ve=RegExp(te,"g"),_e=RegExp(oe+"(?="+oe+")|"+ge+pe,"g"),ye=RegExp([le+"?"+ne+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Qt,le,"$"].join("|")+")",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Qt,le+ce,"$"].join("|")+")",le+"?"+ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",le+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ee,de].join("|"),"g"),be=RegExp("[\\u200d\\ud800-\\udfff"+$t+"\\ufe0e\\ufe0f]"),we=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ke=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,Be={};Be[ut]=Be[lt]=Be[ct]=Be[ft]=Be[ht]=Be[pt]=Be[dt]=Be[gt]=Be[mt]=!0,Be[N]=Be[U]=Be[at]=Be[q]=Be[st]=Be[V]=Be[G]=Be[W]=Be[Y]=Be[X]=Be[J]=Be[Q]=Be[tt]=Be[et]=Be[it]=!1;var Ce={};Ce[N]=Ce[U]=Ce[at]=Ce[st]=Ce[q]=Ce[V]=Ce[ut]=Ce[lt]=Ce[ct]=Ce[ft]=Ce[ht]=Ce[Y]=Ce[X]=Ce[J]=Ce[Q]=Ce[tt]=Ce[et]=Ce[rt]=Ce[pt]=Ce[dt]=Ce[gt]=Ce[mt]=!0,Ce[G]=Ce[W]=Ce[it]=!1;var Ee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Pe=parseFloat,je=parseInt,Se="object"==typeof t&&t&&t.Object===Object&&t,Te="object"==typeof self&&self&&self.Object===Object&&self,Ae=Se||Te||Function("return this")(),Me="object"==typeof r&&r&&!r.nodeType&&r,Ie=Me&&"object"==typeof e&&e&&!e.nodeType&&e,Re=Ie&&Ie.exports===Me,Le=Re&&Se.process,Fe=function(){try{var t=Ie&&Ie.require&&Ie.require("util").types;return t||Le&&Le.binding&&Le.binding("util")}catch(t){}}(),Oe=Fe&&Fe.isArrayBuffer,De=Fe&&Fe.isDate,Ne=Fe&&Fe.isMap,Ue=Fe&&Fe.isRegExp,ze=Fe&&Fe.isSet,qe=Fe&&Fe.isTypedArray;function Ve(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function He(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function $e(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function _r(t,e){for(var r=t.length;r--&&or(e,t[r],0)>-1;);return r}var yr=cr({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),br=cr({"&":"&","<":"<",">":">",'"':""","'":"'"});function wr(t){return"\\"+Ee[t]}function kr(t){return be.test(t)}function xr(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function Br(t,e){return function(r){return t(e(r))}}function Cr(t,e){for(var r=-1,n=t.length,i=0,o=[];++r",""":'"',"'":"'"});var Ar=function t(e){var r,$t=(e=null==e?Ae:Ar.defaults(Ae.Object(),e,Ar.pick(Ae,ke))).Array,Jt=e.Date,Kt=e.Error,Qt=e.Function,te=e.Math,ee=e.Object,re=e.RegExp,ne=e.String,ie=e.TypeError,oe=$t.prototype,ae=Qt.prototype,se=ee.prototype,ue=e["__core-js_shared__"],le=ae.toString,ce=se.hasOwnProperty,fe=0,he=(r=/[^.]+$/.exec(ue&&ue.keys&&ue.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",pe=se.toString,de=le.call(ee),ge=Ae._,_e=re("^"+le.call(ce).replace(Tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),be=Re?e.Buffer:n,Ee=e.Symbol,Se=e.Uint8Array,Te=be?be.allocUnsafe:n,Me=Br(ee.getPrototypeOf,ee),Ie=ee.create,Le=se.propertyIsEnumerable,Fe=oe.splice,rr=Ee?Ee.isConcatSpreadable:n,cr=Ee?Ee.iterator:n,Mr=Ee?Ee.toStringTag:n,Ir=function(){try{var t=No(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),Rr=e.clearTimeout!==Ae.clearTimeout&&e.clearTimeout,Lr=Jt&&Jt.now!==Ae.Date.now&&Jt.now,Fr=e.setTimeout!==Ae.setTimeout&&e.setTimeout,Or=te.ceil,Dr=te.floor,Nr=ee.getOwnPropertySymbols,Ur=be?be.isBuffer:n,zr=e.isFinite,qr=oe.join,Vr=Br(ee.keys,ee),Hr=te.max,Gr=te.min,Wr=Jt.now,Zr=e.parseInt,Yr=te.random,Xr=oe.reverse,$r=No(e,"DataView"),Jr=No(e,"Map"),Kr=No(e,"Promise"),Qr=No(e,"Set"),tn=No(e,"WeakMap"),en=No(ee,"create"),rn=tn&&new tn,nn={},on=fa($r),an=fa(Jr),sn=fa(Kr),un=fa(Qr),ln=fa(tn),cn=Ee?Ee.prototype:n,fn=cn?cn.valueOf:n,hn=cn?cn.toString:n;function pn(t){if(js(t)&&!vs(t)&&!(t instanceof vn)){if(t instanceof mn)return t;if(ce.call(t,"__wrapped__"))return ha(t)}return new mn(t)}var dn=function(){function t(){}return function(e){if(!Ps(e))return{};if(Ie)return Ie(e);t.prototype=e;var r=new t;return t.prototype=n,r}}();function gn(){}function mn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}function vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=L,this.__views__=[]}function _n(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Ln(t,e,r,i,o,a){var s,u=e&c,l=e&f,p=e&h;if(r&&(s=o?r(t,i,o,a):r(t)),s!==n)return s;if(!Ps(t))return t;var d=vs(t);if(d){if(s=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ce.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!u)return ro(t,s)}else{var g=qo(t),m=g==W||g==Z;if(ws(t))return $i(t,u);if(g==J||g==N||m&&!o){if(s=l||m?{}:Ho(t),!u)return l?function(t,e){return no(t,zo(t),e)}(t,function(t,e){return t&&no(e,ou(e),t)}(s,t)):function(t,e){return no(t,Uo(t),e)}(t,An(s,t))}else{if(!Ce[g])return o?t:{};s=function(t,e,r){var n,i,o,a=t.constructor;switch(e){case at:return Ji(t);case q:case V:return new a(+t);case st:return function(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case ut:case lt:case ct:case ft:case ht:case pt:case dt:case gt:case mt:return Ki(t,r);case Y:return new a;case X:case et:return new a(t);case Q:return(o=new(i=t).constructor(i.source,zt.exec(i))).lastIndex=i.lastIndex,o;case tt:return new a;case rt:return n=t,fn?ee(fn.call(n)):{}}}(t,g,u)}}a||(a=new kn);var v=a.get(t);if(v)return v;if(a.set(t,s),Is(t))return t.forEach(function(n){s.add(Ln(n,e,r,n,t,a))}),s;if(Ss(t))return t.forEach(function(n,i){s.set(i,Ln(n,e,r,i,t,a))}),s;var _=d?n:(p?l?Mo:Ao:l?ou:iu)(t);return Ge(_||t,function(n,i){_&&(n=t[i=n]),jn(s,i,Ln(n,e,r,i,t,a))}),s}function Fn(t,e,r){var i=r.length;if(null==t)return!i;for(t=ee(t);i--;){var o=r[i],a=e[o],s=t[o];if(s===n&&!(o in t)||!a(s))return!1}return!0}function On(t,e,r){if("function"!=typeof t)throw new ie(a);return ia(function(){t.apply(n,r)},e)}function Dn(t,e,r,n){var o=-1,a=Xe,s=!0,u=t.length,l=[],c=e.length;if(!u)return l;r&&(e=Je(e,dr(r))),n?(a=$e,s=!1):e.length>=i&&(a=mr,s=!1,e=new wn(e));t:for(;++o-1},yn.prototype.set=function(t,e){var r=this.__data__,n=Sn(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},bn.prototype.clear=function(){this.size=0,this.__data__={hash:new _n,map:new(Jr||yn),string:new _n}},bn.prototype.delete=function(t){var e=Oo(this,t).delete(t);return this.size-=e?1:0,e},bn.prototype.get=function(t){return Oo(this,t).get(t)},bn.prototype.has=function(t){return Oo(this,t).has(t)},bn.prototype.set=function(t,e){var r=Oo(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},wn.prototype.add=wn.prototype.push=function(t){return this.__data__.set(t,s),this},wn.prototype.has=function(t){return this.__data__.has(t)},kn.prototype.clear=function(){this.__data__=new yn,this.size=0},kn.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},kn.prototype.get=function(t){return this.__data__.get(t)},kn.prototype.has=function(t){return this.__data__.has(t)},kn.prototype.set=function(t,e){var r=this.__data__;if(r instanceof yn){var n=r.__data__;if(!Jr||n.length0&&r(s)?e>1?Hn(s,e-1,r,n,i):Ke(i,s):n||(i[i.length]=s)}return i}var Gn=so(),Wn=so(!0);function Zn(t,e){return t&&Gn(t,e,iu)}function Yn(t,e){return t&&Wn(t,e,iu)}function Xn(t,e){return Ye(e,function(e){return Bs(t[e])})}function $n(t,e){for(var r=0,i=(e=Wi(e,t)).length;null!=t&&re}function ti(t,e){return null!=t&&ce.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ri(t,e,r){for(var i=r?$e:Xe,o=t[0].length,a=t.length,s=a,u=$t(a),l=1/0,c=[];s--;){var f=t[s];s&&e&&(f=Je(f,dr(e))),l=Gr(f.length,l),u[s]=!r&&(e||o>=120&&f.length>=120)?new wn(s&&f):n}f=t[0];var h=-1,p=u[0];t:for(;++h=s)return u;var l=r[n];return u*("desc"==l?-1:1)}}return t.index-e.index}(t,e,r)})}function _i(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)s!==t&&Fe.call(s,u,1),Fe.call(t,u,1);return t}function bi(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;Wo(i)?Fe.call(t,i,1):Di(t,i)}}return t}function wi(t,e){return t+Dr(Yr()*(e-t+1))}function ki(t,e){var r="";if(!t||e<1||e>M)return r;do{e%2&&(r+=t),(e=Dr(e/2))&&(t+=t)}while(e);return r}function xi(t,e){return oa(ta(t,e,Tu),t+"")}function Bi(t){return Bn(pu(t))}function Ci(t,e){var r=pu(t);return ua(r,Rn(e,0,r.length))}function Ei(t,e,r,i){if(!Ps(t))return t;for(var o=-1,a=(e=Wi(e,t)).length,s=a-1,u=t;null!=u&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=$t(i);++n>>1,a=t[o];null!==a&&!Ls(a)&&(r?a<=e:a=i){var c=e?null:xo(t);if(c)return Er(c);s=!1,o=mr,l=new wn}else l=e?[]:u;t:for(;++n=i?t:Ti(t,e,r)}var Xi=Rr||function(t){return Ae.clearTimeout(t)};function $i(t,e){if(e)return t.slice();var r=t.length,n=Te?Te(r):new t.constructor(r);return t.copy(n),n}function Ji(t){var e=new t.constructor(t.byteLength);return new Se(e).set(new Se(t)),e}function Ki(t,e){var r=e?Ji(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Qi(t,e){if(t!==e){var r=t!==n,i=null===t,o=t==t,a=Ls(t),s=e!==n,u=null===e,l=e==e,c=Ls(e);if(!u&&!c&&!a&&t>e||a&&s&&l&&!u&&!c||i&&s&&l||!r&&l||!o)return 1;if(!i&&!a&&!c&&t1?r[o-1]:n,s=o>2?r[2]:n;for(a=t.length>3&&"function"==typeof a?(o--,a):n,s&&Zo(r[0],r[1],s)&&(a=o<3?n:a,o=1),e=ee(e);++i-1?o[a?e[s]:s]:n}}function ho(t){return To(function(e){var r=e.length,i=r,o=mn.prototype.thru;for(t&&e.reverse();i--;){var s=e[i];if("function"!=typeof s)throw new ie(a);if(o&&!u&&"wrapper"==Ro(s))var u=new mn([],!0)}for(i=u?i:r;++i1&&_.reverse(),f&&lu))return!1;var c=a.get(t);if(c&&a.get(e))return c==e;var f=-1,h=!0,g=r&d?new wn:n;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Lt,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return Ge(D,function(r){var n="_."+r[0];e&r[1]&&!Xe(t,n)&&t.push(n)}),t.sort()}(function(t){var e=t.match(Ft);return e?e[1].split(Ot):[]}(n),r)))}function sa(t){var e=0,r=0;return function(){var i=Wr(),o=j-(i-r);if(r=i,o>0){if(++e>=P)return arguments[0]}else e=0;return t.apply(n,arguments)}}function ua(t,e){var r=-1,i=t.length,o=i-1;for(e=e===n?i:e;++r1?t[e-1]:n;return Ma(t,r="function"==typeof r?(t.pop(),r):n)});function Na(t){var e=pn(t);return e.__chain__=!0,e}function Ua(t,e){return e(t)}var za=To(function(t){var e=t.length,r=e?t[0]:0,i=this.__wrapped__,o=function(e){return In(e,t)};return!(e>1||this.__actions__.length)&&i instanceof vn&&Wo(r)?((i=i.slice(r,+r+(e?1:0))).__actions__.push({func:Ua,args:[o],thisArg:n}),new mn(i,this.__chain__).thru(function(t){return e&&!t.length&&t.push(n),t})):this.thru(o)});var qa=io(function(t,e,r){ce.call(t,r)?++t[r]:Mn(t,r,1)});var Va=fo(ma),Ha=fo(va);function Ga(t,e){return(vs(t)?Ge:Nn)(t,Fo(e,3))}function Wa(t,e){return(vs(t)?We:Un)(t,Fo(e,3))}var Za=io(function(t,e,r){ce.call(t,r)?t[r].push(e):Mn(t,r,[e])});var Ya=xi(function(t,e,r){var n=-1,i="function"==typeof e,o=ys(t)?$t(t.length):[];return Nn(t,function(t){o[++n]=i?Ve(e,t,r):ni(t,e,r)}),o}),Xa=io(function(t,e,r){Mn(t,r,e)});function $a(t,e){return(vs(t)?Je:hi)(t,Fo(e,3))}var Ja=io(function(t,e,r){t[r?0:1].push(e)},function(){return[[],[]]});var Ka=xi(function(t,e){if(null==t)return[];var r=e.length;return r>1&&Zo(t,e[0],e[1])?e=[]:r>2&&Zo(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,Hn(e,1),[])}),Qa=Lr||function(){return Ae.Date.now()};function ts(t,e,r){return e=r?n:e,e=t&&null==e?t.length:e,Co(t,k,n,n,n,n,e)}function es(t,e){var r;if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){return--t>0&&(r=e.apply(this,arguments)),t<=1&&(e=n),r}}var rs=xi(function(t,e,r){var n=g;if(r.length){var i=Cr(r,Lo(rs));n|=b}return Co(t,n,e,r,i)}),ns=xi(function(t,e,r){var n=g|m;if(r.length){var i=Cr(r,Lo(ns));n|=b}return Co(e,n,t,r,i)});function is(t,e,r){var i,o,s,u,l,c,f=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new ie(a);function g(e){var r=i,a=o;return i=o=n,f=e,u=t.apply(a,r)}function m(t){var r=t-c;return c===n||r>=e||r<0||p&&t-f>=s}function v(){var t=Qa();if(m(t))return _(t);l=ia(v,function(t){var r=e-(t-c);return p?Gr(r,s-(t-f)):r}(t))}function _(t){return l=n,d&&i?g(t):(i=o=n,u)}function y(){var t=Qa(),r=m(t);if(i=arguments,o=this,c=t,r){if(l===n)return function(t){return f=t,l=ia(v,e),h?g(t):u}(c);if(p)return l=ia(v,e),g(c)}return l===n&&(l=ia(v,e)),u}return e=Vs(e)||0,Ps(r)&&(h=!!r.leading,s=(p="maxWait"in r)?Hr(Vs(r.maxWait)||0,e):s,d="trailing"in r?!!r.trailing:d),y.cancel=function(){l!==n&&Xi(l),f=0,i=c=o=l=n},y.flush=function(){return l===n?u:_(Qa())},y}var os=xi(function(t,e){return On(t,1,e)}),as=xi(function(t,e,r){return On(t,Vs(e)||0,r)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=t.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(ss.Cache||bn),r}function us(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=bn;var ls=Zi(function(t,e){var r=(e=1==e.length&&vs(e[0])?Je(e[0],dr(Fo())):Je(Hn(e,1),dr(Fo()))).length;return xi(function(n){for(var i=-1,o=Gr(n.length,r);++i=e}),ms=ii(function(){return arguments}())?ii:function(t){return js(t)&&ce.call(t,"callee")&&!Le.call(t,"callee")},vs=$t.isArray,_s=Oe?dr(Oe):function(t){return js(t)&&Kn(t)==at};function ys(t){return null!=t&&Es(t.length)&&!Bs(t)}function bs(t){return js(t)&&ys(t)}var ws=Ur||Vu,ks=De?dr(De):function(t){return js(t)&&Kn(t)==V};function xs(t){if(!js(t))return!1;var e=Kn(t);return e==G||e==H||"string"==typeof t.message&&"string"==typeof t.name&&!As(t)}function Bs(t){if(!Ps(t))return!1;var e=Kn(t);return e==W||e==Z||e==z||e==K}function Cs(t){return"number"==typeof t&&t==zs(t)}function Es(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=M}function Ps(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function js(t){return null!=t&&"object"==typeof t}var Ss=Ne?dr(Ne):function(t){return js(t)&&qo(t)==Y};function Ts(t){return"number"==typeof t||js(t)&&Kn(t)==X}function As(t){if(!js(t)||Kn(t)!=J)return!1;var e=Me(t);if(null===e)return!0;var r=ce.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&le.call(r)==de}var Ms=Ue?dr(Ue):function(t){return js(t)&&Kn(t)==Q};var Is=ze?dr(ze):function(t){return js(t)&&qo(t)==tt};function Rs(t){return"string"==typeof t||!vs(t)&&js(t)&&Kn(t)==et}function Ls(t){return"symbol"==typeof t||js(t)&&Kn(t)==rt}var Fs=qe?dr(qe):function(t){return js(t)&&Es(t.length)&&!!Be[Kn(t)]};var Os=bo(fi),Ds=bo(function(t,e){return t<=e});function Ns(t){if(!t)return[];if(ys(t))return Rs(t)?Sr(t):ro(t);if(cr&&t[cr])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[cr]());var e=qo(t);return(e==Y?xr:e==tt?Er:pu)(t)}function Us(t){return t?(t=Vs(t))===A||t===-A?(t<0?-1:1)*I:t==t?t:0:0===t?t:0}function zs(t){var e=Us(t),r=e%1;return e==e?r?e-r:e:0}function qs(t){return t?Rn(zs(t),0,L):0}function Vs(t){if("number"==typeof t)return t;if(Ls(t))return R;if(Ps(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ps(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Mt,"");var r=Vt.test(t);return r||Gt.test(t)?je(t.slice(2),r?2:8):qt.test(t)?R:+t}function Hs(t){return no(t,ou(t))}function Gs(t){return null==t?"":Fi(t)}var Ws=oo(function(t,e){if(Jo(e)||ys(e))no(e,iu(e),t);else for(var r in e)ce.call(e,r)&&jn(t,r,e[r])}),Zs=oo(function(t,e){no(e,ou(e),t)}),Ys=oo(function(t,e,r,n){no(e,ou(e),t,n)}),Xs=oo(function(t,e,r,n){no(e,iu(e),t,n)}),$s=To(In);var Js=xi(function(t,e){t=ee(t);var r=-1,i=e.length,o=i>2?e[2]:n;for(o&&Zo(e[0],e[1],o)&&(i=1);++r1),e}),no(t,Mo(t),r),n&&(r=Ln(r,c|f|h,jo));for(var i=e.length;i--;)Di(r,e[i]);return r});var lu=To(function(t,e){return null==t?{}:function(t,e){return _i(t,e,function(e,r){return tu(t,r)})}(t,e)});function cu(t,e){if(null==t)return{};var r=Je(Mo(t),function(t){return[t]});return e=Fo(e),_i(t,r,function(t,r){return e(t,r[0])})}var fu=Bo(iu),hu=Bo(ou);function pu(t){return null==t?[]:gr(t,iu(t))}var du=lo(function(t,e,r){return e=e.toLowerCase(),t+(r?gu(e):e)});function gu(t){return xu(Gs(t).toLowerCase())}function mu(t){return(t=Gs(t))&&t.replace(Zt,yr).replace(ve,"")}var vu=lo(function(t,e,r){return t+(r?"-":"")+e.toLowerCase()}),_u=lo(function(t,e,r){return t+(r?" ":"")+e.toLowerCase()}),yu=uo("toLowerCase");var bu=lo(function(t,e,r){return t+(r?"_":"")+e.toLowerCase()});var wu=lo(function(t,e,r){return t+(r?" ":"")+xu(e)});var ku=lo(function(t,e,r){return t+(r?" ":"")+e.toUpperCase()}),xu=uo("toUpperCase");function Bu(t,e,r){return t=Gs(t),(e=r?n:e)===n?function(t){return we.test(t)}(t)?function(t){return t.match(ye)||[]}(t):function(t){return t.match(Dt)||[]}(t):t.match(e)||[]}var Cu=xi(function(t,e){try{return Ve(t,n,e)}catch(t){return xs(t)?t:new Kt(t)}}),Eu=To(function(t,e){return Ge(e,function(e){e=ca(e),Mn(t,e,rs(t[e],t))}),t});function Pu(t){return function(){return t}}var ju=ho(),Su=ho(!0);function Tu(t){return t}function Au(t){return ui("function"==typeof t?t:Ln(t,c))}var Mu=xi(function(t,e){return function(r){return ni(r,t,e)}}),Iu=xi(function(t,e){return function(r){return ni(t,r,e)}});function Ru(t,e,r){var n=iu(e),i=Xn(e,n);null!=r||Ps(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=Xn(e,iu(e)));var o=!(Ps(r)&&"chain"in r&&!r.chain),a=Bs(t);return Ge(i,function(r){var n=e[r];t[r]=n,a&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__);return(r.__actions__=ro(this.__actions__)).push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Ke([this.value()],arguments))})}),t}function Lu(){}var Fu=vo(Je),Ou=vo(Ze),Du=vo(er);function Nu(t){return Yo(t)?lr(ca(t)):function(t){return function(e){return $n(e,t)}}(t)}var Uu=yo(),zu=yo(!0);function qu(){return[]}function Vu(){return!1}var Hu=mo(function(t,e){return t+e},0),Gu=ko("ceil"),Wu=mo(function(t,e){return t/e},1),Zu=ko("floor");var Yu,Xu=mo(function(t,e){return t*e},1),$u=ko("round"),Ju=mo(function(t,e){return t-e},0);return pn.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=zs(t),function(){if(--t<1)return e.apply(this,arguments)}},pn.ary=ts,pn.assign=Ws,pn.assignIn=Zs,pn.assignInWith=Ys,pn.assignWith=Xs,pn.at=$s,pn.before=es,pn.bind=rs,pn.bindAll=Eu,pn.bindKey=ns,pn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},pn.chain=Na,pn.chunk=function(t,e,r){e=(r?Zo(t,e,r):e===n)?1:Hr(zs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,a=0,s=$t(Or(i/e));oo?0:o+r),(i=i===n||i>o?o:zs(i))<0&&(i+=o),i=r>i?0:qs(i);r>>0)?(t=Gs(t))&&("string"==typeof e||null!=e&&!Ms(e))&&!(e=Fi(e))&&kr(t)?Yi(Sr(t),0,r):t.split(e,r):[]},pn.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Hr(zs(e),0),xi(function(r){var n=r[e],i=Yi(r,0,e);return n&&Ke(i,n),Ve(t,this,i)})},pn.tail=function(t){var e=null==t?0:t.length;return e?Ti(t,1,e):[]},pn.take=function(t,e,r){return t&&t.length?Ti(t,0,(e=r||e===n?1:zs(e))<0?0:e):[]},pn.takeRight=function(t,e,r){var i=null==t?0:t.length;return i?Ti(t,(e=i-(e=r||e===n?1:zs(e)))<0?0:e,i):[]},pn.takeRightWhile=function(t,e){return t&&t.length?Ui(t,Fo(e,3),!1,!0):[]},pn.takeWhile=function(t,e){return t&&t.length?Ui(t,Fo(e,3)):[]},pn.tap=function(t,e){return e(t),t},pn.throttle=function(t,e,r){var n=!0,i=!0;if("function"!=typeof t)throw new ie(a);return Ps(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),is(t,e,{leading:n,maxWait:e,trailing:i})},pn.thru=Ua,pn.toArray=Ns,pn.toPairs=fu,pn.toPairsIn=hu,pn.toPath=function(t){return vs(t)?Je(t,ca):Ls(t)?[t]:ro(la(Gs(t)))},pn.toPlainObject=Hs,pn.transform=function(t,e,r){var n=vs(t),i=n||ws(t)||Fs(t);if(e=Fo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:Ps(t)&&Bs(o)?dn(Me(t)):{}}return(i?Ge:Zn)(t,function(t,n,i){return e(r,t,n,i)}),r},pn.unary=function(t){return ts(t,1)},pn.union=ja,pn.unionBy=Sa,pn.unionWith=Ta,pn.uniq=function(t){return t&&t.length?Oi(t):[]},pn.uniqBy=function(t,e){return t&&t.length?Oi(t,Fo(e,2)):[]},pn.uniqWith=function(t,e){return e="function"==typeof e?e:n,t&&t.length?Oi(t,n,e):[]},pn.unset=function(t,e){return null==t||Di(t,e)},pn.unzip=Aa,pn.unzipWith=Ma,pn.update=function(t,e,r){return null==t?t:Ni(t,e,Gi(r))},pn.updateWith=function(t,e,r,i){return i="function"==typeof i?i:n,null==t?t:Ni(t,e,Gi(r),i)},pn.values=pu,pn.valuesIn=function(t){return null==t?[]:gr(t,ou(t))},pn.without=Ia,pn.words=Bu,pn.wrap=function(t,e){return cs(Gi(e),t)},pn.xor=Ra,pn.xorBy=La,pn.xorWith=Fa,pn.zip=Oa,pn.zipObject=function(t,e){return Vi(t||[],e||[],jn)},pn.zipObjectDeep=function(t,e){return Vi(t||[],e||[],Ei)},pn.zipWith=Da,pn.entries=fu,pn.entriesIn=hu,pn.extend=Zs,pn.extendWith=Ys,Ru(pn,pn),pn.add=Hu,pn.attempt=Cu,pn.camelCase=du,pn.capitalize=gu,pn.ceil=Gu,pn.clamp=function(t,e,r){return r===n&&(r=e,e=n),r!==n&&(r=(r=Vs(r))==r?r:0),e!==n&&(e=(e=Vs(e))==e?e:0),Rn(Vs(t),e,r)},pn.clone=function(t){return Ln(t,h)},pn.cloneDeep=function(t){return Ln(t,c|h)},pn.cloneDeepWith=function(t,e){return Ln(t,c|h,e="function"==typeof e?e:n)},pn.cloneWith=function(t,e){return Ln(t,h,e="function"==typeof e?e:n)},pn.conformsTo=function(t,e){return null==e||Fn(t,e,iu(e))},pn.deburr=mu,pn.defaultTo=function(t,e){return null==t||t!=t?e:t},pn.divide=Wu,pn.endsWith=function(t,e,r){t=Gs(t),e=Fi(e);var i=t.length,o=r=r===n?i:Rn(zs(r),0,i);return(r-=e.length)>=0&&t.slice(r,o)==e},pn.eq=ps,pn.escape=function(t){return(t=Gs(t))&&xt.test(t)?t.replace(wt,br):t},pn.escapeRegExp=function(t){return(t=Gs(t))&&At.test(t)?t.replace(Tt,"\\$&"):t},pn.every=function(t,e,r){var i=vs(t)?Ze:zn;return r&&Zo(t,e,r)&&(e=n),i(t,Fo(e,3))},pn.find=Va,pn.findIndex=ma,pn.findKey=function(t,e){return nr(t,Fo(e,3),Zn)},pn.findLast=Ha,pn.findLastIndex=va,pn.findLastKey=function(t,e){return nr(t,Fo(e,3),Yn)},pn.floor=Zu,pn.forEach=Ga,pn.forEachRight=Wa,pn.forIn=function(t,e){return null==t?t:Gn(t,Fo(e,3),ou)},pn.forInRight=function(t,e){return null==t?t:Wn(t,Fo(e,3),ou)},pn.forOwn=function(t,e){return t&&Zn(t,Fo(e,3))},pn.forOwnRight=function(t,e){return t&&Yn(t,Fo(e,3))},pn.get=Qs,pn.gt=ds,pn.gte=gs,pn.has=function(t,e){return null!=t&&Vo(t,e,ti)},pn.hasIn=tu,pn.head=ya,pn.identity=Tu,pn.includes=function(t,e,r,n){t=ys(t)?t:pu(t),r=r&&!n?zs(r):0;var i=t.length;return r<0&&(r=Hr(i+r,0)),Rs(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&or(t,e,r)>-1},pn.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:zs(r);return i<0&&(i=Hr(n+i,0)),or(t,e,i)},pn.inRange=function(t,e,r){return e=Us(e),r===n?(r=e,e=0):r=Us(r),function(t,e,r){return t>=Gr(e,r)&&t=-M&&t<=M},pn.isSet=Is,pn.isString=Rs,pn.isSymbol=Ls,pn.isTypedArray=Fs,pn.isUndefined=function(t){return t===n},pn.isWeakMap=function(t){return js(t)&&qo(t)==it},pn.isWeakSet=function(t){return js(t)&&Kn(t)==ot},pn.join=function(t,e){return null==t?"":qr.call(t,e)},pn.kebabCase=vu,pn.last=xa,pn.lastIndexOf=function(t,e,r){var i=null==t?0:t.length;if(!i)return-1;var o=i;return r!==n&&(o=(o=zs(r))<0?Hr(i+o,0):Gr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):ir(t,sr,o,!0)},pn.lowerCase=_u,pn.lowerFirst=yu,pn.lt=Os,pn.lte=Ds,pn.max=function(t){return t&&t.length?qn(t,Tu,Qn):n},pn.maxBy=function(t,e){return t&&t.length?qn(t,Fo(e,2),Qn):n},pn.mean=function(t){return ur(t,Tu)},pn.meanBy=function(t,e){return ur(t,Fo(e,2))},pn.min=function(t){return t&&t.length?qn(t,Tu,fi):n},pn.minBy=function(t,e){return t&&t.length?qn(t,Fo(e,2),fi):n},pn.stubArray=qu,pn.stubFalse=Vu,pn.stubObject=function(){return{}},pn.stubString=function(){return""},pn.stubTrue=function(){return!0},pn.multiply=Xu,pn.nth=function(t,e){return t&&t.length?mi(t,zs(e)):n},pn.noConflict=function(){return Ae._===this&&(Ae._=ge),this},pn.noop=Lu,pn.now=Qa,pn.pad=function(t,e,r){t=Gs(t);var n=(e=zs(e))?jr(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return _o(Dr(i),r)+t+_o(Or(i),r)},pn.padEnd=function(t,e,r){t=Gs(t);var n=(e=zs(e))?jr(t):0;return e&&ne){var i=t;t=e,e=i}if(r||t%1||e%1){var o=Yr();return Gr(t+o*(e-t+Pe("1e-"+((o+"").length-1))),e)}return wi(t,e)},pn.reduce=function(t,e,r){var n=vs(t)?Qe:fr,i=arguments.length<3;return n(t,Fo(e,4),r,i,Nn)},pn.reduceRight=function(t,e,r){var n=vs(t)?tr:fr,i=arguments.length<3;return n(t,Fo(e,4),r,i,Un)},pn.repeat=function(t,e,r){return e=(r?Zo(t,e,r):e===n)?1:zs(e),ki(Gs(t),e)},pn.replace=function(){var t=arguments,e=Gs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},pn.result=function(t,e,r){var i=-1,o=(e=Wi(e,t)).length;for(o||(o=1,t=n);++iM)return[];var r=L,n=Gr(t,L);e=Fo(e),t-=L;for(var i=pr(n,e);++r=a)return t;var u=r-jr(i);if(u<1)return i;var l=s?Yi(s,0,u).join(""):t.slice(0,u);if(o===n)return l+i;if(s&&(u+=l.length-u),Ms(o)){if(t.slice(u).search(o)){var c,f=l;for(o.global||(o=re(o.source,Gs(zt.exec(o))+"g")),o.lastIndex=0;c=o.exec(f);)var h=c.index;l=l.slice(0,h===n?u:h)}}else if(t.indexOf(Fi(o),u)!=u){var p=l.lastIndexOf(o);p>-1&&(l=l.slice(0,p))}return l+i},pn.unescape=function(t){return(t=Gs(t))&&kt.test(t)?t.replace(bt,Tr):t},pn.uniqueId=function(t){var e=++fe;return Gs(t)+e},pn.upperCase=ku,pn.upperFirst=xu,pn.each=Ga,pn.eachRight=Wa,pn.first=ya,Ru(pn,(Yu={},Zn(pn,function(t,e){ce.call(pn.prototype,e)||(Yu[e]=t)}),Yu),{chain:!1}),pn.VERSION="4.17.11",Ge(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){pn[t].placeholder=pn}),Ge(["drop","take"],function(t,e){vn.prototype[t]=function(r){r=r===n?1:Hr(zs(r),0);var i=this.__filtered__&&!e?new vn(this):this.clone();return i.__filtered__?i.__takeCount__=Gr(r,i.__takeCount__):i.__views__.push({size:Gr(r,L),type:t+(i.__dir__<0?"Right":"")}),i},vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ge(["filter","map","takeWhile"],function(t,e){var r=e+1,n=r==S||3==r;vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Fo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}}),Ge(["head","last"],function(t,e){var r="take"+(e?"Right":"");vn.prototype[t]=function(){return this[r](1).value()[0]}}),Ge(["initial","tail"],function(t,e){var r="drop"+(e?"":"Right");vn.prototype[t]=function(){return this.__filtered__?new vn(this):this[r](1)}}),vn.prototype.compact=function(){return this.filter(Tu)},vn.prototype.find=function(t){return this.filter(t).head()},vn.prototype.findLast=function(t){return this.reverse().find(t)},vn.prototype.invokeMap=xi(function(t,e){return"function"==typeof t?new vn(this):this.map(function(r){return ni(r,t,e)})}),vn.prototype.reject=function(t){return this.filter(us(Fo(t)))},vn.prototype.slice=function(t,e){t=zs(t);var r=this;return r.__filtered__&&(t>0||e<0)?new vn(r):(t<0?r=r.takeRight(-t):t&&(r=r.drop(t)),e!==n&&(r=(e=zs(e))<0?r.dropRight(-e):r.take(e-t)),r)},vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vn.prototype.toArray=function(){return this.take(L)},Zn(vn.prototype,function(t,e){var r=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=pn[i?"take"+("last"==e?"Right":""):e],a=i||/^find/.test(e);o&&(pn.prototype[e]=function(){var e=this.__wrapped__,s=i?[1]:arguments,u=e instanceof vn,l=s[0],c=u||vs(e),f=function(t){var e=o.apply(pn,Ke([t],s));return i&&h?e[0]:e};c&&r&&"function"==typeof l&&1!=l.length&&(u=c=!1);var h=this.__chain__,p=!!this.__actions__.length,d=a&&!h,g=u&&!p;if(!a&&c){e=g?e:new vn(this);var m=t.apply(e,s);return m.__actions__.push({func:Ua,args:[f],thisArg:n}),new mn(m,h)}return d&&g?t.apply(this,s):(m=this.thru(f),d?i?m.value()[0]:m.value():m)})}),Ge(["pop","push","shift","sort","splice","unshift"],function(t){var e=oe[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);pn.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[r](function(r){return e.apply(vs(r)?r:[],t)})}}),Zn(vn.prototype,function(t,e){var r=pn[e];if(r){var n=r.name+"";(nn[n]||(nn[n]=[])).push({name:e,func:r})}}),nn[po(n,m).name]=[{name:"wrapper",func:n}],vn.prototype.clone=function(){var t=new vn(this.__wrapped__);return t.__actions__=ro(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=ro(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=ro(this.__views__),t},vn.prototype.reverse=function(){if(this.__filtered__){var t=new vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=vs(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?n:this.__values__[this.__index__++]}},pn.prototype.plant=function(t){for(var e,r=this;r instanceof gn;){var i=ha(r);i.__index__=0,i.__values__=n,e?o.__wrapped__=i:e=i;var o=i;r=r.__wrapped__}return o.__wrapped__=t,e},pn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vn){var e=t;return this.__actions__.length&&(e=new vn(this)),(e=e.reverse()).__actions__.push({func:Ua,args:[Pa],thisArg:n}),new mn(e,this.__chain__)}return this.thru(Pa)},pn.prototype.toJSON=pn.prototype.valueOf=pn.prototype.value=function(){return zi(this.__wrapped__,this.__actions__)},pn.prototype.first=pn.prototype.head,cr&&(pn.prototype[cr]=function(){return this}),pn}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(Ae._=Ar,define(function(){return Ar})):Ie?((Ie.exports=Ar)._=Ar,Me._=Ar):Ae._=Ar}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],77:[function(t,e,r){(function(r){t("path");var n=t("fs");function i(){this.types=Object.create(null),this.extensions=Object.create(null)}i.prototype.define=function(t){for(var e in t){for(var n=t[e],i=0;i=0;--s)if(h[s]=f,f*=l[s],p=Math.max(p,a.scratchMemory(l[s])),e.shape[s]!==r.shape[s])throw new Error("Shape mismatch, real and imaginary arrays must have same size");var d,g=4*f+p;d="array"===e.dtype||"float64"===e.dtype||"custom"===e.dtype?o.mallocDouble(g):o.mallocFloat(g);var m,v,_,y,b=i(d,l.slice(0),h,0),w=i(d,l.slice(0),h.slice(0),f),k=i(d,l.slice(0),h.slice(0),2*f),x=i(d,l.slice(0),h.slice(0),3*f),B=4*f;for(n.assign(b,e),n.assign(w,r),s=c-1;s>=0&&(a(t,f/l[s],l[s],d,b.offset,w.offset,B),0!==s);--s){for(v=1,_=k.stride,y=x.stride,u=s-1;u=0;--u)y[u]=_[u]=v,v*=l[u];n.assign(k,b),n.assign(x,w),m=b,b=k,k=m,m=w,w=x,x=m}n.assign(e,b),n.assign(r,w),o.free(d)}},{"./lib/fft-matrix.js":80,ndarray:85,"ndarray-ops":82,"typedarray-pool":174}],80:[function(t,e,r){var n=t("bit-twiddle");function i(t,e,r,i,o,a){var s,u,l,c,f,h,p,d,g,m,v,_,y,b,w,k,x,B,C,E,P,j,S,T;for(t|=0,e|=0,o|=0,a|=0,s=r|=0,u=n.log2(s),B=0;B>1,f=0,l=0;l>=1;f+=h}for(v=-1,_=0,m=1,d=0;d>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var u={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var l={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var c=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=n({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=n({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=n({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=n({args:["array","array"],pre:i,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":15}],83:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],o=t,a=1;Array.isArray(o);)r.push(o.length),a*=o.length,o=o[0];return 0===r.length?n():(e||(e=n(new Float64Array(a),r)),i(e,t),e)}},{"./doConvert.js":84,ndarray:85}],84:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":15}],85:[function(t,e,r){var n=t("iota-array"),i=t("is-buffer"),o="undefined"!=typeof Float64Array;function a(t,e){return t[0]-e[0]}function s(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+u.join(",")+",v){"),i?o.push("return this.data.set("+c+",v)}"):o.push("return this.data["+c+"]=v}"),o.push("proto.get=function "+r+"_get("+u.join(",")+"){"),i?o.push("return this.data.get("+c+")}"):o.push("return this.data["+c+"]}"),o.push("proto.index=function "+r+"_index(",u.join(),"){return "+c+"}"),o.push("proto.hi=function "+r+"_hi("+u.join(",")+"){return new "+r+"(this.data,"+a.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+a.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=a.map(function(t){return"a"+t+"=this.shape["+t+"]"}),d=a.map(function(t){return"c"+t+"=this.stride["+t+"]"});o.push("proto.lo=function "+r+"_lo("+u.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+d.join(","));for(var g=0;g=0){d=i"+g+"|0;b+=c"+g+"*d;a"+g+"-=d}");o.push("return new "+r+"(this.data,"+a.map(function(t){return"a"+t}).join(",")+","+a.map(function(t){return"c"+t}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+u.join(",")+"){var "+a.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+a.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(g=0;g=0){c=(c+this.stride["+g+"]*i"+g+")|0}else{a.push(this.shape["+g+"]);b.push(this.stride["+g+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+a.map(function(t){return"shape["+t+"]"}).join(",")+","+a.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(l[t],s)}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,l.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var a=e.length;if(void 0===r){r=new Array(a);for(var s=a-1,c=1;s>=0;--s)r[s]=c,c*=e[s]}if(void 0===n)for(n=0,s=0;s>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1}},{}],87:[function(t,e,r){(function(r,n){"use strict";var i=t("util"),o=t("stream"),a=e.exports=function(){o.call(this),this._buffers=[],this._buffered=0,this._reads=[],this._paused=!1,this._encoding="utf8",this.writable=!0};i.inherits(a,o),a.prototype.read=function(t,e){this._reads.push({length:Math.abs(t),allowLess:t<0,func:e}),r.nextTick(function(){this._process(),this._paused&&this._reads.length>0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(n.isBuffer(t)||(t=new n(t,e||this._encoding)),this._buffers.push(t),this._buffered+=t.length,this._process(),this._reads&&0==this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1)},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0==this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._process=function(){for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess){this._reads.shift(),(o=this._buffers[0]).length>t.length?(this._buffered-=t.length,this._buffers[0]=o.slice(t.length),t.func.call(this,o.slice(0,t.length))):(this._buffered-=o.length,this._buffers.shift(),t.func.call(this,o))}else{if(!(this._buffered>=t.length))break;this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)}}this._buffers&&this._buffers.length>0&&null==this._buffers[0]&&this._end()}}).call(this,t("_process"),t("buffer").Buffer)},{_process:118,buffer:48,stream:169,util:180}],88:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLOR_PALETTE:1,COLOR_COLOR:2,COLOR_ALPHA:4}},{}],89:[function(t,e,r){"use strict";var n=t("util"),i=t("stream"),o=e.exports=function(){i.call(this),this._crc=-1,this.writable=!0};n.inherits(o,i),o.prototype.write=function(t){for(var e=0;e>>8;return!0},o.prototype.end=function(t){t&&this.write(t),this.emit("crc",this.crc32())},o.prototype.crc32=function(){return-1^this._crc},o.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e};for(var a=[],s=0;s<256;s++){for(var u=s,l=0;l<8;l++)1&u?u=3988292384^u>>>1:u>>>=1;a[s]=u}},{stream:169,util:180}],90:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=(t("zlib"),t("./chunkstream")),o=e.exports=function(t,e,r,n,o){i.call(this),this._width=t,this._height=e,this._Bpp=r,this._data=n,this._options=o,this._line=0,"filterType"in o&&-1!=o.filterType?"number"==typeof o.filterType&&(o.filterType=[o.filterType]):o.filterType=[0,1,2,3,4],this._filters={0:this._filterNone.bind(this),1:this._filterSub.bind(this),2:this._filterUp.bind(this),3:this._filterAvg.bind(this),4:this._filterPaeth.bind(this)},this.read(this._width*r+1,this._reverseFilterLine.bind(this))};n.inherits(o,i);var a={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};o.prototype._reverseFilterLine=function(t){var e=this._data,r=this._width<<2,n=this._line*r,i=t[0];if(0==i)for(var o=0;o0?e[u+c-4]:0;e[u+c]=255!=f?t[l+f]+h:255}else if(2==i)for(o=0;o0?e[u-r+c]:0;e[u+c]=255!=f?t[l+f]+p:255}else if(3==i)for(o=0;o0?e[u+c-4]:0,p=this._line>0?e[u-r+c]:0;var d=Math.floor((h+p)/2);e[u+c]=255!=f?t[l+f]+d:255}else if(4==i)for(o=0;o0?e[u+c-4]:0,p=this._line>0?e[u-r+c]:0;var g=o>0&&this._line>0?e[u-r+c-4]:0;d=s(h,p,g);e[u+c]=255!=f?t[l+f]+d:255}this._line++,this._line=4?t[e*n+a-4]:0,u=t[e*n+a]-s;r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterUp=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=2);for(var a=0;a0?t[(e-1)*n+a]:0,u=t[e*n+a]-s;r?r[e*i+1+a]=u:o+=Math.abs(u)}return o},o.prototype._filterAvg=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=3);for(var a=0;a=4?t[e*n+a-4]:0,u=e>0?t[(e-1)*n+a]:0,l=t[e*n+a]-(s+u>>1);r?r[e*i+1+a]=l:o+=Math.abs(l)}return o},o.prototype._filterPaeth=function(t,e,r){var n=this._width<<2,i=n+1,o=0;r&&(r[e*i]=4);for(var a=0;a=4?t[e*n+a-4]:0,l=e>0?t[(e-1)*n+a]:0,c=a>=4&&e>0?t[(e-1)*n+a-4]:0,f=t[e*n+a]-s(u,l,c);r?r[e*i+1+a]=f:o+=Math.abs(f)}return o};var s=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}}).call(this,t("buffer").Buffer)},{"./chunkstream":87,buffer:48,util:180,zlib:46}],91:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("zlib"),a=t("./filter"),s=t("./crc"),u=t("./constants"),l=e.exports=function(t){i.call(this),this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=t.deflateLevel||9,t.deflateStrategy=t.deflateStrategy||3,this.readable=!0};n.inherits(l,i),l.prototype.pack=function(t,e,n){this.emit("data",new r(u.PNG_SIGNATURE)),this.emit("data",this._packIHDR(e,n));t=new a(e,n,4,t,this._options).filter();var i=o.createDeflate({chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy});i.on("error",this.emit.bind(this,"error")),i.on("data",function(t){this.emit("data",this._packIDAT(t))}.bind(this)),i.on("end",function(){this.emit("data",this._packIEND()),this.emit("end")}.bind(this)),i.end(t)},l.prototype._packChunk=function(t,e){var n=e?e.length:0,i=new r(n+12);return i.writeUInt32BE(n,0),i.writeUInt32BE(t,4),e&&e.copy(i,8),i.writeInt32BE(s.crc32(i.slice(4,i.length-4)),i.length-4),i},l.prototype._packIHDR=function(t,e){var n=new r(13);return n.writeUInt32BE(t,0),n.writeUInt32BE(e,4),n[8]=8,n[9]=6,n[10]=0,n[11]=0,n[12]=0,this._packChunk(u.TYPE_IHDR,n)},l.prototype._packIDAT=function(t){return this._packChunk(u.TYPE_IDAT,t)},l.prototype._packIEND=function(){return this._packChunk(u.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./constants":88,"./crc":89,"./filter":90,buffer:48,stream:169,util:180,zlib:46}],92:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("zlib"),o=t("./crc"),a=t("./chunkstream"),s=t("./constants"),u=t("./filter"),l=e.exports=function(t){a.call(this),this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._inflate=null,this._filter=null,this._crc=null,this._palette=[],this._colorType=0,this._chunks={},this._chunks[s.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[s.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[s.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[s.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[s.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[s.TYPE_gAMA]=this._handleGAMA.bind(this),this.writable=!0,this.on("error",this._handleError.bind(this)),this._handleSignature()};n.inherits(l,a),l.prototype._handleError=function(){this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy()},l.prototype._handleSignature=function(){this.read(s.PNG_SIGNATURE.length,this._parseSignature.bind(this))},l.prototype._parseSignature=function(t){for(var e=s.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.emit("error",new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(t):this._handleChunkEnd()},l.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},l.prototype._parseIEND=function(t){this._crc.write(t),this._inflate.end(),this._hasIEND=!0,this._handleChunkEnd()};var c={0:1,2:3,3:1,4:2,6:4};l.prototype._reverseFiltered=function(t,e,r){if(3==this._colorType)for(var n=e<<2,i=0;i0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t||{}),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(u,o),u.prototype.pack=function(){return e.nextTick(function(){this._packer.pack(this.data,this.width,this.height)}.bind(this)),this},u.prototype.parse=function(t,e){if(e){var r,n=null;this.once("parsed",r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this)),this.once("error",n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this))}return this.end(t),this},u.prototype.write=function(t){return this._parser.write(t),!0},u.prototype.end=function(t){this._parser.end(t)},u.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.data=t.data,delete t.data,this.emit("metadata",t)},u.prototype._gamma=function(t){this.gamma=t},u.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},u.prototype.bitblt=function(t,e,r,n,i,o,a){if(e>this.width||r>this.height||e+n>this.width||r+i>this.height)throw new Error("bitblt reading outside image");if(o>t.width||a>t.height||o+n>t.width||a+i>t.height)throw new Error("bitblt writing outside image");for(var s=0;s>=u,c-=u,m!==o){if(m===a)break;for(var v=mo;)y=d[y]>>8,++_;var b=y;if(h+_+(v!==m?1:0)>n)return void console.log("Warning, gif stream longer than expected.");r[h++]=b;var w=h+=_;for(v!==m&&(r[h++]=b),y=v;_--;)y=d[y],r[--w]=255&y,y>>=8;null!==g&&s<4096&&(d[s++]=g<<8|b,s>=l+1&&u<12&&(++u,l=l<<1|1)),g=m}else s=a+1,l=(1<<(u=i+1))-1,g=null}return h!==n&&console.log("Warning, gif stream shorter than expected."),r}try{r.GifWriter=function(t,e,r,n){var i=0,o=void 0===(n=void 0===n?{}:n).loop?null:n.loop,a=void 0===n.palette?null:n.palette;if(e<=0||r<=0||e>65535||r>65535)throw new Error("Width/Height invalid.");function s(t){var e=t.length;if(e<2||e>256||e&e-1)throw new Error("Invalid code/color length, must be power of 2 and 2 .. 256.");return e}t[i++]=71,t[i++]=73,t[i++]=70,t[i++]=56,t[i++]=57,t[i++]=97;var u=0,l=0;if(null!==a){for(var c=s(a);c>>=1;)++u;if(c=1<=c)throw new Error("Background index out of range.");if(0===l)throw new Error("Background index explicitly passed as 0.")}}if(t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=(null!==a?128:0)|u,t[i++]=l,t[i++]=0,null!==a)for(var f=0,h=a.length;f>16&255,t[i++]=p>>8&255,t[i++]=255&p}if(null!==o){if(o<0||o>65535)throw new Error("Loop count invalid.");t[i++]=33,t[i++]=255,t[i++]=11,t[i++]=78,t[i++]=69,t[i++]=84,t[i++]=83,t[i++]=67,t[i++]=65,t[i++]=80,t[i++]=69,t[i++]=50,t[i++]=46,t[i++]=48,t[i++]=3,t[i++]=1,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=0}var d=!1;this.addFrame=function(e,r,n,o,u,l){if(!0===d&&(--i,d=!1),l=void 0===l?{}:l,e<0||r<0||e>65535||r>65535)throw new Error("x/y invalid.");if(n<=0||o<=0||n>65535||o>65535)throw new Error("Width/Height invalid.");if(u.length>=1;)++p;h=1<3)throw new Error("Disposal out of range.");var v=!1,_=0;if(void 0!==l.transparent&&null!==l.transparent&&(v=!0,(_=l.transparent)<0||_>=h))throw new Error("Transparent color index.");if((0!==m||v||0!==g)&&(t[i++]=33,t[i++]=249,t[i++]=4,t[i++]=m<<2|(!0===v?1:0),t[i++]=255&g,t[i++]=g>>8&255,t[i++]=_,t[i++]=0),t[i++]=44,t[i++]=255&e,t[i++]=e>>8&255,t[i++]=255&r,t[i++]=r>>8&255,t[i++]=255&n,t[i++]=n>>8&255,t[i++]=255&o,t[i++]=o>>8&255,t[i++]=!0===c?128|p-1:0,!0===c)for(var y=0,b=f.length;y>16&255,t[i++]=w>>8&255,t[i++]=255&w}return i=function(t,e,r,n){t[e++]=r;var i=e++,o=1<=r;)t[e++]=255&f,f>>=8,c-=8,e===i+256&&(t[i]=255,i=e++)}function p(t){f|=t<=8;)t[e++]=255&f,f>>=8,c-=8,e===i+256&&(t[i]=255,i=e++);4096===u?(p(o),u=s+1,l=r+1,g={}):(u>=1<>7,s=1<<1+(7&o);t[e++],t[e++];var u=null,l=null;a&&(u=e,l=s,e+=3*s);var c=!0,f=[],h=0,p=null,d=0,g=null;for(this.width=r,this.height=i;c&&e=0))throw Error("Invalid block size");if(0===j)break;e+=j}break;case 249:if(4!==t[e++]||0!==t[e+4])throw new Error("Invalid graphics extension block.");var m=t[e++];h=t[e++]|t[e++]<<8,p=t[e++],0==(1&m)&&(p=null),d=m>>2&7,e++;break;case 254:for(;;){if(!((j=t[e++])>=0))throw Error("Invalid block size");if(0===j)break;e+=j}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var v=t[e++]|t[e++]<<8,_=t[e++]|t[e++]<<8,y=t[e++]|t[e++]<<8,b=t[e++]|t[e++]<<8,w=t[e++],k=w>>6&1,x=1<<1+(7&w),B=u,C=l,E=!1;w>>7&&(E=!0,B=e,C=x,e+=3*x);var P=e;for(e++;;){var j;if(!((j=t[e++])>=0))throw Error("Invalid block size");if(0===j)break;e+=j}f.push({x:v,y:_,width:y,height:b,has_local_palette:E,palette_offset:B,palette_size:C,data_offset:P,data_length:e-P,transparent_index:p,interlaced:!!k,delay:h,disposal:d});break;case 59:c=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return f.length},this.loopCount=function(){return g},this.frameInfo=function(t){if(t<0||t>=f.length)throw new Error("Frame index out of range.");return f[t]},this.decodeAndBlitFrameBGRA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var u=o.palette_offset,l=o.transparent_index;null===l&&(l=256);var c=o.width,f=r-c,h=c,p=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),g=p,m=4*f;!0===o.interlaced&&(m+=4*r*7);for(var v=8,_=0,y=s.length;_=d&&(m=4*f+4*r*(v-1),g=p+(c+f)*(v<<1),v>>=1)),b===l)g+=4;else{var w=t[u+3*b],k=t[u+3*b+1],x=t[u+3*b+2];i[g++]=x,i[g++]=k,i[g++]=w,i[g++]=255}--h}},this.decodeAndBlitFrameRGBA=function(e,i){var o=this.frameInfo(e),a=o.width*o.height,s=new Uint8Array(a);n(t,o.data_offset,s,a);var u=o.palette_offset,l=o.transparent_index;null===l&&(l=256);var c=o.width,f=r-c,h=c,p=4*(o.y*r+o.x),d=4*((o.y+o.height)*r+o.x),g=p,m=4*f;!0===o.interlaced&&(m+=4*r*7);for(var v=8,_=0,y=s.length;_=d&&(m=4*f+4*r*(v-1),g=p+(c+f)*(v<<1),v>>=1)),b===l)g+=4;else{var w=t[u+3*b],k=t[u+3*b+1],x=t[u+3*b+2];i[g++]=w,i[g++]=k,i[g++]=x,i[g++]=255}--h}}}}catch(t){}},{}],95:[function(t,e,r){(function(r){var n=t("charm");function i(t){if(!(t=t||{}).total)throw new Error("You MUST specify the total number of operations that will be processed.");this.total=t.total,this.current=0,this.max_burden=t.maxBurden||.5,this.show_burden=t.showBurden||!1,this.started=!1,this.size=50,this.inner_time=0,this.outer_time=0,this.elapsed=0,this.time_start=0,this.time_end=0,this.time_left=0,this.time_burden=0,this.skip_steps=0,this.skipped=0,this.aborted=!1,this.charm=n(),this.charm.pipe(r.stdout),this.charm.write("\n\n\n")}function o(t,e,r){for(r=r||" ";t.length3&&(u[0]=u[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,a)),(u[1]||"").length=this.total&&this.finished(),this.time_end=(new Date).getTime(),this.inner_time=this.time_end-this.time_start)},i.prototype.updateTimes=function(){this.elapsed=this.time_start-this.started,this.time_end>0&&(this.outer_time=this.time_start-this.time_end),this.inner_time>0&&this.outer_time>0&&(this.time_burden=this.inner_time/(this.inner_time+this.outer_time)*100,this.time_left=this.elapsed/this.current*(this.total-this.current),this.time_left<0&&(this.time_left=0)),this.time_burden>this.max_burden&&this.skip_steps0&&this.current=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-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&&(r=a+"/"+r,i="/"===a.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var o=r.isAbsolute(t),a="/"===i(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!o).join("/"))||o||(t="."),t&&a&&(t+="/"),(o?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),o=n(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u=1;--o)if(47===(e=t.charCodeAt(o))){if(!i){n=o;break}}else i=!1;return-1===n?r?"/":".":r&&1===n?"/":t.slice(0,n)},r.basename=function(t,e){var r=function(t){"string"!=typeof t&&(t+="");var e,r=0,n=-1,i=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!i){r=e+1;break}}else-1===n&&(i=!1,n=e+1);return-1===n?"":t.slice(r,n)}(t);return e&&r.substr(-1*e.length)===e&&(r=r.substr(0,r.length-e.length)),r},r.extname=function(t){"string"!=typeof t&&(t+="");for(var e=-1,r=0,n=-1,i=!0,o=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===n&&(i=!1,n=a+1),46===s?-1===e?e=a:1!==o&&(o=1):-1!==e&&(o=-1);else if(!i){r=a+1;break}}return-1===e||-1===n||0===o||1===o&&e===n-1&&e===r+1?"":t.slice(e,n)};var i="b"==="ab".substr(-1)?function(t,e,r){return t.substr(e,r)}:function(t,e,r){return e<0&&(e=t.length+e),t.substr(e,r)}}).call(this,t("_process"))},{_process:118}],97:[function(t,e,r){(function(e){"use strict";var n=t("./interlace"),i={1:{0:0,1:0,2:0,3:255},2:{0:0,1:0,2:0,3:1},3:{0:0,1:1,2:2,3:255},4:{0:0,1:1,2:2,3:3}};function o(t,e,r,n,o,a){for(var s=t.width,u=t.height,l=t.index,c=0;c>4,r.push(f,c);break;case 2:u=3&h,l=h>>2&3,c=h>>4&3,f=h>>6&3,r.push(f,c,l,u);break;case 1:i=1&h,o=h>>1&1,a=h>>2&1,s=h>>3&1,u=h>>4&1,l=h>>5&1,c=h>>6&1,f=h>>7&1,r.push(f,c,l,u,s,a,o,i)}}return{get:function(t){for(;r.length0&&(this._paused=!1,this.emit("drain"))}.bind(this))},a.prototype.write=function(t,e){return this.writable?(r=n.isBuffer(t)?t:new n(t,e||this._encoding),this._buffers.push(r),this._buffered+=r.length,this._process(),this._reads&&0===this._reads.length&&(this._paused=!0),this.writable&&!this._paused):(this.emit("error",new Error("Stream not writable")),!1);var r},a.prototype.end=function(t,e){t&&this.write(t,e),this.writable=!1,this._buffers&&(0===this._buffers.length?this._end():(this._buffers.push(null),this._process()))},a.prototype.destroySoon=a.prototype.end,a.prototype._end=function(){this._reads.length>0&&this.emit("error",new Error("There are some read requests waitng on finished stream")),this.destroy()},a.prototype.destroy=function(){this._buffers&&(this.writable=!1,this._reads=null,this._buffers=null,this.emit("close"))},a.prototype._processReadAllowingLess=function(t){this._reads.shift();var e=this._buffers[0];e.length>t.length?(this._buffered-=t.length,this._buffers[0]=e.slice(t.length),t.func.call(this,e.slice(0,t.length))):(this._buffered-=e.length,this._buffers.shift(),t.func.call(this,e))},a.prototype._processRead=function(t){this._reads.shift();for(var e=0,r=0,i=new n(t.length);e0&&this._buffers.splice(0,r),this._buffered-=t.length,t.func.call(this,i)},a.prototype._process=function(){try{for(;this._buffered>0&&this._reads&&this._reads.length>0;){var t=this._reads[0];if(t.allowLess)this._processReadAllowingLess(t);else{if(!(this._buffered>=t.length))break;this._processRead(t)}}this._buffers&&this._buffers.length>0&&null===this._buffers[0]&&this._end()}catch(t){this.emit("error",t)}}}).call(this,t("_process"),t("buffer").Buffer)},{_process:118,buffer:48,stream:169,util:180}],100:[function(t,e,r){"use strict";e.exports={PNG_SIGNATURE:[137,80,78,71,13,10,26,10],TYPE_IHDR:1229472850,TYPE_IEND:1229278788,TYPE_IDAT:1229209940,TYPE_PLTE:1347179589,TYPE_tRNS:1951551059,TYPE_gAMA:1732332865,COLORTYPE_GRAYSCALE:0,COLORTYPE_PALETTE:1,COLORTYPE_COLOR:2,COLORTYPE_ALPHA:4,COLORTYPE_PALETTE_COLOR:3,COLORTYPE_COLOR_ALPHA:6,COLORTYPE_TO_BPP_MAP:{0:1,2:3,3:1,4:2,6:4},GAMMA_DIVISION:1e5}},{}],101:[function(t,e,r){"use strict";var n=[];!function(){for(var t=0;t<256;t++){for(var e=t,r=0;r<8;r++)1&e?e=3988292384^e>>>1:e>>>=1;n[t]=e}}();var i=e.exports=function(){this._crc=-1};i.prototype.write=function(t){for(var e=0;e>>8;return!0},i.prototype.crc32=function(){return-1^this._crc},i.crc32=function(t){for(var e=-1,r=0;r>>8;return-1^e}},{}],102:[function(t,e,r){(function(r){"use strict";var n=t("./paeth-predictor");var i={0:function(t,e,r,n,i){t.copy(n,i,e,e+r)},1:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,u=t[e+a]-s;n[i+a]=u}},2:function(t,e,r,n,i){for(var o=0;o0?t[e+o-r]:0,s=t[e+o]-a;n[i+o]=s}},3:function(t,e,r,n,i,o){for(var a=0;a=o?t[e+a-o]:0,u=e>0?t[e+a-r]:0,l=t[e+a]-(s+u>>1);n[i+a]=l}},4:function(t,e,r,i,o,a){for(var s=0;s=a?t[e+s-a]:0,l=e>0?t[e+s-r]:0,c=e>0&&s>=a?t[e+s-(r+a)]:0,f=t[e+s]-n(u,l,c);i[o+s]=f}}},o={0:function(t,e,r){for(var n=0,i=e+r,o=e;o=n?t[e+o-n]:0,s=t[e+o]-a;i+=Math.abs(s)}return i},2:function(t,e,r){for(var n=0,i=e+r,o=e;o0?t[o-r]:0,s=t[o]-a;n+=Math.abs(s)}return n},3:function(t,e,r,n){for(var i=0,o=0;o=n?t[e+o-n]:0,s=e>0?t[e+o-r]:0,u=t[e+o]-(a+s>>1);i+=Math.abs(u)}return i},4:function(t,e,r,i){for(var o=0,a=0;a=i?t[e+a-i]:0,u=e>0?t[e+a-r]:0,l=e>0&&a>=i?t[e+a-(r+i)]:0,c=t[e+a]-n(s,u,l);o+=Math.abs(c)}return o}};e.exports=function(t,e,n,a,s){var u;if("filterType"in a&&-1!==a.filterType){if("number"!=typeof a.filterType)throw new Error("unrecognised filter types");u=[a.filterType]}else u=[0,1,2,3,4];for(var l=e*s,c=0,f=0,h=new r((l+1)*n),p=u[0],d=0;d1)for(var g=1/0,m=0;mi?e[o-n]:0;e[o]=a+s}},a.prototype._unFilterType2=function(t,e,r){for(var n=this._lastLine,i=0;ii?e[a-n]:0,c=Math.floor((l+u)/2);e[a]=s+c}},a.prototype._unFilterType4=function(t,e,r){for(var n=this._xComparison,o=n-1,a=this._lastLine,s=0;so?e[s-n]:0,f=s>o&&a?a[s-n]:0,h=i(c,l,f);e[s]=u+h}},a.prototype._reverseFilterLine=function(t){var e,n=t[0],i=this._images[this._imageIndex],o=i.byteWidth;if(0===n)e=t.slice(1,o+1);else switch(e=new r(o),n){case 1:this._unFilterType1(t,e,o);break;case 2:this._unFilterType2(t,e,o);break;case 3:this._unFilterType3(t,e,o);break;case 4:this._unFilterType4(t,e,o);break;default:throw new Error("Unrecognised filter type - "+n)}this.write(e),i.lineIndex++,i.lineIndex>=i.height?(this._lastLine=null,this._imageIndex++,i=this._images[this._imageIndex]):this._lastLine=e,i?this.read(i.byteWidth+1,this._reverseFilterLine.bind(this)):(this._lastLine=null,this.complete())}}).call(this,t("buffer").Buffer)},{"./interlace":107,"./paeth-predictor":111,buffer:48}],106:[function(t,e,r){(function(t){"use strict";e.exports=function(e,r){var n=r.depth,i=r.width,o=r.height,a=r.colorType,s=r.transColor,u=r.palette,l=e;return 3===a?function(t,e,r,n,i){for(var o=0,a=0;a0&&f>0&&r.push({width:c,height:f,index:u})}return r},r.getInterlaceIterator=function(t){return function(e,r,i){var o=e%n[i].x.length,a=(e-o)/n[i].x.length*8+n[i].x[o],s=r%n[i].y.length;return 4*a+((r-s)/n[i].y.length*8+n[i].y[s])*t*4}}},{}],108:[function(t,e,r){(function(r){"use strict";var n=t("util"),i=t("stream"),o=t("./constants"),a=t("./packer"),s=e.exports=function(t){i.call(this);var e=t||{};this._packer=new a(e),this._deflate=this._packer.createDeflate(),this.readable=!0};n.inherits(s,i),s.prototype.pack=function(t,e,n,i){this.emit("data",new r(o.PNG_SIGNATURE)),this.emit("data",this._packer.packIHDR(e,n)),i&&this.emit("data",this._packer.packGAMA(i));var a=this._packer.filterData(t,e,n);this._deflate.on("error",this.emit.bind(this,"error")),this._deflate.on("data",function(t){this.emit("data",this._packer.packIDAT(t))}.bind(this)),this._deflate.on("end",function(){this.emit("data",this._packer.packIEND()),this.emit("end")}.bind(this)),this._deflate.end(a)}}).call(this,t("buffer").Buffer)},{"./constants":100,"./packer":110,buffer:48,stream:169,util:180}],109:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./constants"),a=t("./packer");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var s=new a(e||{}),u=[];u.push(new r(o.PNG_SIGNATURE)),u.push(s.packIHDR(t.width,t.height)),t.gamma&&u.push(s.packGAMA(t.gamma));var l=s.filterData(t.data,t.width,t.height),c=i.deflateSync(l,s.getDeflateOptions());if(l=null,!c||!c.length)throw new Error("bad png - invalid compressed data response");return u.push(s.packIDAT(c)),u.push(s.packIEND()),r.concat(u)}}).call(this,t("buffer").Buffer)},{"./constants":100,"./packer":110,buffer:48,zlib:46}],110:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=t("./bitpacker"),a=t("./filter-pack"),s=t("zlib"),u=e.exports=function(t){if(this._options=t,t.deflateChunkSize=t.deflateChunkSize||32768,t.deflateLevel=null!=t.deflateLevel?t.deflateLevel:9,t.deflateStrategy=null!=t.deflateStrategy?t.deflateStrategy:3,t.inputHasAlpha=null==t.inputHasAlpha||t.inputHasAlpha,t.deflateFactory=t.deflateFactory||s.createDeflate,t.bitDepth=t.bitDepth||8,t.colorType="number"==typeof t.colorType?t.colorType:n.COLORTYPE_COLOR_ALPHA,t.colorType!==n.COLORTYPE_COLOR&&t.colorType!==n.COLORTYPE_COLOR_ALPHA)throw new Error("option color type:"+t.colorType+" is not supported at present");if(8!==t.bitDepth)throw new Error("option bit depth:"+t.bitDepth+" is not supported at present")};u.prototype.getDeflateOptions=function(){return{chunkSize:this._options.deflateChunkSize,level:this._options.deflateLevel,strategy:this._options.deflateStrategy}},u.prototype.createDeflate=function(){return this._options.deflateFactory(this.getDeflateOptions())},u.prototype.filterData=function(t,e,r){var i=o(t,e,r,this._options),s=n.COLORTYPE_TO_BPP_MAP[this._options.colorType];return a(i,e,r,this._options,s)},u.prototype._packChunk=function(t,e){var n=e?e.length:0,o=new r(n+12);return o.writeUInt32BE(n,0),o.writeUInt32BE(t,4),e&&e.copy(o,8),o.writeInt32BE(i.crc32(o.slice(4,o.length-4)),o.length-4),o},u.prototype.packGAMA=function(t){var e=new r(4);return e.writeUInt32BE(Math.floor(t*n.GAMMA_DIVISION),0),this._packChunk(n.TYPE_gAMA,e)},u.prototype.packIHDR=function(t,e){var i=new r(13);return i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=this._options.bitDepth,i[9]=this._options.colorType,i[10]=0,i[11]=0,i[12]=0,this._packChunk(n.TYPE_IHDR,i)},u.prototype.packIDAT=function(t){return this._packChunk(n.TYPE_IDAT,t)},u.prototype.packIEND=function(){return this._packChunk(n.TYPE_IEND,null)}}).call(this,t("buffer").Buffer)},{"./bitpacker":98,"./constants":100,"./crc":101,"./filter-pack":102,buffer:48,zlib:46}],111:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=t+e-r,i=Math.abs(n-t),o=Math.abs(n-e),a=Math.abs(n-r);return i<=o&&i<=a?t:o<=a?e:r}},{}],112:[function(t,e,r){"use strict";var n=t("util"),i=t("zlib"),o=t("./chunkstream"),a=t("./filter-parse-async"),s=t("./parser"),u=t("./bitmapper"),l=t("./format-normaliser"),c=e.exports=function(t){o.call(this),this._parser=new s(t,{read:this.read.bind(this),error:this._handleError.bind(this),metadata:this._handleMetaData.bind(this),gamma:this.emit.bind(this,"gamma"),palette:this._handlePalette.bind(this),transColor:this._handleTransColor.bind(this),finished:this._finished.bind(this),inflateData:this._inflateData.bind(this)}),this._options=t,this.writable=!0,this._parser.start()};n.inherits(c,o),c.prototype._handleError=function(t){this.emit("error",t),this.writable=!1,this.destroy(),this._inflate&&this._inflate.destroy&&this._inflate.destroy(),this.errord=!0},c.prototype._inflateData=function(t){this._inflate||(this._inflate=i.createInflate(),this._inflate.on("error",this.emit.bind(this,"error")),this._filter.on("complete",this._complete.bind(this)),this._inflate.pipe(this._filter)),this._inflate.write(t)},c.prototype._handleMetaData=function(t){this.emit("metadata",t),this._bitmapInfo=Object.create(t),this._filter=new a(this._bitmapInfo)},c.prototype._handleTransColor=function(t){this._bitmapInfo.transColor=t},c.prototype._handlePalette=function(t){this._bitmapInfo.palette=t},c.prototype._finished=function(){this.errord||(this._inflate?this._inflate.end():this.emit("error","No Inflate block"),this.destroySoon())},c.prototype._complete=function(t){if(!this.errord){try{var e=u.dataToBitMap(t,this._bitmapInfo),r=l(e,this._bitmapInfo);e=null}catch(t){return void this._handleError(t)}this.emit("parsed",r)}}},{"./bitmapper":97,"./chunkstream":99,"./filter-parse-async":103,"./format-normaliser":106,"./parser":114,util:180,zlib:46}],113:[function(t,e,r){(function(r){"use strict";var n=!0,i=t("zlib");i.deflateSync||(n=!1);var o=t("./sync-reader"),a=t("./filter-parse-sync"),s=t("./parser"),u=t("./bitmapper"),l=t("./format-normaliser");e.exports=function(t,e){if(!n)throw new Error("To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport");var c,f,h;var p=[];var d=new o(t);if(new s(e,{read:d.read.bind(d),error:function(t){c=t},metadata:function(t){f=t},gamma:function(t){h=t},palette:function(t){f.palette=t},transColor:function(t){f.transColor=t},inflateData:function(t){p.push(t)}}).start(),d.process(),c)throw c;var g=r.concat(p);p.length=0;var m=i.inflateSync(g);if(g=null,!m||!m.length)throw new Error("bad png - invalid inflate data response");var v=a.process(m,f);g=null;var _=u.dataToBitMap(v,f);v=null;var y=l(_,f);return f.data=y,f.gamma=h||0,f}}).call(this,t("buffer").Buffer)},{"./bitmapper":97,"./filter-parse-sync":104,"./format-normaliser":106,"./parser":114,"./sync-reader":117,buffer:48,zlib:46}],114:[function(t,e,r){(function(r){"use strict";var n=t("./constants"),i=t("./crc"),o=e.exports=function(t,e){this._options=t,t.checkCRC=!1!==t.checkCRC,this._hasIHDR=!1,this._hasIEND=!1,this._palette=[],this._colorType=0,this._chunks={},this._chunks[n.TYPE_IHDR]=this._handleIHDR.bind(this),this._chunks[n.TYPE_IEND]=this._handleIEND.bind(this),this._chunks[n.TYPE_IDAT]=this._handleIDAT.bind(this),this._chunks[n.TYPE_PLTE]=this._handlePLTE.bind(this),this._chunks[n.TYPE_tRNS]=this._handleTRNS.bind(this),this._chunks[n.TYPE_gAMA]=this._handleGAMA.bind(this),this.read=e.read,this.error=e.error,this.metadata=e.metadata,this.gamma=e.gamma,this.transColor=e.transColor,this.palette=e.palette,this.parsed=e.parsed,this.inflateData=e.inflateData,this.inflateData=e.inflateData,this.finished=e.finished};o.prototype.start=function(){this.read(n.PNG_SIGNATURE.length,this._parseSignature.bind(this))},o.prototype._parseSignature=function(t){for(var e=n.PNG_SIGNATURE,r=0;rthis._palette.length)return void this.error(new Error("More transparent colors than palette size"));for(var e=0;e0?this._handleIDAT(r):this._handleChunkEnd()},o.prototype._handleIEND=function(t){this.read(t,this._parseIEND.bind(this))},o.prototype._parseIEND=function(t){this._crc.write(t),this._hasIEND=!0,this._handleChunkEnd(),this.finished&&this.finished()}}).call(this,t("buffer").Buffer)},{"./constants":100,"./crc":101,buffer:48}],115:[function(t,e,r){"use strict";var n=t("./parser-sync"),i=t("./packer-sync");r.read=function(t,e){return n(t,e||{})},r.write=function(t){return i(t)}},{"./packer-sync":109,"./parser-sync":113}],116:[function(t,e,r){(function(e,n){"use strict";var i=t("util"),o=t("stream"),a=t("./parser-async"),s=t("./packer-async"),u=t("./png-sync"),l=r.PNG=function(t){o.call(this),t=t||{},this.width=t.width||0,this.height=t.height||0,this.data=this.width>0&&this.height>0?new n(4*this.width*this.height):null,t.fill&&this.data&&this.data.fill(0),this.gamma=0,this.readable=this.writable=!0,this._parser=new a(t),this._parser.on("error",this.emit.bind(this,"error")),this._parser.on("close",this._handleClose.bind(this)),this._parser.on("metadata",this._metadata.bind(this)),this._parser.on("gamma",this._gamma.bind(this)),this._parser.on("parsed",function(t){this.data=t,this.emit("parsed",t)}.bind(this)),this._packer=new s(t),this._packer.on("data",this.emit.bind(this,"data")),this._packer.on("end",this.emit.bind(this,"end")),this._parser.on("close",this._handleClose.bind(this)),this._packer.on("error",this.emit.bind(this,"error"))};i.inherits(l,o),l.sync=u,l.prototype.pack=function(){return this.data&&this.data.length?(e.nextTick(function(){this._packer.pack(this.data,this.width,this.height,this.gamma)}.bind(this)),this):(this.emit("error","No data provided"),this)},l.prototype.parse=function(t,e){var r,n;e&&(r=function(t){this.removeListener("error",n),this.data=t,e(null,this)}.bind(this),n=function(t){this.removeListener("parsed",r),e(t,null)}.bind(this),this.once("parsed",r),this.once("error",n));return this.end(t),this},l.prototype.write=function(t){return this._parser.write(t),!0},l.prototype.end=function(t){this._parser.end(t)},l.prototype._metadata=function(t){this.width=t.width,this.height=t.height,this.emit("metadata",t)},l.prototype._gamma=function(t){this.gamma=t},l.prototype._handleClose=function(){this._parser.writable||this._packer.readable||this.emit("close")},l.bitblt=function(t,e,r,n,i,o,a,s){if(r>t.width||n>t.height||r+i>t.width||n+o>t.height)throw new Error("bitblt reading outside image");if(a>e.width||s>e.height||a+i>e.width||s+o>e.height)throw new Error("bitblt writing outside image");for(var u=0;u0&&this._buffer.length;){var t=this._reads[0];if(!this._buffer.length||!(this._buffer.length>=t.length||t.allowLess))break;this._reads.shift();var e=this._buffer;this._buffer=e.slice(t.length),t.func.call(this,e.slice(0,t.length))}return this._reads.length>0?new Error("There are some read requests waitng on finished stream"):this._buffer.length>0?new Error("unrecognised content at end of stream"):void 0}},{}],118:[function(t,e,r){var n,i,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var l,c=[],f=!1,h=-1;function p(){f&&l&&(f=!1,l.length?c=l.concat(c):h=-1,c.length&&d())}function d(){if(!f){var t=u(p);f=!0;for(var e=c.length;e;){for(l=c,c=[];++h1)for(var r=1;r>>7-t%8&1)},put:function(t,e){for(var r=0;r>>e-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},e.exports=n},{}],124:[function(t,e,r){var n=t("../utils/buffer");function i(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new n(t*t),this.data.fill(0),this.reservedBit=new n(t*t),this.reservedBit.fill(0)}i.prototype.set=function(t,e,r,n){var i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)},i.prototype.get=function(t,e){return this.data[t*this.size+e]},i.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},i.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]},e.exports=i},{"../utils/buffer":146}],125:[function(t,e,r){var n=t("../utils/buffer"),i=t("./mode");function o(t){this.mode=i.BYTE,this.data=new n(t)}o.getBitsLength=function(t){return 8*t},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(t){for(var e=0,r=this.data.length;e=0&&t.bit<4},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"l":case"low":return r.L;case"m":case"medium":return r.M;case"q":case"quartile":return r.Q;case"h":case"high":return r.H;default:throw new Error("Unknown EC Level: "+t)}}(t)}catch(t){return e}}},{}],128:[function(t,e,r){var n=t("./utils").getSymbolSize;r.getPositions=function(t){var e=n(t);return[[0,0],[e-7,0],[0,e-7]]}},{"./utils":140}],129:[function(t,e,r){var n=t("./utils"),i=n.getBCHDigit(1335);r.getEncodedBits=function(t,e){for(var r=t.bit<<3|e,o=r<<10;n.getBCHDigit(o)-i>=0;)o^=1335<=33088&&r<=40956)r-=33088;else{if(!(r>=57408&&r<=60351))throw new Error("Invalid SJIS character: "+this.data[e]+"\nMake sure your charset is UTF-8");r-=49472}r=192*(r>>>8&255)+(255&r),t.put(r,13)}},e.exports=o},{"./mode":133,"./utils":140}],132:[function(t,e,r){r.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var n=3,i=3,o=40,a=10;function s(t,e,n){switch(t){case r.Patterns.PATTERN000:return(e+n)%2==0;case r.Patterns.PATTERN001:return e%2==0;case r.Patterns.PATTERN010:return n%3==0;case r.Patterns.PATTERN011:return(e+n)%3==0;case r.Patterns.PATTERN100:return(Math.floor(e/2)+Math.floor(n/3))%2==0;case r.Patterns.PATTERN101:return e*n%2+e*n%3==0;case r.Patterns.PATTERN110:return(e*n%2+e*n%3)%2==0;case r.Patterns.PATTERN111:return(e*n%3+(e+n)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}}r.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},r.from=function(t){return r.isValid(t)?parseInt(t,10):void 0},r.getPenaltyN1=function(t){for(var e=t.size,r=0,i=0,o=0,a=null,s=null,u=0;u=5&&(r+=n+(i-5)),a=c,i=1),(c=t.get(l,u))===s?o++:(o>=5&&(r+=n+(o-5)),s=c,o=1)}i>=5&&(r+=n+(i-5)),o>=5&&(r+=n+(o-5))}return r},r.getPenaltyN2=function(t){for(var e=t.size,r=0,n=0;n=10&&(1488===n||93===n)&&r++,i=i<<1&2047|t.get(s,a),s>=10&&(1488===i||93===i)&&r++}return r*o},r.getPenaltyN4=function(t){for(var e=0,r=t.data.length,n=0;n=1&&e<10?t.ccBits[0]:e<27?t.ccBits[1]:t.ccBits[2]},r.getBestModeForData=function(t){return i.testNumeric(t)?r.NUMERIC:i.testAlphanumeric(t)?r.ALPHANUMERIC:i.testKanji(t)?r.KANJI:r.BYTE},r.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},r.isValid=function(t){return t&&t.bit&&t.ccBits},r.from=function(t,e){if(r.isValid(t))return t;try{return function(t){if("string"!=typeof t)throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}(t)}catch(t){return e}}},{"./regex":138,"./version-check":141}],134:[function(t,e,r){var n=t("./mode");function i(t){this.mode=n.NUMERIC,this.data=t.toString()}i.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(t){var e,r,n;for(e=0;e+3<=this.data.length;e+=3)r=this.data.substr(e,3),n=parseInt(r,10),t.put(n,10);var i=this.data.length-e;i>0&&(r=this.data.substr(e),n=parseInt(r,10),t.put(n,3*i+1))},e.exports=i},{"./mode":133}],135:[function(t,e,r){var n=t("../utils/buffer"),i=t("./galois-field");r.mul=function(t,e){var r=new n(t.length+e.length-1);r.fill(0);for(var o=0;o=0;){for(var o=r[0],a=0;a>n&1),n<6?t.set(n,8,i,!0):n<8?t.set(n+1,8,i,!0):t.set(o-15+n,8,i,!0),n<8?t.set(8,o-n-1,i,!0):n<9?t.set(8,15-n-1+1,i,!0):t.set(8,15-n-1,i,!0);t.set(o-8,8,1,!0)}function y(t,e,r){var o=new a;r.forEach(function(e){o.put(e.mode.bit,4),o.put(e.getLength(),g.getCharCountIndicator(e.mode,t)),e.write(o)});var s=8*(i.getSymbolTotalCodewords(t)-f.getTotalCodewordsCount(t,e));for(o.getLengthInBits()+4<=s&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(0);for(var u=(s-o.getLengthInBits())/8,l=0;l=0&&s<=6&&(0===u||6===u)||u>=0&&u<=6&&(0===s||6===s)||s>=2&&s<=4&&u>=2&&u<=4?t.set(o+s,a+u,!0,!0):t.set(o+s,a+u,!1,!0))}(b,e),function(t){for(var e=t.size,r=8;r=7&&function(t,e){for(var r,n,i,o=t.size,a=p.getEncodedBits(e),s=0;s<18;s++)r=Math.floor(s/3),n=s%3+o-8-3,i=1==(a>>s&1),t.set(r,n,i,!0),t.set(n,r,i,!0)}(b,e),function(t,e){for(var r=t.size,n=-1,i=r-1,o=7,a=0,s=r-1;s>0;s-=2)for(6===s&&s--;;){for(var u=0;u<2;u++)if(!t.isReserved(i,s-u)){var l=!1;a>>o&1)),t.set(i,s-u,l),-1==--o&&(a++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(b,d),isNaN(n)&&(n=c.getBestMask(b,_.bind(null,b,r))),c.applyMask(n,b),_(b,r,n),{modules:b,version:e,errorCorrectionLevel:r,maskPattern:n,segments:o}}r.create=function(t,e){if(void 0===t||""===t)throw new Error("No input text");var r,n,a=o.M;return void 0!==e&&(a=o.from(e.errorCorrectionLevel,o.M),r=p.from(e.version),n=c.from(e.maskPattern),e.toSJISFunc&&i.setToSJISFunction(e.toSJISFunc)),b(t,r,a,n)}},{"../utils/buffer":146,"./alignment-pattern":121,"./bit-buffer":123,"./bit-matrix":124,"./error-correction-code":126,"./error-correction-level":127,"./finder-pattern":128,"./format-info":129,"./mask-pattern":132,"./mode":133,"./reed-solomon-encoder":137,"./segments":139,"./utils":140,"./version":142,isarray:147}],137:[function(t,e,r){var n=t("../utils/buffer"),i=t("./polynomial");function o(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}o.prototype.initialize=function(t){this.degree=t,this.genPoly=i.generateECPolynomial(this.degree)},o.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");var e=new n(this.degree);e.fill(0);var r=n.concat([t,e],t.length+this.degree),o=i.mod(r,this.genPoly),a=this.degree-o.length;if(a>0){var s=new n(this.degree);return s.fill(0),o.copy(s,a),s}return o},e.exports=o},{"../utils/buffer":146,"./polynomial":135}],138:[function(t,e,r){var n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";r.KANJI=new RegExp(n,"g"),r.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),r.BYTE=new RegExp(i,"g"),r.NUMERIC=new RegExp("[0-9]+","g"),r.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");var o=new RegExp("^"+n+"$"),a=new RegExp("^[0-9]+$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");r.testKanji=function(t){return o.test(t)},r.testNumeric=function(t){return a.test(t)},r.testAlphanumeric=function(t){return s.test(t)}},{}],139:[function(t,e,r){var n=t("./mode"),i=t("./numeric-data"),o=t("./alphanumeric-data"),a=t("./byte-data"),s=t("./kanji-data"),u=t("./regex"),l=t("./utils"),c=t("dijkstrajs");function f(t){return unescape(encodeURIComponent(t)).length}function h(t,e,r){for(var n,i=[];null!==(n=t.exec(r));)i.push({data:n[0],index:n.index,mode:e,length:n[0].length});return i}function p(t){var e,r,i=h(u.NUMERIC,n.NUMERIC,t),o=h(u.ALPHANUMERIC,n.ALPHANUMERIC,t);return l.isKanjiModeEnabled()?(e=h(u.BYTE,n.BYTE,t),r=h(u.KANJI,n.KANJI,t)):(e=h(u.BYTE_KANJI,n.BYTE,t),r=[]),i.concat(o,e,r).sort(function(t,e){return t.index-e.index}).map(function(t){return{data:t.data,mode:t.mode,length:t.length}})}function d(t,e){switch(e){case n.NUMERIC:return i.getBitsLength(t);case n.ALPHANUMERIC:return o.getBitsLength(t);case n.KANJI:return s.getBitsLength(t);case n.BYTE:return a.getBitsLength(t)}}function g(t,e){var r,u=n.getBestModeForData(t);if((r=n.from(e,u))!==n.BYTE&&r.bit=0?t[t.length-1]:null;return r&&r.mode===e.mode?(t[t.length-1].data+=e.data,t):(t.push(e),t)},[])}(a))},r.rawSplit=function(t){return r.fromArray(p(t,l.isKanjiModeEnabled()))}},{"./alphanumeric-data":122,"./byte-data":125,"./kanji-data":131,"./mode":133,"./numeric-data":134,"./regex":138,"./utils":140,dijkstrajs:20}],140:[function(t,e,r){var n,i=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];r.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},r.getSymbolTotalCodewords=function(t){return i[t]},r.getBCHDigit=function(t){for(var e=0;0!==t;)e++,t>>>=1;return e},r.setToSJISFunction=function(t){if("function"!=typeof t)throw new Error('"toSJISFunc" is not a valid function.');n=t},r.isKanjiModeEnabled=function(){return void 0!==n},r.toSJIS=function(t){return n(t)}},{}],141:[function(t,e,r){r.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}},{}],142:[function(t,e,r){var n=t("./utils"),i=t("./error-correction-code"),o=t("./error-correction-level"),a=t("./mode"),s=t("./version-check"),u=t("isarray"),l=n.getBCHDigit(7973);function c(t,e){return a.getCharCountIndicator(t,e)+4}function f(t,e){var r=0;return t.forEach(function(t){var n=c(t.mode,e);r+=n+t.getBitsLength()}),r}r.from=function(t,e){return s.isValid(t)?parseInt(t,10):e},r.getCapacity=function(t,e,r){if(!s.isValid(t))throw new Error("Invalid QR Code version");void 0===r&&(r=a.BYTE);var o=8*(n.getSymbolTotalCodewords(t)-i.getTotalCodewordsCount(t,e));if(r===a.MIXED)return o;var u=o-c(r,t);switch(r){case a.NUMERIC:return Math.floor(u/10*3);case a.ALPHANUMERIC:return Math.floor(u/11*2);case a.KANJI:return Math.floor(u/13);case a.BYTE:default:return Math.floor(u/8)}},r.getBestVersionForData=function(t,e){var n,i=o.from(e,o.M);if(u(t)){if(t.length>1)return function(t,e){for(var n=1;n<=40;n++)if(f(t,n)<=r.getCapacity(n,e,a.MIXED))return n}(t,i);if(0===t.length)return 1;n=t[0]}else n=t;return function(t,e,n){for(var i=1;i<=40;i++)if(e<=r.getCapacity(i,n,t))return i}(n.mode,n.getLength(),i)},r.getEncodedBits=function(t){if(!s.isValid(t)||t<7)throw new Error("Invalid QR Code version");for(var e=t<<12;n.getBCHDigit(e)-l>=0;)e^=7973<':"",f="0&&l>0&&t[u-1]||(n+=a?o("M",l+r,.5+c+r):o("m",i,0),i=0,a=!1),l+1',h='viewBox="0 0 '+l+" "+l+'"',p=''+c+f+"\n";return"function"==typeof r&&r(null,p),p}},{"./utils":145}],145:[function(t,e,r){function n(t){if("string"!=typeof t)throw new Error("Color should be defined as hex string");var e=t.slice().replace("#","").split("");if(e.length<3||5===e.length||e.length>8)throw new Error("Invalid hex color: "+t);3!==e.length&&4!==e.length||(e=Array.prototype.concat.apply([],e.map(function(t){return[t,t]}))),6===e.length&&e.push("F","F");var r=parseInt(e.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(t){t||(t={}),t.color||(t.color={});var e=void 0===t.margin||null===t.margin||t.margin<0?4:t.margin,r=t.width&&t.width>=21?t.width:void 0,i=t.scale||4;return{width:r,scale:r?4:i,margin:e,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},r.getScale=function(t,e){return e.width&&e.width>=t+2*e.margin?e.width/(t+2*e.margin):e.scale},r.getImageWidth=function(t,e){var n=r.getScale(t,e);return Math.floor((t+2*e.margin)*n)},r.qrToImageData=function(t,e,n){for(var i=e.modules.size,o=e.modules.data,a=r.getScale(i,n),s=Math.floor((i+2*n.margin)*a),u=n.margin*a,l=[n.color.light,n.color.dark],c=0;c=u&&f>=u&&c=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|t}function s(t,e){var r;return o.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e)).__proto__=o.prototype:(null===(r=t)&&(r=new o(e)),r.length=e),r}function u(t,e){var r=s(t,e<0?0:0|a(e));if(!o.TYPED_ARRAY_SUPPORT)for(var n=0;n55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function f(t){return o.isBuffer(t)?t.length:"undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)?t.byteLength:("string"!=typeof t&&(t=""+t),0===t.length?0:c(t).length)}o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1})),o.prototype.write=function(t,e,r){void 0===e?(r=this.length,e=0):void 0===r&&"string"==typeof e?(r=this.length,e=0):isFinite(e)&&(e|=0,isFinite(r)?r|=0:r=void 0);var n=this.length-e;if((void 0===r||r>n)&&(r=n),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");return function(t,e,r,n){return function(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}(c(e,t.length-r),t,r,n)}(this,t,e,r)},o.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?w(t,a,e,!1):E(t,a)):w(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function B(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(C,t):C(t))}function C(t){p("emit readable"),t.emit("readable"),T(t)}function E(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(P,t,e))}function P(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var n;to.length?o.length:t;if(a===o.length?i+=o:i+=o.slice(0,t),0===(t-=a)){a===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++n}return e.length-=n,i}(t,e):function(t,e){var r=l.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;for(;n=n.next;){var o=n.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(a));break}++i}return e.length-=i,r}(t,e);return n}(t,e.buffer,e.decoder),r);var r}function M(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(I,e,t))}function I(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function R(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):B(this),null;if(0===(t=x(t,e))&&e.ended)return 0===e.length&&M(this),null;var n,i=e.needReadable;return p("need readable",i),(0===e.length||e.length-t0?A(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&M(this)),null!==n&&this.emit("data",n),n},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?c:y;function l(e,r){p("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,p("cleanup"),t.removeListener("close",v),t.removeListener("finish",_),t.removeListener("drain",f),t.removeListener("error",m),t.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",y),n.removeListener("data",g),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function c(){p("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",l);var f=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,T(t))}}(n);t.on("drain",f);var h=!1;var d=!1;function g(e){p("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==R(o.pipes,t))&&!h&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function m(e){p("onerror",e),y(),t.removeListener("error",m),0===s(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",_),y()}function _(){p("onfinish"),t.removeListener("close",v),y()}function y(){p("unpipe"),n.unpipe(t)}return n.on("data",g),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",m),t.once("close",v),t.once("finish",_),t.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?i:o.nextTick;_.WritableState=v;var l=t("core-util-is");l.inherits=t("inherits");var c={deprecate:t("util-deprecate")},f=t("./internal/streams/stream"),h=t("safe-buffer").Buffer,p=n.Uint8Array||function(){};var d,g=t("./internal/streams/destroy");function m(){}function v(e,r){s=s||t("./_stream_duplex"),e=e||{};var n=r instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(B,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(i(n),t._writableState.errorEmitted=!0,t.emit("error",n),B(t,e))}(t,r,n,e,i);else{var a=k(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||w(t,r),n?u(b,t,r,a,i):b(t,r,a,i)}}(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function _(e){if(s=s||t("./_stream_duplex"),!(d.call(_,this)||this instanceof s))return new _(e);this._writableState=new v(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function y(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function b(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),B(t,e)}function w(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,c=r.encoding,f=r.callback;if(y(t,e,!1,e.objectMode?1:l.length,l,c,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function x(t,e){t._final(function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),B(t,e)})}function B(t,e){var r=k(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(x,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}l.inherits(_,f),v.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(v.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(_,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===_&&(t&&t._writableState instanceof v)}})):d=function(t){return t instanceof this},_.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},_.prototype.write=function(t,e,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(n=t,h.isBuffer(n)||n instanceof p);return s&&!h.isBuffer(t)&&(t=function(t){return h.from(t)}(t)),"function"==typeof e&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,t,r))&&(i.pendingcb++,a=function(t,e,r,n,i,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=h.from(e,r));return e}(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),_.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},_.prototype._writev=null,_.prototype.end=function(t,e,r){var n=this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,r){e.ending=!0,B(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r)},Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),_.prototype.destroy=g.destroy,_.prototype._undestroy=g.undestroy,_.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":149,"./internal/streams/destroy":155,"./internal/streams/stream":156,_process:118,"core-util-is":14,inherits:71,"process-nextick-args":158,"safe-buffer":164,timers:172,"util-deprecate":178}],154:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,r,i,o=n.allocUnsafe(t>>>0),a=this.head,s=0;a;)e=a.data,r=o,i=s,e.copy(r,i),s+=a.data.length,a=a.next;return o},t}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var t=i.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":164,util:4}],155:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(n.nextTick(i,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":158}],156:[function(t,e,r){e.exports=t("events").EventEmitter},{events:49}],157:[function(t,e,r){arguments[4][147][0].apply(r,arguments)},{dup:147}],158:[function(t,e,r){(function(t){"use strict";!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function c(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}r.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":164}],160:[function(t,e,r){e.exports=t("./readable").PassThrough},{"./readable":161}],161:[function(t,e,r){(r=e.exports=t("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":149,"./lib/_stream_passthrough.js":150,"./lib/_stream_readable.js":151,"./lib/_stream_transform.js":152,"./lib/_stream_writable.js":153}],162:[function(t,e,r){e.exports=t("./readable").Transform},{"./readable":161}],163:[function(t,e,r){e.exports=t("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":153}],164:[function(t,e,r){var n=t("buffer"),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,r),r.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:48}],165:[function(t,e,r){arguments[4][68][0].apply(r,arguments)},{"./lib/decoder":166,"./lib/encoder":167,dup:68}],166:[function(t,e,r){(function(t){var r=function(){"use strict";var t=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),e=4017,r=799,n=3406,i=2276,o=1567,a=3784,s=5793,u=2896;function l(){}function c(t,e){for(var r,n,i=0,o=[],a=16;a>0&&!t[a-1];)a--;o.push({children:[],index:0});var s,u=o[0];for(r=0;r0;)u=o.pop();for(u.index++,o.push(u);o.length<=r;)o.push(s={children:[],index:0}),u.children[u.index]=s.children,u=s;i++}r+10)return p>>--d&1;if(255==(p=e[r++])){var t=e[r++];if(t)throw"unexpected marker: "+(p<<8|t).toString(16)}return d=7,p>>>7}function m(t){for(var e,r=t;null!==(e=g());){if("number"==typeof(r=r[e]))return r;if("object"!=typeof r)throw"invalid huffman sequence"}return null}function v(t){for(var e=0;t>0;){var r=g();if(null===r)return;e=e<<1|r,t--}return e}function _(t){var e=v(t);return e>=1<0)y--;else for(var n=a,i=s;n<=i;){var o=m(e.huffmanTableAC),u=15&o,c=o>>4;if(0!==u)r[t[n+=c]]=_(u)*(1<>4,0===f)o<15?(y=v(o)+(1<>4;if(0!==s)r[t[o+=u]]=_(s),o++;else{if(u<15)break;o+=16}}};var A,M,I,R,L=0;for(M=1==T?i[0].blocksPerLine*i[0].blocksPerColumn:c*n.mcusPerColumn,o||(o=M);L=65488&&A<=65495))break;r+=2}return r-h}function h(t,l){var c,f,h=[],p=l.blocksPerLine,d=l.blocksPerColumn,g=p<<3,m=new Int32Array(64),v=new Uint8Array(64);function _(t,c,f){var h,p,d,g,m,v,_,y,b,w,k=l.quantizationTable,x=f;for(w=0;w<64;w++)x[w]=t[w]*k[w];for(w=0;w<8;++w){var B=8*w;0!=x[1+B]||0!=x[2+B]||0!=x[3+B]||0!=x[4+B]||0!=x[5+B]||0!=x[6+B]||0!=x[7+B]?(h=s*x[0+B]+128>>8,p=s*x[4+B]+128>>8,d=x[2+B],g=x[6+B],m=u*(x[1+B]-x[7+B])+128>>8,y=u*(x[1+B]+x[7+B])+128>>8,v=x[3+B]<<4,_=x[5+B]<<4,b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+g*o+128>>8,d=d*o-g*a+128>>8,g=b,b=m-_+1>>1,m=m+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=b,b=h-g+1>>1,h=h+g+1>>1,g=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=m*i+y*n+2048>>12,m=m*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,x[0+B]=h+y,x[7+B]=h-y,x[1+B]=p+_,x[6+B]=p-_,x[2+B]=d+v,x[5+B]=d-v,x[3+B]=g+m,x[4+B]=g-m):(b=s*x[0+B]+512>>10,x[0+B]=b,x[1+B]=b,x[2+B]=b,x[3+B]=b,x[4+B]=b,x[5+B]=b,x[6+B]=b,x[7+B]=b)}for(w=0;w<8;++w){var C=w;0!=x[8+C]||0!=x[16+C]||0!=x[24+C]||0!=x[32+C]||0!=x[40+C]||0!=x[48+C]||0!=x[56+C]?(h=s*x[0+C]+2048>>12,p=s*x[32+C]+2048>>12,d=x[16+C],g=x[48+C],m=u*(x[8+C]-x[56+C])+2048>>12,y=u*(x[8+C]+x[56+C])+2048>>12,v=x[24+C],_=x[40+C],b=h-p+1>>1,h=h+p+1>>1,p=b,b=d*a+g*o+2048>>12,d=d*o-g*a+2048>>12,g=b,b=m-_+1>>1,m=m+_+1>>1,_=b,b=y+v+1>>1,v=y-v+1>>1,y=b,b=h-g+1>>1,h=h+g+1>>1,g=b,b=p-d+1>>1,p=p+d+1>>1,d=b,b=m*i+y*n+2048>>12,m=m*n-y*i+2048>>12,y=b,b=v*r+_*e+2048>>12,v=v*e-_*r+2048>>12,_=b,x[0+C]=h+y,x[56+C]=h-y,x[8+C]=p+_,x[48+C]=p-_,x[16+C]=d+v,x[40+C]=d-v,x[24+C]=g+m,x[32+C]=g-m):(b=s*f[w+0]+8192>>14,x[0+C]=b,x[8+C]=b,x[16+C]=b,x[24+C]=b,x[32+C]=b,x[40+C]=b,x[48+C]=b,x[56+C]=b)}for(w=0;w<64;++w){var E=128+(x[w]+8>>4);c[w]=E<0?0:E>255?255:E}}for(var y=0;y255?255:t}return l.prototype={load:function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer",e.onload=function(){var t=new Uint8Array(e.response||e.mozResponseArrayBuffer);this.parse(t),this.onload&&this.onload()}.bind(this),e.send(null)},parse:function(e){var r=0;e.length;function n(){var t=e[r]<<8|e[r+1];return r+=2,t}function i(){var t=n(),i=e.subarray(r,r+t-2);return r+=i.length,i}function o(t){var e,r,n=0,i=0;for(r in t.components)t.components.hasOwnProperty(r)&&(n<(e=t.components[r]).h&&(n=e.h),i>4==0)for(_=0;_<64;_++){k[t[_]]=e[r++]}else{if(w>>4!=1)throw"DQT: invalid table spec";for(_=0;_<64;_++){k[t[_]]=n()}}p[15&w]=k}break;case 65472:case 65473:case 65474:n(),(a={}).extended=65473===v,a.progressive=65474===v,a.precision=e[r++],a.scanLines=n(),a.samplesPerLine=n(),a.components={},a.componentsOrder=[];var x,B=e[r++];for(U=0;U>4,E=15&e[r+1],P=e[r+2];a.componentsOrder.push(x),a.components[x]={h:C,v:E,quantizationTable:p[P]},r+=3}o(a),d.push(a);break;case 65476:var j=n();for(U=2;U>4==0?m:g)[15&S]=c(T,M)}break;case 65501:n(),s=n();break;case 65498:n();var I=e[r++],R=[];for(U=0;U>4],z.huffmanTableAC=g[15&L],R.push(z)}var F=e[r++],O=e[r++],D=e[r++],N=f(e,r,a,R,s,F,O,D>>4,15&D);r+=N;break;default:if(255==e[r-3]&&e[r-2]>=192&&e[r-2]<=254){r-=3;break}throw"unknown JPEG marker "+v.toString(16)}v=n()}if(1!=d.length)throw"only single frame JPEGs supported";this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=u,this.adobe=l,this.components=[];for(var U=0;U=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var n=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,n),n-=this.charReceived);var i;n=(e+=t.toString(this.encoding,0,n)).length-1;if((i=e.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,n)}return e},o.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},o.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},{buffer:48}],171:[function(t,e,r){(function(r){var n=t("stream");function i(t,e,i){t=t||function(t){this.queue(t)},e=e||function(){this.queue(null)};var o=!1,a=!1,s=[],u=!1,l=new n;function c(){for(;s.length&&!l.paused;){var t=s.shift();if(null===t)return l.emit("end");l.emit("data",t)}}return l.readable=l.writable=!0,l.paused=!1,l.autoDestroy=!(i&&!1===i.autoDestroy),l.write=function(e){return t.call(this,e),!l.paused},l.queue=l.push=function(t){return u?l:(null===t&&(u=!0),s.push(t),c(),l)},l.on("end",function(){l.readable=!1,!l.writable&&l.autoDestroy&&r.nextTick(function(){l.destroy()})}),l.end=function(t){if(!o)return o=!0,arguments.length&&l.write(t),l.writable=!1,e.call(l),!l.readable&&l.autoDestroy&&l.destroy(),l},l.destroy=function(){if(!a)return a=!0,o=!0,s.length=0,l.writable=l.readable=!1,l.emit("close"),l},l.pause=function(){if(!l.paused)return l.paused=!0,l},l.resume=function(){return l.paused&&(l.paused=!1,l.emit("resume")),c(),l.paused||l.emit("drain"),l},l}e.exports=i,i.through=i}).call(this,t("_process"))},{_process:118,stream:169}],172:[function(t,e,r){(function(e,n){var i=t("process/browser.js").nextTick,o=Function.prototype.apply,a=Array.prototype.slice,s={},u=0;function l(t,e){this._id=t,this._clearFn=e}r.setTimeout=function(){return new l(o.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new l(o.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(t){t.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},r.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},r._unrefActive=r.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r.setImmediate="function"==typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&a.call(arguments,1);return s[e]=!0,i(function(){s[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))}),e},r.clearImmediate="function"==typeof n?n:function(t){delete s[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":118,timers:172}],173:[function(t,e,r){r.isatty=function(){return!1},r.ReadStream=function(){throw new Error("tty.ReadStream is not implemented")},r.WriteStream=function(){throw new Error("tty.WriteStream is not implemented")}},{}],174:[function(t,e,r){(function(e,n){"use strict";var i=t("bit-twiddle"),o=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:o([32,0]),UINT16:o([32,0]),UINT32:o([32,0]),INT8:o([32,0]),INT16:o([32,0]),INT32:o([32,0]),FLOAT:o([32,0]),DOUBLE:o([32,0]),DATA:o([32,0]),UINT8C:o([32,0]),BUFFER:o([32,0])});var a="undefined"!=typeof Uint8ClampedArray,s=e.__TYPEDARRAY_POOL;s.UINT8C||(s.UINT8C=o([32,0])),s.BUFFER||(s.BUFFER=o([32,0]));var u=s.DATA,l=s.BUFFER;function c(t){if(t){var e=t.length||t.byteLength,r=i.log2(e);u[r].push(t)}}function f(t){t=i.nextPow2(t);var e=i.log2(t),r=u[e];return r.length>0?r.pop():new ArrayBuffer(t)}function h(t){return new Uint8Array(f(t),0,t)}function p(t){return new Uint16Array(f(2*t),0,t)}function d(t){return new Uint32Array(f(4*t),0,t)}function g(t){return new Int8Array(f(t),0,t)}function m(t){return new Int16Array(f(2*t),0,t)}function v(t){return new Int32Array(f(4*t),0,t)}function _(t){return new Float32Array(f(4*t),0,t)}function y(t){return new Float64Array(f(8*t),0,t)}function b(t){return a?new Uint8ClampedArray(f(t),0,t):h(t)}function w(t){return new DataView(f(t),0,t)}function k(t){t=i.nextPow2(t);var e=i.log2(t),r=l[e];return r.length>0?r.pop():new n(t)}r.free=function(t){if(n.isBuffer(t))l[i.log2(t.length)].push(t);else{if("[object ArrayBuffer]"!==Object.prototype.toString.call(t)&&(t=t.buffer),!t)return;var e=t.length||t.byteLength,r=0|i.log2(e);u[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){c(t.buffer)},r.freeArrayBuffer=c,r.freeBuffer=function(t){l[i.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return f(t);switch(e){case"uint8":return h(t);case"uint16":return p(t);case"uint32":return d(t);case"int8":return g(t);case"int16":return m(t);case"int32":return v(t);case"float":case"float32":return _(t);case"double":case"float64":return y(t);case"uint8_clamped":return b(t);case"buffer":return k(t);case"data":case"dataview":return w(t);default:return null}return null},r.mallocArrayBuffer=f,r.mallocUint8=h,r.mallocUint16=p,r.mallocUint32=d,r.mallocInt8=g,r.mallocInt16=m,r.mallocInt32=v,r.mallocFloat32=r.mallocFloat=_,r.mallocFloat64=r.mallocDouble=y,r.mallocUint8Clamped=b,r.mallocDataView=w,r.mallocBuffer=k,r.clearCache=function(){for(var t=0;t<32;++t)s.UINT8[t].length=0,s.UINT16[t].length=0,s.UINT32[t].length=0,s.INT8[t].length=0,s.INT16[t].length=0,s.INT32[t].length=0,s.FLOAT[t].length=0,s.DOUBLE[t].length=0,s.UINT8C[t].length=0,u[t].length=0,l[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":2,buffer:48,dup:21}],175:[function(t,e,r){(function(){var t=this,n=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,l=o.slice,c=o.concat,f=a.toString,h=a.hasOwnProperty,p=o.forEach,d=o.map,g=o.reduce,m=o.reduceRight,v=o.filter,_=o.every,y=o.some,b=o.indexOf,w=o.lastIndexOf,k=Array.isArray,x=Object.keys,B=s.bind,C=function(t){return t instanceof C?t:this instanceof C?void(this._wrapped=t):new C(t)};void 0!==r?(void 0!==e&&e.exports&&(r=e.exports=C),r._=C):t._=C,C.VERSION="1.4.4";var E=C.each=C.forEach=function(t,e,r){if(null!=t)if(p&&t.forEach===p)t.forEach(e,r);else if(t.length===+t.length){for(var n=0,o=t.length;n2;if(null==t&&(t=[]),g&&t.reduce===g)return n&&(e=C.bind(e,n)),i?t.reduce(e,r):t.reduce(e);if(E(t,function(t,o,a){i?r=e.call(n,r,t,o,a):(r=t,i=!0)}),!i)throw new TypeError(P);return r},C.reduceRight=C.foldr=function(t,e,r,n){var i=arguments.length>2;if(null==t&&(t=[]),m&&t.reduceRight===m)return n&&(e=C.bind(e,n)),i?t.reduceRight(e,r):t.reduceRight(e);var o=t.length;if(o!==+o){var a=C.keys(t);o=a.length}if(E(t,function(s,u,l){u=a?a[--o]:--o,i?r=e.call(n,r,t[u],u,l):(r=t[u],i=!0)}),!i)throw new TypeError(P);return r},C.find=C.detect=function(t,e,r){var n;return j(t,function(t,i,o){if(e.call(r,t,i,o))return n=t,!0}),n},C.filter=C.select=function(t,e,r){var n=[];return null==t?n:v&&t.filter===v?t.filter(e,r):(E(t,function(t,i,o){e.call(r,t,i,o)&&(n[n.length]=t)}),n)},C.reject=function(t,e,r){return C.filter(t,function(t,n,i){return!e.call(r,t,n,i)},r)},C.every=C.all=function(t,e,r){e||(e=C.identity);var n=!0;return null==t?n:_&&t.every===_?t.every(e,r):(E(t,function(t,o,a){if(!(n=n&&e.call(r,t,o,a)))return i}),!!n)};var j=C.some=C.any=function(t,e,r){e||(e=C.identity);var n=!1;return null==t?n:y&&t.some===y?t.some(e,r):(E(t,function(t,o,a){if(n||(n=e.call(r,t,o,a)))return i}),!!n)};C.contains=C.include=function(t,e){return null!=t&&(b&&t.indexOf===b?-1!=t.indexOf(e):j(t,function(t){return t===e}))},C.invoke=function(t,e){var r=l.call(arguments,2),n=C.isFunction(e);return C.map(t,function(t){return(n?e:t[e]).apply(t,r)})},C.pluck=function(t,e){return C.map(t,function(t){return t[e]})},C.where=function(t,e,r){return C.isEmpty(e)?r?null:[]:C[r?"find":"filter"](t,function(t){for(var r in e)if(e[r]!==t[r])return!1;return!0})},C.findWhere=function(t,e){return C.where(t,e,!0)},C.max=function(t,e,r){if(!e&&C.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&C.isEmpty(t))return-1/0;var n={computed:-1/0,value:-1/0};return E(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;a>=n.computed&&(n={value:t,computed:a})}),n.value},C.min=function(t,e,r){if(!e&&C.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&C.isEmpty(t))return 1/0;var n={computed:1/0,value:1/0};return E(t,function(t,i,o){var a=e?e.call(r,t,i,o):t;an||void 0===r)return 1;if(r>>1;r.call(n,t[s])=0})})},C.difference=function(t){var e=c.apply(o,l.call(arguments,1));return C.filter(t,function(t){return!C.contains(e,t)})},C.zip=function(){for(var t=l.call(arguments),e=C.max(C.pluck(t,"length")),r=new Array(e),n=0;n=0;r--)e=[t[r].apply(this,e)];return e[0]}},C.after=function(t,e){return t<=0?e():function(){if(--t<1)return e.apply(this,arguments)}},C.keys=x||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var r in t)C.has(t,r)&&(e[e.length]=r);return e},C.values=function(t){var e=[];for(var r in t)C.has(t,r)&&e.push(t[r]);return e},C.pairs=function(t){var e=[];for(var r in t)C.has(t,r)&&e.push([r,t[r]]);return e},C.invert=function(t){var e={};for(var r in t)C.has(t,r)&&(e[t[r]]=r);return e},C.functions=C.methods=function(t){var e=[];for(var r in t)C.isFunction(t[r])&&e.push(r);return e.sort()},C.extend=function(t){return E(l.call(arguments,1),function(e){if(e)for(var r in e)t[r]=e[r]}),t},C.pick=function(t){var e={},r=c.apply(o,l.call(arguments,1));return E(r,function(r){r in t&&(e[r]=t[r])}),e},C.omit=function(t){var e={},r=c.apply(o,l.call(arguments,1));for(var n in t)C.contains(r,n)||(e[n]=t[n]);return e},C.defaults=function(t){return E(l.call(arguments,1),function(e){if(e)for(var r in e)null==t[r]&&(t[r]=e[r])}),t},C.clone=function(t){return C.isObject(t)?C.isArray(t)?t.slice():C.extend({},t):t},C.tap=function(t,e){return e(t),t};var M=function(t,e,r,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof C&&(t=t._wrapped),e instanceof C&&(e=e._wrapped);var i=f.call(t);if(i!=f.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=r.length;o--;)if(r[o]==t)return n[o]==e;r.push(t),n.push(e);var a=0,s=!0;if("[object Array]"==i){if(s=(a=t.length)==e.length)for(;a--&&(s=M(t[a],e[a],r,n)););}else{var u=t.constructor,l=e.constructor;if(u!==l&&!(C.isFunction(u)&&u instanceof u&&C.isFunction(l)&&l instanceof l))return!1;for(var c in t)if(C.has(t,c)&&(a++,!(s=C.has(e,c)&&M(t[c],e[c],r,n))))break;if(s){for(c in e)if(C.has(e,c)&&!a--)break;s=!a}}return r.pop(),n.pop(),s};C.isEqual=function(t,e){return M(t,e,[],[])},C.isEmpty=function(t){if(null==t)return!0;if(C.isArray(t)||C.isString(t))return 0===t.length;for(var e in t)if(C.has(t,e))return!1;return!0},C.isElement=function(t){return!(!t||1!==t.nodeType)},C.isArray=k||function(t){return"[object Array]"==f.call(t)},C.isObject=function(t){return t===Object(t)},E(["Arguments","Function","String","Number","Date","RegExp"],function(t){C["is"+t]=function(e){return f.call(e)=="[object "+t+"]"}}),C.isArguments(arguments)||(C.isArguments=function(t){return!(!t||!C.has(t,"callee"))}),"function"!=typeof/./&&(C.isFunction=function(t){return"function"==typeof t}),C.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},C.isNaN=function(t){return C.isNumber(t)&&t!=+t},C.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"==f.call(t)},C.isNull=function(t){return null===t},C.isUndefined=function(t){return void 0===t},C.has=function(t,e){return h.call(t,e)},C.noConflict=function(){return t._=n,this},C.identity=function(t){return t},C.times=function(t,e,r){for(var n=Array(t),i=0;i":">",'"':""","'":"'","/":"/"}};I.unescape=C.invert(I.escape);var R={escape:new RegExp("["+C.keys(I.escape).join("")+"]","g"),unescape:new RegExp("("+C.keys(I.unescape).join("|")+")","g")};C.each(["escape","unescape"],function(t){C[t]=function(e){return null==e?"":(""+e).replace(R[t],function(e){return I[t][e]})}}),C.result=function(t,e){if(null==t)return null;var r=t[e];return C.isFunction(r)?r.call(t):r},C.mixin=function(t){E(C.functions(t),function(e){var r=C[e]=t[e];C.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),N.call(this,r.apply(C,t))}})};var L=0;C.uniqueId=function(t){var e=++L+"";return t?t+e:e},C.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var F=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\t":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;C.template=function(t,e,r){var n;r=C.defaults({},r,C.templateSettings);var i=new RegExp([(r.escape||F).source,(r.interpolate||F).source,(r.evaluate||F).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,r,n,i,s){return a+=t.slice(o,s).replace(D,function(t){return"\\"+O[t]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),n&&(a+="'+\n((__t=("+n+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(r.variable||"obj","_",a)}catch(t){throw t.source=a,t}if(e)return n(e,C);var s=function(t){return n.call(this,t,C)};return s.source="function("+(r.variable||"obj")+"){\n"+a+"}",s},C.chain=function(t){return C(t).chain()};var N=function(t){return this._chain?C(t).chain():t};C.mixin(C),E(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];C.prototype[t]=function(){var r=this._wrapped;return e.apply(r,arguments),"shift"!=t&&"splice"!=t||0!==r.length||delete r[0],N.call(this,r)}}),E(["concat","join","slice"],function(t){var e=o[t];C.prototype[t]=function(){return N.call(this,e.apply(this._wrapped,arguments))}}),C.extend(C.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],176:[function(t,e,r){"use strict";e.exports=function(t,e,r){return 0===t.length?t:e?(r||t.sort(e),function(t,e){for(var r=1,n=t.length,i=t[0],o=t[0],a=1;a=a?u+1:a}n.mkdir(e+"sequencer"+a,function(){var o=e+"sequencer"+a+"/";for(var s in r.images){var u=r.images[s].steps;if(i){var l=u.slice(-1)[0].output.src,c=u.slice(-1)[0].output.format,f=t("data-uri-to-buffer")(l);n.writeFile(o+s+"_"+(u.length-1)+"."+c,f,function(){})}else for(var h in u){l=u[h].output.src,c=u[h].output.format,f=t("data-uri-to-buffer")(l);n.writeFile(o+s+"_"+h+"."+c,f,function(){})}}})},n.readdir(c,function(t,e){var r=[];if(void 0===e||0==e.length)return f(r),[];for(var i=0;i0&&(thisStep=c[t].steps[e],thisStep.UI.onRemove(thisStep.options.step),c[t].steps.splice(e,1))}function g(){var e=[],r=this;for(var n in arguments)e.push(a(arguments[n]));var i=l.call(this,e,"l");f.push({method:"loadImages",json_q:a(i)});var o=this.copy(i.loadedimages),s={name:"ImageSequencer Wrapper",sequencer:this,addSteps:this.addSteps,removeSteps:this.removeSteps,insertSteps:this.insertSteps,run:this.run,UI:this.UI,setUI:this.setUI,images:o};!function e(n){if(n!=o.length){var a=o[n];t("./ui/LoadImage")(r,a,i.images[a],function(){e(++n)})}else i.callback.call(s)}(0)}function m(t){var e={};if("load-image"==t)return{};if(0==arguments.length){for(var r in this.modules)e[r]=s[r][1];for(var n in this.sequences)e[n]={name:n,steps:this.sequences[n]}}else e=s[t]?s[t][1]:{inputs:u[t].options};return e}function v(t){let e=m(t.options.name).inputs||{},r={};for(let n in e)t.options[n]&&t.options[n]!=e[n].default&&(r[n]=t.options[n],r[n]=encodeURIComponent(r[n]));var n=Object.keys(r).map(t=>t+":"+r[t]).join("|");return`${t.options.name}{${n}}`}function _(t){let e;return(e=t.includes(",")?t.split(","):[t]).map(y)}function y(t){var e;if(e=t.includes("{")?t.includes("(")&&t.indexOf("(")=e.images[u].steps.length?{options:{name:void 0}}:e.images[u].steps.slice(f+t)[0]},p.getIndex=function(){return f},n)n.hasOwnProperty(d)&&(p[d]=n[d]);p.UI.onDraw(p.options.step);var g=t("./RunToolkit")(e.copy(h));p.draw(g,function(){e.images[u].steps[f].options.step.output=e.images[u].steps[f].output.src,e.images[u].steps[f].UI.onComplete(e.images[u].steps[f].options.step),r(o,++s)},a)}}(s,o)}(r=function(t){for(var r in t)0==t[r]&&1==e.images[r].steps.length?delete t[r]:0==t[r]&&t[r]++;for(var r in t)for(var n=e.images[r].steps[t[r]-1];void 0===n||void 0===n.output;)n=e.images[r].steps[--t[r]-1];return t}(r))}},{"./RunToolkit":189,"./util/getStep.js":306}],189:[function(t,e,r){const n=t("get-pixels"),i=t("./modules/_nomodule/PixelManipulation"),o=t("lodash"),a=t("data-uri-to-buffer"),s=t("save-pixels");e.exports=function(t){return t.getPixels=n,t.pixelManipulation=i,t.lodash=o,t.dataUriToBuffer=a,t.savePixels=s,t}},{"./modules/_nomodule/PixelManipulation":298,"data-uri-to-buffer":19,"get-pixels":30,lodash:76,"save-pixels":168}],190:[function(t,e,r){e.exports={sample:[{name:"invert",options:{}},{name:"channel",options:{channel:"red"}},{name:"blur",options:{blur:"5"}}]}},{}],191:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.size=e.size||n.size,e.qrCodeString=e.qrCodeString||"https://github.com/publiclab/image-sequencer",getPixels=t("get-pixels"),{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return getPixels(r.src,function(i,a){return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r,n){i?console.log(i):t("./QR")(e,r,a,n)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./QR":192,"./info.json":194,"get-pixels":30}],192:[function(t,e,r){e.exports=function(e,r,n,i){t("qrcode").toDataURL(e.qrCodeString,function(o,a){t("get-pixels")(a,function(o,a){o&&console.log("Bad image path",image);var s=new(t("imagejs").Bitmap)({width:a.shape[0],height:a.shape[1]});s._data.data=a.data;var u=s.resize({width:e.size,height:e.size,algorithm:"bicubicInterpolation"});a.data=u._data.data,a.shape=[e.size,e.size,4],a.stride[1]=4*e.size;for(var l=n.shape[0],c=n.shape[1],f=l-e.size,h=c-e.size,p=0;p=f&&d>=h?(r.set(p,d,0,a.get(p-f,d-h,0)),r.set(p,d,1,a.get(p-f,d-h,1)),r.set(p,d,2,a.get(p-f,d-h,2)),r.set(p,d,3,a.get(p-f,d-h,3))):(r.set(p,d,0,n.get(p,d,0)),r.set(p,d,1,n.get(p,d,1)),r.set(p,d,2,n.get(p,d,2)),r.set(p,d,3,n.get(p,d,3)));i()})})}},{"get-pixels":30,imagejs:63,qrcode:119}],193:[function(t,e,r){e.exports=[t("./Module"),t("./info.json")]},{"./Module":191,"./info.json":194}],194:[function(t,e,r){e.exports={name:"Add QR",description:"Adds QR corresponding to the given string",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{size:{type:"integer",desc:"size of QR code in pixels",default:200},qrCodeString:{type:"string",desc:"input string to generate QR code",default:"https://github.com/publiclab/image-sequencer"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],195:[function(t,e,r){e.exports=function(e,r){return e.step.metadata=e.step.metadata||{},{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(t){for(var r=0,n=[0,0,0,0];rAverages (r, g, b, a): "+n.join(", ")+"

"),t},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298}],196:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":195,"./info.json":197,dup:193}],197:[function(t,e,r){e.exports={name:"Average",description:"Average all pixel color",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],198:[function(require,module,exports){module.exports=function Dynamic(options,UI,util){var defaults=require("./../../util/getDefaults.js")(require("./info.json")),output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;"string"==typeof options.func&&eval("options.func = "+options.func);var getPixels=require("get-pixels");"string"==typeof options.offset&&(options.offset=parseInt(options.offset));var priorStep=this.getStep(options.offset);void 0===priorStep.output&&(this.output=input,UI.notify("Offset Unavailable","offset-notification"),callback()),getPixels(priorStep.output.src,function(t,e){return options.firstImagePixels=e,require("../_nomodule/PixelManipulation.js")(input,{output:function(t,e,r){step.output={src:e,format:r}},changePixel:function(t,e,r,n,i,o){let a=options.firstImagePixels;return options.func(t,e,r,n,a.get(i,o,0),a.get(i,o,1),a.get(i,o,2),a.get(i,o,3))},format:input.format,image:options.image,inBrowser:options.inBrowser,callback:callback})})}return options.func=options.func||defaults.blend,options.offset=options.offset||defaults.offset,{options:options,draw:draw,output:output,UI:UI}}},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":200,"get-pixels":30}],199:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":198,"./info.json":200,dup:193}],200:[function(t,e,r){e.exports={name:"Blend",description:"Blend two chosen image steps with the given function. Defaults to using the red channel from image 1 and the green and blue and alpha channels of image 2. Easier to use interfaces coming soon!",inputs:{offset:{type:"integer",desc:"Choose which image to blend the current image with. Two steps back is -2, three steps back is -3 etc.",default:-2},blend:{type:"input",desc:"Function to use to blend the two images.",default:"function(r1, g1, b1, a1, r2, g2, b2, a2) { return [ r1, g2, b2, a2 ] }"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],201:[function(t,e,r){e.exports=function(e,r){let n=[[2/159,4/159,5/159,4/159,2/159],[4/159,9/159,12/159,9/159,4/159],[5/159,12/159,15/159,12/159,5/159],[4/159,9/159,12/159,9/159,4/159],[2/159,4/159,5/159,4/159,2/159]],i=t("lodash").cloneDeep(e);n=function(t){let e=[];for(let r=t.length-1;r>=0;r--){let n=[];for(let e=t[r].length-1;e>=0;e--)n.push(t[r][e]);e.push(n)}return e}(n);for(let t=0;tg;r=0<=g?++c:--c)n[r]=(e-i)/(o-i)*(u[r]-s[r])+s[r];return n}}e.exports=function(t,e){return e.colormap=e.colormap||i.default,"object"==typeof e.colormap?colormapFunction=n(e.colormap):i.hasOwnProperty(e.colormap)?colormapFunction=i[e.colormap]:colormapFunction=i.default,colormapFunction(t/255)};var i={greyscale:n([[0,[0,0,0],[255,255,255]],[1,[255,255,255],[255,255,255]]]),bluwhtgrngis:n([[0,[6,23,86],[6,25,84]],[.0625,[6,25,84],[6,25,84]],[.125,[6,25,84],[6,25,84]],[.1875,[6,25,84],[6,25,84]],[.25,[6,25,84],[6,25,84]],[.3125,[6,25,84],[9,24,84]],[.3438,[9,24,84],[119,120,162]],[.375,[119,129,162],[249,250,251]],[.406,[249,250,251],[255,255,255]],[.4375,[255,255,255],[255,255,255]],[.5,[255,255,255],[214,205,191]],[.52,[214,205,191],[178,175,96]],[.5625,[178,175,96],[151,176,53]],[.593,[151,176,53],[146,188,12]],[.625,[146,188,12],[96,161,1]],[.6875,[96,161,1],[30,127,3]],[.75,[30,127,3],[0,99,1]],[.8125,[0,99,1],[0,74,1]],[.875,[0,74,1],[0,52,0]],[.9375,[0,52,0],[0,34,0]],[.968,[0,34,0],[68,70,67]]]),brntogrn:n([[0,[110,12,3],[118,6,1]],[.0625,[118,6,1],[141,19,6]],[.125,[141,19,6],[165,35,13]],[.1875,[165,35,13],[177,59,25]],[.2188,[177,59,25],[192,91,36]],[.25,[192,91,36],[214,145,76]],[.3125,[214,145,76],[230,183,134]],[.375,[230,183,134],[243,224,194]],[.4375,[243,224,194],[250,252,229]],[.5,[250,252,229],[217,235,185]],[.5625,[217,235,185],[184,218,143]],[.625,[184,218,143],[141,202,89]],[.6875,[141,202,89],[80,176,61]],[.75,[80,176,61],[0,147,32]],[.8125,[0,147,32],[1,122,22]],[.875,[1,122,22],[0,114,19]],[.9,[0,114,19],[0,105,18]],[.9375,[0,105,18],[7,70,14]]]),blutoredjet:n([[0,[0,0,140],[1,1,186]],[.0625,[1,1,186],[0,1,248]],[.125,[0,1,248],[0,70,254]],[.1875,[0,70,254],[0,130,255]],[.25,[0,130,255],[2,160,255]],[.2813,[2,160,255],[0,187,255]],[.3125,[0,187,255],[6,250,255]],[.375,[8,252,251],[27,254,228]],[.406,[27,254,228],[70,255,187]],[.4375,[70,255,187],[104,254,151]],[.47,[104,254,151],[132,255,19]],[.5,[132,255,19],[195,255,60]],[.5625,[195,255,60],[231,254,25]],[.5976,[231,254,25],[253,246,1]],[.625,[253,246,1],[252,210,1]],[.657,[252,210,1],[255,183,0]],[.6875,[255,183,0],[255,125,2]],[.75,[255,125,2],[255,65,1]],[.8125,[255,65,1],[247,1,1]],[.875,[247,1,1],[200,1,3]],[.9375,[200,1,3],[122,3,2]]]),colors16:n([[0,[0,0,0],[0,0,0]],[.0625,[3,1,172],[3,1,172]],[.125,[3,1,222],[3,1,222]],[.1875,[0,111,255],[0,111,255]],[.25,[3,172,255],[3,172,255]],[.3125,[1,226,255],[1,226,255]],[.375,[2,255,0],[2,255,0]],[.4375,[198,254,0],[190,254,0]],[.5,[252,255,0],[252,255,0]],[.5625,[255,223,3],[255,223,3]],[.625,[255,143,3],[255,143,3]],[.6875,[255,95,3],[255,95,3]],[.75,[242,0,1],[242,0,1]],[.8125,[245,0,170],[245,0,170]],[.875,[223,180,225],[223,180,225]],[.9375,[255,255,255],[255,255,255]]]),default:n([[0,[45,1,121],[25,1,137]],[.125,[25,1,137],[0,6,156]],[.1875,[0,6,156],[7,41,172]],[.25,[7,41,172],[22,84,187]],[.3125,[22,84,187],[25,125,194]],[.375,[25,125,194],[26,177,197]],[.4375,[26,177,197],[23,199,193]],[.47,[23,199,193],[25,200,170]],[.5,[25,200,170],[21,209,27]],[.5625,[21,209,27],[108,215,18]],[.625,[108,215,18],[166,218,19]],[.6875,[166,218,19],[206,221,20]],[.75,[206,221,20],[222,213,19]],[.7813,[222,213,19],[222,191,19]],[.8125,[222,191,19],[227,133,17]],[.875,[227,133,17],[231,83,16]],[.9375,[231,83,16],[220,61,48]]]),fastie:n([[0,[255,255,255],[0,0,0]],[.167,[0,0,0],[255,255,255]],[.33,[255,255,255],[0,0,0]],[.5,[0,0,0],[140,140,255]],[.55,[140,140,255],[0,255,0]],[.63,[0,255,0],[255,255,0]],[.75,[255,255,0],[255,0,0]],[.95,[255,0,0],[255,0,255]]]),stretched:n([[0,[0,0,255],[0,0,255]],[.1,[0,0,255],[38,195,195]],[.5,[0,150,0],[255,255,0]],[.7,[255,255,0],[255,50,50]],[.9,[255,50,50],[255,50,50]]])}},{}],215:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(r,n,i,o){var a=(r+n+i)/3,s=t("./Colormap")(a,e);return[s[0],s[1],s[2],255]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./Colormap":214}],216:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":215,"./info.json":217,dup:193}],217:[function(t,e,r){e.exports={name:"Colormap",description:"Maps brightness values (average of red, green & blue) to a given color lookup table, made up of a set of one more color gradients.\n\nFor example, 'cooler' colors like blue could represent low values, while 'hot' colors like red could represent high values.",inputs:{colormap:{type:"select",desc:"Name of the Colormap",default:"default",values:["default","greyscale","bluwhtgrngis","stretched","fastie","brntogrn","blutoredjet","colors16"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],218:[function(t,e,r){var n=t("lodash");e.exports=function(t,e){let r=n.cloneDeep(t);(e=Number(e))<-100&&(e=-100),e>100&&(e=100),e=(100+e)/100,e*=e;for(let n=0;n255&&(i=255);var o=r.get(n,s,1)/255;o-=.5,o*=e,o+=.5,(o*=255)<0&&(o=0),o>255&&(o=255);var a=r.get(n,s,2)/255;a-=.5,a*=e,a+=.5,(a*=255)<0&&(a=0),a>255&&(a=255),t.set(n,s,0,i),t.set(n,s,1,o),t.set(n,s,2,a)}return t}},{lodash:76}],219:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.contrast=e.contrast||n.contrast,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(r){return r=t("./Contrast")(r,e.contrast)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Contrast":218,"./info.json":221}],220:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":219,"./info.json":221,dup:193}],221:[function(t,e,r){e.exports={name:"Contrast",description:"Change the contrast of the image by given value",inputs:{contrast:{type:"range",desc:"contrast for the new image, typically -100 to 100",default:"70",min:"-100",max:"100",step:"1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],222:[function(t,e,r){var n=t("lodash");e.exports=function(t,e,r){let o=function(t,e){for(e=e.split(" "),i=0;i<9;i++)e[i]=Number(e[i])*t;let r=0,n=[];for(i=0;i<3;i++){let t=[];for(j=0;j<3;j++)t.push(e[r]),r+=1;n.push(t)}return n}(e,r),a=n.cloneDeep(t);o=function(t){let e=[];for(let r=t.length-1;r>=0;r--){let n=[];for(let e=t[r].length-1;e>=0;e--)n.push(t[r][e]);e.push(n)}return e}(o);for(let e=0;eRead more",inputs:{constantFactor:{type:"Float",desc:"a constant factor, multiplies all the kernel values by that factor",default:.1111,placeholder:.1111},kernelValues:{type:"String",desc:"nine space separated numbers representing the kernel values in left to right and top to bottom format.",default:"1 1 1 1 1 1 1 1 1",placeholder:"1 1 1 1 1 1 1 1 1"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],226:[function(t,e,r){(function(r){e.exports=function(e,n,i){var o=t("./../../util/getDefaults.js")(t("./info.json")),a=t("get-pixels"),s=t("save-pixels");n.x=parseInt(n.x)||o.x,n.y=parseInt(n.y)||o.y,a(e.src,function(t,a){n.w=parseInt(n.w)||Math.floor(a.shape[0]),n.h=parseInt(n.h)||Math.floor(a.shape[1]),n.backgroundColor=n.backgroundColor||o.backgroundColor;var u=n.x,l=n.y,c=n.w,f=n.h,h=a.shape[0],p=a.shape[1],d=[];backgroundColor=n.backgroundColor.split(" ");for(var g=0;gRead more",inputs:{dither:{type:"select",desc:"Name of the Dithering Algorithm",default:"none",values:["none","floydsteinberg","bayer","Atkinson"]}}}},{}],238:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));r.startingX=r.startingX||n.startingX,r.startingY=r.startingY||n.startingY;var i=Number(r.startingX),o=Number(r.startingY),a=e.shape[0],s=e.shape[1],u=Number(r.thickness)||n.thickness,l=r.endX=Number(r.endX)-u||a-1,c=r.endY=Number(r.endY)-u||s-1,f=r.color||n.color;f=f.split(" ");var h=function(t,r,n,i){for(var o=t;o<=n+u;o++)for(var a=r;a<=i+u;a++)e.set(o,a,0,f[0]),e.set(o,a,1,f[1]),e.set(o,a,2,f[2]),e.set(o,a,3,f[3])};return h(i,o,i,c),h(l,o,l,c),h(i,o,l,o),h(i,c,l,c),e}},{"./../../util/getDefaults.js":305,"./info.json":241}],239:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t,e,r,n]},extraManipulation:function(r){return r=t("./DrawRectangle")(r,e)},format:r.format,image:e.image,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./DrawRectangle":238}],240:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":239,"./info.json":241,dup:193}],241:[function(t,e,r){e.exports={name:"Draw Rectangle",description:"It draws a rectangle on the image",inputs:{startingX:{type:"Number",desc:"starting x position of the rectangle",default:0},startingY:{type:"Number",desc:"starting y position of the rectangle",default:0},endX:{type:"integer",desc:"last x position of the rectangle",default:"width"},endY:{type:"integer",desc:"last y position of the rectangle",default:"height"},thickness:{type:"integer",desc:"thickness of border",default:1},color:{type:"String",desc:"RGBA values separated by a space",default:"0 0 0 255"}}}},{}],242:[function(require,module,exports){module.exports=function Dynamic(options,UI){var output;function draw(input,callback,progressObj){progressObj.stop(!0),progressObj.overrideFlag=!0;var step=this;function generator(expression){var func="f = function (r, g, b, a) { var R = r, G = g, B = b, A = a;",f;return func+="return ",func=func+expression+"}",eval(func),f}options.monochrome=options.monochrome||"(R+G+B)/3";var channels=["red","green","blue","alpha"];function changePixel(t,e,r,n){return[options.red_function(t,e,r,n),options.green_function(t,e,r,n),options.blue_function(t,e,r,n),options.alpha_function(t,e,r,n)]}function getNeighbourPixel(t,e,r,n,i){return[t.get(e+n,r+i,0),t.get(e+n,r+i,1),t.get(e+n,r+i,2),t.get(e+n,r+i,3)]}function map(t,e,r,n,i,o){var a=(t-e)/(r-e)*(i-n)+n;if(!o)return a;function s(t,e,r){return Math.max(Math.min(t,r),e)}return nInfragrammar.",inputs:{red:{type:"input",desc:"Expression to return for red channel with R, G, B, and A inputs",default:"r"},green:{type:"input",desc:"Expression to return for green channel with R, G, B, and A inputs",default:"g"},blue:{type:"input",desc:"Expression to return for blue channel with R, G, B, and A inputs",default:"b"},"monochrome (fallback)":{type:"input",desc:"Expression to return with R, G, B, and A inputs; fallback for other channels if none provided",default:"r + g + b"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],245:[function(t,e,r){t("lodash");const n=[[-1,0,1],[-2,0,2],[-1,0,1]],i=[[-1,-2,-1],[0,0,0],[1,2,1]];function o(t,e,r,o,a){let s=0;for(let e=0;e<3;e++)for(let r=0;r<3;r++){let i=o+e-1,u=a+r-1;s+=t.get(i,u,0)*n[e][r]}let u=0;for(let e=0;e<3;e++)for(let r=0;r<3;r++){let n=o+e-1,s=a+r-1;u+=t.get(n,s,0)*i[e][r]}return{pixel:[e,e,e,Math.sqrt(Math.pow(s,2)+Math.pow(u,2))],angle:Math.atan2(u,s)}}e.exports=function(t,e,r,n){let i=[],u=[];for(var l=0;lt.map(a));for(let n=1;n=-22.5&&o<=22.5||o<-157.5&&o>=-180?e[n][i]>=e[n][i+1]&&e[n][i]>=e[n][i-1]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0):o>=22.5&&o<=67.5||o<-112.5&&o>=-157.5?e[n][i]>=e[n+1][i+1]&&e[n][i]>=e[n-1][i-1]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0):o>=67.5&&o<=112.5||o<-67.5&&o>=-112.5?e[n][n]>=e[n+1][i]&&e[n][i]>=e[n][i]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0):(o>=112.5&&o<=157.5||o<-22.5&&o>=-67.5)&&(e[n][i]>=e[n+1][i-1]&&e[n][i]>=e[n-1][i+1]?t.set(n,i,3,e[n][i]):t.set(n,i,3,0))}}(t,u,i),function(t,e,r,n,i,o){const a=s(n)*e,u=a*r;for(let e=0;eu?n[e][r]>a?i.push(s):o.push(s):t.set(e,r,3,0)}i.forEach(e=>t.set(e[0],e[1],3,255))}(t,e,r,u,[],[]),t};var a=t=>180*t/Math.PI,s=t=>Math.max(...t.map(t=>t.map(t=>t||0)).map(t=>Math.max(...t)))},{lodash:76}],246:[function(t,e,r){e.exports=function(e,r){var n=t("./../../util/getDefaults.js")(t("./info.json"));return e.blur=e.blur||n.blur,e.highThresholdRatio=e.highThresholdRatio||n.highThresholdRatio,e.lowThresholdRatio=e.lowThresholdRatio||n.lowThresholdRatio,{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[(t+e+r)/3,(t+e+r)/3,(t+e+r)/3,n]},extraManipulation:function(r){return r=t("ndarray-gaussian-filter")(r,e.blur),r=t("./EdgeUtils")(r,e.highThresholdRatio,e.lowThresholdRatio,e.inBrowser)},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./EdgeUtils":245,"./info.json":248,"ndarray-gaussian-filter":81}],247:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":246,"./info.json":248,dup:193}],248:[function(t,e,r){e.exports={name:"Detect Edges",description:"This module detects edges using the Canny method, which first Gaussian blurs the image to reduce noise (amount of blur configurable in settings as `options.blur`), then applies a number of steps to highlight edges, resulting in a greyscale image where the brighter the pixel, the stronger the detected edge. Read more. ",inputs:{blur:{type:"range",desc:"Amount of gaussian blur(Less blur gives more detail, typically 0-5)",default:"2",min:"0",max:"5",step:"0.25"},highThresholdRatio:{type:"float",desc:"The high threshold ratio for the image",default:.2},lowThresholdRatio:{type:"float",desc:"The low threshold value for the image",default:.15}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],249:[function(t,e,r){e.exports=function(e,r){return t("fisheyegl"),{options:e,draw:function(t,r){var n=this;if(e.inBrowser){if(document.querySelector("#image-sequencer-canvas"))var i=document.querySelector("#image-sequencer-canvas");else(i=document.createElement("canvas")).style.display="none",i.setAttribute("id","image-sequencer-canvas"),document.body.append(i);distorter=FisheyeGl({selector:"#image-sequencer-canvas"}),e.a=parseFloat(e.a)||distorter.lens.a,e.b=parseFloat(e.b)||distorter.lens.b,e.Fx=parseFloat(e.Fx)||distorter.lens.Fx,e.Fy=parseFloat(e.Fy)||distorter.lens.Fy,e.scale=parseFloat(e.scale)||distorter.lens.scale,e.x=parseFloat(e.x)||distorter.fov.x,e.y=parseFloat(e.y)||distorter.fov.y,distorter.lens.a=e.a,distorter.lens.b=e.b,distorter.lens.Fx=e.Fx,distorter.lens.Fy=e.Fy,distorter.lens.scale=e.scale,distorter.fov.x=e.x,distorter.fov.y=e.y,distorter.setImage(t.src,function(){n.output={src:i.toDataURL(),format:t.format},r()})}else this.output=t,r()},output:void 0,UI:r}}},{fisheyegl:22}],250:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":249,"./info.json":251,dup:193}],251:[function(t,e,r){e.exports={name:"Fisheye GL",description:"Correct fisheye, or barrel distortion, in images (with WebGL -- adapted from fisheye-correction-webgl by @bluemir).",requires:["webgl"],inputs:{a:{type:"float",desc:"a parameter",default:1,min:1,max:4},b:{type:"float",desc:"b parameter",default:1,min:1,max:4},Fx:{type:"float",desc:"Fx parameter",default:0,min:0,max:4},Fy:{type:"float",desc:"Fy parameter",default:0,min:0,max:4},scale:{type:"float",desc:"Image Scaling",default:1.5,min:0,max:20},x:{type:"float",desc:"FOV x parameter",default:1.5,min:0,max:20},y:{type:"float",desc:"FOV y parameter",default:1.5,min:0,max:20},fragmentSrc:{type:"PATH",desc:"Path to a WebGL fragment shader file",default:"(inbuilt)"},vertexSrc:{type:"PATH",desc:"Path to a WebGL vertex shader file",default:"(inbuilt)"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],252:[function(t,e,r){e.exports=function(e,r){return{options:e,draw:function(r,n,i){i.stop(!0),i.overrideFlag=!0;var o=this,a=t("./../../util/getDefaults.js")(t("./info.json")),s=(e.adjustment||a.adjustment)/a.adjustment;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,e,r,n){return[t=255*Math.pow(t/255,s),e=255*Math.pow(e/255,s),r=255*Math.pow(r/255,s),n]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:n})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./info.json":254}],253:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":252,"./info.json":254,dup:193}],254:[function(t,e,r){e.exports={name:"Gamma Correction",description:"Apply gamma correction on the image Read more",inputs:{adjustment:{type:"float",desc:"gamma correction (inverse of actual gamma factor) for the new image",default:.2}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],255:[function(t,e,r){(function(r){e.exports=function(e,n){return{options:e,draw:function(e,n,i){var o=t("get-pixels"),a=t("save-pixels"),s=this;o(e.src,function(t,i){if(t)console.log("Bad Image path");else{for(var o=i.shape[0],u=0;u

Select or drag in an image to overlay.

';$(t.ui).find(".details").prepend(i),sequencer.setInputStep({dropZoneSelector:"#"+n,fileInputSelector:"#"+n+" .file-input",onLoad:function(e){var r=e.target;t.options.imageUrl=r.result,t.options.url=r.result,sequencer.run(),setUrlHashParameter("steps",sequencer.toString())}}),$(t.ui).find(".btn-save").on("click",function(){var e=$(t.ui).find(".det input").val();t.options.imageUrl=e,sequencer.run()})}}}},{}],263:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":261,"./info.json":264,dup:193}],264:[function(t,e,r){e.exports={name:"Import Image",description:"Import a new image and replace the original with it. Future versions may enable a blend mode. Specify an image by URL or by file selector.",url:"https://github.com/publiclab/image-sequencer/tree/master/MODULES.md",inputs:{url:{type:"string",desc:"URL of image to import",default:"./images/monarch.png"}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],265:[function(t,e,r){e.exports=function(e,r){if(e.step.inBrowser)var n=t("./Ui.js")(e.step,r);var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.filter=e.filter||i.filter,{options:e,draw:function(r,i,o){o.stop(!0),o.overrideFlag=!0;var a=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){a.output={src:e,format:r}},changePixel:function(t,r,n,i){if("red"==e.filter)var o=(n-t)/(1*n+t);"blue"==e.filter&&(o=(t-n)/(1*n+t));var a=255*(o+1)/2;return[a,a,a,i]},format:r.format,image:e.image,inBrowser:e.inBrowser,callback:function(){e.step.inBrowser&&n.setup(),i()}})},output:void 0,UI:r}}},{"../_nomodule/PixelManipulation.js":298,"./../../util/getDefaults.js":305,"./Ui.js":266,"./info.json":268}],266:[function(t,e,r){e.exports=function(t,e){return{setup:function(){var e=$(t.imgElement);e.mousemove(function(t){var r=document.createElement("canvas");r.width=e.width(),r.height=e.height(),r.getContext("2d").drawImage(this,0,0);var n=$(this).offset(),i=t.pageX-n.left,o=t.pageY-n.top,a=r.getContext("2d").getImageData(i,o,1,1).data[0];a=(a=a/127.5-1).toFixed(2),e[0].title="NDVI: "+a})}}}},{}],267:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":265,"./info.json":268,dup:193}],268:[function(t,e,r){e.exports={name:"NDVI",description:"Normalized Difference Vegetation Index, or NDVI, is an image analysis technique used with aerial photography. It's a way to visualize the amounts of infrared and other wavelengths of light reflected from vegetation by comparing ratios of blue and red light absorbed versus green and IR light reflected. NDVI is used to evaluate the health of vegetation in satellite imagery, where it correlates with how much photosynthesis is happening. This is helpful in assessing vegetative health or stress. Read more.

This is designed for use with red-filtered single camera DIY Infragram cameras; change to 'blue' for blue filters",inputs:{filter:{type:"select",desc:"Filter color",default:"red",values:["red","blue"]}},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],269:[function(t,e,r){e.exports=t("../../util/createMetaModule.js")(function(t){return[{name:"ndvi",options:{}},{name:"colormap",options:{colormap:t.colormap}}]},{infoJson:t("./info.json")})[0]},{"../../util/createMetaModule.js":304,"./info.json":271}],270:[function(t,e,r){arguments[4][193][0].apply(r,arguments)},{"./Module":269,"./info.json":271,dup:193}],271:[function(t,e,r){e.exports={name:"NDVI-Colormap",description:"Sequentially Applies NDVI and Colormap steps",inputs:{},"docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md"}},{}],272:[function(t,e,r){e.exports=function(e,r,n){var i=t("./../../util/getDefaults.js")(t("./info.json"));return e.x=e.x||i.x,e.y=e.y||i.y,{options:e,draw:function(r,n,i){e.offset=e.offset||-2,i.stop(!0),i.overrideFlag=!0;var o=this;t("../../util/ParseInputCoordinates")(e,{src:r.src,x:{valInp:e.x,type:"horizontal"},y:{valInp:e.y,type:"vertical"}},function(t,e){t.x=parseInt(e.x.valInp),t.y=parseInt(e.y.valInp)});var a=this.getStep(e.offset).image,s=this.getOutput(e.offset);t("get-pixels")(r.src,function(r,i){return e.secondImagePixels=i,t("../_nomodule/PixelManipulation.js")(s,{output:function(t,e,r){o.output={src:e,format:r}},changePixel:function(t,r,n,i,o,a){var s=e.secondImagePixels;return o>=e.x&&o=e.y&&a=p*w&&e.get(t,r,0)<=p*b&&e.get(t,r,1)>=d*w&&e.get(t,r,1)<=d*b&&e.get(t,r,2)>=g*w&&e.get(t,r,2)<=g*b&&e.get(t,r,3)>=m*w&&e.get(t,r,3)<=m*b}for(l=l.split(" ");_.length;)if(k(i=v.pop(),n=_.pop())){o=a=n;do{o-=1}while(k(i,o)&&o>=0);do{a+=1}while(k(i,a)&&aa&&(a=f,s=u)}return s}(n));for(var c=0;c<=l;c+=4)e.data[c]=e.data[c]"40000"?"40000":e.temperature,i.stop(!0),i.overrideFlag=!0;var o=this;return t("../_nomodule/PixelManipulation.js")(r,{output:function(t,e,r){o.output={src:e,format:r}},extraManipulation:function(t){let r,n,i,o=parseInt(e.temperature);(o/=100)<=66?(r=255,n=Math.min(Math.max(99.4708025861*Math.log(o)-161.1195681661,0),255)):(r=Math.min(Math.max(329.698727446*Math.pow(o-60,-.1332047592),0),255),n=Math.min(Math.max(288.1221695283*Math.pow(o-60,-.0755148492),0),255)),o>=66?i=255:o<=19?i=0:(i=o-10,i=Math.min(Math.max(138.5177312231*Math.log(i)-305.0447927307,0),255));for(let e=0;e
To work with a new or different image, drag one into the drop zone.",ID:e.options.sequencerCounter++,imageName:t,inBrowser:e.options.inBrowser,ui:e.options.ui},a={src:r,steps:[{options:{id:n.ID,name:"load-image",description:"This initial step loads and displays the original image without any modifications.",title:"Load Image",step:n},UI:e.events,draw:function(){return UI.onDraw(options.step),1==arguments.length?(this.output=o(arguments[0]),options.step.output=this.output,UI.onComplete(options.step),!0):2==arguments.length&&(this.output=o(arguments[0]),options.step.output=this.output,arguments[1](),UI.onComplete(options.step),!0)}}]};o(r,function(r){var n=function(t){return{src:t,format:t.split(":")[1].split(";")[0].split("/")[1]}}(r);e.images[t]=a;var o=e.images[t].steps[0];return o.output=n,o.options.step.output=o.output.src,o.UI.onSetup(o.options.step),o.UI.onDraw(o.options.step),o.UI.onComplete(o.options.step),i(),!0})}(r,n)}},{urify:177}],300:[function(t,e,r){e.exports=function(){return function(t){var e=$(t.dropZoneSelector),r=$(t.fileInputSelector),n=$(t.takePhotoSelector),i=t.onLoad;function o(t){if(t.preventDefault(),t.stopPropagation(),t.target&&t.target.files)var e=t.target.files[0];else e=t.dataTransfer.files[0];if(e){var r=new FileReader;r.onload=i,r.readAsDataURL(e)}}t.onTakePhoto,new FileReader,r.on("change",o),n.on("click",function(){document.getElementById("video").style.display="inline",document.getElementById("capture").style.display="inline",document.getElementById("close").style.display="inline";var e=document.getElementById("video");canvas=document.getElementById("canvas"),context=canvas.getContext("2d"),vendorUrl=window.URL||window.webkitURL,navigator.mediaDevices.getUserMedia({audio:!1,video:!0}).then(function(t){window.stream=t,e.srcObject=t,e.onloadedmetadata=function(t){e.play()},document.getElementById("close").addEventListener("click",function(){!function(t){t.getVideoTracks().forEach(function(t){t.stop()}),document.getElementById("video").style.display="none",document.getElementById("capture").style.display="none",document.getElementById("close").style.display="none"}(t)})}).catch(function(t){console.log("navigator.getUserMedia error: ",t)}),document.getElementById("capture").addEventListener("click",function(r){context.drawImage(e,0,0,400,300),t.onTakePhoto(canvas.toDataURL())})}),e[0].addEventListener("drop",o,!1),e.on("dragover",function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},!1),e.on("dragenter",function(t){e.addClass("hover")}),e.on("dragleave",function(t){e.removeClass("hover")})}}},{}],301:[function(t,e,r){e.exports=function(t={}){return t.onSetup=t.onSetup||function(t){0==t.ui||(t.inBrowser?console.log('Added Step "'+t.name+'" to "'+t.imageName+'".'):console.log("%s",'Added Step "'+t.name+'" to "'+t.imageName+'".'))},t.onDraw=t.onDraw||function(t){0==t.ui||(t.inBrowser?console.log('Drawing Step "'+t.name+'" on "'+t.imageName+'".'):console.log("%s",'Drawing Step "'+t.name+'" on "'+t.imageName+'".'))},t.onComplete=t.onComplete||function(t){0==t.ui||(t.inBrowser?console.log('Drawn Step "'+t.name+'" on "'+t.imageName+'".'):console.log("%s",'Drawn Step "'+t.name+'" on "'+t.imageName+'".'))},t.onRemove=t.onRemove||function(t){0==t.ui||(t.inBrowser?console.log('Removing Step "'+t.name+'" of "'+t.imageName+'".'):console.log("%s",'Removing Step "'+t.name+'" of "'+t.imageName+'".'))},t.notify=t.notify||function(t){console.log(t)},t}},{}],302:[function(t,e,r){e.exports=function(t){var e=void 0;return"jpeg"===(e=(e=function(t){return"data:image"===t.substr(0,10)}(t)?t.split(";")[0].split("/").pop():t.split(".").pop()).toLowerCase())&&(e="jpg"),["jpg","jpeg","png","gif","canvas"].includes(e)?e:"jpg"}},{}],303:[function(t,e,r){e.exports=function(e,r,n){t("get-pixels")(r.src,function(t,i){var o=i.shape[0],a=i.shape[1];if(r.x.valInp){Object.keys(r).forEach(function(t){var e=r[t];e.valInp&&"%"===e.valInp.slice(-1)&&(e.valInp=parseInt(e.valInp,10),"horizontal"===e.type?e.valInp=e.valInp*o/100:e.valInp=e.valInp*a/100)});n(e,r)}})}},{"get-pixels":30}],304:[function(t,e,r){e.exports=function(e,r){return(r=r||{}).infoJson=r.infoJson||{},[function(n,i){var o=t("./getDefaults.js")(r.infoJson);for(key in r.infoJson.inputs)r.infoJson.inputs.hasOwnProperty(key)&&(n[key]=n[key]||o[key]);var a=e(n),s=ImageSequencer({inBrowser:!1,ui:!1});return{options:n,draw:function(t,e){var r=this;s.loadImage(t.src,function(){s.importJSON(a),s.run(function(n){r.output={src:n,format:t.format},e()})})},output:void 0,UI:i}},r.infoJson]}},{"./getDefaults.js":305}],305:[function(t,e,r){e.exports=function(t){var e={};for(var r in t.inputs)t.inputs.hasOwnProperty(r)&&(e[r]=t.inputs[r].default);return e}},{}],306:[function(t,e,r){e.exports={getPreviousStep:function(){return this.getStep(-1)},getNextStep:function(){return this.getStep(1)},getInput:function(t){return t+this.getIndex()===0&&t++,this.getStep(t-1).output},getOutput:function(t){return this.getStep(t).output},getOptions:function(){return this.getStep(0).options},setOptions:function(t){let e=this.getStep(0).options;for(let r in t)e[r]&&(e[r]=t[r])},getFormat:function(){return this.getStep(-1).output.format},getHeight:function(t){let e=new Image;e.onload=function(){t(e.height)},e.src=this.getInput(0).src},getWidth:function(t){let e=new Image;e.onload=function(){t(e.width)},e.src=this.getInput(0).src}}},{}]},{},[184]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9a35db9b..825e6d3a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "integrity": "sha1-qarWPV5EJf+KbZpqlKsoehtZXb4=", "dev": true, "requires": { - "once": "1.4.0", - "tap-parser": "0.2.1", - "through": "2.3.8" + "once": "^1.3.3", + "tap-parser": "~0.2.0", + "through": "~2.3.4" } }, "@types/node": { @@ -26,8 +26,8 @@ "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, "abab": { @@ -38,7 +38,8 @@ "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true }, "accepts": { "version": "1.3.5", @@ -46,7 +47,7 @@ "integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=", "dev": true, "requires": { - "mime-types": "2.1.20", + "mime-types": "~2.1.18", "negotiator": "0.6.1" } }, @@ -60,8 +61,8 @@ "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", "requires": { - "acorn": "6.1.0", - "acorn-walk": "6.1.0" + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" }, "dependencies": { "acorn": { @@ -76,9 +77,9 @@ "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.6.0.tgz", "integrity": "sha512-ZsysjEh+Y3i14f7YXCAKJy99RXbd56wHKYBzN4FlFtICIZyFpYwK6OwNJhcz8A/FMtxoUZkJofH1v9KIfNgWmw==", "requires": { - "acorn": "6.0.2", - "acorn-walk": "6.1.0", - "xtend": "4.0.1" + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1", + "xtend": "^4.0.1" }, "dependencies": { "acorn": { @@ -105,8 +106,8 @@ "integrity": "sha1-mfy+wdbSeS+F+pSVNTMr0U9fN5A=", "dev": true, "requires": { - "file-system": "2.2.2", - "utils-extend": "1.0.8" + "file-system": "^2.1.1", + "utils-extend": "^1.0.7" } }, "ajv": { @@ -114,10 +115,10 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", "requires": { - "co": "4.6.0", - "fast-deep-equal": "1.1.0", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.3.1" + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" } }, "align-text": { @@ -125,9 +126,9 @@ "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" } }, "amdefine": { @@ -146,7 +147,7 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { - "color-convert": "1.9.3" + "color-convert": "^1.9.0" } }, "anymatch": { @@ -155,8 +156,8 @@ "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "dev": true, "requires": { - "micromatch": "3.1.10", - "normalize-path": "2.1.1" + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" }, "dependencies": { "kind-of": { @@ -171,44 +172,30 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } } } }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" - }, - "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", - "requires": { - "delegates": "1.0.0", - "readable-stream": "2.3.6" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" }, "dependencies": { "sprintf-js": { @@ -294,7 +281,7 @@ "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": "~2.1.0" } }, "asn1.js": { @@ -303,9 +290,9 @@ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "assert": { @@ -395,8 +382,8 @@ "integrity": "sha1-LY4+XQvb1zJ/kbyBT1xXZg+Bgk0=", "dev": true, "requires": { - "follow-redirects": "1.5.9", - "is-buffer": "1.1.6" + "follow-redirects": "^1.2.5", + "is-buffer": "^1.1.5" } }, "backo2": { @@ -408,7 +395,8 @@ "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true }, "base": { "version": "0.11.2", @@ -416,13 +404,13 @@ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -431,7 +419,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -440,7 +428,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -449,7 +437,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -458,9 +446,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "kind-of": { @@ -483,8 +471,8 @@ "integrity": "sha1-PiLVXWx0okVT2EDSsbwSp9sHjTU=", "dev": true, "requires": { - "ajax-request": "1.2.3", - "file-system": "2.2.2" + "ajax-request": "^1.2.0", + "file-system": "^2.1.0" } }, "base64-js": { @@ -509,7 +497,7 @@ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "requires": { - "tweetnacl": "0.14.5" + "tweetnacl": "^0.14.3" } }, "better-assert": { @@ -527,42 +515,17 @@ "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", "dev": true }, - "bindings": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.4.0.tgz", - "integrity": "sha512-7znEVX22Djn+nYjxCWKDne0RRloa9XfYa84yk3s+HkE3LpDYZmhArYr9O9huBoHY3/oXispx5LorIX7Sl2CgSQ==", - "requires": { - "file-uri-to-path": "1.0.0" - } - }, "bit-twiddle": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/bit-twiddle/-/bit-twiddle-1.0.2.tgz", "integrity": "sha1-DGwfq+KyPRcXPZpht7cJPrnhdp4=" }, - "bl": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", - "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", - "requires": { - "readable-stream": "2.3.6", - "safe-buffer": "5.1.2" - } - }, "blob": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", "integrity": "sha1-vPEwUspURj8w+fx+lbmkdjCpSSE=", "dev": true }, - "block-stream": { - "version": "0.0.9", - "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", - "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", - "requires": { - "inherits": "2.0.3" - } - }, "bluebird": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", @@ -580,10 +543,10 @@ "integrity": "sha1-5LoM5BCkaTYyM2dgnstOZVMSUGk=", "dev": true, "requires": { - "continuable-cache": "0.3.1", - "error": "7.0.2", - "raw-body": "1.1.7", - "safe-json-parse": "1.0.1" + "continuable-cache": "^0.3.1", + "error": "^7.0.0", + "raw-body": "~1.1.0", + "safe-json-parse": "~1.0.1" }, "dependencies": { "bytes": { @@ -598,8 +561,8 @@ "integrity": "sha1-HQJ8K/oRasxmI7yo8AAWVyqH1CU=", "dev": true, "requires": { - "bytes": "1.0.0", - "string_decoder": "0.10.31" + "bytes": "1", + "string_decoder": "0.10" } } } @@ -613,8 +576,9 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -624,16 +588,16 @@ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.3", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -642,7 +606,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -659,11 +623,11 @@ "integrity": "sha512-XLZ96W4jzKOBMcrE7juOusdiIzbZRG3q/sPGh5ytZJSJ7/JndKqoUjfHdiXFzxILidIjsj79rCKUHAIKxJCUCw==", "dev": true, "requires": { - "headless": "0.1.3", + "headless": "~0.1.3", "minimist": "0.0.5", - "mkdirp": "0.3.5", + "mkdirp": "~0.3.3", "plist": "0.2.1", - "xtend": "4.0.1" + "xtend": "^4.0.0" }, "dependencies": { "headless": { @@ -673,7 +637,7 @@ }, "minimist": { "version": "0.0.5", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", "dev": true }, @@ -691,12 +655,12 @@ "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "combine-source-map": "0.8.0", - "defined": "1.0.0", - "safe-buffer": "5.1.2", - "through2": "2.0.3", - "umd": "3.0.3" + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" } }, "browser-process-hrtime": { @@ -727,19 +691,19 @@ "integrity": "sha512-5fWPcJACcgaeOms6xXcHLXEoPTlze63EV8vKd1qxGqksNvaARLeKSUxdCfS+MTQvtBYEXgkkcH/FhR6QHgWzKg==", "dev": true, "requires": { - "browser-launcher": "1.0.1", - "duplexer": "0.1.1", - "ecstatic": "2.2.1", - "electron-stream": "5.1.2", - "enstore": "1.0.1", - "html-inject-script": "1.1.0", - "optimist": "0.6.1", - "phantomjs-stream": "1.1.1", - "server-destroy": "1.0.1", - "source-map-support": "0.4.18", - "through": "2.3.8", - "xhr-write-stream": "0.1.2", - "xtend": "4.0.1" + "browser-launcher": "^1.0.1", + "duplexer": "^0.1.1", + "ecstatic": "^2.0.0", + "electron-stream": "^5.1.1", + "enstore": "^1.0.1", + "html-inject-script": "^1.1.0", + "optimist": "^0.6.1", + "phantomjs-stream": "^1.1.1", + "server-destroy": "^1.0.1", + "source-map-support": "^0.4.0", + "through": "^2.3.8", + "xhr-write-stream": "^0.1.2", + "xtend": "^4.0.1" } }, "browser-sync": { @@ -748,27 +712,27 @@ "integrity": "sha512-VLzpjCA4uXqfzkwqWtMM6hvPm2PNHp2RcmzBXcbi6C9WpkUhhFb8SVAr4CFrCsFxDg+oY6HalOjn8F+egyvhag==", "dev": true, "requires": { - "browser-sync-client": "2.26.2", - "browser-sync-ui": "2.26.2", + "browser-sync-client": "^2.26.2", + "browser-sync-ui": "^2.26.2", "bs-recipes": "1.3.4", - "bs-snippet-injector": "2.0.1", - "chokidar": "2.0.4", + "bs-snippet-injector": "^2.0.1", + "chokidar": "^2.0.4", "connect": "3.6.6", - "connect-history-api-fallback": "1.5.0", - "dev-ip": "1.0.1", - "easy-extender": "2.3.4", - "eazy-logger": "3.0.2", - "etag": "1.8.1", - "fresh": "0.5.2", + "connect-history-api-fallback": "^1", + "dev-ip": "^1.0.1", + "easy-extender": "^2.3.4", + "eazy-logger": "^3", + "etag": "^1.8.1", + "fresh": "^0.5.2", "fs-extra": "3.0.1", "http-proxy": "1.15.2", - "immutable": "3.8.2", + "immutable": "^3", "localtunnel": "1.9.1", "micromatch": "2.3.11", "opn": "5.3.0", "portscanner": "2.1.1", "qs": "6.2.3", - "raw-body": "2.3.3", + "raw-body": "^2.3.2", "resp-modifier": "6.0.2", "rx": "4.1.0", "send": "0.16.2", @@ -796,8 +760,8 @@ "requires": { "etag": "1.8.1", "fresh": "0.5.2", - "mitt": "1.1.3", - "rxjs": "5.5.12" + "mitt": "^1.1.3", + "rxjs": "^5.5.6" } }, "browser-sync-ui": { @@ -807,11 +771,11 @@ "dev": true, "requires": { "async-each-series": "0.1.1", - "connect-history-api-fallback": "1.5.0", - "immutable": "3.8.2", + "connect-history-api-fallback": "^1", + "immutable": "^3", "server-destroy": "1.0.1", - "socket.io-client": "2.1.1", - "stream-throttle": "0.1.3" + "socket.io-client": "^2.0.4", + "stream-throttle": "^0.1.3" } }, "browserify": { @@ -820,54 +784,54 @@ "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "assert": "1.4.1", - "browser-pack": "6.1.0", - "browser-resolve": "1.11.3", - "browserify-zlib": "0.2.0", - "buffer": "5.0.8", - "cached-path-relative": "1.0.2", - "concat-stream": "1.6.2", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.2.0", - "duplexer2": "0.1.4", - "events": "2.1.0", - "glob": "7.1.3", - "has": "1.0.3", - "htmlescape": "1.1.1", - "https-browserify": "1.0.0", - "inherits": "2.0.3", - "insert-module-globals": "7.2.0", - "labeled-stream-splicer": "2.0.1", - "mkdirp": "0.5.1", - "module-deps": "6.2.0", - "os-browserify": "0.3.0", - "parents": "1.0.1", - "path-browserify": "0.0.1", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.3", - "string_decoder": "1.2.0", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.4", - "vm-browserify": "1.1.0", - "xtend": "4.0.1" + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" }, "dependencies": { "browserify-zlib": { @@ -876,7 +840,7 @@ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "1.0.7" + "pako": "~1.0.5" } }, "buffer": { @@ -885,8 +849,8 @@ "integrity": "sha512-xXvjQhVNz50v2nPeoOsNqWCLGfiv4ji/gXZM28jnVwdLJxH4mFyqgqCKfaK9zf1KUbG6zTkjLOy7ou+jSMarGA==", "dev": true, "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.12" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, "glob": { @@ -895,12 +859,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "pako": { @@ -915,7 +879,7 @@ "integrity": "sha512-6YqyX6ZWEYguAxgZzHGL7SsCeGx3V2TtOTqZz1xSTSWnqsbWwbptafNyvf/ACquZUXV3DANr5BDIwNYe1mN42w==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } } } @@ -926,12 +890,12 @@ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "browserify-cache-api": { @@ -940,9 +904,9 @@ "integrity": "sha1-liR+hT8Gj9bg1FzHPwuyzZd47wI=", "dev": true, "requires": { - "async": "1.5.2", - "through2": "2.0.3", - "xtend": "4.0.1" + "async": "^1.5.2", + "through2": "^2.0.0", + "xtend": "^4.0.0" } }, "browserify-cipher": { @@ -951,9 +915,9 @@ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { - "browserify-aes": "1.2.0", - "browserify-des": "1.0.2", - "evp_bytestokey": "1.0.3" + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" } }, "browserify-des": { @@ -962,10 +926,10 @@ "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" } }, "browserify-incremental": { @@ -974,10 +938,10 @@ "integrity": "sha1-BxPLdYckemMqnwjPG9FpuHi2Koo=", "dev": true, "requires": { - "JSONStream": "0.10.0", - "browserify-cache-api": "3.0.1", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^0.10.0", + "browserify-cache-api": "^3.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" }, "dependencies": { "JSONStream": { @@ -987,7 +951,7 @@ "dev": true, "requires": { "jsonparse": "0.0.5", - "through": "2.3.8" + "through": ">=2.2.7 <3" } }, "jsonparse": { @@ -1004,8 +968,8 @@ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" } }, "browserify-sign": { @@ -1014,13 +978,13 @@ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "dev": true, "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "elliptic": "6.4.1", - "inherits": "2.0.3", - "parse-asn1": "5.1.1" + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" } }, "browserify-zlib": { @@ -1029,7 +993,7 @@ "integrity": "sha1-uzX4pRn2AOD6a4SFJByXnQFB+y0=", "dev": true, "requires": { - "pako": "0.2.9" + "pako": "~0.2.0" } }, "bs-recipes": { @@ -1049,34 +1013,15 @@ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz", "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==", "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.12" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, - "buffer-alloc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", - "requires": { - "buffer-alloc-unsafe": "1.1.0", - "buffer-fill": "1.0.0" - } - }, - "buffer-alloc-unsafe": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" - }, "buffer-equal": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz", "integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=" }, - "buffer-fill": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" - }, "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", @@ -1118,15 +1063,15 @@ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "cached-path-relative": { @@ -1153,24 +1098,16 @@ "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", "dev": true, "requires": { - "camelcase": "2.1.1", - "map-obj": "1.0.1" + "camelcase": "^2.0.0", + "map-obj": "^1.0.0" } }, - "canvas": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.3.1.tgz", - "integrity": "sha512-jSxwf4V9AGD6t6yBC600xFZKjrfKTR0T0RUNlX/AODs/ifrfJHIQjFEK8iF2euNy6z7K3GNv82DJgTjYZZktqA==", + "can-promise": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/can-promise/-/can-promise-0.0.1.tgz", + "integrity": "sha512-gzVrHyyrvgt0YpDm7pn04MQt8gjh0ZAhN4ZDyCRtGl6YnuuK6b4aiUTD7G52r9l4YNmxfTtEscb92vxtAlL6XQ==", "requires": { - "nan": "2.12.1", - "node-pre-gyp": "0.11.0" - }, - "dependencies": { - "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==" - } + "window-or-global": "^1.0.1" } }, "caseless": { @@ -1183,8 +1120,8 @@ "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chalk": { @@ -1192,9 +1129,9 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.5.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "charm": { @@ -1208,34 +1145,29 @@ "integrity": "sha512-z9n7yt9rOvIJrMhvDtDictKrkFHeihkNl6uWMmZlmL6tJtX9Cs+87oK+teBx+JIgzvbX3yZHT3eF8vpbDxHJXQ==", "dev": true, "requires": { - "anymatch": "2.0.0", - "async-each": "1.0.1", - "braces": "2.3.2", - "fsevents": "1.2.4", - "glob-parent": "3.1.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "4.0.0", - "lodash.debounce": "4.0.8", - "normalize-path": "2.1.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.2.1", - "upath": "1.1.0" + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.2.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "lodash.debounce": "^4.0.8", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.5" } }, - "chownr": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==" - }, "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "class-utils": { @@ -1244,10 +1176,10 @@ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -1256,7 +1188,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -1280,9 +1212,9 @@ "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wrap-ansi": "2.1.0" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wrap-ansi": "^2.0.0" } }, "clone": { @@ -1312,8 +1244,8 @@ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { @@ -1347,10 +1279,10 @@ "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", "dev": true, "requires": { - "convert-source-map": "1.1.3", - "inline-source-map": "0.6.2", - "lodash.memoize": "3.0.4", - "source-map": "0.5.7" + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" }, "dependencies": { "convert-source-map": { @@ -1366,7 +1298,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } }, "commander": { @@ -1395,17 +1327,18 @@ "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true }, "concat-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "requires": { - "buffer-from": "1.1.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "connect": { @@ -1416,7 +1349,7 @@ "requires": { "debug": "2.6.9", "finalhandler": "1.1.0", - "parseurl": "1.3.2", + "parseurl": "~1.3.2", "utils-merge": "1.0.1" }, "dependencies": { @@ -1443,14 +1376,9 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "0.1.4" + "date-now": "^0.1.4" } }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" - }, "constants-browserify": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", @@ -1462,7 +1390,7 @@ "resolved": "https://registry.npmjs.org/contentstream/-/contentstream-1.0.0.tgz", "integrity": "sha1-C9z6RtowRkqGzo+n7OVlQQ3G+aU=", "requires": { - "readable-stream": "1.0.34" + "readable-stream": "~1.0.33-1" }, "dependencies": { "readable-stream": { @@ -1470,10 +1398,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } } } @@ -1489,7 +1417,7 @@ "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.1" } }, "cookie": { @@ -1515,8 +1443,8 @@ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.1" + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" } }, "create-hash": { @@ -1525,11 +1453,11 @@ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.3", - "md5.js": "1.3.5", - "ripemd160": "2.0.2", - "sha.js": "2.4.11" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" } }, "create-hmac": { @@ -1538,12 +1466,24 @@ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "inherits": "2.0.3", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } }, "crypto-browserify": { @@ -1552,17 +1492,17 @@ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { - "browserify-cipher": "1.0.1", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.3", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "diffie-hellman": "5.0.3", - "inherits": "2.0.3", - "pbkdf2": "3.0.17", - "public-encrypt": "4.0.3", - "randombytes": "2.0.6", - "randomfill": "1.0.4" + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" } }, "crypto-random-string": { @@ -1577,7 +1517,7 @@ "integrity": "sha1-pmAt/34EqDBtwNuaVR6S6LVmKtg=", "dev": true, "requires": { - "through": "2.3.8" + "through": "X.X.X" } }, "cssom": { @@ -1590,7 +1530,7 @@ "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", "requires": { - "cssom": "0.3.6" + "cssom": "0.3.x" } }, "currently-unhandled": { @@ -1599,7 +1539,7 @@ "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", "dev": true, "requires": { - "array-find-index": "1.0.2" + "array-find-index": "^1.0.1" } }, "cwise": { @@ -1607,10 +1547,10 @@ "resolved": "https://registry.npmjs.org/cwise/-/cwise-1.0.10.tgz", "integrity": "sha1-JO7mBy69/WuMb12tsXCQtkmxK+8=", "requires": { - "cwise-compiler": "1.1.3", - "cwise-parser": "1.0.3", - "static-module": "1.5.0", - "uglify-js": "2.8.29" + "cwise-compiler": "^1.1.1", + "cwise-parser": "^1.0.0", + "static-module": "^1.0.0", + "uglify-js": "^2.6.0" } }, "cwise-compiler": { @@ -1618,7 +1558,7 @@ "resolved": "https://registry.npmjs.org/cwise-compiler/-/cwise-compiler-1.1.3.tgz", "integrity": "sha1-9NZnQQ6FDToxOn0tt7HlBbsDTMU=", "requires": { - "uniq": "1.0.1" + "uniq": "^1.0.0" } }, "cwise-parser": { @@ -1626,8 +1566,8 @@ "resolved": "https://registry.npmjs.org/cwise-parser/-/cwise-parser-1.0.3.tgz", "integrity": "sha1-jkk8F9VPl8sDCp6YVLyGyd+zVP4=", "requires": { - "esprima": "1.2.5", - "uniq": "1.0.1" + "esprima": "^1.0.3", + "uniq": "^1.0.0" }, "dependencies": { "esprima": { @@ -1642,7 +1582,7 @@ "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "requires": { - "es5-ext": "0.10.47" + "es5-ext": "^0.10.9" } }, "dashdash": { @@ -1650,7 +1590,7 @@ "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "data-uri-to-buffer": { @@ -1658,7 +1598,7 @@ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-2.0.0.tgz", "integrity": "sha512-YbKCNLPPP4inc0E5If4OaalBc7gpaM2MRv77Pv2VThVComLKfbGYtJcdDCViDyp1Wd4SebhHLz94vp91zbK6bw==", "requires": { - "@types/node": "8.10.36" + "@types/node": "^8.0.7" } }, "data-urls": { @@ -1666,9 +1606,9 @@ "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", "requires": { - "abab": "2.0.0", - "whatwg-mimetype": "2.3.0", - "whatwg-url": "7.0.0" + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" } }, "date-now": { @@ -1683,8 +1623,8 @@ "integrity": "sha1-nxJLZ1lMk3/3BpMuSmQsyo27/uk=", "dev": true, "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" + "get-stdin": "^4.0.1", + "meow": "^3.3.0" } }, "debug": { @@ -1707,14 +1647,6 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", "dev": true }, - "decompress-response": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", - "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "requires": { - "mimic-response": "1.0.1" - } - }, "deep-equal": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", @@ -1724,7 +1656,8 @@ "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true }, "deep-is": { "version": "0.1.3", @@ -1754,8 +1687,8 @@ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -1764,7 +1697,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1773,7 +1706,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1782,9 +1715,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "kind-of": { @@ -1806,11 +1739,6 @@ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" - }, "depd": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", @@ -1823,10 +1751,10 @@ "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", "dev": true, "requires": { - "JSONStream": "1.3.5", - "shasum": "1.0.2", - "subarg": "1.0.0", - "through2": "2.0.3" + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" } }, "des.js": { @@ -1835,8 +1763,8 @@ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "dev": true, "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "destroy": { @@ -1851,20 +1779,15 @@ "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", "dev": true }, - "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=" - }, "detective": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/detective/-/detective-5.1.0.tgz", "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", "dev": true, "requires": { - "acorn-node": "1.6.0", - "defined": "1.0.0", - "minimist": "1.2.0" + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" } }, "dev-ip": { @@ -1879,8 +1802,8 @@ "integrity": "sha1-f3Qt4Gb8dIvI24IFad3c5Jvw1FY=", "dev": true, "requires": { - "asap": "2.0.6", - "wrappy": "1.0.2" + "asap": "^2.0.0", + "wrappy": "1" } }, "diffie-hellman": { @@ -1889,11 +1812,16 @@ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" } }, + "dijkstrajs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.1.tgz", + "integrity": "sha1-082BIh4+pAdCz83lVtTpnpjdxxs=" + }, "domain-browser": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", @@ -1905,7 +1833,7 @@ "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", "requires": { - "webidl-conversions": "4.0.2" + "webidl-conversions": "^4.0.2" } }, "downloadjs": { @@ -1929,7 +1857,7 @@ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz", "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } }, "easy-extender": { @@ -1938,7 +1866,7 @@ "integrity": "sha512-8cAwm6md1YTiPpOvDULYJL4ZS6WfM5/cTeVVh4JsvyYZAoqlRVUpHL9Gr5Fy7HA6xcSZicUia3DeAgO3Us8E+Q==", "dev": true, "requires": { - "lodash": "4.17.11" + "lodash": "^4.17.10" } }, "eazy-logger": { @@ -1947,7 +1875,7 @@ "integrity": "sha1-oyWqXlPROiIliJsqxBE7K5Y29Pw=", "dev": true, "requires": { - "tfunk": "3.1.0" + "tfunk": "^3.0.1" } }, "ecc-jsbn": { @@ -1955,8 +1883,8 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "requires": { - "jsbn": "0.1.1", - "safer-buffer": "2.1.2" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "ecstatic": { @@ -1965,10 +1893,10 @@ "integrity": "sha512-ztE4WqheoWLh3wv+HQwy7dACnvNY620coWpa+XqY6R2cVWgaAT2lUISU1Uf7JpdLLJCURktJOaA9av2AOzsyYQ==", "dev": true, "requires": { - "he": "1.2.0", - "mime": "1.6.0", - "minimist": "1.2.0", - "url-join": "2.0.5" + "he": "^1.1.1", + "mime": "^1.2.11", + "minimist": "^1.1.0", + "url-join": "^2.0.2" } }, "ee-first": { @@ -1983,9 +1911,9 @@ "integrity": "sha512-1f9zJehcTTGjrkb06o6ds+gsRq6SYhZJyxOk6zIWjRH8hVy03y/RzUDELzNas71f5vcvXmfGVvyjeEsadDI8tg==", "dev": true, "requires": { - "@types/node": "8.10.36", - "electron-download": "3.3.0", - "extract-zip": "1.6.7" + "@types/node": "^8.0.24", + "electron-download": "^3.0.1", + "extract-zip": "^1.0.3" } }, "electron-download": { @@ -1994,15 +1922,15 @@ "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=", "dev": true, "requires": { - "debug": "2.6.9", - "fs-extra": "0.30.0", - "home-path": "1.0.6", - "minimist": "1.2.0", - "nugget": "2.0.1", - "path-exists": "2.1.0", - "rc": "1.2.8", - "semver": "5.6.0", - "sumchecker": "1.3.1" + "debug": "^2.2.0", + "fs-extra": "^0.30.0", + "home-path": "^1.0.1", + "minimist": "^1.2.0", + "nugget": "^2.0.0", + "path-exists": "^2.1.0", + "rc": "^1.1.2", + "semver": "^5.3.0", + "sumchecker": "^1.2.0" }, "dependencies": { "debug": { @@ -2020,11 +1948,11 @@ "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "2.4.0", - "klaw": "1.3.1", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" + "graceful-fs": "^4.1.2", + "jsonfile": "^2.1.0", + "klaw": "^1.0.0", + "path-is-absolute": "^1.0.0", + "rimraf": "^2.2.8" } }, "jsonfile": { @@ -2033,7 +1961,7 @@ "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } } } @@ -2044,11 +1972,11 @@ "integrity": "sha512-r21cChsfIVdVKPp76xNk7Gs+Rjib2EyJEWKlQntvTm5+XYtX8GtXNFY1Wa9ZkYBiWby5W143zRWbDbzWqAiZkA==", "dev": true, "requires": { - "debug": "2.6.9", - "ecstatic": "3.3.0", - "electron": "1.8.8", - "json-stringify-safe": "5.0.1", - "stream-read": "1.1.2", + "debug": "^2.6.1", + "ecstatic": "^3.0.0", + "electron": "^1.8.4", + "json-stringify-safe": "^5.0.1", + "stream-read": "^1.1.2", "tempy": "0.1.0" }, "dependencies": { @@ -2067,10 +1995,10 @@ "integrity": "sha512-EblWYTd+wPIAMQ0U4oYJZ7QBypT9ZUIwpqli0bKDjeIIQnXDBK2dXtZ9yzRCOlkW1HkO8gn7/FxLK1yPIW17pw==", "dev": true, "requires": { - "he": "1.2.0", - "mime": "1.6.0", - "minimist": "1.2.0", - "url-join": "2.0.5" + "he": "^1.1.1", + "mime": "^1.6.0", + "minimist": "^1.1.0", + "url-join": "^2.0.5" } } } @@ -2081,13 +2009,13 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.5", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "encodeurl": { @@ -2101,7 +2029,7 @@ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "engine.io": { @@ -2110,12 +2038,12 @@ "integrity": "sha512-mRbgmAtQ4GAlKwuPnnAvXXwdPhEx+jkc0OBCLrXuD/CRvwNK3AxRSnqK4FSqmAMRRHryVJP8TopOvmEaA64fKw==", "dev": true, "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.4", "base64id": "1.0.0", "cookie": "0.3.1", - "debug": "3.1.0", - "engine.io-parser": "2.1.2", - "ws": "3.3.3" + "debug": "~3.1.0", + "engine.io-parser": "~2.1.0", + "ws": "~3.3.1" } }, "engine.io-client": { @@ -2126,14 +2054,14 @@ "requires": { "component-emitter": "1.2.1", "component-inherit": "0.0.3", - "debug": "3.1.0", - "engine.io-parser": "2.1.2", + "debug": "~3.1.0", + "engine.io-parser": "~2.1.1", "has-cors": "1.1.0", "indexof": "0.0.1", "parseqs": "0.0.5", "parseuri": "0.0.5", - "ws": "3.3.3", - "xmlhttprequest-ssl": "1.5.5", + "ws": "~3.3.1", + "xmlhttprequest-ssl": "~1.5.4", "yeast": "0.1.2" } }, @@ -2144,10 +2072,10 @@ "dev": true, "requires": { "after": "0.8.2", - "arraybuffer.slice": "0.0.7", + "arraybuffer.slice": "~0.0.7", "base64-arraybuffer": "0.1.5", "blob": "0.0.4", - "has-binary2": "1.0.3" + "has-binary2": "~1.0.2" } }, "enstore": { @@ -2165,8 +2093,8 @@ "integrity": "sha1-pfdf/02ZJhJt2sDqXcOOaJFTywI=", "dev": true, "requires": { - "string-template": "0.2.1", - "xtend": "4.0.1" + "string-template": "~0.2.1", + "xtend": "~4.0.0" } }, "error-ex": { @@ -2175,7 +2103,7 @@ "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es-abstract": { @@ -2208,9 +2136,9 @@ "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.47.tgz", "integrity": "sha512-/1TItLfj+TTfWoeRcDn/0FbGV6SNo4R+On2GGVucPU/j3BWnXE2Co8h8CTo4Tu34gFJtnmwS9xiScKs4EjZhdw==", "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1", - "next-tick": "1.0.0" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" } }, "es6-iterator": { @@ -2218,9 +2146,9 @@ "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.47", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" } }, "es6-map": { @@ -2228,12 +2156,12 @@ "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz", "integrity": "sha1-kTbgUD3MBqMBaQ8LsU/042TpSfA=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.47", - "es6-iterator": "2.0.3", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", + "es6-set": "~0.1.5", + "es6-symbol": "~3.1.1", + "event-emitter": "~0.3.5" } }, "es6-promise": { @@ -2247,11 +2175,11 @@ "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz", "integrity": "sha1-0rPsXU2ADO2BjbU40ol02wpzzLE=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.47", - "es6-iterator": "2.0.3", + "d": "1", + "es5-ext": "~0.10.14", + "es6-iterator": "~2.0.1", "es6-symbol": "3.1.1", - "event-emitter": "0.3.5" + "event-emitter": "~0.3.5" } }, "es6-symbol": { @@ -2259,8 +2187,8 @@ "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.47" + "d": "1", + "es5-ext": "~0.10.14" } }, "escape-html": { @@ -2279,11 +2207,11 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", "requires": { - "esprima": "3.1.3", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.6.1" + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" }, "dependencies": { "source-map": { @@ -2325,8 +2253,8 @@ "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "requires": { - "d": "1.0.0", - "es5-ext": "0.10.47" + "d": "1", + "es5-ext": "~0.10.14" } }, "eventemitter2": { @@ -2353,8 +2281,22 @@ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "md5.js": "1.3.5", - "safe-buffer": "5.1.2" + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "exit": { @@ -2369,13 +2311,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "debug": { @@ -2393,7 +2335,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -2402,7 +2344,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2413,7 +2355,7 @@ "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { - "fill-range": "2.2.4" + "fill-range": "^2.1.0" }, "dependencies": { "fill-range": { @@ -2422,11 +2364,11 @@ "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { - "is-number": "2.1.0", - "isobject": "2.1.0", - "randomatic": "3.1.0", - "repeat-element": "1.1.3", - "repeat-string": "1.6.1" + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" } }, "is-number": { @@ -2435,7 +2377,7 @@ "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "isarray": { @@ -2455,18 +2397,13 @@ } } }, - "expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==" - }, "expand-tilde": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, "requires": { - "homedir-polyfill": "1.0.1" + "homedir-polyfill": "^1.0.1" } }, "extend": { @@ -2480,8 +2417,8 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -2490,7 +2427,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -2501,14 +2438,14 @@ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -2517,7 +2454,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -2526,7 +2463,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -2535,7 +2472,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -2544,7 +2481,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -2553,9 +2490,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "kind-of": { @@ -2599,10 +2536,10 @@ "resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz", "integrity": "sha1-lrsXdh2rqU9G0AFzizzt86Z/4Gw=", "requires": { - "acorn": "5.7.3", - "foreach": "2.0.5", + "acorn": "^5.0.0", + "foreach": "^2.0.5", "isarray": "0.0.1", - "object-keys": "1.0.12" + "object-keys": "^1.0.6" } }, "fast-deep-equal": { @@ -2626,7 +2563,7 @@ "integrity": "sha1-TkkvjQTftviQA1B/btvy1QHnxvQ=", "dev": true, "requires": { - "websocket-driver": "0.7.0" + "websocket-driver": ">=0.5.1" } }, "fd-slicer": { @@ -2635,7 +2572,7 @@ "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "dev": true, "requires": { - "pend": "1.2.0" + "pend": "~1.2.0" } }, "figures": { @@ -2644,8 +2581,8 @@ "integrity": "sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5", - "object-assign": "4.1.1" + "escape-string-regexp": "^1.0.5", + "object-assign": "^4.1.0" } }, "file-match": { @@ -2654,7 +2591,7 @@ "integrity": "sha1-ycrSZdLIrfOoFHWw30dYWQafrvc=", "dev": true, "requires": { - "utils-extend": "1.0.8" + "utils-extend": "^1.0.6" } }, "file-system": { @@ -2663,15 +2600,10 @@ "integrity": "sha1-fWWDPjojR9zZVqgTxncVPtPt2Yc=", "dev": true, "requires": { - "file-match": "1.0.2", - "utils-extend": "1.0.8" + "file-match": "^1.0.1", + "utils-extend": "^1.0.4" } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" - }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -2684,10 +2616,10 @@ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -2696,7 +2628,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2708,12 +2640,12 @@ "dev": true, "requires": { "debug": "2.6.9", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "on-finished": "2.3.0", - "parseurl": "1.3.2", - "statuses": "1.3.1", - "unpipe": "1.0.0" + "encodeurl": "~1.0.1", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.2", + "statuses": "~1.3.1", + "unpipe": "~1.0.0" }, "dependencies": { "debug": { @@ -2733,8 +2665,8 @@ "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", "dev": true, "requires": { - "path-exists": "2.1.0", - "pinkie-promise": "2.0.1" + "path-exists": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "findup-sync": { @@ -2743,7 +2675,7 @@ "integrity": "sha1-N5MKpdgWt3fANEXhlmzGeQpMCxY=", "dev": true, "requires": { - "glob": "5.0.15" + "glob": "~5.0.0" } }, "fisheyegl": { @@ -2757,7 +2689,7 @@ "integrity": "sha512-Bh65EZI/RU8nx0wbYF9shkFZlqLP+6WT/5FnA3cE/djNSuKNHJEinGGZgu/cQEkeeb2GdFOgenAmn8qaqYke2w==", "dev": true, "requires": { - "debug": "3.1.0" + "debug": "=3.1.0" } }, "font-awesome": { @@ -2786,7 +2718,7 @@ "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", "dev": true, "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "foreach": { @@ -2804,9 +2736,9 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", "requires": { - "asynckit": "0.4.0", + "asynckit": "^0.4.0", "combined-stream": "1.0.6", - "mime-types": "2.1.20" + "mime-types": "^2.1.12" }, "dependencies": { "combined-stream": { @@ -2814,7 +2746,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", "requires": { - "delayed-stream": "1.0.0" + "delayed-stream": "~1.0.0" } } } @@ -2825,7 +2757,7 @@ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fresh": { @@ -2839,8 +2771,8 @@ "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" } }, "from2-string": { @@ -2848,37 +2780,25 @@ "resolved": "https://registry.npmjs.org/from2-string/-/from2-string-1.1.0.tgz", "integrity": "sha1-GCgrJ9CKJnyzAwzSuLSw8hKvdSo=", "requires": { - "from2": "2.3.0" + "from2": "^2.0.3" } }, - "fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" - }, "fs-extra": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "3.0.1", - "universalify": "0.1.2" - } - }, - "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", - "requires": { - "minipass": "2.3.5" + "graceful-fs": "^4.1.2", + "jsonfile": "^3.0.0", + "universalify": "^0.1.0" } }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true }, "fsevents": { "version": "1.2.4", @@ -2887,8 +2807,8 @@ "dev": true, "optional": true, "requires": { - "nan": "2.11.1", - "node-pre-gyp": "0.10.0" + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" }, "dependencies": { "abbrev": { @@ -3409,44 +3329,18 @@ } } }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "requires": { - "graceful-fs": "4.1.11", - "inherits": "2.0.3", - "mkdirp": "0.5.1", - "rimraf": "2.6.2" - } - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "requires": { - "aproba": "1.2.0", - "console-control-strings": "1.1.0", - "has-unicode": "2.0.1", - "object-assign": "4.1.1", - "signal-exit": "3.0.2", - "string-width": "1.0.2", - "strip-ansi": "3.0.1", - "wide-align": "1.1.3" - } - }, "gaze": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", "dev": true, "requires": { - "globule": "1.2.1" + "globule": "^1.0.0" } }, "get-assigned-identifiers": { @@ -3457,8 +3351,7 @@ "get-caller-file": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", - "dev": true + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" }, "get-pixels": { "version": "3.3.2", @@ -3466,16 +3359,16 @@ "integrity": "sha512-6ar+8yPxRd1pskEcl2GSEu1La0+xYRjjnkby6AYiRDDwZ0tJbPQmHnSeH9fGLskT8kvR0OukVgtZLcsENF9YKQ==", "requires": { "data-uri-to-buffer": "0.0.3", - "jpeg-js": "0.3.4", - "mime-types": "2.1.20", - "ndarray": "1.0.18", - "ndarray-pack": "1.2.1", + "jpeg-js": "^0.3.2", + "mime-types": "^2.0.1", + "ndarray": "^1.0.13", + "ndarray-pack": "^1.1.1", "node-bitmap": "0.0.1", - "omggif": "1.0.9", - "parse-data-uri": "0.2.0", - "pngjs": "3.3.3", - "request": "2.88.0", - "through": "2.3.8" + "omggif": "^1.0.5", + "parse-data-uri": "^0.2.0", + "pngjs": "^3.3.3", + "request": "^2.44.0", + "through": "^2.3.4" }, "dependencies": { "data-uri-to-buffer": { @@ -3491,6 +3384,25 @@ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", "dev": true }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + }, + "dependencies": { + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -3508,15 +3420,15 @@ "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", "requires": { - "assert-plus": "1.0.0" + "assert-plus": "^1.0.0" } }, "gif-encoder": { "version": "0.4.3", - "resolved": "http://registry.npmjs.org/gif-encoder/-/gif-encoder-0.4.3.tgz", + "resolved": "https://registry.npmjs.org/gif-encoder/-/gif-encoder-0.4.3.tgz", "integrity": "sha1-iitP6MqJWkjjoLbLs0CgpqNXGJk=", "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.9" }, "dependencies": { "readable-stream": { @@ -3524,10 +3436,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } } } @@ -3537,35 +3449,17 @@ "resolved": "https://registry.npmjs.org/gifshot/-/gifshot-0.4.5.tgz", "integrity": "sha1-48tXAgOjsTn/MGnXV4CYopwDsPg=" }, - "github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=" - }, - "gl": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/gl/-/gl-4.1.1.tgz", - "integrity": "sha512-2SeT0193YonCMR0wjKuZm3GNq52qcRD7S1LsRvs3U9c5lnDceQjEw0sUgpEukIe4tS0F/6wL5q+/CWH4Zf58OA==", - "requires": { - "bindings": "1.4.0", - "bit-twiddle": "1.0.2", - "glsl-tokenizer": "2.1.5", - "nan": "2.11.1", - "node-gyp": "3.8.0", - "prebuild-install": "5.2.4" - } - }, "glob": { "version": "5.0.15", "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-base": { @@ -3574,8 +3468,8 @@ "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", "dev": true, "requires": { - "glob-parent": "2.0.0", - "is-glob": "2.0.1" + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" }, "dependencies": { "glob-parent": { @@ -3584,7 +3478,7 @@ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "is-extglob": { @@ -3599,7 +3493,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -3610,8 +3504,8 @@ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" }, "dependencies": { "is-glob": { @@ -3620,7 +3514,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.0" } } } @@ -3631,9 +3525,9 @@ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { - "global-prefix": "1.0.2", - "is-windows": "1.0.2", - "resolve-dir": "1.0.1" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, "global-prefix": { @@ -3642,11 +3536,11 @@ "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "dev": true, "requires": { - "expand-tilde": "2.0.2", - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "1.0.2", - "which": "1.3.1" + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, "globule": { @@ -3655,9 +3549,9 @@ "integrity": "sha512-g7QtgWF4uYSL5/dn71WxubOrS7JVGCnFPEnoeChJmBnyR9Mw8nGoEwOgJL/RC2Te0WhbsEUCejfH8SZNJ+adYQ==", "dev": true, "requires": { - "glob": "7.1.3", - "lodash": "4.17.11", - "minimatch": "3.0.4" + "glob": "~7.1.1", + "lodash": "~4.17.10", + "minimatch": "~3.0.2" }, "dependencies": { "glob": { @@ -3666,42 +3560,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - } - } - }, - "glsl-tokenizer": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/glsl-tokenizer/-/glsl-tokenizer-2.1.5.tgz", - "integrity": "sha512-XSZEJ/i4dmz3Pmbnpsy3cKh7cotvFlBiZnDOwnj/05EwNp2XrhQ4XKJxT7/pDt4kp4YcpRSKz8eTV7S+mwV6MA==", - "requires": { - "through2": "0.6.5" - }, - "dependencies": { - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "0.0.1", - "string_decoder": "0.10.31" - } - }, - "through2": { - "version": "0.6.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-0.6.5.tgz", - "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", - "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -3709,7 +3573,8 @@ "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true }, "grunt": { "version": "1.0.3", @@ -3717,23 +3582,23 @@ "integrity": "sha512-/JzmZNPfKorlCrrmxWqQO4JVodO+DVd5XX4DkocL/1WlLlKVLE9+SdEIempOAxDhWPysLle6afvn/hg7Ck2k9g==", "dev": true, "requires": { - "coffeescript": "1.10.0", - "dateformat": "1.0.12", - "eventemitter2": "0.4.14", - "exit": "0.1.2", - "findup-sync": "0.3.0", - "glob": "7.0.6", - "grunt-cli": "1.2.0", - "grunt-known-options": "1.1.1", - "grunt-legacy-log": "2.0.0", - "grunt-legacy-util": "1.1.1", - "iconv-lite": "0.4.24", - "js-yaml": "3.5.5", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "path-is-absolute": "1.0.1", - "rimraf": "2.6.2" + "coffeescript": "~1.10.0", + "dateformat": "~1.0.12", + "eventemitter2": "~0.4.13", + "exit": "~0.1.1", + "findup-sync": "~0.3.0", + "glob": "~7.0.0", + "grunt-cli": "~1.2.0", + "grunt-known-options": "~1.1.0", + "grunt-legacy-log": "~2.0.0", + "grunt-legacy-util": "~1.1.1", + "iconv-lite": "~0.4.13", + "js-yaml": "~3.5.2", + "minimatch": "~3.0.2", + "mkdirp": "~0.5.1", + "nopt": "~3.0.6", + "path-is-absolute": "~1.0.0", + "rimraf": "~2.6.2" }, "dependencies": { "glob": { @@ -3742,12 +3607,12 @@ "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.2", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "grunt-cli": { @@ -3756,10 +3621,10 @@ "integrity": "sha1-VisRnrsGndtGSs4oRVAb6Xs1tqg=", "dev": true, "requires": { - "findup-sync": "0.3.0", - "grunt-known-options": "1.1.1", - "nopt": "3.0.6", - "resolve": "1.1.7" + "findup-sync": "~0.3.0", + "grunt-known-options": "~1.1.0", + "nopt": "~3.0.6", + "resolve": "~1.1.0" } }, "resolve": { @@ -3776,7 +3641,7 @@ "integrity": "sha1-oOnB/RzLXEVMJexRcBE///BqR3I=", "dev": true, "requires": { - "browser-sync": "2.26.3" + "browser-sync": "^2.6.4" } }, "grunt-browserify": { @@ -3785,13 +3650,13 @@ "integrity": "sha1-R/2M+LrFj+LeaDr9xX9/OoDKeS0=", "dev": true, "requires": { - "async": "2.6.1", - "browserify": "16.2.3", - "browserify-incremental": "3.1.1", - "glob": "7.1.3", - "lodash": "4.17.11", - "resolve": "1.8.1", - "watchify": "3.11.0" + "async": "^2.5.0", + "browserify": "^16.0.0", + "browserify-incremental": "^3.1.1", + "glob": "^7.1.2", + "lodash": "^4.17.4", + "resolve": "^1.1.6", + "watchify": "^3.6.1" }, "dependencies": { "assert": { @@ -3826,7 +3691,7 @@ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "lodash": "4.17.11" + "lodash": "^4.17.10" } }, "browserify": { @@ -3835,54 +3700,54 @@ "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "assert": "1.4.1", - "browser-pack": "6.1.0", - "browser-resolve": "1.11.3", - "browserify-zlib": "0.2.0", - "buffer": "5.0.8", - "cached-path-relative": "1.0.2", - "concat-stream": "1.6.2", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.2.0", - "duplexer2": "0.1.4", - "events": "2.1.0", - "glob": "7.1.3", - "has": "1.0.3", - "htmlescape": "1.1.1", - "https-browserify": "1.0.0", - "inherits": "2.0.3", - "insert-module-globals": "7.2.0", - "labeled-stream-splicer": "2.0.1", - "mkdirp": "0.5.1", - "module-deps": "6.1.0", - "os-browserify": "0.3.0", - "parents": "1.0.1", - "path-browserify": "0.0.1", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.3", - "string_decoder": "1.1.1", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.4", - "vm-browserify": "1.1.0", - "xtend": "4.0.1" + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" }, "dependencies": { "buffer": { @@ -3891,8 +3756,8 @@ "integrity": "sha512-xXvjQhVNz50v2nPeoOsNqWCLGfiv4ji/gXZM28jnVwdLJxH4mFyqgqCKfaK9zf1KUbG6zTkjLOy7ou+jSMarGA==", "dev": true, "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.12" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } } } @@ -3903,7 +3768,7 @@ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "1.0.6" + "pako": "~1.0.5" } }, "cached-path-relative": { @@ -3918,9 +3783,9 @@ "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", "dev": true, "requires": { - "acorn-node": "1.6.0", - "defined": "1.0.0", - "minimist": "1.2.0" + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" } }, "domain-browser": { @@ -3941,12 +3806,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "https-browserify": { @@ -3961,21 +3826,21 @@ "integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "browser-resolve": "1.11.3", - "cached-path-relative": "1.0.2", - "concat-stream": "1.6.2", - "defined": "1.0.0", - "detective": "5.1.0", - "duplexer2": "0.1.4", - "inherits": "2.0.3", - "parents": "1.0.1", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" } }, "os-browserify": { @@ -3996,7 +3861,7 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "vm-browserify": { @@ -4013,8 +3878,8 @@ "integrity": "sha1-YVCYYwhOhx1+ht5IwBUlntl3Rb0=", "dev": true, "requires": { - "chalk": "1.1.3", - "source-map": "0.5.7" + "chalk": "^1.0.0", + "source-map": "^0.5.3" }, "dependencies": { "ansi-styles": { @@ -4029,11 +3894,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -4050,10 +3915,10 @@ "integrity": "sha1-wV97Ef1BMgPU4MkTf10/r1Wo34A=", "dev": true, "requires": { - "chalk": "1.1.3", - "maxmin": "1.1.0", - "uglify-es": "3.3.9", - "uri-path": "1.0.0" + "chalk": "^1.0.0", + "maxmin": "^1.1.0", + "uglify-es": "~3.3.0", + "uri-path": "^1.0.0" }, "dependencies": { "ansi-styles": { @@ -4068,11 +3933,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -4089,10 +3954,10 @@ "integrity": "sha512-yGweN+0DW5yM+oo58fRu/XIRrPcn3r4tQx+nL7eMRwjpvk+rQY6R8o94BPK0i2UhTg9FN21hS+m8vR8v9vXfeg==", "dev": true, "requires": { - "async": "2.6.1", - "gaze": "1.1.3", - "lodash": "4.17.11", - "tiny-lr": "1.1.1" + "async": "^2.6.0", + "gaze": "^1.1.0", + "lodash": "^4.17.10", + "tiny-lr": "^1.1.1" }, "dependencies": { "async": { @@ -4101,7 +3966,7 @@ "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", "dev": true, "requires": { - "lodash": "4.17.11" + "lodash": "^4.17.10" } } } @@ -4118,10 +3983,10 @@ "integrity": "sha512-1m3+5QvDYfR1ltr8hjiaiNjddxGdQWcH0rw1iKKiQnF0+xtgTazirSTGu68RchPyh1OBng1bBUjLmX8q9NpoCw==", "dev": true, "requires": { - "colors": "1.1.2", - "grunt-legacy-log-utils": "2.0.1", - "hooker": "0.2.3", - "lodash": "4.17.11" + "colors": "~1.1.2", + "grunt-legacy-log-utils": "~2.0.0", + "hooker": "~0.2.3", + "lodash": "~4.17.5" } }, "grunt-legacy-log-utils": { @@ -4130,8 +3995,8 @@ "integrity": "sha512-o7uHyO/J+i2tXG8r2bZNlVk20vlIFJ9IEYyHMCQGfWYru8Jv3wTqKZzvV30YW9rWEjq0eP3cflQ1qWojIe9VFA==", "dev": true, "requires": { - "chalk": "2.4.1", - "lodash": "4.17.11" + "chalk": "~2.4.1", + "lodash": "~4.17.10" } }, "grunt-legacy-util": { @@ -4140,13 +4005,13 @@ "integrity": "sha512-9zyA29w/fBe6BIfjGENndwoe1Uy31BIXxTH3s8mga0Z5Bz2Sp4UCjkeyv2tI449ymkx3x26B+46FV4fXEddl5A==", "dev": true, "requires": { - "async": "1.5.2", - "exit": "0.1.2", - "getobject": "0.1.0", - "hooker": "0.2.3", - "lodash": "4.17.11", - "underscore.string": "3.3.5", - "which": "1.3.1" + "async": "~1.5.2", + "exit": "~0.1.1", + "getobject": "~0.1.0", + "hooker": "~0.2.3", + "lodash": "~4.17.10", + "underscore.string": "~3.3.4", + "which": "~1.3.0" } }, "gzip-size": { @@ -4155,8 +4020,8 @@ "integrity": "sha1-Zs+LEBBHInuVus5uodoMF37Vwi8=", "dev": true, "requires": { - "browserify-zlib": "0.1.4", - "concat-stream": "1.6.2" + "browserify-zlib": "^0.1.4", + "concat-stream": "^1.4.1" } }, "har-schema": { @@ -4169,8 +4034,8 @@ "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", "requires": { - "ajv": "5.5.2", - "har-schema": "2.0.0" + "ajv": "^5.3.0", + "har-schema": "^2.0.0" } }, "has": { @@ -4178,7 +4043,7 @@ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, "has-ansi": { @@ -4187,7 +4052,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-binary2": { @@ -4224,20 +4089,15 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" - }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" } }, "has-values": { @@ -4246,8 +4106,8 @@ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -4256,7 +4116,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4267,8 +4127,8 @@ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "hash.js": { @@ -4277,8 +4137,8 @@ "integrity": "sha512-eWI5HG9Np+eHV1KQhisXWwM+4EPPYe5dFX1UZZH7k/E3JzDEazVH+VGlZi6R94ZqImq+A3D1mCEtrFIfg/E7sA==", "dev": true, "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" } }, "he": { @@ -4293,9 +4153,9 @@ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "1.1.5", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "home-path": { @@ -4310,7 +4170,7 @@ "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", "dev": true, "requires": { - "parse-passwd": "1.0.0" + "parse-passwd": "^1.0.0" } }, "hooker": { @@ -4330,7 +4190,7 @@ "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", "requires": { - "whatwg-encoding": "1.0.5" + "whatwg-encoding": "^1.0.1" } }, "html-inject-script": { @@ -4339,7 +4199,7 @@ "integrity": "sha1-GnwQoPy9MJ6Fv1PZpe0kt0xeMnU=", "dev": true, "requires": { - "trumpet": "1.7.2" + "trumpet": "^1.7.1" } }, "html-select": { @@ -4348,14 +4208,14 @@ "integrity": "sha1-Rq1tcS5zLPMcZznV0BEKX6vxdYU=", "dev": true, "requires": { - "cssauron": "1.4.0", - "duplexer2": "0.0.2", - "inherits": "2.0.3", - "minimist": "0.0.10", - "readable-stream": "1.1.14", - "split": "0.3.3", - "stream-splicer": "1.3.2", - "through2": "1.1.1" + "cssauron": "^1.1.0", + "duplexer2": "~0.0.2", + "inherits": "^2.0.1", + "minimist": "~0.0.8", + "readable-stream": "^1.0.27-1", + "split": "~0.3.0", + "stream-splicer": "^1.2.0", + "through2": "^1.0.0" }, "dependencies": { "duplexer2": { @@ -4364,12 +4224,12 @@ "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", "dev": true, "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.9" } }, "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -4379,10 +4239,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "split": { @@ -4391,7 +4251,7 @@ "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", "dev": true, "requires": { - "through": "2.3.8" + "through": "2" } }, "stream-splicer": { @@ -4401,11 +4261,11 @@ "dev": true, "requires": { "indexof": "0.0.1", - "inherits": "2.0.3", - "isarray": "0.0.1", - "readable-stream": "1.1.14", - "readable-wrap": "1.0.0", - "through2": "1.1.1" + "inherits": "^2.0.1", + "isarray": "~0.0.1", + "readable-stream": "^1.1.13-1", + "readable-wrap": "^1.0.0", + "through2": "^1.0.0" } }, "through2": { @@ -4414,8 +4274,8 @@ "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", "dev": true, "requires": { - "readable-stream": "1.1.14", - "xtend": "4.0.1" + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } } } @@ -4426,15 +4286,15 @@ "integrity": "sha1-flupnstR75Buyaf83ubKMmfHiX4=", "dev": true, "requires": { - "inherits": "2.0.3", - "minimist": "0.0.10", - "readable-stream": "1.0.34", - "through2": "0.4.2" + "inherits": "~2.0.1", + "minimist": "~0.0.8", + "readable-stream": "~1.0.27-1", + "through2": "~0.4.1" }, "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true }, @@ -4450,10 +4310,10 @@ "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "through2": { @@ -4462,8 +4322,8 @@ "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=", "dev": true, "requires": { - "readable-stream": "1.0.34", - "xtend": "2.1.2" + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" } }, "xtend": { @@ -4472,7 +4332,7 @@ "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "dev": true, "requires": { - "object-keys": "0.4.0" + "object-keys": "~0.4.0" } } } @@ -4489,10 +4349,10 @@ "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", "dev": true, "requires": { - "depd": "1.1.2", + "depd": "~1.1.2", "inherits": "2.0.3", "setprototypeof": "1.1.0", - "statuses": "1.5.0" + "statuses": ">= 1.4.0 < 2" }, "dependencies": { "statuses": { @@ -4515,8 +4375,8 @@ "integrity": "sha1-ZC/cr/5S00SNK9o7AHnpQJBk2jE=", "dev": true, "requires": { - "eventemitter3": "1.2.0", - "requires-port": "1.0.0" + "eventemitter3": "1.x.x", + "requires-port": "1.x.x" } }, "http-signature": { @@ -4524,9 +4384,9 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "requires": { - "assert-plus": "1.0.0", - "jsprim": "1.4.1", - "sshpk": "1.15.1" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, "https-browserify": { @@ -4540,7 +4400,7 @@ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "ieee754": { @@ -4548,21 +4408,13 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" }, - "ignore-walk": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", - "requires": { - "minimatch": "3.0.4" - } - }, "image-filter-core": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/image-filter-core/-/image-filter-core-2.0.2.tgz", "integrity": "sha1-G5lMm540R2Uw3pyoRQ6F+HqBvRA=", "dev": true, "requires": { - "es6-promise": "4.2.5" + "es6-promise": "^4.0.5" } }, "image-filter-threshold": { @@ -4571,7 +4423,7 @@ "integrity": "sha1-RxTd2a+tUHyygjmzRiNuLCpvu0w=", "dev": true, "requires": { - "image-filter-core": "2.0.2" + "image-filter-core": "^2.0.0" }, "dependencies": { "image-filter-core": { @@ -4580,7 +4432,7 @@ "integrity": "sha1-G5lMm540R2Uw3pyoRQ6F+HqBvRA=", "dev": true, "requires": { - "es6-promise": "4.2.5" + "es6-promise": "^4.0.5" } } } @@ -4595,7 +4447,7 @@ "resolved": "https://registry.npmjs.org/imagejs/-/imagejs-0.0.9.tgz", "integrity": "sha1-JoBkWQD211+/D2e7wAY+aIiufr4=", "requires": { - "bluebird": "3.5.3", + "bluebird": "*", "jpeg-js": "0.1.1", "node-png": "0.4.3", "underscore": "1.4.4" @@ -4609,7 +4461,8 @@ } }, "imgareaselect": { - "version": "git://github.com/jywarren/imgareaselect.git#db8ae869ca0fcb289252678cebd17d6f40711f61" + "version": "git://github.com/jywarren/imgareaselect.git#db8ae869ca0fcb289252678cebd17d6f40711f61", + "from": "git://github.com/jywarren/imgareaselect.git#v1.0.0-rc.2" }, "immutable": { "version": "3.8.2", @@ -4623,7 +4476,7 @@ "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", "dev": true, "requires": { - "repeating": "2.0.1" + "repeating": "^2.0.0" } }, "indexof": { @@ -4636,9 +4489,10 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -4649,7 +4503,8 @@ "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true }, "inline-source-map": { "version": "0.6.2", @@ -4657,7 +4512,7 @@ "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "~0.5.3" } }, "insert-module-globals": { @@ -4666,16 +4521,16 @@ "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "acorn-node": "1.6.0", - "combine-source-map": "0.8.0", - "concat-stream": "1.6.2", - "is-buffer": "1.1.6", - "path-is-absolute": "1.0.1", - "process": "0.11.10", - "through2": "2.0.3", - "undeclared-identifiers": "1.1.2", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" } }, "invert-kv": { @@ -4695,7 +4550,7 @@ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-arrayish": { @@ -4710,7 +4565,7 @@ "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "dev": true, "requires": { - "binary-extensions": "1.12.0" + "binary-extensions": "^1.0.0" } }, "is-buffer": { @@ -4724,7 +4579,7 @@ "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", "dev": true, "requires": { - "builtin-modules": "1.1.1" + "builtin-modules": "^1.0.0" } }, "is-callable": { @@ -4739,7 +4594,7 @@ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-date-object": { @@ -4754,9 +4609,9 @@ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -4779,7 +4634,7 @@ "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", "dev": true, "requires": { - "is-primitive": "2.0.0" + "is-primitive": "^2.0.0" } }, "is-extendable": { @@ -4800,7 +4655,7 @@ "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-fullwidth-code-point": { @@ -4808,7 +4663,7 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "is-glob": { @@ -4817,7 +4672,7 @@ "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.1" } }, "is-number": { @@ -4826,7 +4681,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "is-number-like": { @@ -4835,7 +4690,7 @@ "integrity": "sha512-6rZi3ezCyFcn5L71ywzz2bS5b2Igl1En3eTlZlvKjpz1n3IZLAYMbKYAIQgFmEu0GENg92ziU/faEOA/aixjbA==", "dev": true, "requires": { - "lodash.isfinite": "3.3.2" + "lodash.isfinite": "^3.3.2" } }, "is-plain-object": { @@ -4844,7 +4699,7 @@ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "is-posix-bracket": { @@ -4868,6 +4723,11 @@ "has": "^1.0.1" } }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, "is-symbol": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", @@ -4958,8 +4818,8 @@ "integrity": "sha1-A3fDgBfKvHMisNH7zSWkkWQfL74=", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "2.7.3" + "argparse": "^1.0.2", + "esprima": "^2.6.0" }, "dependencies": { "esprima": { @@ -4980,32 +4840,32 @@ "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-13.2.0.tgz", "integrity": "sha512-cG1NtMWO9hWpqRNRR3dSvEQa8bFI6iLlqU2x4kwX51FQjp0qus8T9aBaAO6iGp3DeBrhdwuKxckknohkmfvsFw==", "requires": { - "abab": "2.0.0", - "acorn": "6.1.0", - "acorn-globals": "4.3.0", - "array-equal": "1.0.0", - "cssom": "0.3.6", - "cssstyle": "1.1.1", - "data-urls": "1.1.0", - "domexception": "1.0.1", - "escodegen": "1.11.0", - "html-encoding-sniffer": "1.0.2", - "nwsapi": "2.1.0", + "abab": "^2.0.0", + "acorn": "^6.0.4", + "acorn-globals": "^4.3.0", + "array-equal": "^1.0.0", + "cssom": "^0.3.4", + "cssstyle": "^1.1.1", + "data-urls": "^1.1.0", + "domexception": "^1.0.1", + "escodegen": "^1.11.0", + "html-encoding-sniffer": "^1.0.2", + "nwsapi": "^2.0.9", "parse5": "5.1.0", - "pn": "1.1.0", - "request": "2.88.0", - "request-promise-native": "1.0.5", - "saxes": "3.1.6", - "symbol-tree": "3.2.2", - "tough-cookie": "2.5.0", - "w3c-hr-time": "1.0.1", - "w3c-xmlserializer": "1.0.1", - "webidl-conversions": "4.0.2", - "whatwg-encoding": "1.0.5", - "whatwg-mimetype": "2.3.0", - "whatwg-url": "7.0.0", - "ws": "6.1.3", - "xml-name-validator": "3.0.0" + "pn": "^1.1.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.5", + "saxes": "^3.1.5", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.5.0", + "w3c-hr-time": "^1.0.1", + "w3c-xmlserializer": "^1.0.1", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^7.0.0", + "ws": "^6.1.2", + "xml-name-validator": "^3.0.0" }, "dependencies": { "acorn": { @@ -5023,8 +4883,8 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "requires": { - "psl": "1.1.29", - "punycode": "2.1.1" + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "ws": { @@ -5032,7 +4892,7 @@ "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.3.tgz", "integrity": "sha512-tbSxiT+qJI223AP4iLfQbkbxkwdFcneYinM2+x46Gx2wgvbaOMO36czfdfVUBRTHvzAMRhDd98sA5d/BuWbQdg==", "requires": { - "async-limiter": "1.0.0" + "async-limiter": "~1.0.0" } } } @@ -5053,7 +4913,7 @@ "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", "dev": true, "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "json-stringify-safe": { @@ -5067,7 +4927,7 @@ "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" } }, "jsonify": { @@ -5103,7 +4963,7 @@ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } }, "klaw": { @@ -5112,7 +4972,7 @@ "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.9" } }, "labeled-stream-splicer": { @@ -5121,9 +4981,9 @@ "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", "dev": true, "requires": { - "inherits": "2.0.3", - "isarray": "2.0.4", - "stream-splicer": "2.0.0" + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" }, "dependencies": { "isarray": { @@ -5145,7 +5005,7 @@ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "levn": { @@ -5153,8 +5013,8 @@ "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "limiter": { @@ -5175,11 +5035,11 @@ "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "parse-json": "2.2.0", - "pify": "2.3.0", - "pinkie-promise": "2.0.1", - "strip-bom": "2.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0", + "strip-bom": "^2.0.0" } }, "localtunnel": { @@ -5215,23 +5075,39 @@ "integrity": "sha1-eC7CHvQDNF+DCoCMo9UTr1YGUgg=", "dev": true, "requires": { - "camelcase": "3.0.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.3", - "os-locale": "1.4.0", - "read-pkg-up": "1.0.1", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "1.0.2", - "which-module": "1.0.0", - "y18n": "3.2.1", - "yargs-parser": "4.2.1" + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.2.0" } } } }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + } + } + }, "lodash": { "version": "4.17.11", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", @@ -5279,11 +5155,11 @@ "integrity": "sha512-a/BdaF+Q7mqpJZ5Xz1VM9Nb+LnDu8l1A+2ZKEoaqmb9B+nlap1dKeUG8YeVUkQh4pnqsAs6mcSDUp35wkvxozw==", "dev": true, "requires": { - "color-diff": "1.1.0", - "concat-stream": "1.6.2", - "lodash": "4.17.11", - "parse-color": "1.0.0", - "pngjs": "3.3.3" + "color-diff": "^1.1.0", + "concat-stream": "^1.6.2", + "lodash": "^4.17.3", + "parse-color": "^1.0.0", + "pngjs": "^3.3.3" } }, "loud-rejection": { @@ -5292,16 +5168,24 @@ "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", "dev": true, "requires": { - "currently-unhandled": "0.4.1", - "signal-exit": "3.0.2" + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" } }, "magic-string": { "version": "0.22.5", - "resolved": "http://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", "requires": { - "vlq": "0.2.3" + "vlq": "^0.2.2" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "requires": { + "p-defer": "^1.0.0" } }, "map-cache": { @@ -5322,7 +5206,7 @@ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "matchdep": { @@ -5331,9 +5215,9 @@ "integrity": "sha1-xvNINKDY28OzfCfui7yyfHd1WC4=", "dev": true, "requires": { - "findup-sync": "2.0.0", - "micromatch": "3.1.10", - "resolve": "1.8.1", + "findup-sync": "^2.0.0", + "micromatch": "^3.0.4", + "resolve": "^1.4.0", "stack-trace": "0.0.10" }, "dependencies": { @@ -5343,10 +5227,10 @@ "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "dev": true, "requires": { - "detect-file": "1.0.0", - "is-glob": "3.1.0", - "micromatch": "3.1.10", - "resolve-dir": "1.0.1" + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, "is-glob": { @@ -5355,7 +5239,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.0" } }, "kind-of": { @@ -5370,19 +5254,19 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } } } @@ -5399,10 +5283,10 @@ "integrity": "sha1-cTZehKmd2Piz99X94vANHn9zvmE=", "dev": true, "requires": { - "chalk": "1.1.3", - "figures": "1.7.0", - "gzip-size": "1.0.0", - "pretty-bytes": "1.0.4" + "chalk": "^1.0.0", + "figures": "^1.0.1", + "gzip-size": "^1.0.0", + "pretty-bytes": "^1.0.0" }, "dependencies": { "ansi-styles": { @@ -5417,11 +5301,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -5438,9 +5322,19 @@ "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mem": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", + "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^2.0.0" } }, "meow": { @@ -5449,16 +5343,16 @@ "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", "dev": true, "requires": { - "camelcase-keys": "2.1.0", - "decamelize": "1.2.0", - "loud-rejection": "1.6.0", - "map-obj": "1.0.1", - "minimist": "1.2.0", - "normalize-package-data": "2.4.0", - "object-assign": "4.1.1", - "read-pkg-up": "1.0.1", - "redent": "1.0.0", - "trim-newlines": "1.0.0" + "camelcase-keys": "^2.0.0", + "decamelize": "^1.1.2", + "loud-rejection": "^1.0.0", + "map-obj": "^1.0.1", + "minimist": "^1.1.3", + "normalize-package-data": "^2.3.4", + "object-assign": "^4.0.1", + "read-pkg-up": "^1.0.1", + "redent": "^1.0.0", + "trim-newlines": "^1.0.0" } }, "merge-source-map": { @@ -5466,7 +5360,7 @@ "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz", "integrity": "sha1-pd5GU42uhNQRTMXqArR3KmNGcB8=", "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } }, "micromatch": { @@ -5475,19 +5369,19 @@ "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", "dev": true, "requires": { - "arr-diff": "2.0.0", - "array-unique": "0.2.1", - "braces": "1.8.5", - "expand-brackets": "0.1.5", - "extglob": "0.3.2", - "filename-regex": "2.0.1", - "is-extglob": "1.0.0", - "is-glob": "2.0.1", - "kind-of": "3.2.2", - "normalize-path": "2.1.1", - "object.omit": "2.0.1", - "parse-glob": "3.0.4", - "regex-cache": "0.4.4" + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" }, "dependencies": { "arr-diff": { @@ -5496,7 +5390,7 @@ "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", "dev": true, "requires": { - "arr-flatten": "1.1.0" + "arr-flatten": "^1.0.1" } }, "array-unique": { @@ -5511,9 +5405,9 @@ "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", "dev": true, "requires": { - "expand-range": "1.8.2", - "preserve": "0.2.0", - "repeat-element": "1.1.3" + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" } }, "expand-brackets": { @@ -5522,7 +5416,7 @@ "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", "dev": true, "requires": { - "is-posix-bracket": "0.1.1" + "is-posix-bracket": "^0.1.0" } }, "extglob": { @@ -5531,7 +5425,7 @@ "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "is-extglob": { @@ -5546,7 +5440,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -5557,8 +5451,8 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, "mime": { @@ -5576,7 +5470,7 @@ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", "requires": { - "mime-db": "1.36.0" + "mime-db": "~1.36.0" } }, "mimic-fn": { @@ -5584,11 +5478,6 @@ "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" - }, "minimalistic-assert": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", @@ -5605,32 +5494,16 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" }, - "minipass": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", - "requires": { - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - }, - "minizlib": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", - "requires": { - "minipass": "2.3.5" - } - }, "mitt": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/mitt/-/mitt-1.1.3.tgz", @@ -5643,8 +5516,8 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -5653,7 +5526,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -5662,14 +5535,16 @@ "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, "requires": { "minimist": "0.0.8" }, "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true } } }, @@ -5679,21 +5554,21 @@ "integrity": "sha512-hKPmO06so6bL/ZvqVNVqdTVO8UAYsi3tQWlCa+z9KuWhoN4KDQtb5hcqQQv58qYiDE21wIvnttZEPiDgEbpwbA==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "browser-resolve": "1.11.3", - "cached-path-relative": "1.0.2", - "concat-stream": "1.6.2", - "defined": "1.0.0", - "detective": "5.1.0", - "duplexer2": "0.1.4", - "inherits": "2.0.3", - "parents": "1.0.1", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" }, "dependencies": { "cached-path-relative": { @@ -5713,12 +5588,15 @@ "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true }, "nan": { "version": "2.11.1", "resolved": "https://registry.npmjs.org/nan/-/nan-2.11.1.tgz", - "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==" + "integrity": "sha512-iji6k87OSXa0CcrLl9z+ZiYSuR2o+c0bGuNmXdrhTQTakxytAFsC56SArGYoiHlJlFoHSnvmhpceZJaXkVuOtA==", + "dev": true, + "optional": true }, "nanomatch": { "version": "1.2.13", @@ -5726,17 +5604,17 @@ "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "kind-of": { @@ -5747,18 +5625,13 @@ } } }, - "napi-build-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.1.tgz", - "integrity": "sha512-boQj1WFgQH3v4clhu3mTNfP+vOBxorDlE8EKiMjUlLG3C4qAESnn9AxIOkFgTR2c9LtzNjPrjS60cT27ZKBhaA==" - }, "ndarray": { "version": "1.0.18", "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.18.tgz", "integrity": "sha1-tg06cyJOxVXQ+qeXEeUCRI/T95M=", "requires": { - "iota-array": "1.0.0", - "is-buffer": "1.1.6" + "iota-array": "^1.0.0", + "is-buffer": "^1.0.2" } }, "ndarray-fft": { @@ -5766,11 +5639,11 @@ "resolved": "https://registry.npmjs.org/ndarray-fft/-/ndarray-fft-1.0.3.tgz", "integrity": "sha1-3Fu6GOOrgsmXrbrrt455+CyToio=", "requires": { - "bit-twiddle": "1.0.2", - "cwise": "1.0.10", - "ndarray": "1.0.18", - "ndarray-ops": "1.2.2", - "typedarray-pool": "1.1.0" + "bit-twiddle": "^1.0.2", + "cwise": "^1.0.4", + "ndarray": "^1.0.15", + "ndarray-ops": "^1.2.2", + "typedarray-pool": "^1.0.0" } }, "ndarray-gaussian-filter": { @@ -5778,13 +5651,13 @@ "resolved": "https://registry.npmjs.org/ndarray-gaussian-filter/-/ndarray-gaussian-filter-1.0.0.tgz", "integrity": "sha1-tSHY+AQK9w5OXCRKPH8Gy7NYAk4=", "requires": { - "cwise": "1.0.10", - "dup": "1.0.0", - "ndarray": "1.0.18", - "ndarray-fft": "1.0.3", - "ndarray-ops": "1.2.2", - "next-pow-2": "1.0.0", - "typedarray-pool": "1.1.0" + "cwise": "^1.0.7", + "dup": "^1.0.0", + "ndarray": "^1.0.18", + "ndarray-fft": "^1.0.0", + "ndarray-ops": "^1.2.2", + "next-pow-2": "^1.0.0", + "typedarray-pool": "^1.1.0" } }, "ndarray-ops": { @@ -5792,7 +5665,7 @@ "resolved": "https://registry.npmjs.org/ndarray-ops/-/ndarray-ops-1.2.2.tgz", "integrity": "sha1-WeiNLDKn7ryxvGkPrhQVeVV6YU4=", "requires": { - "cwise-compiler": "1.1.3" + "cwise-compiler": "^1.0.0" } }, "ndarray-pack": { @@ -5800,33 +5673,8 @@ "resolved": "https://registry.npmjs.org/ndarray-pack/-/ndarray-pack-1.2.1.tgz", "integrity": "sha1-jK6+qqJNXs9w/4YCBjeXfajuWFo=", "requires": { - "cwise-compiler": "1.1.3", - "ndarray": "1.0.18" - } - }, - "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", - "requires": { - "debug": "2.6.9", - "iconv-lite": "0.4.24", - "sax": "1.2.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" - } + "cwise-compiler": "^1.1.2", + "ndarray": "^1.0.13" } }, "negotiator": { @@ -5845,116 +5693,28 @@ "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, - "node-abi": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.7.0.tgz", - "integrity": "sha512-egTtvNoZLMjwxkL/5iiJKYKZgn2im0zP+G+PncMxICYGiD3aZtXUvEsDmu0pF8gpASvLZyD8v53qi1/ELaRZpg==", - "requires": { - "semver": "5.6.0" - } + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "node-bitmap": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/node-bitmap/-/node-bitmap-0.0.1.tgz", "integrity": "sha1-GA6scAPgxwdhjvMTaPYvhLKmkJE=" }, - "node-gyp": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", - "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", - "requires": { - "fstream": "1.0.11", - "glob": "7.1.3", - "graceful-fs": "4.1.11", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "npmlog": "4.1.2", - "osenv": "0.1.5", - "request": "2.88.0", - "rimraf": "2.6.2", - "semver": "5.3.0", - "tar": "2.2.1", - "which": "1.3.1" - }, - "dependencies": { - "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - }, - "semver": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", - "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=" - } - } - }, "node-png": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/node-png/-/node-png-0.4.3.tgz", "integrity": "sha1-RQIjeWuC08yg/+Sl1cf6l0hZdOc=" }, - "node-pre-gyp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", - "requires": { - "detect-libc": "1.0.3", - "mkdirp": "0.5.1", - "needle": "2.2.4", - "nopt": "4.0.1", - "npm-packlist": "1.3.0", - "npmlog": "4.1.2", - "rc": "1.2.8", - "rimraf": "2.6.2", - "semver": "5.6.0", - "tar": "4.4.8" - }, - "dependencies": { - "nopt": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", - "requires": { - "abbrev": "1.1.1", - "osenv": "0.1.5" - } - }, - "tar": { - "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", - "requires": { - "chownr": "1.1.1", - "fs-minipass": "1.2.5", - "minipass": "2.3.5", - "minizlib": "1.2.1", - "mkdirp": "0.5.1", - "safe-buffer": "5.1.2", - "yallist": "3.0.3" - } - } - } - }, - "noop-logger": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", - "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=" - }, "nopt": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "dev": true, "requires": { - "abbrev": "1.1.1" + "abbrev": "1" } }, "normalize-package-data": { @@ -5963,10 +5723,10 @@ "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "is-builtin-module": "1.0.0", - "semver": "5.6.0", - "validate-npm-package-license": "3.0.4" + "hosted-git-info": "^2.1.4", + "is-builtin-module": "^1.0.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "normalize-path": { @@ -5975,32 +5735,15 @@ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, - "npm-bundled": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", - "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==" - }, - "npm-packlist": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.3.0.tgz", - "integrity": "sha512-qPBc6CnxEzpOcc4bjoIBJbYdy0D/LFFPUdxvfwor4/w3vxeE0h6TiOVurCEPpQ6trjN77u/ShyfeJGsbAfB3dA==", + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { - "ignore-walk": "3.0.1", - "npm-bundled": "1.0.6" - } - }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "requires": { - "are-we-there-yet": "1.1.5", - "console-control-strings": "1.1.0", - "gauge": "2.7.4", - "set-blocking": "2.0.0" + "path-key": "^2.0.0" } }, "nugget": { @@ -6009,12 +5752,12 @@ "integrity": "sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA=", "dev": true, "requires": { - "debug": "2.6.9", - "minimist": "1.2.0", - "pretty-bytes": "1.0.4", - "progress-stream": "1.2.0", - "request": "2.88.0", - "single-line-log": "1.1.2", + "debug": "^2.1.3", + "minimist": "^1.1.0", + "pretty-bytes": "^1.0.2", + "progress-stream": "^1.1.0", + "request": "^2.45.0", + "single-line-log": "^1.1.2", "throttleit": "0.0.2" }, "dependencies": { @@ -6047,7 +5790,8 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true }, "object-component": { "version": "0.0.3", @@ -6061,9 +5805,9 @@ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -6072,7 +5816,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -6100,7 +5844,7 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" } }, "object.omit": { @@ -6109,8 +5853,8 @@ "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", "dev": true, "requires": { - "for-own": "0.1.5", - "is-extendable": "0.1.1" + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" } }, "object.pick": { @@ -6119,7 +5863,7 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "omggif": { @@ -6141,7 +5885,7 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -6164,7 +5908,7 @@ "integrity": "sha512-bYJHo/LOmoTd+pfiYhfZDnf9zekVJrY+cnS2a5F2x+w5ppvTqObojTP7WiFG+kVZs9Inw+qQ/lw7TroWwhdd2g==", "dev": true, "requires": { - "is-wsl": "1.1.0" + "is-wsl": "^1.1.0" } }, "optimist": { @@ -6173,13 +5917,13 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "minimist": { "version": "0.0.10", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", "dev": true } @@ -6190,12 +5934,12 @@ "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" }, "dependencies": { "wordwrap": { @@ -6255,32 +5999,13 @@ "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", "dev": true }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" - }, "os-locale": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", "dev": true, "requires": { - "lcid": "1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "requires": { - "os-homedir": "1.0.2", - "os-tmpdir": "1.0.2" + "lcid": "^1.0.0" } }, "outpipe": { @@ -6289,15 +6014,51 @@ "integrity": "sha1-UM+GFjZeh+Ax4ppeyTOaPaRyX6I=", "dev": true, "requires": { - "shell-quote": "1.6.1" + "shell-quote": "^1.4.2" } }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-is-promise": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", + "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" + }, + "p-limit": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", + "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", + "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" + }, "pace": { "version": "0.0.4", "resolved": "https://registry.npmjs.org/pace/-/pace-0.0.4.tgz", "integrity": "sha1-1mQF1fW8EtJUQabibIeNvGnnenc=", "requires": { - "charm": "0.1.2" + "charm": "~0.1.0" } }, "pako": { @@ -6312,7 +6073,7 @@ "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "dev": true, "requires": { - "path-platform": "0.11.15" + "path-platform": "~0.11.15" } }, "parse-asn1": { @@ -6321,11 +6082,11 @@ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.2.0", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.17" + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" } }, "parse-color": { @@ -6334,7 +6095,7 @@ "integrity": "sha1-e3SLlag/A/FqlPU15S1/PZRlhhk=", "dev": true, "requires": { - "color-convert": "0.5.3" + "color-convert": "~0.5.0" }, "dependencies": { "color-convert": { @@ -6366,10 +6127,10 @@ "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", "dev": true, "requires": { - "glob-base": "0.3.0", - "is-dotfile": "1.0.3", - "is-extglob": "1.0.0", - "is-glob": "2.0.1" + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" }, "dependencies": { "is-extglob": { @@ -6384,7 +6145,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } } } @@ -6395,7 +6156,7 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.2" + "error-ex": "^1.2.0" } }, "parse-ms": { @@ -6421,7 +6182,7 @@ "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", "dev": true, "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseuri": { @@ -6430,7 +6191,7 @@ "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", "dev": true, "requires": { - "better-assert": "1.0.2" + "better-assert": "~1.0.0" } }, "parseurl": { @@ -6463,13 +6224,19 @@ "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", "dev": true, "requires": { - "pinkie-promise": "2.0.1" + "pinkie-promise": "^2.0.0" } }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "path-parse": { "version": "1.0.6", @@ -6488,9 +6255,9 @@ "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "graceful-fs": "^4.1.2", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" } }, "pbkdf2": { @@ -6499,11 +6266,11 @@ "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", "dev": true, "requires": { - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "pend": { @@ -6523,7 +6290,7 @@ "integrity": "sha1-VlD0ICjAnoRrxGO4K/TK/EOjuis=", "dev": true, "requires": { - "stream-read": "1.1.2" + "stream-read": "^1.1.2" } }, "pify": { @@ -6544,7 +6311,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "plist": { @@ -6553,7 +6320,7 @@ "integrity": "sha1-86PeB4hddz5m2KlngvG+wozystA=", "dev": true, "requires": { - "sax": "0.1.5" + "sax": "0.1.x" } }, "plur": { @@ -6584,7 +6351,7 @@ "dev": true, "requires": { "async": "1.5.2", - "is-number-like": "1.0.8" + "is-number-like": "^1.0.3" } }, "posix-character-classes": { @@ -6593,29 +6360,6 @@ "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", "dev": true }, - "prebuild-install": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.2.4.tgz", - "integrity": "sha512-CG3JnpTZXdmr92GW4zbcba4jkDha6uHraJ7hW4Fn8j0mExxwOKK20hqho8ZuBDCKYCHYIkFM1P2jhtG+KpP4fg==", - "requires": { - "detect-libc": "1.0.3", - "expand-template": "2.0.3", - "github-from-package": "0.0.0", - "minimist": "1.2.0", - "mkdirp": "0.5.1", - "napi-build-utils": "1.0.1", - "node-abi": "2.7.0", - "noop-logger": "0.1.1", - "npmlog": "4.1.2", - "os-homedir": "1.0.2", - "pump": "2.0.1", - "rc": "1.2.8", - "simple-get": "2.8.1", - "tar-fs": "1.16.3", - "tunnel-agent": "0.6.0", - "which-pm-runs": "1.0.0" - } - }, "prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", @@ -6633,8 +6377,8 @@ "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", "dev": true, "requires": { - "get-stdin": "4.0.1", - "meow": "3.7.0" + "get-stdin": "^4.0.1", + "meow": "^3.1.0" } }, "pretty-ms": { @@ -6643,9 +6387,9 @@ "integrity": "sha1-QlfCVt8/sLRR1q/6qwIYhBJpgdw=", "dev": true, "requires": { - "is-finite": "1.0.2", - "parse-ms": "1.0.1", - "plur": "1.0.0" + "is-finite": "^1.0.1", + "parse-ms": "^1.0.0", + "plur": "^1.0.0" } }, "process": { @@ -6666,8 +6410,8 @@ "integrity": "sha1-LNPP6jO6OonJwSHsM0er6asSX3c=", "dev": true, "requires": { - "speedometer": "0.1.4", - "through2": "0.2.3" + "speedometer": "~0.1.2", + "through2": "~0.2.3" }, "dependencies": { "object-keys": { @@ -6682,10 +6426,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "through2": { @@ -6694,8 +6438,8 @@ "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", "dev": true, "requires": { - "readable-stream": "1.1.14", - "xtend": "2.1.2" + "readable-stream": "~1.1.9", + "xtend": "~2.1.1" } }, "xtend": { @@ -6704,7 +6448,7 @@ "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "dev": true, "requires": { - "object-keys": "0.4.0" + "object-keys": "~0.4.0" } } } @@ -6720,21 +6464,12 @@ "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", "dev": true, "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "parse-asn1": "5.1.1", - "randombytes": "2.0.6", - "safe-buffer": "5.1.2" - } - }, - "pump": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", - "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", - "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" } }, "punycode": { @@ -6742,6 +6477,131 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, + "qrcode": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.3.3.tgz", + "integrity": "sha512-SH7V13AcJusH3GT8bMNOGz4w0L+LjcpNOU/NiOgtBhT/5DoWeZE6D5ntMJnJ84AMkoaM4kjJJoHoh9g++8lWFg==", + "requires": { + "can-promise": "0.0.1", + "dijkstrajs": "^1.0.1", + "isarray": "^2.0.1", + "pngjs": "^3.3.0", + "yargs": "^12.0.5" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "camelcase": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", + "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "requires": { + "locate-path": "^3.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "isarray": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.4.tgz", + "integrity": "sha512-GMxXOiUirWg1xTKRipM0Ek07rX+ubx4nNVElTJdNLYmNO/2YrDkgJGw9CljXn+r4EWiDQg/8lsRdHyg2PJuUaA==" + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "requires": { + "invert-kv": "^2.0.0" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", @@ -6765,12 +6625,12 @@ "integrity": "sha1-zeKelMQJsW4Z3HCYuJtmWPlyHTs=", "requires": { "minimist": "0.0.8", - "through2": "0.4.2" + "through2": "~0.4.1" }, "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" }, "object-keys": { @@ -6783,10 +6643,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "through2": { @@ -6794,8 +6654,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=", "requires": { - "readable-stream": "1.0.34", - "xtend": "2.1.2" + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" } }, "xtend": { @@ -6803,7 +6663,7 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "requires": { - "object-keys": "0.4.0" + "object-keys": "~0.4.0" } } } @@ -6814,9 +6674,9 @@ "integrity": "sha512-KnGPVE0lo2WoXxIZ7cPR8YBpiol4gsSuOwDSg410oHh80ZMp5EiypNqL2K4Z77vJn6lB5rap7IkAmcUlalcnBQ==", "dev": true, "requires": { - "is-number": "4.0.0", - "kind-of": "6.0.2", - "math-random": "1.0.1" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "is-number": { @@ -6839,7 +6699,7 @@ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.1.0" } }, "randomfill": { @@ -6848,8 +6708,8 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.2" + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" } }, "range-parser": { @@ -6876,7 +6736,7 @@ "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } } } @@ -6885,11 +6745,12 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" } }, "re-emitter": { @@ -6904,7 +6765,7 @@ "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", "dev": true, "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } }, "read-pkg": { @@ -6913,9 +6774,9 @@ "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "load-json-file": "1.1.0", - "normalize-package-data": "2.4.0", - "path-type": "1.1.0" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, "read-pkg-up": { @@ -6924,8 +6785,8 @@ "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "find-up": "1.1.2", - "read-pkg": "1.1.0" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, "readable-stream": { @@ -6933,13 +6794,13 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, "dependencies": { "isarray": { @@ -6957,7 +6818,7 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } } } @@ -6968,7 +6829,7 @@ "integrity": "sha1-O1ohHGMeEjA6VJkcgGwX564ga/8=", "dev": true, "requires": { - "readable-stream": "1.1.14" + "readable-stream": "^1.1.13-1" }, "dependencies": { "readable-stream": { @@ -6977,10 +6838,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } } } @@ -6991,9 +6852,9 @@ "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "micromatch": "3.1.10", - "readable-stream": "2.3.6" + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" }, "dependencies": { "kind-of": { @@ -7008,19 +6869,19 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.13", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } } } @@ -7036,8 +6897,8 @@ "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", "dev": true, "requires": { - "indent-string": "2.1.0", - "strip-indent": "1.0.1" + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" } }, "regex-cache": { @@ -7046,7 +6907,7 @@ "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", "dev": true, "requires": { - "is-equal-shallow": "0.1.3" + "is-equal-shallow": "^0.1.3" } }, "regex-not": { @@ -7055,8 +6916,8 @@ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "remove-trailing-separator": { @@ -7082,7 +6943,7 @@ "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", "dev": true, "requires": { - "is-finite": "1.0.2" + "is-finite": "^1.0.0" } }, "request": { @@ -7090,26 +6951,26 @@ "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", "requires": { - "aws-sign2": "0.7.0", - "aws4": "1.8.0", - "caseless": "0.12.0", - "combined-stream": "1.0.7", - "extend": "3.0.2", - "forever-agent": "0.6.1", - "form-data": "2.3.2", - "har-validator": "5.1.0", - "http-signature": "1.2.0", - "is-typedarray": "1.0.0", - "isstream": "0.1.2", - "json-stringify-safe": "5.0.1", - "mime-types": "2.1.20", - "oauth-sign": "0.9.0", - "performance-now": "2.1.0", - "qs": "6.5.2", - "safe-buffer": "5.1.2", - "tough-cookie": "2.4.3", - "tunnel-agent": "0.6.0", - "uuid": "3.3.2" + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.0", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.4.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" } }, "request-promise-core": { @@ -7117,7 +6978,7 @@ "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", "requires": { - "lodash": "4.17.11" + "lodash": "^4.13.1" } }, "request-promise-native": { @@ -7126,21 +6987,19 @@ "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", "requires": { "request-promise-core": "1.1.1", - "stealthy-require": "1.1.1", - "tough-cookie": "2.4.3" + "stealthy-require": "^1.1.0", + "tough-cookie": ">=2.3.3" } }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "requires-port": { "version": "1.0.0", @@ -7153,7 +7012,7 @@ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "requires": { - "path-parse": "1.0.6" + "path-parse": "^1.0.5" } }, "resolve-dir": { @@ -7162,8 +7021,8 @@ "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "dev": true, "requires": { - "expand-tilde": "2.0.2", - "global-modules": "1.0.0" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, "resolve-url": { @@ -7178,8 +7037,8 @@ "integrity": "sha1-sSTeXE+6/LpUH0j/pzlw9KpFa08=", "dev": true, "requires": { - "debug": "2.6.9", - "minimatch": "3.0.4" + "debug": "^2.2.0", + "minimatch": "^3.0.2" }, "dependencies": { "debug": { @@ -7222,28 +7081,30 @@ "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, "requires": { - "glob": "7.1.3" + "glob": "^7.0.5" }, "dependencies": { "glob": { "version": "7.1.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -7254,8 +7115,8 @@ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, "rx": { @@ -7290,7 +7151,7 @@ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "safer-buffer": { @@ -7303,13 +7164,13 @@ "resolved": "https://registry.npmjs.org/save-pixels/-/save-pixels-2.3.4.tgz", "integrity": "sha1-SdNJwGuNfAEn2/DaJLRKylr7Wf4=", "requires": { - "contentstream": "1.0.0", - "gif-encoder": "0.4.3", + "contentstream": "^1.0.0", + "gif-encoder": "~0.4.1", "jpeg-js": "0.0.4", - "ndarray": "1.0.18", - "ndarray-ops": "1.2.2", - "pngjs-nozlib": "1.0.0", - "through": "2.3.8" + "ndarray": "^1.0.18", + "ndarray-ops": "^1.2.2", + "pngjs-nozlib": "^1.0.0", + "through": "^2.3.4" }, "dependencies": { "jpeg-js": { @@ -7321,7 +7182,7 @@ }, "sax": { "version": "0.1.5", - "resolved": "http://registry.npmjs.org/sax/-/sax-0.1.5.tgz", + "resolved": "https://registry.npmjs.org/sax/-/sax-0.1.5.tgz", "integrity": "sha1-0YKaYSD6AWZetNv/bEPyn9bWFHE=", "dev": true }, @@ -7330,7 +7191,7 @@ "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.6.tgz", "integrity": "sha512-LAYs+lChg1v5uKNzPtsgTxSS5hLo8aIhSMCJt1WMpefAxm3D1RTpMwSpb6ebdL31cubiLTnhokVktBW+cv9Y9w==", "requires": { - "xmlchars": "1.3.1" + "xmlchars": "^1.3.1" } }, "scope-analyzer": { @@ -7338,12 +7199,12 @@ "resolved": "https://registry.npmjs.org/scope-analyzer/-/scope-analyzer-2.0.5.tgz", "integrity": "sha512-+U5H0417mnTEstCD5VwOYO7V4vYuSqwqjFap40ythe67bhMFL5C3UgPwyBv7KDJsqUBIKafOD57xMlh1rN7eaw==", "requires": { - "array-from": "2.1.1", - "es6-map": "0.1.5", - "es6-set": "0.1.5", - "es6-symbol": "3.1.1", - "estree-is-function": "1.0.0", - "get-assigned-identifiers": "1.2.0" + "array-from": "^2.1.1", + "es6-map": "^0.1.5", + "es6-set": "^0.1.5", + "es6-symbol": "^3.1.1", + "estree-is-function": "^1.0.0", + "get-assigned-identifiers": "^1.1.0" } }, "semver": { @@ -7358,18 +7219,18 @@ "dev": true, "requires": { "debug": "2.6.9", - "depd": "1.1.2", - "destroy": "1.0.4", - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "etag": "1.8.1", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "1.6.3", + "http-errors": "~1.6.2", "mime": "1.4.1", "ms": "2.0.0", - "on-finished": "2.3.0", - "range-parser": "1.2.0", - "statuses": "1.4.0" + "on-finished": "~2.3.0", + "range-parser": "~1.2.0", + "statuses": "~1.4.0" }, "dependencies": { "debug": { @@ -7401,13 +7262,13 @@ "integrity": "sha1-03aNabHn2C5c4FD/9bRTvqEqkjk=", "dev": true, "requires": { - "accepts": "1.3.5", + "accepts": "~1.3.4", "batch": "0.6.1", "debug": "2.6.9", - "escape-html": "1.0.3", - "http-errors": "1.6.3", - "mime-types": "2.1.20", - "parseurl": "1.3.2" + "escape-html": "~1.0.3", + "http-errors": "~1.6.2", + "mime-types": "~2.1.17", + "parseurl": "~1.3.2" }, "dependencies": { "debug": { @@ -7427,9 +7288,9 @@ "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==", "dev": true, "requires": { - "encodeurl": "1.0.2", - "escape-html": "1.0.3", - "parseurl": "1.3.2", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.2", "send": "0.16.2" } }, @@ -7450,10 +7311,10 @@ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -7462,7 +7323,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7479,8 +7340,8 @@ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "shallow-copy": { @@ -7494,20 +7355,33 @@ "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, "requires": { - "json-stable-stringify": "0.0.1", - "sha.js": "2.4.11" + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" } }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, "shell-quote": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", "dev": true, "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" } }, "signal-exit": { @@ -7518,17 +7392,8 @@ "simple-concat": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", - "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=" - }, - "simple-get": { - "version": "2.8.1", - "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-2.8.1.tgz", - "integrity": "sha512-lSSHRSw3mQNUGPAYRqo7xy9dhKmxFXIjLjp4KHpf99GEH2VH7C3AM+Qfx6du6jhfUi6Vm7XnbEVEf7Wb6N8jRw==", - "requires": { - "decompress-response": "3.3.0", - "once": "1.4.0", - "simple-concat": "1.0.0" - } + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true }, "single-line-log": { "version": "1.1.2", @@ -7536,7 +7401,7 @@ "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=", "dev": true, "requires": { - "string-width": "1.0.2" + "string-width": "^1.0.1" } }, "snapdragon": { @@ -7545,14 +7410,14 @@ "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.2", - "use": "3.1.1" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { "debug": { @@ -7570,7 +7435,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -7579,7 +7444,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -7590,9 +7455,9 @@ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -7601,7 +7466,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -7610,7 +7475,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -7619,7 +7484,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -7628,9 +7493,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } }, "kind-of": { @@ -7647,7 +7512,7 @@ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" } }, "socket.io": { @@ -7656,12 +7521,12 @@ "integrity": "sha512-rORqq9c+7W0DAK3cleWNSyfv/qKXV99hV4tZe+gGLfBECw3XEhBy7x85F3wypA9688LKjtwO9pX9L33/xQI8yA==", "dev": true, "requires": { - "debug": "3.1.0", - "engine.io": "3.2.0", - "has-binary2": "1.0.3", - "socket.io-adapter": "1.1.1", + "debug": "~3.1.0", + "engine.io": "~3.2.0", + "has-binary2": "~1.0.2", + "socket.io-adapter": "~1.1.0", "socket.io-client": "2.1.1", - "socket.io-parser": "3.2.0" + "socket.io-parser": "~3.2.0" } }, "socket.io-adapter": { @@ -7680,15 +7545,15 @@ "base64-arraybuffer": "0.1.5", "component-bind": "1.0.0", "component-emitter": "1.2.1", - "debug": "3.1.0", - "engine.io-client": "3.2.1", - "has-binary2": "1.0.3", + "debug": "~3.1.0", + "engine.io-client": "~3.2.0", + "has-binary2": "~1.0.2", "has-cors": "1.1.0", "indexof": "0.0.1", "object-component": "0.0.3", "parseqs": "0.0.5", "parseuri": "0.0.5", - "socket.io-parser": "3.2.0", + "socket.io-parser": "~3.2.0", "to-array": "0.1.4" } }, @@ -7699,7 +7564,7 @@ "dev": true, "requires": { "component-emitter": "1.2.1", - "debug": "3.1.0", + "debug": "~3.1.0", "isarray": "2.0.1" }, "dependencies": { @@ -7722,11 +7587,11 @@ "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", "dev": true, "requires": { - "atob": "2.1.2", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-support": { @@ -7735,7 +7600,7 @@ "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.6" } }, "source-map-url": { @@ -7750,8 +7615,8 @@ "integrity": "sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.1" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -7766,8 +7631,8 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.2.0", - "spdx-license-ids": "3.0.1" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -7788,7 +7653,7 @@ "integrity": "sha1-xDlc5oOrzSVLwo/h2rtuXCfc/64=", "dev": true, "requires": { - "through": "2.3.8" + "through": "2" } }, "split-string": { @@ -7797,7 +7662,7 @@ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "sprintf-js": { @@ -7811,15 +7676,15 @@ "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", "requires": { - "asn1": "0.2.4", - "assert-plus": "1.0.0", - "bcrypt-pbkdf": "1.0.2", - "dashdash": "1.14.1", - "ecc-jsbn": "0.1.2", - "getpass": "0.1.7", - "jsbn": "0.1.1", - "safer-buffer": "2.1.2", - "tweetnacl": "0.14.5" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" } }, "stack-trace": { @@ -7833,7 +7698,7 @@ "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-0.2.4.tgz", "integrity": "sha1-t9NNg4k3uWn5ZBygfUj47eJj6ns=", "requires": { - "escodegen": "0.0.28" + "escodegen": "~0.0.24" }, "dependencies": { "escodegen": { @@ -7841,9 +7706,9 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-0.0.28.tgz", "integrity": "sha1-Dk/xcV8yh3XWyrUaxEpAbNer/9M=", "requires": { - "esprima": "1.0.4", - "estraverse": "1.3.2", - "source-map": "0.5.7" + "esprima": "~1.0.2", + "estraverse": "~1.3.0", + "source-map": ">= 0.1.2" } }, "esprima": { @@ -7864,8 +7729,8 @@ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -7874,7 +7739,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -7884,17 +7749,17 @@ "resolved": "https://registry.npmjs.org/static-module/-/static-module-1.5.0.tgz", "integrity": "sha1-J9qYg8QajNCSNvhC8MHrxu32PYY=", "requires": { - "concat-stream": "1.6.2", - "duplexer2": "0.0.2", - "escodegen": "1.3.3", - "falafel": "2.1.0", - "has": "1.0.3", - "object-inspect": "0.4.0", - "quote-stream": "0.0.0", - "readable-stream": "1.0.34", - "shallow-copy": "0.0.1", - "static-eval": "0.2.4", - "through2": "0.4.2" + "concat-stream": "~1.6.0", + "duplexer2": "~0.0.2", + "escodegen": "~1.3.2", + "falafel": "^2.1.0", + "has": "^1.0.0", + "object-inspect": "~0.4.0", + "quote-stream": "~0.0.0", + "readable-stream": "~1.0.27-1", + "shallow-copy": "~0.0.1", + "static-eval": "~0.2.0", + "through2": "~0.4.1" }, "dependencies": { "duplexer2": { @@ -7902,7 +7767,7 @@ "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz", "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.9" }, "dependencies": { "readable-stream": { @@ -7910,10 +7775,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } } } @@ -7923,10 +7788,10 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.3.3.tgz", "integrity": "sha1-8CQBb1qI4Eb9EgBQVek5gC5sXyM=", "requires": { - "esprima": "1.1.1", - "estraverse": "1.5.1", - "esutils": "1.0.0", - "source-map": "0.1.43" + "esprima": "~1.1.1", + "estraverse": "~1.5.0", + "esutils": "~1.0.0", + "source-map": "~0.1.33" } }, "esprima": { @@ -7959,10 +7824,10 @@ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "source-map": { @@ -7971,7 +7836,7 @@ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } }, "through2": { @@ -7979,8 +7844,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz", "integrity": "sha1-2/WGYDEVHsg1K7bE22SiKSqEC5s=", "requires": { - "readable-stream": "1.0.34", - "xtend": "2.1.2" + "readable-stream": "~1.0.17", + "xtend": "~2.1.1" } }, "xtend": { @@ -7988,7 +7853,7 @@ "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "requires": { - "object-keys": "0.4.0" + "object-keys": "~0.4.0" } } } @@ -8010,8 +7875,8 @@ "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" } }, "stream-combiner2": { @@ -8020,8 +7885,8 @@ "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "dev": true, "requires": { - "duplexer2": "0.1.4", - "readable-stream": "2.3.6" + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" } }, "stream-http": { @@ -8030,11 +7895,11 @@ "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", "dev": true, "requires": { - "builtin-status-codes": "3.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "to-arraybuffer": "1.0.1", - "xtend": "4.0.1" + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" } }, "stream-read": { @@ -8043,7 +7908,7 @@ "integrity": "sha1-MTcRDXqoC6VOS4KcTNM8oQa5Vk0=", "dev": true, "requires": { - "dezalgo": "1.0.3" + "dezalgo": "^1.0.1" } }, "stream-splicer": { @@ -8052,8 +7917,8 @@ "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" } }, "stream-throttle": { @@ -8062,8 +7927,8 @@ "integrity": "sha1-rdV8jXzHOoFjDTHNVdOWHPr7qcM=", "dev": true, "requires": { - "commander": "2.19.0", - "limiter": "1.1.3" + "commander": "^2.2.0", + "limiter": "^1.0.5" } }, "string-template": { @@ -8077,9 +7942,9 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "string.prototype.trim": { @@ -8103,7 +7968,7 @@ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -8112,22 +7977,28 @@ "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", "dev": true, "requires": { - "is-utf8": "0.2.1" + "is-utf8": "^0.2.0" } }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, "strip-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", "dev": true, "requires": { - "get-stdin": "4.0.1" + "get-stdin": "^4.0.1" } }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true }, "subarg": { "version": "1.0.0", @@ -8135,7 +8006,7 @@ "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "dev": true, "requires": { - "minimist": "1.2.0" + "minimist": "^1.1.0" } }, "sumchecker": { @@ -8144,8 +8015,8 @@ "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=", "dev": true, "requires": { - "debug": "2.6.9", - "es6-promise": "4.2.5" + "debug": "^2.2.0", + "es6-promise": "^4.0.5" }, "dependencies": { "debug": { @@ -8164,7 +8035,7 @@ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "symbol-observable": { @@ -8184,7 +8055,7 @@ "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", "dev": true, "requires": { - "acorn-node": "1.6.0" + "acorn-node": "^1.2.0" } }, "tap-out": { @@ -8211,13 +8082,13 @@ "integrity": "sha1-z3jsb0ptHrQ9JkiMrJfwQudLf8g=", "dev": true, "requires": { - "buffer-shims": "1.0.0", - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "1.0.7", - "string_decoder": "1.0.3", - "util-deprecate": "1.0.2" + "buffer-shims": "~1.0.0", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "~1.0.0", + "process-nextick-args": "~1.0.6", + "string_decoder": "~1.0.0", + "util-deprecate": "~1.0.1" } }, "string_decoder": { @@ -8226,7 +8097,7 @@ "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } } } @@ -8237,7 +8108,7 @@ "integrity": "sha1-jh6CPyEU7iHQMuLzHk+2QqKW9Qs=", "dev": true, "requires": { - "split": "0.1.2" + "split": "~0.1.2" }, "dependencies": { "split": { @@ -8246,7 +8117,7 @@ "integrity": "sha1-8HEHRMRT1VH8cUPq2YPaYBTjNsw=", "dev": true, "requires": { - "through": "1.1.2" + "through": "1" } }, "through": { @@ -8263,14 +8134,14 @@ "integrity": "sha512-zMDVJiE5I6Y4XGjlueGXJIX2YIkbDN44broZlnypT38Hj/czfOXrszHNNJBF/DXR8n+x6gbfSx68x04kIEHdrw==", "dev": true, "requires": { - "chalk": "1.1.3", - "duplexer": "0.1.1", - "figures": "1.7.0", - "lodash": "4.17.11", - "pretty-ms": "2.1.0", - "repeat-string": "1.6.1", - "tap-out": "2.1.0", - "through2": "2.0.3" + "chalk": "^1.0.0", + "duplexer": "^0.1.1", + "figures": "^1.4.0", + "lodash": "^4.17.10", + "pretty-ms": "^2.1.0", + "repeat-string": "^1.5.2", + "tap-out": "^2.1.0", + "through2": "^2.0.0" }, "dependencies": { "ansi-styles": { @@ -8285,11 +8156,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -8353,58 +8224,12 @@ "dev": true, "requires": { "@juliangruber/tap-finished": "0.0.2", - "browser-run": "5.0.1", - "optimist": "0.6.1", - "through": "2.3.8", + "browser-run": "^5.0.1", + "optimist": "~0.6.1", + "through": "~2.3.4", "throughout": "0.0.0" } }, - "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", - "requires": { - "block-stream": "0.0.9", - "fstream": "1.0.11", - "inherits": "2.0.3" - } - }, - "tar-fs": { - "version": "1.16.3", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz", - "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==", - "requires": { - "chownr": "1.1.1", - "mkdirp": "0.5.1", - "pump": "1.0.3", - "tar-stream": "1.6.2" - }, - "dependencies": { - "pump": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz", - "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==", - "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" - } - } - } - }, - "tar-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", - "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", - "requires": { - "bl": "1.2.2", - "buffer-alloc": "1.2.0", - "end-of-stream": "1.4.1", - "fs-constants": "1.0.0", - "readable-stream": "2.3.6", - "to-buffer": "1.1.1", - "xtend": "4.0.1" - } - }, "temp-dir": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-1.0.0.tgz", @@ -8417,9 +8242,9 @@ "integrity": "sha1-hSdBPNBxAINPzJy7gkK+lboOH+4=", "dev": true, "requires": { - "pify": "2.3.0", - "temp-dir": "1.0.0", - "unique-string": "1.0.0" + "pify": "^2.3.0", + "temp-dir": "^1.0.0", + "unique-string": "^1.0.0" } }, "tfunk": { @@ -8428,8 +8253,8 @@ "integrity": "sha1-OORBT8ZJd9h6/apy+sttKfgve1s=", "dev": true, "requires": { - "chalk": "1.1.3", - "object-path": "0.9.2" + "chalk": "^1.1.1", + "object-path": "^0.9.0" }, "dependencies": { "ansi-styles": { @@ -8444,11 +8269,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -8475,8 +8300,8 @@ "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "throughout": { @@ -8485,8 +8310,8 @@ "integrity": "sha1-2pNVJyMaeUTapg061HoyQprxqME=", "dev": true, "requires": { - "duplexer": "0.0.4", - "through": "2.3.8" + "duplexer": "~0.0.2", + "through": "~2.3.4" }, "dependencies": { "duplexer": { @@ -8503,7 +8328,7 @@ "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", "dev": true, "requires": { - "process": "0.11.10" + "process": "~0.11.0" } }, "tiny-lr": { @@ -8512,12 +8337,12 @@ "integrity": "sha512-44yhA3tsaRoMOjQQ+5v5mVdqef+kH6Qze9jTpqtVufgYjYt08zyZAwNwwVBj3i1rJMnR52IxOW0LK0vBzgAkuA==", "dev": true, "requires": { - "body": "5.1.0", - "debug": "3.1.0", - "faye-websocket": "0.10.0", - "livereload-js": "2.3.0", - "object-assign": "4.1.1", - "qs": "6.5.2" + "body": "^5.1.0", + "debug": "^3.1.0", + "faye-websocket": "~0.10.0", + "livereload-js": "^2.3.0", + "object-assign": "^4.1.0", + "qs": "^6.4.0" } }, "to-array": { @@ -8532,18 +8357,13 @@ "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", "dev": true }, - "to-buffer": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", - "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==" - }, "to-object-path": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" } }, "to-regex": { @@ -8552,10 +8372,10 @@ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -8564,8 +8384,8 @@ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tough-cookie": { @@ -8573,8 +8393,8 @@ "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", "requires": { - "psl": "1.1.29", - "punycode": "1.4.1" + "psl": "^1.1.24", + "punycode": "^1.4.1" } }, "tr46": { @@ -8582,7 +8402,7 @@ "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", "requires": { - "punycode": "2.1.1" + "punycode": "^2.1.0" }, "dependencies": { "punycode": { @@ -8610,12 +8430,12 @@ "integrity": "sha1-sCxp5GXRcfVeRJJL+bW90gl0yDA=", "dev": true, "requires": { - "duplexer2": "0.0.2", - "html-select": "2.3.24", - "html-tokenize": "1.2.5", - "inherits": "2.0.3", - "readable-stream": "1.1.14", - "through2": "1.1.1" + "duplexer2": "~0.0.2", + "html-select": "^2.3.5", + "html-tokenize": "^1.1.1", + "inherits": "^2.0.0", + "readable-stream": "^1.0.27-1", + "through2": "^1.0.0" }, "dependencies": { "duplexer2": { @@ -8624,7 +8444,7 @@ "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", "dev": true, "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.9" } }, "readable-stream": { @@ -8633,10 +8453,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "through2": { @@ -8645,8 +8465,8 @@ "integrity": "sha1-CEfLxESfNAVXTb3M2buEG4OsNUU=", "dev": true, "requires": { - "readable-stream": "1.1.14", - "xtend": "4.0.1" + "readable-stream": ">=1.1.13-1 <1.2.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } } } @@ -8662,7 +8482,7 @@ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.0.1" } }, "tweetnacl": { @@ -8675,7 +8495,7 @@ "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "typedarray": { @@ -8688,8 +8508,8 @@ "resolved": "https://registry.npmjs.org/typedarray-pool/-/typedarray-pool-1.1.0.tgz", "integrity": "sha1-0RT0hIAUifU+yrXoCIqiMET0mNk=", "requires": { - "bit-twiddle": "1.0.2", - "dup": "1.0.0" + "bit-twiddle": "^1.0.0", + "dup": "^1.0.0" } }, "ua-parser-js": { @@ -8704,8 +8524,8 @@ "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", "dev": true, "requires": { - "commander": "2.13.0", - "source-map": "0.6.1" + "commander": "~2.13.0", + "source-map": "~0.6.1" }, "dependencies": { "commander": { @@ -8727,9 +8547,9 @@ "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" }, "dependencies": { "camelcase": { @@ -8742,8 +8562,8 @@ "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" } }, @@ -8762,9 +8582,9 @@ "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } } @@ -8794,10 +8614,10 @@ "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", "dev": true, "requires": { - "acorn-node": "1.6.0", - "get-assigned-identifiers": "1.2.0", - "simple-concat": "1.0.0", - "xtend": "4.0.1" + "acorn-node": "^1.3.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" } }, "underscore": { @@ -8811,8 +8631,8 @@ "integrity": "sha512-g+dpmgn+XBneLmXXo+sGlW5xQEt4ErkS3mgeN2GFbremYeMBSJKr9Wf2KJplQVaiPY/f7FN6atosWYNm9ovrYg==", "dev": true, "requires": { - "sprintf-js": "1.1.1", - "util-deprecate": "1.0.2" + "sprintf-js": "^1.0.3", + "util-deprecate": "^1.0.2" } }, "union-value": { @@ -8821,10 +8641,10 @@ "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -8833,7 +8653,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -8842,10 +8662,10 @@ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -8861,7 +8681,7 @@ "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", "dev": true, "requires": { - "crypto-random-string": "1.0.0" + "crypto-random-string": "^1.0.0" } }, "universalify": { @@ -8882,8 +8702,8 @@ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -8892,9 +8712,9 @@ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -8939,12 +8759,12 @@ "resolved": "https://registry.npmjs.org/urify/-/urify-2.1.1.tgz", "integrity": "sha512-4ybbjC35yivSWm0xgIj0duAJUElBRssLxst6QSGL1HapW3zYlsXHcjslBVGwrWd89ItTon5jmiL88UPtubjp1A==", "requires": { - "from2-string": "1.1.0", - "mime": "1.6.0", - "quote-stream": "1.0.2", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "static-module": "3.0.0" + "from2-string": "^1.1.0", + "mime": "^1.3.4", + "quote-stream": "^1.0.2", + "readable-stream": "^2.0.5", + "resolve": "^1.1.7", + "static-module": "^3.0.0" }, "dependencies": { "escodegen": { @@ -8952,11 +8772,11 @@ "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.9.1.tgz", "integrity": "sha512-6hTjO1NAWkHnDk3OqQ4YrCuwwmGHL9S3nPlzBOUG/R44rda3wLNrfvQ5fkSGjyhHFKM7ALPKcKGrwvCLe0lC7Q==", "requires": { - "esprima": "3.1.3", - "estraverse": "4.2.0", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.6.1" + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" } }, "object-inspect": { @@ -8970,8 +8790,8 @@ "integrity": "sha1-hJY/jJwmuULhU/7rU6rnRlK34LI=", "requires": { "buffer-equal": "0.0.1", - "minimist": "1.2.0", - "through2": "2.0.3" + "minimist": "^1.1.3", + "through2": "^2.0.0" } }, "source-map": { @@ -8985,7 +8805,7 @@ "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.0.tgz", "integrity": "sha512-6flshd3F1Gwm+Ksxq463LtFd1liC77N/PX1FVVc3OzL3hAmo2fwHFbuArkcfi7s9rTNsLEhcRmXGFZhlgy40uw==", "requires": { - "escodegen": "1.9.1" + "escodegen": "^1.8.1" } }, "static-module": { @@ -8993,20 +8813,20 @@ "resolved": "https://registry.npmjs.org/static-module/-/static-module-3.0.0.tgz", "integrity": "sha512-SM757x+T52ye+QNDo80F53rNpir/ZyyFL0NjPXHRXb1hT1eC2Tzq+LV5P2X12UzHJH5SfD248I5/jzUoSey89Q==", "requires": { - "acorn-node": "1.6.0", - "concat-stream": "1.6.2", - "convert-source-map": "1.6.0", - "duplexer2": "0.1.4", - "escodegen": "1.9.1", - "has": "1.0.3", - "magic-string": "0.22.5", + "acorn-node": "^1.3.0", + "concat-stream": "~1.6.0", + "convert-source-map": "^1.5.1", + "duplexer2": "~0.1.4", + "escodegen": "~1.9.0", + "has": "^1.0.1", + "magic-string": "^0.22.4", "merge-source-map": "1.0.4", - "object-inspect": "1.4.1", - "readable-stream": "2.3.6", - "scope-analyzer": "2.0.5", - "shallow-copy": "0.0.1", - "static-eval": "2.0.0", - "through2": "2.0.3" + "object-inspect": "~1.4.0", + "readable-stream": "~2.3.3", + "scope-analyzer": "^2.0.1", + "shallow-copy": "~0.0.1", + "static-eval": "^2.0.0", + "through2": "~2.0.3" } } } @@ -9084,8 +8904,8 @@ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "3.0.2", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "verror": { @@ -9093,9 +8913,9 @@ "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", "requires": { - "assert-plus": "1.0.0", + "assert-plus": "^1.0.0", "core-util-is": "1.0.2", - "extsprintf": "1.3.0" + "extsprintf": "^1.2.0" } }, "vlq": { @@ -9114,7 +8934,7 @@ "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", "requires": { - "browser-process-hrtime": "0.1.3" + "browser-process-hrtime": "^0.1.2" } }, "w3c-xmlserializer": { @@ -9122,9 +8942,9 @@ "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.0.1.tgz", "integrity": "sha512-XZGI1OH/OLQr/NaJhhPmzhngwcAnZDLytsvXnRmlYeRkmbb0I7sqFFA22erq4WQR0sUu17ZSQOAV9mFwCqKRNg==", "requires": { - "domexception": "1.0.1", - "webidl-conversions": "4.0.2", - "xml-name-validator": "3.0.0" + "domexception": "^1.0.1", + "webidl-conversions": "^4.0.2", + "xml-name-validator": "^3.0.0" } }, "watchify": { @@ -9133,13 +8953,13 @@ "integrity": "sha512-7jWG0c3cKKm2hKScnSAMUEUjRJKXUShwMPk0ASVhICycQhwND3IMAdhJYmc1mxxKzBUJTSF5HZizfrKrS6BzkA==", "dev": true, "requires": { - "anymatch": "1.3.2", - "browserify": "16.2.3", - "chokidar": "1.7.0", - "defined": "1.0.0", - "outpipe": "1.1.1", - "through2": "2.0.3", - "xtend": "4.0.1" + "anymatch": "^1.3.0", + "browserify": "^16.1.0", + "chokidar": "^1.0.0", + "defined": "^1.0.0", + "outpipe": "^1.1.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" }, "dependencies": { "anymatch": { @@ -9148,8 +8968,8 @@ "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", "dev": true, "requires": { - "micromatch": "2.3.11", - "normalize-path": "2.1.1" + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" } }, "assert": { @@ -9184,54 +9004,54 @@ "integrity": "sha512-zQt/Gd1+W+IY+h/xX2NYMW4orQWhqSwyV+xsblycTtpOuB27h1fZhhNQuipJ4t79ohw4P4mMem0jp/ZkISQtjQ==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "assert": "1.4.1", - "browser-pack": "6.1.0", - "browser-resolve": "1.11.3", - "browserify-zlib": "0.2.0", - "buffer": "5.0.8", - "cached-path-relative": "1.0.2", - "concat-stream": "1.6.2", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.2.0", - "duplexer2": "0.1.4", - "events": "2.1.0", - "glob": "7.1.3", - "has": "1.0.3", - "htmlescape": "1.1.1", - "https-browserify": "1.0.0", - "inherits": "2.0.3", - "insert-module-globals": "7.2.0", - "labeled-stream-splicer": "2.0.1", - "mkdirp": "0.5.1", - "module-deps": "6.1.0", - "os-browserify": "0.3.0", - "parents": "1.0.1", - "path-browserify": "0.0.1", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.3", - "string_decoder": "1.1.1", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.4", - "vm-browserify": "1.1.0", - "xtend": "4.0.1" + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" }, "dependencies": { "buffer": { @@ -9240,8 +9060,8 @@ "integrity": "sha512-xXvjQhVNz50v2nPeoOsNqWCLGfiv4ji/gXZM28jnVwdLJxH4mFyqgqCKfaK9zf1KUbG6zTkjLOy7ou+jSMarGA==", "dev": true, "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.12" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } } } @@ -9252,7 +9072,7 @@ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "1.0.6" + "pako": "~1.0.5" } }, "cached-path-relative": { @@ -9267,15 +9087,15 @@ "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", "dev": true, "requires": { - "anymatch": "1.3.2", - "async-each": "1.0.1", - "fsevents": "1.2.4", - "glob-parent": "2.0.0", - "inherits": "2.0.3", - "is-binary-path": "1.0.1", - "is-glob": "2.0.1", - "path-is-absolute": "1.0.1", - "readdirp": "2.2.1" + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" } }, "detective": { @@ -9284,9 +9104,9 @@ "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", "dev": true, "requires": { - "acorn-node": "1.6.0", - "defined": "1.0.0", - "minimist": "1.2.0" + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" } }, "domain-browser": { @@ -9307,12 +9127,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-parent": { @@ -9321,7 +9141,7 @@ "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", "dev": true, "requires": { - "is-glob": "2.0.1" + "is-glob": "^2.0.0" } }, "https-browserify": { @@ -9342,7 +9162,7 @@ "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", "dev": true, "requires": { - "is-extglob": "1.0.0" + "is-extglob": "^1.0.0" } }, "module-deps": { @@ -9351,21 +9171,21 @@ "integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", "dev": true, "requires": { - "JSONStream": "1.3.5", - "browser-resolve": "1.11.3", - "cached-path-relative": "1.0.2", - "concat-stream": "1.6.2", - "defined": "1.0.0", - "detective": "5.1.0", - "duplexer2": "0.1.4", - "inherits": "2.0.3", - "parents": "1.0.1", - "readable-stream": "2.3.6", - "resolve": "1.8.1", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" } }, "os-browserify": { @@ -9386,7 +9206,7 @@ "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.0" } }, "vm-browserify": { @@ -9416,8 +9236,8 @@ "integrity": "sha1-DK+dLXVdk67gSdS90NP+LMoqJOs=", "dev": true, "requires": { - "http-parser-js": "0.4.13", - "websocket-extensions": "0.1.3" + "http-parser-js": ">=0.4.0", + "websocket-extensions": ">=0.1.1" } }, "websocket-extensions": { @@ -9444,9 +9264,9 @@ "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", "requires": { - "lodash.sortby": "4.7.0", - "tr46": "1.0.1", - "webidl-conversions": "4.0.2" + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" } }, "which": { @@ -9454,7 +9274,7 @@ "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -9463,18 +9283,10 @@ "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", "dev": true }, - "which-pm-runs": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", - "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=" - }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "requires": { - "string-width": "1.0.2" - } + "window-or-global": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/window-or-global/-/window-or-global-1.0.1.tgz", + "integrity": "sha1-2+RboqKRqrxW1iz2bEW3+jIpRt4=" }, "window-size": { "version": "0.2.0", @@ -9492,10 +9304,9 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", - "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" } }, "wrappy": { @@ -9509,9 +9320,9 @@ "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", "dev": true, "requires": { - "async-limiter": "1.0.0", - "safe-buffer": "5.1.2", - "ultron": "1.1.1" + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" } }, "xhr-write-stream": { @@ -9520,8 +9331,8 @@ "integrity": "sha1-41eEjg0Dm0Ef3Vs7+BvkfuXOJqo=", "dev": true, "requires": { - "concat-stream": "0.1.1", - "ordered-emitter": "0.1.1" + "concat-stream": "~0.1.0", + "ordered-emitter": "~0.1.0" }, "dependencies": { "concat-stream": { @@ -9556,13 +9367,7 @@ "y18n": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", - "dev": true - }, - "yallist": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, "yargs": { "version": "6.4.0", @@ -9570,20 +9375,20 @@ "integrity": "sha1-gW4ahm1VmMzzTlWW3c4i2S2kkNQ=", "dev": true, "requires": { - "camelcase": "3.0.0", - "cliui": "3.2.0", - "decamelize": "1.2.0", - "get-caller-file": "1.0.3", - "os-locale": "1.4.0", - "read-pkg-up": "1.0.1", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "1.0.2", - "which-module": "1.0.0", - "window-size": "0.2.0", - "y18n": "3.2.1", - "yargs-parser": "4.2.1" + "camelcase": "^3.0.0", + "cliui": "^3.2.0", + "decamelize": "^1.1.1", + "get-caller-file": "^1.0.1", + "os-locale": "^1.4.0", + "read-pkg-up": "^1.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^1.0.2", + "which-module": "^1.0.0", + "window-size": "^0.2.0", + "y18n": "^3.2.1", + "yargs-parser": "^4.1.0" }, "dependencies": { "camelcase": { @@ -9600,7 +9405,7 @@ "integrity": "sha1-KczqwNxPA8bIe0qfIX3RjJ90hxw=", "dev": true, "requires": { - "camelcase": "3.0.0" + "camelcase": "^3.0.0" }, "dependencies": { "camelcase": { @@ -9617,7 +9422,7 @@ "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", "dev": true, "requires": { - "fd-slicer": "1.0.1" + "fd-slicer": "~1.0.1" } }, "yeast": { @@ -9627,4 +9432,4 @@ "dev": true } } -} \ No newline at end of file +} diff --git a/package.json b/package.json index 35d966d2..b6b7bc41 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "src/ImageSequencer.js", "scripts": { "debug": "TEST=true node ./index.js -i ./examples/images/monarch.png -s invert", - "test": "TEST=true tape test/core/*.js test/core/ui/user-interface.js | tap-spec; browserify test/core/modules/image-sequencer.js test/core/modules/chain.js test/core/modules/meta-modules.js test/core/modules/replace.js test/core/modules/import-export.js test/core/modules/run.js test/core/modules/dynamic-imports.js test/core/util/parse-input.js test/core/modules/benchmark.js | tape-run --render=\"tap-spec\"", + "test": "TEST=true tape test/core/*.js test/core/ui/user-interface.js test/core/modules/QR.js | tap-spec; browserify test/core/modules/image-sequencer.js test/core/modules/chain.js test/core/modules/meta-modules.js test/core/modules/replace.js test/core/modules/import-export.js test/core/modules/run.js test/core/modules/dynamic-imports.js test/core/util/parse-input.js test/core/modules/benchmark.js| tape-run --render=\"tap-spec\"", "test-ui": "jasmine test/spec/*.js", "setup": "npm i && npm i -g grunt grunt-cli", "start": "grunt serve" @@ -43,6 +43,7 @@ "ndarray-gaussian-filter": "^1.0.0", "ora": "^3.0.0", "pace": "0.0.4", + "qrcode": "1.3.3", "readline-sync": "^1.4.7", "save-pixels": "~2.3.4", "urify": "^2.1.1" @@ -72,4 +73,4 @@ "bin": { "sequencer": "./index.js" } -} \ No newline at end of file +} diff --git a/src/Modules.js b/src/Modules.js index 586f813e..3f65a2dd 100644 --- a/src/Modules.js +++ b/src/Modules.js @@ -2,6 +2,7 @@ * Core modules and their info files */ module.exports = { + 'add-qr': require('./modules/AddQR'), 'average': require('./modules/Average'), 'blend': require('./modules/Blend'), 'blur': require('./modules/Blur'), diff --git a/src/modules/AddQR/Module.js b/src/modules/AddQR/Module.js new file mode 100644 index 00000000..04e1fd3b --- /dev/null +++ b/src/modules/AddQR/Module.js @@ -0,0 +1,51 @@ +module.exports = function AddQR(options, UI) { + + var defaults = require('./../../util/getDefaults.js')(require('./info.json')); + options.size = options.size || defaults.size; + options.qrCodeString = options.qrCodeString || "https://github.com/publiclab/image-sequencer"; + var output; + getPixels = require('get-pixels'); + + function draw(input, callback, progressObj) { + + progressObj.stop(true); + progressObj.overrideFlag = true; + + var step = this; + + return getPixels(input.src, function (err, oldPixels) { + function changePixel(r, g, b, a) { + return [r, g, b, a]; + } + + function extraManipulation(pixels,generateOutput) { + if (err) { + console.log(err); + return; + } + require('./QR')(options, pixels, oldPixels, generateOutput); + } + function output(image, datauri, mimetype) { + step.output = { src: datauri, format: mimetype }; + } + + return require('../_nomodule/PixelManipulation.js')(input, { + output: output, + changePixel: changePixel, + extraManipulation: extraManipulation, + format: input.format, + image: options.image, + inBrowser: options.inBrowser, + callback: callback + }); + }) + + } + + return { + options: options, + draw: draw, + output: output, + UI: UI + } +} \ No newline at end of file diff --git a/src/modules/AddQR/QR.js b/src/modules/AddQR/QR.js new file mode 100644 index 00000000..d2424cd8 --- /dev/null +++ b/src/modules/AddQR/QR.js @@ -0,0 +1,48 @@ +module.exports = exports = function (options, pixels, oldPixels, callback) { + var QRCode = require('qrcode') + QRCode.toDataURL(options.qrCodeString, function (err, url) { + var getPixels = require("get-pixels"); + getPixels(url, function (err, qrPixels) { + if (err) { + console.log("Bad image path", image); + } + + var imagejs = require('imagejs'); + var bitmap = new imagejs.Bitmap({ width: qrPixels.shape[0], height: qrPixels.shape[1] }); + bitmap._data.data = qrPixels.data; + var resized = bitmap.resize({ + width: options.size, height: options.size, + algorithm: "bicubicInterpolation" + }); + + qrPixels.data = resized._data.data; + qrPixels.shape = [options.size, options.size, 4]; + qrPixels.stride[1] = 4 * options.size; + + var width = oldPixels.shape[0], + height = oldPixels.shape[1]; + var xe = width - options.size, + ye = height - options.size; + for (var m = 0; m < width; m++) { + for (var n = 0; n < height; n++) { + if (m >= xe && n >= ye) { + pixels.set(m, n, 0, qrPixels.get(m - xe, n - ye, 0)) + pixels.set(m, n, 1, qrPixels.get(m - xe, n - ye, 1)) + pixels.set(m, n, 2, qrPixels.get(m - xe, n - ye, 2)) + pixels.set(m, n, 3, qrPixels.get(m - xe, n - ye, 3)) + } + + else { + pixels.set(m, n, 0, oldPixels.get(m, n, 0)) + pixels.set(m, n, 1, oldPixels.get(m, n, 1)) + pixels.set(m, n, 2, oldPixels.get(m, n, 2)) + pixels.set(m, n, 3, oldPixels.get(m, n, 3)) + } + + } + } + callback(); + + }) + }) +} diff --git a/src/modules/AddQR/index.js b/src/modules/AddQR/index.js new file mode 100644 index 00000000..11ef888f --- /dev/null +++ b/src/modules/AddQR/index.js @@ -0,0 +1,4 @@ +module.exports = [ + require('./Module'), + require('./info.json') +] \ No newline at end of file diff --git a/src/modules/AddQR/info.json b/src/modules/AddQR/info.json new file mode 100644 index 00000000..4f5805af --- /dev/null +++ b/src/modules/AddQR/info.json @@ -0,0 +1,19 @@ +{ + "name": "Add QR", + "description": "Adds QR corresponding to the given string", + "url": "https://github.com/publiclab/image-sequencer/tree/master/MODULES.md", + "inputs": { + "size": { + "type": "integer", + "desc": "size of QR code in pixels", + "default": 200 + }, + "qrCodeString":{ + "type": "string", + "desc": "input string to generate QR code", + "default": "https://github.com/publiclab/image-sequencer" + } + }, + "docs-link":"https://github.com/publiclab/image-sequencer/blob/main/docs/MODULES.md" + } + \ No newline at end of file diff --git a/src/modules/_nomodule/PixelManipulation.js b/src/modules/_nomodule/PixelManipulation.js index 30b341f2..6d5971b2 100644 --- a/src/modules/_nomodule/PixelManipulation.js +++ b/src/modules/_nomodule/PixelManipulation.js @@ -67,14 +67,15 @@ module.exports = function PixelManipulation(image, options) { } } } - // perform any extra operations on the entire array: - if (options.extraManipulation) pixels = options.extraManipulation(pixels); - + var res; + if (options.extraManipulation) res = options.extraManipulation(pixels,generateOutput); // there may be a more efficient means to encode an image object, // but node modules and their documentation are essentially arcane on this point - var chunks = []; + function generateOutput(){ + var chunks = []; var totalLength = 0; + var r = savePixels(pixels, options.format, { quality: 100 }); r.on("data", function(chunk) { @@ -89,5 +90,11 @@ module.exports = function PixelManipulation(image, options) { options.output(options.image, datauri, options.format); if (options.callback) options.callback(); }); + } + if(res){ + pixels=res; + generateOutput(); + } + else if(!options.extraManipulation) generateOutput(); }); }; diff --git a/test/core/modules/QR.js b/test/core/modules/QR.js new file mode 100644 index 00000000..6f809cb4 --- /dev/null +++ b/test/core/modules/QR.js @@ -0,0 +1,44 @@ +var test = require('tape'); +var base64Img = require('base64-img'); +var looksSame = require('looks-same'); +require('../../../src/ImageSequencer.js'); + +var sequencer1 = ImageSequencer({ ui: false }); +var options = {size:200,qrCodeString:'https://github.com/publiclab/image-sequencer'}; +var target = 'test_outputs'; +var red = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABlBMVEX+AAD///+KQee0AAAAAWJLR0QB/wIt3gAAAAd0SU1FB+EGHRIVAvrm6EMAAAAMSURBVAjXY2AgDQAAADAAAceqhY4AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTctMDYtMjlUMTg6MjE6MDIrMDI6MDDGD83DAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE3LTA2LTI5VDE4OjIxOjAyKzAyOjAwt1J1fwAAAABJRU5ErkJggg=="; +var benchmark= 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAklEQVR4AewaftIAAAApSURBVKXBAQEAAAiAIPP/5+qDMPsIJJJIIokkkkgiiSSSSCKJJJJIogNrygQcXEYsHQAAAABJRU5ErkJggg=='; +// Test 1 to check brightness module is getting loaded +test('Load add QR module', function(t) { + sequencer1.loadImages('image1', red); + sequencer1.addSteps('add-qr', options); + t.equal(sequencer1.images.image1.steps[1].options.name, "add-qr", "Add-QR module is getting loaded."); + t.end(); +}); + +// Test 2 to check options are correct +test('Check Options', function(t) { + sequencer1.loadImages('image1', red); + sequencer1.addSteps('add-qr', options); + t.equal(sequencer1.images.image1.steps[1].options.size, 200, "Options are correct"); + t.end(); +}); + + +// Test 3 to check Add QR module works as expected +test('Add QR module works correctly', function(t) { + sequencer1.run( function(out) { + var result = sequencer1.images.image1.steps[1].output.src + base64Img.imgSync(result, target, 'result') + base64Img.imgSync(benchmark, target, 'benchmark') + result = 'test_outputs/result.png' + benchmark = 'test_outputs/benchmark.png' + looksSame(result, benchmark, function(err, res) { + if (err) console.log(err) + t.equal(res.equal, true) + t.end() + }) + }) +}) + +