From 275a5d0b044c49c30d5102f095b18702c991916f Mon Sep 17 00:00:00 2001 From: Sebastian Kupke Date: Tue, 14 May 2019 13:56:05 +0200 Subject: [PATCH] Added Scrollview. --- dist/iwmlib.3rdparty.js | 8447 +++++++++++++++-- dist/iwmlib.3rdparty.min.js | 2 +- dist/iwmlib.3rdparty.preload.js | 890 -- dist/iwmlib.3rdparty.preload.min.js | 2 +- dist/iwmlib.pixi.js | 691 +- gulpfile.js | 6 +- lib/3rdparty/highlight/CHANGES.md | 314 + lib/3rdparty/highlight/README.md | 84 +- lib/3rdparty/highlight/README.ru.md | 36 +- lib/3rdparty/highlight/highlight.pack.js | 4 +- lib/3rdparty/highlight/styles/a11y-dark.css | 99 + lib/3rdparty/highlight/styles/a11y-light.css | 99 + lib/3rdparty/highlight/styles/an-old-hope.css | 89 + .../styles/atom-one-dark-reasonable.css | 77 + lib/3rdparty/highlight/styles/gml.css | 78 + .../highlight/styles/isbl-editor-dark.css | 112 + .../highlight/styles/isbl-editor-light.css | 112 + lib/3rdparty/highlight/styles/lightfair.css | 87 + lib/3rdparty/highlight/styles/nord.css | 309 + lib/3rdparty/highlight/styles/routeros.css | 108 + .../highlight/styles/shades-of-purple.css | 97 + lib/3rdparty/highlight/styles/vs2015.css | 115 + lib/3rdparty/highlight/styles/xcode.css | 39 +- lib/3rdparty/highlight/styles/xt256.css | 2 +- lib/3rdparty/pixi-ease.js | 4090 ++++++++ lib/3rdparty/pixi-viewport.js | 3465 +++++++ lib/pixi/bundle.js | 2 + lib/pixi/scrollbox.js | 585 ++ lib/pixi/scrollbox.min.js | 1 - lib/pixi/scrollview.html | 54 +- lib/pixi/scrollview.js | 426 +- package-lock.json | 5 - package.json | 1 - 33 files changed, 18231 insertions(+), 2297 deletions(-) create mode 100644 lib/3rdparty/highlight/styles/a11y-dark.css create mode 100644 lib/3rdparty/highlight/styles/a11y-light.css create mode 100644 lib/3rdparty/highlight/styles/an-old-hope.css create mode 100644 lib/3rdparty/highlight/styles/atom-one-dark-reasonable.css create mode 100644 lib/3rdparty/highlight/styles/gml.css create mode 100644 lib/3rdparty/highlight/styles/isbl-editor-dark.css create mode 100644 lib/3rdparty/highlight/styles/isbl-editor-light.css create mode 100644 lib/3rdparty/highlight/styles/lightfair.css create mode 100644 lib/3rdparty/highlight/styles/nord.css create mode 100644 lib/3rdparty/highlight/styles/routeros.css create mode 100644 lib/3rdparty/highlight/styles/shades-of-purple.css create mode 100644 lib/3rdparty/highlight/styles/vs2015.css create mode 100644 lib/3rdparty/pixi-ease.js create mode 100644 lib/3rdparty/pixi-viewport.js create mode 100644 lib/pixi/scrollbox.js delete mode 100644 lib/pixi/scrollbox.min.js diff --git a/dist/iwmlib.3rdparty.js b/dist/iwmlib.3rdparty.js index cc5089e..8576b2a 100644 --- a/dist/iwmlib.3rdparty.js +++ b/dist/iwmlib.3rdparty.js @@ -4354,896 +4354,6 @@ if (typeof define === 'function' && define.amd) { }; })); -/* -Syntax highlighting with language autodetection. -https://highlightjs.org/ -*/ - -(function(factory) { - - // Find the global object for export to both the browser and web workers. - var globalObject = typeof window === 'object' && window || - typeof self === 'object' && self; - - // Setup highlight.js for different environments. First is Node.js or - // CommonJS. - if(typeof exports !== 'undefined') { - factory(exports); - } else if(globalObject) { - // Export hljs globally even when using AMD for cases when this script - // is loaded with others that may still expect a global hljs. - globalObject.hljs = factory({}); - - // Finally register the global hljs with AMD. - if(typeof define === 'function' && define.amd) { - define([], function() { - return globalObject.hljs; - }); - } - } - -}(function(hljs) { - // Convenience variables for build-in objects - var ArrayProto = [], - objectKeys = Object.keys; - - // Global internal variables used within the highlight.js library. - var languages = {}, - aliases = {}; - - // Regular expressions used throughout the highlight.js library. - var noHighlightRe = /^(no-?highlight|plain|text)$/i, - languagePrefixRe = /\blang(?:uage)?-([\w-]+)\b/i, - fixMarkupRe = /((^(<[^>]+>|\t|)+|(?:\n)))/gm; - - // The object will be assigned by the build tool. It used to synchronize API - // of external language files with minified version of the highlight.js library. - var API_REPLACES; - - var spanEndTag = ''; - - // Global options used when within external APIs. This is modified when - // calling the `hljs.configure` function. - var options = { - classPrefix: 'hljs-', - tabReplace: null, - useBR: false, - languages: undefined - }; - - - /* Utility functions */ - - function escape(value) { - return value.replace(/&/g, '&').replace(//g, '>'); - } - - function tag(node) { - return node.nodeName.toLowerCase(); - } - - function testRe(re, lexeme) { - var match = re && re.exec(lexeme); - return match && match.index === 0; - } - - function isNotHighlighted(language) { - return noHighlightRe.test(language); - } - - function blockLanguage(block) { - var i, match, length, _class; - var classes = block.className + ' '; - - classes += block.parentNode ? block.parentNode.className : ''; - - // language-* takes precedence over non-prefixed class names. - match = languagePrefixRe.exec(classes); - if (match) { - return getLanguage(match[1]) ? match[1] : 'no-highlight'; - } - - classes = classes.split(/\s+/); - - for (i = 0, length = classes.length; i < length; i++) { - _class = classes[i]; - - if (isNotHighlighted(_class) || getLanguage(_class)) { - return _class; - } - } - } - - function inherit(parent) { // inherit(parent, override_obj, override_obj, ...) - var key; - var result = {}; - var objects = Array.prototype.slice.call(arguments, 1); - - for (key in parent) - result[key] = parent[key]; - objects.forEach(function(obj) { - for (key in obj) - result[key] = obj[key]; - }); - return result; - } - - /* Stream merging */ - - function nodeStream(node) { - var result = []; - (function _nodeStream(node, offset) { - for (var child = node.firstChild; child; child = child.nextSibling) { - if (child.nodeType === 3) - offset += child.nodeValue.length; - else if (child.nodeType === 1) { - result.push({ - event: 'start', - offset: offset, - node: child - }); - offset = _nodeStream(child, offset); - // Prevent void elements from having an end tag that would actually - // double them in the output. There are more void elements in HTML - // but we list only those realistically expected in code display. - if (!tag(child).match(/br|hr|img|input/)) { - result.push({ - event: 'stop', - offset: offset, - node: child - }); - } - } - } - return offset; - })(node, 0); - return result; - } - - function mergeStreams(original, highlighted, value) { - var processed = 0; - var result = ''; - var nodeStack = []; - - function selectStream() { - if (!original.length || !highlighted.length) { - return original.length ? original : highlighted; - } - if (original[0].offset !== highlighted[0].offset) { - return (original[0].offset < highlighted[0].offset) ? original : highlighted; - } - - /* - To avoid starting the stream just before it should stop the order is - ensured that original always starts first and closes last: - - if (event1 == 'start' && event2 == 'start') - return original; - if (event1 == 'start' && event2 == 'stop') - return highlighted; - if (event1 == 'stop' && event2 == 'start') - return original; - if (event1 == 'stop' && event2 == 'stop') - return highlighted; - - ... which is collapsed to: - */ - return highlighted[0].event === 'start' ? original : highlighted; - } - - function open(node) { - function attr_str(a) {return ' ' + a.nodeName + '="' + escape(a.value).replace('"', '"') + '"';} - result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>'; - } - - function close(node) { - result += ''; - } - - function render(event) { - (event.event === 'start' ? open : close)(event.node); - } - - while (original.length || highlighted.length) { - var stream = selectStream(); - result += escape(value.substring(processed, stream[0].offset)); - processed = stream[0].offset; - if (stream === original) { - /* - On any opening or closing tag of the original markup we first close - the entire highlighted node stack, then render the original tag along - with all the following original tags at the same offset and then - reopen all the tags on the highlighted stack. - */ - nodeStack.reverse().forEach(close); - do { - render(stream.splice(0, 1)[0]); - stream = selectStream(); - } while (stream === original && stream.length && stream[0].offset === processed); - nodeStack.reverse().forEach(open); - } else { - if (stream[0].event === 'start') { - nodeStack.push(stream[0].node); - } else { - nodeStack.pop(); - } - render(stream.splice(0, 1)[0]); - } - } - return result + escape(value.substr(processed)); - } - - /* Initialization */ - - function expand_mode(mode) { - if (mode.variants && !mode.cached_variants) { - mode.cached_variants = mode.variants.map(function(variant) { - return inherit(mode, {variants: null}, variant); - }); - } - return mode.cached_variants || (mode.endsWithParent && [inherit(mode)]) || [mode]; - } - - function restoreLanguageApi(obj) { - if(API_REPLACES && !obj.langApiRestored) { - obj.langApiRestored = true; - for(var key in API_REPLACES) - obj[key] && (obj[API_REPLACES[key]] = obj[key]); - (obj.contains || []).concat(obj.variants || []).forEach(restoreLanguageApi); - } - } - - function compileLanguage(language) { - - function reStr(re) { - return (re && re.source) || re; - } - - function langRe(value, global) { - return new RegExp( - reStr(value), - 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '') - ); - } - - // joinRe logically computes regexps.join(separator), but fixes the - // backreferences so they continue to match. - function joinRe(regexps, separator) { - // backreferenceRe matches an open parenthesis or backreference. To avoid - // an incorrect parse, it additionally matches the following: - // - [...] elements, where the meaning of parentheses and escapes change - // - other escape sequences, so we do not misparse escape sequences as - // interesting elements - // - non-matching or lookahead parentheses, which do not capture. These - // follow the '(' with a '?'. - var backreferenceRe = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; - var numCaptures = 0; - var ret = ''; - for (var i = 0; i < regexps.length; i++) { - var offset = numCaptures; - var re = reStr(regexps[i]); - if (i > 0) { - ret += separator; - } - while (re.length > 0) { - var match = backreferenceRe.exec(re); - if (match == null) { - ret += re; - break; - } - ret += re.substring(0, match.index); - re = re.substring(match.index + match[0].length); - if (match[0][0] == '\\' && match[1]) { - // Adjust the backreference. - ret += '\\' + String(Number(match[1]) + offset); - } else { - ret += match[0]; - if (match[0] == '(') { - numCaptures++; - } - } - } - } - return ret; - } - - function compileMode(mode, parent) { - if (mode.compiled) - return; - mode.compiled = true; - - mode.keywords = mode.keywords || mode.beginKeywords; - if (mode.keywords) { - var compiled_keywords = {}; - - var flatten = function(className, str) { - if (language.case_insensitive) { - str = str.toLowerCase(); - } - str.split(' ').forEach(function(kw) { - var pair = kw.split('|'); - compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1]; - }); - }; - - if (typeof mode.keywords === 'string') { // string - flatten('keyword', mode.keywords); - } else { - objectKeys(mode.keywords).forEach(function (className) { - flatten(className, mode.keywords[className]); - }); - } - mode.keywords = compiled_keywords; - } - mode.lexemesRe = langRe(mode.lexemes || /\w+/, true); - - if (parent) { - if (mode.beginKeywords) { - mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')\\b'; - } - if (!mode.begin) - mode.begin = /\B|\b/; - mode.beginRe = langRe(mode.begin); - if (mode.endSameAsBegin) - mode.end = mode.begin; - if (!mode.end && !mode.endsWithParent) - mode.end = /\B|\b/; - if (mode.end) - mode.endRe = langRe(mode.end); - mode.terminator_end = reStr(mode.end) || ''; - if (mode.endsWithParent && parent.terminator_end) - mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end; - } - if (mode.illegal) - mode.illegalRe = langRe(mode.illegal); - if (mode.relevance == null) - mode.relevance = 1; - if (!mode.contains) { - mode.contains = []; - } - mode.contains = Array.prototype.concat.apply([], mode.contains.map(function(c) { - return expand_mode(c === 'self' ? mode : c); - })); - mode.contains.forEach(function(c) {compileMode(c, mode);}); - - if (mode.starts) { - compileMode(mode.starts, parent); - } - - var terminators = - mode.contains.map(function(c) { - return c.beginKeywords ? '\\.?(?:' + c.begin + ')\\.?' : c.begin; - }) - .concat([mode.terminator_end, mode.illegal]) - .map(reStr) - .filter(Boolean); - mode.terminators = terminators.length ? langRe(joinRe(terminators, '|'), true) : {exec: function(/*s*/) {return null;}}; - } - - compileMode(language); - } - - /* - Core highlighting function. Accepts a language name, or an alias, and a - string with the code to highlight. Returns an object with the following - properties: - - - relevance (int) - - value (an HTML string with highlighting markup) - - */ - function highlight(name, value, ignore_illegals, continuation) { - - function escapeRe(value) { - return new RegExp(value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm'); - } - - function subMode(lexeme, mode) { - var i, length; - - for (i = 0, length = mode.contains.length; i < length; i++) { - if (testRe(mode.contains[i].beginRe, lexeme)) { - if (mode.contains[i].endSameAsBegin) { - mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] ); - } - return mode.contains[i]; - } - } - } - - function endOfMode(mode, lexeme) { - if (testRe(mode.endRe, lexeme)) { - while (mode.endsParent && mode.parent) { - mode = mode.parent; - } - return mode; - } - if (mode.endsWithParent) { - return endOfMode(mode.parent, lexeme); - } - } - - function isIllegal(lexeme, mode) { - return !ignore_illegals && testRe(mode.illegalRe, lexeme); - } - - function keywordMatch(mode, match) { - var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]; - return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str]; - } - - function buildSpan(classname, insideSpan, leaveOpen, noPrefix) { - var classPrefix = noPrefix ? '' : options.classPrefix, - openSpan = ''; - - return openSpan + insideSpan + closeSpan; - } - - function processKeywords() { - var keyword_match, last_index, match, result; - - if (!top.keywords) - return escape(mode_buffer); - - result = ''; - last_index = 0; - top.lexemesRe.lastIndex = 0; - match = top.lexemesRe.exec(mode_buffer); - - while (match) { - result += escape(mode_buffer.substring(last_index, match.index)); - keyword_match = keywordMatch(top, match); - if (keyword_match) { - relevance += keyword_match[1]; - result += buildSpan(keyword_match[0], escape(match[0])); - } else { - result += escape(match[0]); - } - last_index = top.lexemesRe.lastIndex; - match = top.lexemesRe.exec(mode_buffer); - } - return result + escape(mode_buffer.substr(last_index)); - } - - function processSubLanguage() { - var explicit = typeof top.subLanguage === 'string'; - if (explicit && !languages[top.subLanguage]) { - return escape(mode_buffer); - } - - var result = explicit ? - highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : - highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); - - // Counting embedded language score towards the host language may be disabled - // with zeroing the containing mode relevance. Usecase in point is Markdown that - // allows XML everywhere and makes every XML snippet to have a much larger Markdown - // score. - if (top.relevance > 0) { - relevance += result.relevance; - } - if (explicit) { - continuations[top.subLanguage] = result.top; - } - return buildSpan(result.language, result.value, false, true); - } - - function processBuffer() { - result += (top.subLanguage != null ? processSubLanguage() : processKeywords()); - mode_buffer = ''; - } - - function startNewMode(mode) { - result += mode.className? buildSpan(mode.className, '', true): ''; - top = Object.create(mode, {parent: {value: top}}); - } - - function processLexeme(buffer, lexeme) { - - mode_buffer += buffer; - - if (lexeme == null) { - processBuffer(); - return 0; - } - - var new_mode = subMode(lexeme, top); - if (new_mode) { - if (new_mode.skip) { - mode_buffer += lexeme; - } else { - if (new_mode.excludeBegin) { - mode_buffer += lexeme; - } - processBuffer(); - if (!new_mode.returnBegin && !new_mode.excludeBegin) { - mode_buffer = lexeme; - } - } - startNewMode(new_mode, lexeme); - return new_mode.returnBegin ? 0 : lexeme.length; - } - - var end_mode = endOfMode(top, lexeme); - if (end_mode) { - var origin = top; - if (origin.skip) { - mode_buffer += lexeme; - } else { - if (!(origin.returnEnd || origin.excludeEnd)) { - mode_buffer += lexeme; - } - processBuffer(); - if (origin.excludeEnd) { - mode_buffer = lexeme; - } - } - do { - if (top.className) { - result += spanEndTag; - } - if (!top.skip && !top.subLanguage) { - relevance += top.relevance; - } - top = top.parent; - } while (top !== end_mode.parent); - if (end_mode.starts) { - if (end_mode.endSameAsBegin) { - end_mode.starts.endRe = end_mode.endRe; - } - startNewMode(end_mode.starts, ''); - } - return origin.returnEnd ? 0 : lexeme.length; - } - - if (isIllegal(lexeme, top)) - throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); - - /* - Parser should not reach this point as all types of lexemes should be caught - earlier, but if it does due to some bug make sure it advances at least one - character forward to prevent infinite looping. - */ - mode_buffer += lexeme; - return lexeme.length || 1; - } - - var language = getLanguage(name); - if (!language) { - throw new Error('Unknown language: "' + name + '"'); - } - - compileLanguage(language); - var top = continuation || language; - var continuations = {}; // keep continuations for sub-languages - var result = '', current; - for(current = top; current !== language; current = current.parent) { - if (current.className) { - result = buildSpan(current.className, '', true) + result; - } - } - var mode_buffer = ''; - var relevance = 0; - try { - var match, count, index = 0; - while (true) { - top.terminators.lastIndex = index; - match = top.terminators.exec(value); - if (!match) - break; - count = processLexeme(value.substring(index, match.index), match[0]); - index = match.index + count; - } - processLexeme(value.substr(index)); - for(current = top; current.parent; current = current.parent) { // close dangling modes - if (current.className) { - result += spanEndTag; - } - } - return { - relevance: relevance, - value: result, - language: name, - top: top - }; - } catch (e) { - if (e.message && e.message.indexOf('Illegal') !== -1) { - return { - relevance: 0, - value: escape(value) - }; - } else { - throw e; - } - } - } - - /* - Highlighting with language detection. Accepts a string with the code to - highlight. Returns an object with the following properties: - - - language (detected language) - - relevance (int) - - value (an HTML string with highlighting markup) - - second_best (object with the same structure for second-best heuristically - detected language, may be absent) - - */ - function highlightAuto(text, languageSubset) { - languageSubset = languageSubset || options.languages || objectKeys(languages); - var result = { - relevance: 0, - value: escape(text) - }; - var second_best = result; - languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { - var current = highlight(name, text, false); - current.language = name; - if (current.relevance > second_best.relevance) { - second_best = current; - } - if (current.relevance > result.relevance) { - second_best = result; - result = current; - } - }); - if (second_best.language) { - result.second_best = second_best; - } - return result; - } - - /* - Post-processing of the highlighted markup: - - - replace TABs with something more useful - - replace real line-breaks with '
' for non-pre containers - - */ - function fixMarkup(value) { - return !(options.tabReplace || options.useBR) - ? value - : value.replace(fixMarkupRe, function(match, p1) { - if (options.useBR && match === '\n') { - return '
'; - } else if (options.tabReplace) { - return p1.replace(/\t/g, options.tabReplace); - } - return ''; - }); - } - - function buildClassName(prevClassName, currentLang, resultLang) { - var language = currentLang ? aliases[currentLang] : resultLang, - result = [prevClassName.trim()]; - - if (!prevClassName.match(/\bhljs\b/)) { - result.push('hljs'); - } - - if (prevClassName.indexOf(language) === -1) { - result.push(language); - } - - return result.join(' ').trim(); - } - - /* - Applies highlighting to a DOM node containing code. Accepts a DOM node and - two optional parameters for fixMarkup. - */ - function highlightBlock(block) { - var node, originalStream, result, resultNode, text; - var language = blockLanguage(block); - - if (isNotHighlighted(language)) - return; - - if (options.useBR) { - node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); - node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(//g, '\n'); - } else { - node = block; - } - text = node.textContent; - result = language ? highlight(language, text, true) : highlightAuto(text); - - originalStream = nodeStream(node); - if (originalStream.length) { - resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); - resultNode.innerHTML = result.value; - result.value = mergeStreams(originalStream, nodeStream(resultNode), text); - } - result.value = fixMarkup(result.value); - - block.innerHTML = result.value; - block.className = buildClassName(block.className, language, result.language); - block.result = { - language: result.language, - re: result.relevance - }; - if (result.second_best) { - block.second_best = { - language: result.second_best.language, - re: result.second_best.relevance - }; - } - } - - /* - Updates highlight.js global options with values passed in the form of an object. - */ - function configure(user_options) { - options = inherit(options, user_options); - } - - /* - Applies highlighting to all
..
blocks on a page. - */ - function initHighlighting() { - if (initHighlighting.called) - return; - initHighlighting.called = true; - - var blocks = document.querySelectorAll('pre code'); - ArrayProto.forEach.call(blocks, highlightBlock); - } - - /* - Attaches highlighting to the page load event. - */ - function initHighlightingOnLoad() { - addEventListener('DOMContentLoaded', initHighlighting, false); - addEventListener('load', initHighlighting, false); - } - - function registerLanguage(name, language) { - var lang = languages[name] = language(hljs); - restoreLanguageApi(lang); - if (lang.aliases) { - lang.aliases.forEach(function(alias) {aliases[alias] = name;}); - } - } - - function listLanguages() { - return objectKeys(languages); - } - - function getLanguage(name) { - name = (name || '').toLowerCase(); - return languages[name] || languages[aliases[name]]; - } - - function autoDetection(name) { - var lang = getLanguage(name); - return lang && !lang.disableAutodetect; - } - - /* Interface definition */ - - hljs.highlight = highlight; - hljs.highlightAuto = highlightAuto; - hljs.fixMarkup = fixMarkup; - hljs.highlightBlock = highlightBlock; - hljs.configure = configure; - hljs.initHighlighting = initHighlighting; - hljs.initHighlightingOnLoad = initHighlightingOnLoad; - hljs.registerLanguage = registerLanguage; - hljs.listLanguages = listLanguages; - hljs.getLanguage = getLanguage; - hljs.autoDetection = autoDetection; - hljs.inherit = inherit; - - // Common regexps - hljs.IDENT_RE = '[a-zA-Z]\\w*'; - hljs.UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*'; - hljs.NUMBER_RE = '\\b\\d+(\\.\\d+)?'; - hljs.C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float - hljs.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b... - hljs.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'; - - // Common modes - hljs.BACKSLASH_ESCAPE = { - begin: '\\\\[\\s\\S]', relevance: 0 - }; - hljs.APOS_STRING_MODE = { - className: 'string', - begin: '\'', end: '\'', - illegal: '\\n', - contains: [hljs.BACKSLASH_ESCAPE] - }; - hljs.QUOTE_STRING_MODE = { - className: 'string', - begin: '"', end: '"', - illegal: '\\n', - contains: [hljs.BACKSLASH_ESCAPE] - }; - hljs.PHRASAL_WORDS_MODE = { - begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ - }; - hljs.COMMENT = function (begin, end, inherits) { - var mode = hljs.inherit( - { - className: 'comment', - begin: begin, end: end, - contains: [] - }, - inherits || {} - ); - mode.contains.push(hljs.PHRASAL_WORDS_MODE); - mode.contains.push({ - className: 'doctag', - begin: '(?:TODO|FIXME|NOTE|BUG|XXX):', - relevance: 0 - }); - return mode; - }; - hljs.C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$'); - hljs.C_BLOCK_COMMENT_MODE = hljs.COMMENT('/\\*', '\\*/'); - hljs.HASH_COMMENT_MODE = hljs.COMMENT('#', '$'); - hljs.NUMBER_MODE = { - className: 'number', - begin: hljs.NUMBER_RE, - relevance: 0 - }; - hljs.C_NUMBER_MODE = { - className: 'number', - begin: hljs.C_NUMBER_RE, - relevance: 0 - }; - hljs.BINARY_NUMBER_MODE = { - className: 'number', - begin: hljs.BINARY_NUMBER_RE, - relevance: 0 - }; - hljs.CSS_NUMBER_MODE = { - className: 'number', - begin: hljs.NUMBER_RE + '(' + - '%|em|ex|ch|rem' + - '|vw|vh|vmin|vmax' + - '|cm|mm|in|pt|pc|px' + - '|deg|grad|rad|turn' + - '|s|ms' + - '|Hz|kHz' + - '|dpi|dpcm|dppx' + - ')?', - relevance: 0 - }; - hljs.REGEXP_MODE = { - className: 'regexp', - begin: /\//, end: /\/[gimuy]*/, - illegal: /\n/, - contains: [ - hljs.BACKSLASH_ESCAPE, - { - begin: /\[/, end: /\]/, - relevance: 0, - contains: [hljs.BACKSLASH_ESCAPE] - } - ] - }; - hljs.TITLE_MODE = { - className: 'title', - begin: hljs.IDENT_RE, - relevance: 0 - }; - hljs.UNDERSCORE_TITLE_MODE = { - className: 'title', - begin: hljs.UNDERSCORE_IDENT_RE, - relevance: 0 - }; - hljs.METHOD_GUARD = { - // excludes method names from keyword processing - begin: '\\.\\s*' + hljs.UNDERSCORE_IDENT_RE, - relevance: 0 - }; - - return hljs; -})); - /*! * pixi.js - v4.8.7 * Compiled Fri, 22 Mar 2019 16:20:35 UTC @@ -78532,6 +77642,7563 @@ var pixi_projection; _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated })((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenLite"); +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o difference ? difference : change; + this.object.rotation += delta * sign; + } + } + }]); + + return face; +}(wait); + +module.exports = face; + +},{"./wait":11,"yy-angle":22}],3:[function(require,module,exports){ +'use strict'; + +var Ease = { + list: require('./list'), + wait: require('./wait'), + to: require('./to'), + shake: require('./shake'), + tint: require('./tint'), + face: require('./face'), + angle: require('./angle'), + target: require('./target'), + movie: require('./movie'), + load: require('./load') +}; + +PIXI.extras.Ease = Ease; + +module.exports = Ease; + +},{"./angle":1,"./face":2,"./list":4,"./load":5,"./movie":6,"./shake":7,"./target":8,"./tint":9,"./to":10,"./wait":11}],4:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Events = require('eventemitter3'); + +var Angle = require('./angle'); +var Face = require('./face'); +var Load = require('./load'); +var Movie = require('./movie'); +var Shake = require('./shake'); +var Target = require('./target'); +var Tint = require('./tint'); +var To = require('./to'); +var Wait = require('./wait'); + +var Ease = function (_Events) { + _inherits(Ease, _Events); + + /** + * Main class for creating eases + * @param {object} [options] + * @param {boolean} [options.noTicker] don't add the update function to PIXI.ticker + * @param {PIXI.ticker} [options.ticker=PIXI.ticker.shared] use this PIXI.ticker for the list + * @extends eventemitter + * @fire done + * @fire each + */ + function Ease(options) { + _classCallCheck(this, Ease); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (Ease.__proto__ || Object.getPrototypeOf(Ease)).call(this)); + + if (!options.noTicker) { + var ticker = options.ticker || PIXI.ticker.shared; + ticker.add(function () { + return _this.update(ticker.elapsedMS); + }); + } + _this.list = []; + _this.empty = true; + _this.removeWaiting = []; + _this.removeAllWaiting = false; + return _this; + } + + /** + * Add animation(s) to animation list + * @param {(object|object[])} any animation class + * @return {object} first animation + */ + + + _createClass(Ease, [{ + key: 'add', + value: function add() { + var first = void 0; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = arguments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var arg = _step.value; + + if (Array.isArray(arg)) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = arg[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var entry = _step2.value; + + if (!first) { + first = entry; + } + this.list.push(entry); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } else { + first = arg; + this.list.push(arg); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + this.empty = false; + return first; + } + + /** + * remove animation(s) + * @param {object|array} animate - the animation (or array of animations) to remove; can be null + */ + + }, { + key: 'remove', + value: function remove(animate) { + if (this.inUpdate) { + this.removeWaiting.push(animate); + } else { + var index = this.list.indexOf(animate); + if (index !== -1) { + this.list.splice(index, 1); + } + } + } + + /** + * remove all animations from list + * @inherited from yy-loop + */ + + }, { + key: 'removeAll', + value: function removeAll() { + if (this.inUpdate) { + this.removeAllWaiting = true; + } else { + this.list = []; + } + } + + /** + * update frame + * this is automatically added to PIXI.ticker unless options.noTicker is set + * if using options.noTicker, this should be called manually + * @param {number} elasped time in MS since last update + */ + + }, { + key: 'update', + value: function update(elapsed) { + this.inUpdate = true; + for (var i = 0, _i = this.list.length; i < _i; i++) { + if (this.list[i] && this.list[i].update(elapsed)) { + this.list.splice(i, 1); + i--; + _i--; + } + } + this.emit('each', this); + if (this.list.length === 0 && !this.empty) { + this.emit('done', this); + this.empty = true; + } + this.inUpdate = false; + if (this.removeAllWaiting) { + this.removeAll(); + this.removeAllWaiting = false; + } + while (this.removeWaiting.length) { + this.remove(this.removeWaiting.pop()); + } + } + + /** + * number of animations + * @type {number} + */ + + }, { + key: 'to', + + + /** + * default options for all eases + * @typedef {object} EaseOptions + * @param {object} [EaseOptions.options] + * @param {number} [EaseOptions.options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [EaseOptions.options.pause] start the animation paused + * @param {boolean|number} [EaseOptions.options.repeat] true: repeat animation forever n: repeat animation n times + * @param {boolean|number} [EaseOptions.options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * @param {Function} [EaseOptions.options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set + * @param {string|Function} [EaseOptions.options.ease] name or function from easing.js (see http://easings.net for examples) + */ + + /** + * ease parameters of object + * @param {PIXI.DisplayObject} object to animate + * @param {object} goto - parameters to animate, e.g.: {alpha: 5, scale: {3, 5}, scale: 5, rotation: Math.PI} + * @param {number} duration - time to run + * @fires done + * @fires wait + * @fires first + * @fires each + * @fires loop + * @fires reverse + */ + value: function to() { + return this.add(new (Function.prototype.bind.apply(To, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** + * animate object's {x, y} using an angle + * @param {object} object to animate + * @param {number} angle in radians + * @param {number} speed in pixels/millisecond + * @param {number} [duration=0] in milliseconds; if 0, then continues forever + * @param {object} [options] @see {@link Wait} + */ + + }, { + key: 'angle', + value: function angle() { + return this.add(new (Function.prototype.bind.apply(Angle, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.face class; see Ease.to class below for parameters */ + + }, { + key: 'face', + value: function face() { + return this.add(new (Function.prototype.bind.apply(Face, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.load class; see Ease.to class below for parameters */ + + }, { + key: 'load', + value: function load() { + return this.add(new (Function.prototype.bind.apply(Load, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.movie class; see Ease.to class below for parameters */ + + }, { + key: 'movie', + value: function movie() { + return this.add(new (Function.prototype.bind.apply(Movie, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.shake class; see Ease.to class below for parameters */ + + }, { + key: 'shake', + value: function shake() { + return this.add(new (Function.prototype.bind.apply(Shake, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.target class; see Ease.to class below for parameters */ + + }, { + key: 'target', + value: function target() { + return this.add(new (Function.prototype.bind.apply(Target, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.angle tint; see Ease.to class below for parameters */ + + }, { + key: 'tint', + value: function tint() { + return this.add(new (Function.prototype.bind.apply(Tint, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.wait class; see Ease.to class below for parameters */ + + }, { + key: 'wait', + value: function wait() { + return this.add(new (Function.prototype.bind.apply(Wait, [null].concat(Array.prototype.slice.call(arguments))))()); + } + }, { + key: 'count', + get: function get() { + return this.list.length; + } + + /** + * number of active animations + * @type {number} + */ + + }, { + key: 'countRunning', + get: function get() { + var count = 0; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = this.list[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var entry = _step3.value; + + if (!entry.pause) { + count++; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return count; + } + }]); + + return Ease; +}(Events); + +module.exports = Ease; + +},{"./angle":1,"./face":2,"./load":5,"./movie":6,"./shake":7,"./target":8,"./tint":9,"./to":10,"./wait":11,"eventemitter3":12}],5:[function(require,module,exports){ +'use strict'; + +var wait = require('./wait'); +var to = require('./to'); +var tint = require('./tint'); +var shake = require('./shake'); +var angle = require('./angle'); +var face = require('./face'); +var target = require('./target'); +var movie = require('./movie'); + +/** + * restart an animation = requires a saved state + * @param {object} object(s) to animate + */ +function load(object, load) { + if (!load) { + return null; + } + var options = { load: load }; + switch (load.type) { + case 'Wait': + return new wait(object, options); + case 'To': + return new to(object, null, null, options); + case 'Tint': + return new tint(object, null, null, options); + case 'Shake': + return new shake(object, null, null, options); + case 'Angle': + return new angle(object, null, null, null, options); + case 'Face': + return new face(object[0], object[1], null, options); + case 'Target': + return new target(object[0], object[1], null, options); + case 'Movie': + return new movie(object, object[1], null, options); + } +} + +module.exports = load; + +},{"./angle":1,"./face":2,"./movie":6,"./shake":7,"./target":8,"./tint":9,"./to":10,"./wait":11}],6:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** + * animate a movie of textures + */ + +var movie = function (_wait) { + _inherits(movie, _wait); + + /** + * @param {object} object to animate + * @param {PIXI.Texture[]} textures + * @param {number} [duration=0] time to run (use 0 for infinite duration--should only be used with customized easing functions) + * @param {object} [options] + * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [options.pause] start the animation paused + * @param {(boolean|number)} [options.repeat] true: repeat animation forever n: repeat animation n times + * @param {(boolean|number)} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * @param {(boolean|number)} [options.continue] true: continue animation with new starting values n: continue animation n times + * @param {Function} [options.load] loads an animation using a .save() object note the * parameters below cannot be loaded and must be re-set + * @param {Function} [options.ease] function from easing.js (see http://easings.net for examples) + * @emits {done} animation expires + * @emits {wait} each update during a wait + * @emits {first} first update when animation starts + * @emits {each} each update while animation is running + * @emits {loop} when animation is repeated + * @emits {reverse} when animation is reversed + */ + function movie(object, textures, duration, options) { + _classCallCheck(this, movie); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (movie.__proto__ || Object.getPrototypeOf(movie)).call(this, object, options)); + + _this.type = 'Movie'; + if (Array.isArray(object)) { + _this.list = object; + _this.object = _this.list[0]; + } + if (options.load) { + _this.load(options.load); + } else { + _this.textures = textures; + _this.duration = duration; + _this.current = 0; + _this.length = textures.length; + _this.interval = duration / _this.length; + _this.isReverse = false; + _this.restart(); + } + return _this; + } + + _createClass(movie, [{ + key: 'save', + value: function save() { + var save = _get(movie.prototype.__proto__ || Object.getPrototypeOf(movie.prototype), 'save', this).call(this); + save.goto = this.goto; + save.current = this.current; + save.length = this.length; + save.interval = this.interval; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(movie.prototype.__proto__ || Object.getPrototypeOf(movie.prototype), 'load', this).call(this, _load); + this.goto = _load.goto; + this.current = _load.current; + this.interval = _load.current; + } + }, { + key: 'restart', + value: function restart() { + this.current = 0; + this.time = 0; + this.isReverse = false; + } + }, { + key: 'reverse', + value: function reverse() { + this.isReverse = !this.isReverse; + } + }, { + key: 'calculate', + value: function calculate() { + var index = Math.round(this.options.ease(this.time, 0, this.length - 1, this.duration)); + if (this.isReverse) { + index = this.length - 1 - index; + } + if (this.list) { + for (var i = 0; i < this.list.length; i++) { + this.list[i].texture = this.textures[index]; + } + } else { + this.object.texture = this.textures[index]; + } + } + }]); + + return movie; +}(wait); + +module.exports = movie; + +},{"./wait":11}],7:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** + * shakes an object or list of objects + */ + +var shake = function (_wait) { + _inherits(shake, _wait); + + /** + * @param {object|array} object or list of objects to shake + * @param {number} amount to shake + * @param {number} duration (in milliseconds) to shake + * @param {object} options (see Animate.wait) + */ + function shake(object, amount, duration, options) { + _classCallCheck(this, shake); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (shake.__proto__ || Object.getPrototypeOf(shake)).call(this, object, options)); + + _this.type = 'Shake'; + if (Array.isArray(object)) { + _this.array = true; + _this.list = object; + } + if (options.load) { + _this.load(options.load); + } else { + if (_this.list) { + _this.start = []; + for (var i = 0; i < object.length; i++) { + var target = object[i]; + _this.start[i] = { x: target.x, y: target.y }; + } + } else { + _this.start = { x: object.x, y: object.y }; + } + _this.amount = amount; + _this.duration = duration; + } + return _this; + } + + _createClass(shake, [{ + key: 'save', + value: function save() { + var save = _get(shake.prototype.__proto__ || Object.getPrototypeOf(shake.prototype), 'save', this).call(this); + save.start = this.start; + save.amount = this.amount; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(shake.prototype.__proto__ || Object.getPrototypeOf(shake.prototype), 'load', this).call(this, _load); + this.start = _load.start; + this.amount = _load.amount; + } + }, { + key: 'calculate', + value: function calculate() /*elapsed*/{ + var object = this.object; + var start = this.start; + var amount = this.amount; + if (this.array) { + var list = this.list; + for (var i = 0; i < list.length; i++) { + var _object = list[i]; + var actual = start[i]; + _object.x = actual.x + Math.floor(Math.random() * amount * 2) - amount; + _object.y = actual.y + Math.floor(Math.random() * amount * 2) - amount; + } + } + object.x = start.x + Math.floor(Math.random() * amount * 2) - amount; + object.y = start.y + Math.floor(Math.random() * amount * 2) - amount; + } + }, { + key: 'done', + value: function done() { + var object = this.object; + var start = this.start; + if (this.array) { + var list = this.list; + for (var i = 0; i < list.length; i++) { + var _object2 = list[i]; + var actual = start[i]; + _object2.x = actual.x; + _object2.y = actual.y; + } + } else { + object.x = start.x; + object.y = start.y; + } + } + }]); + + return shake; +}(wait); + +module.exports = shake; + +},{"./wait":11}],8:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** move an object to a target's location */ + +var target = function (_wait) { + _inherits(target, _wait); + + /** + * move to a target + * @param {object} object - object to animate + * @param {object} target - object needs to contain {x: x, y: y} + * @param {number} speed - number of pixels to move per millisecond + * @param {object} [options] @see {@link Wait} + * @param {boolean} [options.keepAlive] don't cancel the animation when target is reached + */ + function target(object, _target, speed, options) { + _classCallCheck(this, target); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (target.__proto__ || Object.getPrototypeOf(target)).call(this, object, options)); + + _this.type = 'Target'; + _this.target = _target; + if (options.load) { + _this.load(options.load); + } else { + _this.speed = speed; + } + return _this; + } + + _createClass(target, [{ + key: 'save', + value: function save() { + var save = _get(target.prototype.__proto__ || Object.getPrototypeOf(target.prototype), 'save', this).call(this); + save.speed = this.speed; + save.keepAlive = this.options.keepAlive; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(target.prototype.__proto__ || Object.getPrototypeOf(target.prototype), 'load', this).call(this, _load); + this.speed = _load.speed; + this.options.keepAlive = _load.keepAlive; + } + }, { + key: 'calculate', + value: function calculate(elapsed) { + var deltaX = this.target.x - this.object.x; + var deltaY = this.target.y - this.object.y; + if (deltaX === 0 && deltaY === 0) { + this.emit('done', this.object); + if (!this.options.keepAlive) { + return true; + } + } else { + var angle = Math.atan2(deltaY, deltaX); + this.object.x += Math.cos(angle) * elapsed * this.speed; + this.object.y += Math.sin(angle) * elapsed * this.speed; + if (deltaX >= 0 !== this.target.x - this.object.x >= 0) { + this.object.x = this.target.x; + } + if (deltaY >= 0 !== this.target.y - this.object.y >= 0) { + this.object.y = this.target.y; + } + } + } + }]); + + return target; +}(wait); + +module.exports = target; + +},{"./wait":11}],9:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Color = require('yy-color'); +var wait = require('./wait'); + +var tint = function (_wait) { + _inherits(tint, _wait); + + /** + * @param {PIXI.DisplayObject|PIXI.DisplayObject[]} object + * @param {number|number[]} tint + * @param {number} [duration] in milliseconds + * @param {object} [options] @see {@link Wait} + */ + function tint(object, _tint, duration, options) { + _classCallCheck(this, tint); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (tint.__proto__ || Object.getPrototypeOf(tint)).call(this, object, options)); + + _this.type = 'Tint'; + if (Array.isArray(object)) { + _this.list = object; + _this.object = _this.list[0]; + } + _this.duration = duration; + if (options.load) { + _this.load(options.load); + } else if (Array.isArray(_tint)) { + _this.tints = [_this.object.tint].concat(_toConsumableArray(_tint)); + } else { + _this.start = _this.object.tint; + _this.to = _tint; + } + return _this; + } + + _createClass(tint, [{ + key: 'save', + value: function save() { + var save = _get(tint.prototype.__proto__ || Object.getPrototypeOf(tint.prototype), 'save', this).call(this); + save.start = this.start; + save.to = this.to; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(tint.prototype.__proto__ || Object.getPrototypeOf(tint.prototype), 'load', this).call(this, _load); + this.start = _load.start; + this.to = _load.to; + } + }, { + key: 'calculate', + value: function calculate() { + var percent = this.options.ease(this.time, 0, 1, this.duration); + if (this.tints) { + var each = 1 / (this.tints.length - 1); + var per = each; + for (var i = 1; i < this.tints.length; i++) { + if (percent <= per) { + var color = Color.blend(1 - (per - percent) / each, this.tints[i - 1], this.tints[i]); + if (this.list) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = this.list[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var object = _step.value; + + object.tint = color; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } else { + this.object.tint = color; + } + break; + } + per += each; + } + } else { + var _color = Color.blend(percent, this.start, this.to); + if (this.list) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = this.list[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _object = _step2.value; + + _object.tint = _color; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } else { + this.object.tint = _color; + } + } + } + }, { + key: 'reverse', + value: function reverse() { + if (this.tints) { + var tints = []; + for (var i = this.tints.length - 1; i >= 0; i--) { + tints.push(this.tints[i]); + } + this.tints = tints; + } else { + var swap = this.to; + this.to = this.start; + this.start = swap; + } + } + }]); + + return tint; +}(wait); + +module.exports = tint; + +},{"./wait":11,"yy-color":23}],10:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** animate any numeric parameter of an object or array of objects */ + +var to = function (_wait) { + _inherits(to, _wait); + + /** + * @private + * @param {object} object to animate + * @param {object} goto - parameters to animate, e.g.: {alpha: 5, scale: {3, 5}, scale: 5, rotation: Math.PI} + * @param {number} duration - time to run + * @param {object} [options] + * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [options.pause] start the animation paused + * @param {boolean|number} [options.repeat] true: repeat animation forever n: repeat animation n times + * @param {boolean|number} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * @param {Function} [options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set + * @param {string|Function} [options.ease] name or function from easing.js (see http://easings.net for examples) + * @emits to:done animation expires + * @emits to:wait each update during a wait + * @emits to:first first update when animation starts + * @emits to:each each update while animation is running + * @emits to:loop when animation is repeated + * @emits to:reverse when animation is reversed + */ + function to(object, goto, duration, options) { + _classCallCheck(this, to); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (to.__proto__ || Object.getPrototypeOf(to)).call(this, object, options)); + + _this.type = 'To'; + if (Array.isArray(object)) { + _this.list = object; + _this.object = _this.list[0]; + } + if (options.load) { + _this.load(options.load); + } else { + _this.goto = goto; + _this.fixScale(); + _this.duration = duration; + _this.restart(); + } + return _this; + } + + /** + * converts scale from { scale: n } to { scale: { x: n, y: n }} + * @private + */ + + + _createClass(to, [{ + key: 'fixScale', + value: function fixScale() { + if (typeof this.goto['scale'] !== 'undefined' && !Number.isNaN(this.goto['scale'])) { + this.goto['scale'] = { x: this.goto['scale'], y: this.goto['scale'] }; + } + } + }, { + key: 'save', + value: function save() { + var save = _get(to.prototype.__proto__ || Object.getPrototypeOf(to.prototype), 'save', this).call(this); + save.goto = this.goto; + save.start = this.start; + save.delta = this.delta; + save.keys = this.keys; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(to.prototype.__proto__ || Object.getPrototypeOf(to.prototype), 'load', this).call(this, _load); + this.goto = _load.goto; + this.start = _load.start; + this.delta = _load.delta; + this.keys = _load.keys; + } + }, { + key: 'restart', + value: function restart() { + var i = 0; + var start = this.start = []; + var delta = this.delta = []; + var keys = this.keys = []; + var goto = this.goto; + var object = this.object; + + // loops through all keys in goto object + for (var key in goto) { + + // handles keys with one additional level e.g.: goto = {scale: {x: 5, y: 3}} + if (isNaN(goto[key])) { + keys[i] = { key: key, children: [] }; + start[i] = []; + delta[i] = []; + var j = 0; + for (var key2 in goto[key]) { + keys[i].children[j] = key2; + start[i][j] = parseFloat(object[key][key2]); + start[i][j] = this._correctDOM(key2, start[i][j]); + start[i][j] = isNaN(this.start[i][j]) ? 0 : start[i][j]; + delta[i][j] = goto[key][key2] - start[i][j]; + j++; + } + } else { + start[i] = parseFloat(object[key]); + start[i] = this._correctDOM(key, start[i]); + start[i] = isNaN(this.start[i]) ? 0 : start[i]; + delta[i] = goto[key] - start[i]; + keys[i] = key; + } + i++; + } + this.time = 0; + } + }, { + key: 'reverse', + value: function reverse() { + var object = this.object; + var keys = this.keys; + var goto = this.goto; + var delta = this.delta; + var start = this.start; + + for (var i = 0, _i = keys.length; i < _i; i++) { + var key = keys[i]; + if (isNaN(goto[key])) { + for (var j = 0, _j = key.children.length; j < _j; j++) { + delta[i][j] = -delta[i][j]; + start[i][j] = parseFloat(object[key.key][key.children[j]]); + start[i][j] = isNaN(start[i][j]) ? 0 : start[i][j]; + } + } else { + delta[i] = -delta[i]; + start[i] = parseFloat(object[key]); + start[i] = isNaN(start[i]) ? 0 : start[i]; + } + } + } + }, { + key: 'calculate', + value: function calculate() /*elapsed*/{ + var object = this.object; + var list = this.list; + var keys = this.keys; + var goto = this.goto; + var time = this.time; + var start = this.start; + var delta = this.delta; + var duration = this.duration; + var ease = this.options.ease; + for (var i = 0, _i = this.keys.length; i < _i; i++) { + var key = keys[i]; + if (isNaN(goto[key])) { + var key1 = key.key; + for (var j = 0, _j = key.children.length; j < _j; j++) { + var key2 = key.children[j]; + var others = object[key1][key2] = time >= duration ? start[i][j] + delta[i][j] : ease(time, start[i][j], delta[i][j], duration); + if (list) { + for (var k = 1, _k = list.length; k < _k; k++) { + list[k][key1][key2] = others; + } + } + } + } else { + var _key = keys[i]; + var _others = object[_key] = time >= duration ? start[i] + delta[i] : ease(time, start[i], delta[i], duration); + if (list) { + for (var _j2 = 1, _j3 = this.list.length; _j2 < _j3; _j2++) { + list[_j2][_key] = _others; + } + } + } + } + } + }]); + + return to; +}(wait); + +module.exports = to; + +},{"./wait":11}],11:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Easing = require('penner'); +var EventEmitter = require('eventemitter3'); + +var wait = function (_EventEmitter) { + _inherits(wait, _EventEmitter); + + /** + * @param {object|object[]} object or list of objects to animate + * @param {object} [options] + * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [options.pause] start the animation paused + * @param {(boolean|number)} [options.repeat] true: repeat animation forever n: repeat animation n times + * @param {(boolean|number)} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * + * @param {number} [options.id] user-generated id (e.g., I use it to properly load animations when an object has multiple animations running) + * @param {Function} [options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set + * @param {Function|string} [options.ease] function (or penner function name) from easing.js (see http://easings.net for examples)* + * + * @emits {done} animation expires + * @emits {wait} each update during a wait + * @emits {first} first update when animation starts + * @emits {each} each update while animation is running + * @emits {loop} when animation is repeated + * @emits {reverse} when animation is reversed + */ + function wait(object, options) { + _classCallCheck(this, wait); + + var _this = _possibleConstructorReturn(this, (wait.__proto__ || Object.getPrototypeOf(wait)).call(this)); + + _this.object = object; + _this.options = options || {}; + _this.type = 'Wait'; + if (_this.options.load) { + _this.load(_this.options.load); + } else { + _this.time = 0; + } + if (_this.options.ease && typeof _this.options.ease !== 'function') { + _this.options.easeName = _this.options.ease; + _this.options.ease = Easing[_this.options.ease]; + } + if (!_this.options.ease) { + _this.options.ease = Easing['linear']; + } + return _this; + } + + _createClass(wait, [{ + key: 'save', + value: function save() { + var save = { type: this.type, time: this.time, duration: this.duration, ease: this.options.easeName }; + var options = this.options; + if (options.wait) { + save.wait = options.wait; + } + if (typeof options.id !== 'undefined') { + save.id = options.id; + } + if (options.pause) { + save.pause = options.pause; + } + if (options.repeat) { + save.repeat = options.repeat; + } + if (options.reverse) { + save.reverse = options.reverse; + } + return save; + } + }, { + key: 'load', + value: function load(_load) { + this.options.wait = _load.wait; + this.options.pause = _load.pause; + this.options.repeat = _load.repeat; + this.options.reverse = _load.reverse; + this.options.id = _load.id; + this.options.ease = _load.ease; + if (this.options.ease && typeof this.options.ease !== 'function') { + this.options.easeName = this.options.ease; + this.options.ease = Easing[this.options.ease]; + } + if (!this.options.ease) { + this.options.ease = Easing['linear']; + } + this.time = _load.time; + this.duration = _load.duration; + } + + /** + * pause this entry + * @type {boolean} + */ + + }, { + key: 'end', + value: function end(leftOver) { + if (this.options.reverse) { + this.reverse(); + this.time = leftOver; + if (!this.options.repeat) { + if (this.options.reverse === true) { + this.options.reverse = false; + } else { + this.options.reverse--; + } + } else { + if (this.options.repeat !== true) { + this.options.repeat--; + } + } + this.emit('loop', this.list || this.object); + } else if (this.options.repeat) { + this.time = leftOver; + if (this.options.repeat !== true) { + this.options.repeat--; + } + this.emit('loop', this.list || this.object); + } else { + this.done(); + this.emit('done', this.list || this.object, leftOver); + // this.list = this.object = null + return true; + } + } + }, { + key: 'update', + value: function update(elapsed) { + var options = this.options; + if (options.pause) { + return; + } + if (options.wait) { + options.wait -= elapsed; + if (options.wait <= 0) { + elapsed = -options.wait; + options.wait = false; + } else { + this.emit('wait', elapsed, this.list || this.object); + return; + } + } + if (!this.first) { + this.first = true; + this.emit('first', this.list || this.object); + } + this.time += elapsed; + var leftOver = 0; + var duration = this.duration; + var time = this.time; + if (duration !== 0 && time > duration) { + leftOver = time - duration; + this.time = time = duration; + } + var force = this.calculate(elapsed); + this.emit('each', elapsed, this.list || this.object, this); + if (this.type === 'Wait' || duration !== 0 && time === duration) { + return this.end(leftOver); + } + return force || time === duration; + } + + // correct certain DOM values + + }, { + key: '_correctDOM', + value: function _correctDOM(key, value) { + switch (key) { + case 'opacity': + return isNaN(value) ? 1 : value; + } + return value; + } + }, { + key: 'reverse', + value: function reverse() {} + }, { + key: 'calculate', + value: function calculate() {} + }, { + key: 'done', + value: function done() {} + }, { + key: 'pause', + set: function set(value) { + this.options.pause = value; + }, + get: function get() { + return this.options.pause; + } + }]); + + return wait; +}(EventEmitter); + +module.exports = wait; + +},{"eventemitter3":12,"penner":13}],12:[function(require,module,exports){ +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + +},{}],13:[function(require,module,exports){ + +/* + Copyright © 2001 Robert Penner + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + Neither the name of the author nor the names of contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +(function() { + var penner, umd; + + umd = function(factory) { + if (typeof exports === 'object') { + return module.exports = factory; + } else if (typeof define === 'function' && define.amd) { + return define([], factory); + } else { + return this.penner = factory; + } + }; + + penner = { + linear: function(t, b, c, d) { + return c * t / d + b; + }, + easeInQuad: function(t, b, c, d) { + return c * (t /= d) * t + b; + }, + easeOutQuad: function(t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + }, + easeInOutQuad: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t + b; + } else { + return -c / 2 * ((--t) * (t - 2) - 1) + b; + } + }, + easeInCubic: function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + easeOutCubic: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOutCubic: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t + 2) + b; + } + }, + easeInQuart: function(t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + easeOutQuart: function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + easeInOutQuart: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } else { + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + } + }, + easeInQuint: function(t, b, c, d) { + return c * (t /= d) * t * t * t * t + b; + }, + easeOutQuint: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + easeInOutQuint: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + } + }, + easeInSine: function(t, b, c, d) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + easeOutSine: function(t, b, c, d) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + easeInOutSine: function(t, b, c, d) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + easeInExpo: function(t, b, c, d) { + if (t === 0) { + return b; + } else { + return c * Math.pow(2, 10 * (t / d - 1)) + b; + } + }, + easeOutExpo: function(t, b, c, d) { + if (t === d) { + return b + c; + } else { + return c * (-Math.pow(2, -10 * t / d) + 1) + b; + } + }, + easeInOutExpo: function(t, b, c, d) { + if (t === 0) { + b; + } + if (t === d) { + b + c; + } + if ((t /= d / 2) < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } else { + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + } + }, + easeInCirc: function(t, b, c, d) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + easeOutCirc: function(t, b, c, d) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + easeInOutCirc: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + } else { + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + } + }, + easeInElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + easeOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + }, + easeInOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d / 2) === 2) { + b + c; + } + if (!p) { + p = d * (.3 * 1.5); + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + if (t < 1) { + return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + } else { + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; + } + }, + easeInBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + easeOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + easeInOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + if ((t /= d / 2) < 1) { + return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b; + } else { + return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; + } + }, + easeInBounce: function(t, b, c, d) { + var v; + v = penner.easeOutBounce(d - t, 0, c, d); + return c - v + b; + }, + easeOutBounce: function(t, b, c, d) { + if ((t /= d) < 1 / 2.75) { + return c * (7.5625 * t * t) + b; + } else if (t < 2 / 2.75) { + return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b; + } else if (t < 2.5 / 2.75) { + return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b; + } else { + return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b; + } + }, + easeInOutBounce: function(t, b, c, d) { + var v; + if (t < d / 2) { + v = penner.easeInBounce(t * 2, 0, c, d); + return v * .5 + b; + } else { + v = penner.easeOutBounce(t * 2 - d, 0, c, d); + return v * .5 + c * .5 + b; + } + } + }; + + umd(penner); + +}).call(this); + +},{}],14:[function(require,module,exports){ +// A library of seedable RNGs implemented in Javascript. +// +// Usage: +// +// var seedrandom = require('seedrandom'); +// var random = seedrandom(1); // or any seed. +// var x = random(); // 0 <= x < 1. Every bit is random. +// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. + +// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. +// Period: ~2^116 +// Reported to pass all BigCrush tests. +var alea = require('./lib/alea'); + +// xor128, a pure xor-shift generator by George Marsaglia. +// Period: 2^128-1. +// Reported to fail: MatrixRank and LinearComp. +var xor128 = require('./lib/xor128'); + +// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. +// Period: 2^192-2^32 +// Reported to fail: CollisionOver, SimpPoker, and LinearComp. +var xorwow = require('./lib/xorwow'); + +// xorshift7, by François Panneton and Pierre L'ecuyer, takes +// a different approach: it adds robustness by allowing more shifts +// than Marsaglia's original three. It is a 7-shift generator +// with 256 bits, that passes BigCrush with no systmatic failures. +// Period 2^256-1. +// No systematic BigCrush failures reported. +var xorshift7 = require('./lib/xorshift7'); + +// xor4096, by Richard Brent, is a 4096-bit xor-shift with a +// very long period that also adds a Weyl generator. It also passes +// BigCrush with no systematic failures. Its long period may +// be useful if you have many generators and need to avoid +// collisions. +// Period: 2^4128-2^32. +// No systematic BigCrush failures reported. +var xor4096 = require('./lib/xor4096'); + +// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random +// number generator derived from ChaCha, a modern stream cipher. +// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf +// Period: ~2^127 +// No systematic BigCrush failures reported. +var tychei = require('./lib/tychei'); + +// The original ARC4-based prng included in this library. +// Period: ~2^1600 +var sr = require('./seedrandom'); + +sr.alea = alea; +sr.xor128 = xor128; +sr.xorwow = xorwow; +sr.xorshift7 = xorshift7; +sr.xor4096 = xor4096; +sr.tychei = tychei; + +module.exports = sr; + +},{"./lib/alea":15,"./lib/tychei":16,"./lib/xor128":17,"./lib/xor4096":18,"./lib/xorshift7":19,"./lib/xorwow":20,"./seedrandom":21}],15:[function(require,module,exports){ +// A port of an algorithm by Johannes Baagøe , 2010 +// http://baagoe.com/en/RandomMusings/javascript/ +// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror +// Original work is under MIT license - + +// Copyright (C) 2010 by Johannes Baagøe +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// 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. + + + +(function(global, module, define) { + +function Alea(seed) { + var me = this, mash = Mash(); + + me.next = function() { + var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + + // Apply the seeding algorithm from Baagoe. + me.c = 1; + me.s0 = mash(' '); + me.s1 = mash(' '); + me.s2 = mash(' '); + me.s0 -= mash(seed); + if (me.s0 < 0) { me.s0 += 1; } + me.s1 -= mash(seed); + if (me.s1 < 0) { me.s1 += 1; } + me.s2 -= mash(seed); + if (me.s2 < 0) { me.s2 += 1; } + mash = null; +} + +function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; +} + +function impl(seed, opts) { + var xg = new Alea(seed), + state = opts && opts.state, + prng = xg.next; + prng.int32 = function() { return (xg.next() * 0x100000000) | 0; } + prng.double = function() { + return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 + }; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +function Mash() { + var n = 0xefc8249d; + + var mash = function(data) { + data = data.toString(); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000; // 2^32 + } + return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 + }; + + return mash; +} + + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.alea = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],16:[function(require,module,exports){ +// A Javascript implementaion of the "Tyche-i" prng algorithm by +// Samuel Neves and Filipe Araujo. +// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = (b << 25) ^ (b >>> 7) ^ c; + c = (c - d) | 0; + d = (d << 24) ^ (d >>> 8) ^ a; + a = (a - b) | 0; + me.b = b = (b << 20) ^ (b >>> 12) ^ c; + me.c = c = (c - d) | 0; + me.d = (d << 16) ^ (c >>> 16) ^ a; + return me.a = (a - b) | 0; + }; + + /* The following is non-inverted tyche, which has better internal + * bit diffusion, but which is about 25% slower than tyche-i in JS. + me.next = function() { + var a = me.a, b = me.b, c = me.c, d = me.d; + a = (me.a + me.b | 0) >>> 0; + d = me.d ^ a; d = d << 16 ^ d >>> 16; + c = me.c + d | 0; + b = me.b ^ c; b = b << 12 ^ d >>> 20; + me.a = a = a + b | 0; + d = d ^ a; me.d = d = d << 8 ^ d >>> 24; + me.c = c = c + d | 0; + b = b ^ c; + return me.b = (b << 7 ^ b >>> 25); + } + */ + + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + + if (seed === Math.floor(seed)) { + // Integer seed. + me.a = (seed / 0x100000000) | 0; + me.b = seed | 0; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; +}; + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.tychei = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],17:[function(require,module,exports){ +// A Javascript implementaion of the "xor128" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + + // Set up generator function. + me.next = function() { + var t = me.x ^ (me.x << 11); + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); + }; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor128 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],18:[function(require,module,exports){ +// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. +// +// This fast non-cryptographic random number generator is designed for +// use in Monte-Carlo algorithms. It combines a long-period xorshift +// generator with a Weyl generator, and it passes all common batteries +// of stasticial tests for randomness while consuming only a few nanoseconds +// for each prng generated. For background on the generator, see Brent's +// paper: "Some long-period random number generators using shifts and xors." +// http://arxiv.org/pdf/1004.3115v1.pdf +// +// Usage: +// +// var xor4096 = require('xor4096'); +// random = xor4096(1); // Seed with int32 or string. +// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. +// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. +// +// For nonzero numeric keys, this impelementation provides a sequence +// identical to that by Brent's xorgens 3 implementaion in C. This +// implementation also provides for initalizing the generator with +// string seeds, or for saving and restoring the state of the generator. +// +// On Chrome, this prng benchmarks about 2.1 times slower than +// Javascript's built-in Math.random(). + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + var w = me.w, + X = me.X, i = me.i, t, v; + // Update Weyl generator. + me.w = w = (w + 0x61c88647) | 0; + // Update xor generator. + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + // Update Xor generator array state. + v = X[i] = v ^ t; + me.i = i; + // Result is the combination. + return (v + (w ^ (w >>> 16))) | 0; + }; + + function init(me, seed) { + var t, v, i, j, w, X = [], limit = 128; + if (seed === (seed | 0)) { + // Numeric seeds initialize v, which is used to generates X. + v = seed; + seed = null; + } else { + // String seeds are mixed into v and X one character at a time. + seed = seed + '\0'; + v = 0; + limit = Math.max(limit, seed.length); + } + // Initialize circular array and weyl value. + for (i = 0, j = -32; j < limit; ++j) { + // Put the unicode characters into the array, and shuffle them. + if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); + // After 32 shuffles, take v as the starting w value. + if (j === 0) w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = (w + 0x61c88647) | 0; // Weyl. + t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. + i = (0 == t) ? i + 1 : 0; // Count zeroes. + } + } + // We have detected all zeroes; make the key nonzero. + if (i >= 128) { + X[(seed && seed.length || 0) & 127] = -1; + } + // Run the generator 512 times to further mix the state before using it. + // Factoring this as a function slows the main generator, so it is just + // unrolled here. The weyl generator is not advanced while warming up. + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + // Storing state as object members is faster than using closure variables. + me.w = w; + me.X = X; + me.i = i; + } + + init(me, seed); +} + +function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; +}; + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor4096 = impl; +} + +})( + this, // window object or global + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + +},{}],19:[function(require,module,exports){ +// A Javascript implementaion of the "xorshift7" algorithm by +// François Panneton and Pierre L'ecuyer: +// "On the Xorgshift Random Number Generators" +// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + // Update xor generator. + var X = me.x, i = me.i, t, v, w; + t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); + t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); + t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); + t = X[(i + 4) & 7]; v ^= t ^ (t << 7); + t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); + X[i] = v; + me.i = (i + 1) & 7; + return v; + }; + + function init(me, seed) { + var j, w, X = []; + + if (seed === (seed | 0)) { + // Seed state array using a 32-bit integer. + w = X[0] = seed; + } else { + // Seed state using a string. + seed = '' + seed; + for (j = 0; j < seed.length; ++j) { + X[j & 7] = (X[j & 7] << 15) ^ + (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); + } + } + // Enforce an array length of 8, not all zeroes. + while (X.length < 8) X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j); + if (j == 8) w = X[7] = -1; else w = X[j]; + + me.x = X; + me.i = 0; + + // Discard an initial 256 values. + for (j = 256; j > 0; --j) { + me.next(); + } + } + + init(me, seed); +} + +function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; +} + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorshift7 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + +},{}],20:[function(require,module,exports){ +// A Javascript implementaion of the "xorwow" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var t = (me.x ^ (me.x >>> 2)); + me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; + return (me.d = (me.d + 362437 | 0)) + + (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; + }; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorwow = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],21:[function(require,module,exports){ +/* +Copyright 2014 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. + +*/ + +(function (pool, math) { +// +// The following constants are related to IEEE 754 limits. +// +var global = this, + width = 256, // each RC4 output is 0 <= x < 256 + chunks = 6, // at least six RC4 outputs for each double + digits = 52, // there are 52 significant digits in a double + rngname = 'random', // rngname: name for Math.random and Math.seedrandom + startdenom = math.pow(width, chunks), + significance = math.pow(2, digits), + overflow = significance * 2, + mask = width - 1, + nodecrypto; // node.js crypto module, initialized at the bottom. + +// +// seedrandom() +// This is the seedrandom function described above. +// +function seedrandom(seed, options, callback) { + var key = []; + options = (options == true) ? { entropy: true } : (options || {}); + + // Flatten the seed string or build one from local entropy if needed. + var shortseed = mixkey(flatten( + options.entropy ? [seed, tostring(pool)] : + (seed == null) ? autoseed() : seed, 3), key); + + // Use the seed to initialize an ARC4 generator. + var arc4 = new ARC4(key); + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + var prng = function() { + var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 + d = startdenom, // and denominator d = 2 ^ 48. + x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; } + prng.quick = function() { return arc4.g(4) / 0x100000000; } + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); } + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); +} +math['seed' + rngname] = seedrandom; + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); +} + +// +// copy() +// Copies internal state of ARC4 to or from a plain object. +// +function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; +}; + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); +} + +// +// autoseed() +// Returns an object for autoseeding, using window.crypto and Node crypto +// module if available. +// +function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } +} + +// +// tostring() +// Converts an array of charcodes to a string +// +function tostring(a) { + return String.fromCharCode.apply(0, a); +} + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to interfere with deterministic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// +// Nodejs and AMD support: export the implementation as a module using +// either convention. +// +if ((typeof module) == 'object' && module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = require('crypto'); + } catch (ex) {} +} else if ((typeof define) == 'function' && define.amd) { + define(function() { return seedrandom; }); +} + +// End anonymous scope, and pass initial values. +})( + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom +); + +},{"crypto":25}],22:[function(require,module,exports){ +// angle.js +// Released under MIT license +// Author: David Figatner +// Copyright (c) 2016-17 YOPEY YOPEY LLC + +var _toDegreeConversion = 180 / Math.PI +var _toRadianConversion = Math.PI / 180 + +/** @constant {number} */ +var UP = Math.PI / 2 +var DOWN = 3 * Math.PI / 2 +var LEFT = Math.PI +var RIGHT = 0 + +var NORTH = UP +var SOUTH = DOWN +var WEST = LEFT +var EAST = RIGHT + +var PI_2 = Math.PI * 2 +var PI_QUARTER = Math.PI / 4 +var PI_HALF = Math.PI / 2 + +/** + * converts from radians to degrees (all other functions expect radians) + * @param {number} radians + * @return {number} degrees + */ +function toDegrees(radians) +{ + return radians * _toDegreeConversion +} + +/** + * converts from degrees to radians (all other functions expect radians) + * @param {number} degrees + * @return {number} radians + */ +function toRadians(degrees) +{ + return degrees * _toRadianConversion +} + +/** + * returns whether the target angle is between angle1 and angle2 (in radians) + * (based on: http://stackoverflow.com/questions/11406189/determine-if-angle-lies-between-2-other-angles) + * @param {number} target angle + * @param {number} angle1 + * @param {number} angle2 + * @return {boolean} + */ +function isAngleBetween(target, angle1, angle2) +{ + var rAngle = ((angle2 - angle1) % PI_2 + PI_2) % PI_2 + if (rAngle >= Math.PI) + { + var swap = angle1 + angle1 = angle2 + angle2 = swap + } + + if (angle1 <= angle2) + { + return target >= angle1 && target <= angle2 + } + else + { + return target >= angle1 || target <= angle2 + } +} + +/** + * returns +1 or -1 based on whether the difference between two angles is positive or negative (in radians) + * @param {number} target angle + * @param {number} source angle + * @return {number} 1 or -1 + */ +function differenceAnglesSign(target, source) +{ + function mod(a, n) + { + return (a % n + n) % n + } + + var a = target - source + return mod((a + Math.PI), PI_2) - Math.PI > 0 ? 1 : -1 +} + +/** + * returns the normalized difference between two angles (in radians) + * @param {number} a - first angle + * @param {number} b - second angle + * @return {number} normalized difference between a and b + */ +function differenceAngles(a, b) +{ + var c = Math.abs(a - b) % PI_2 + return c > Math.PI ? (PI_2 - c) : c +} + +/** + * returns a target angle that is the shortest way to rotate an object between start and to--may choose a negative angle + * @param {number} start + * @param {number} to + * @return {number} shortest target angle + */ +function shortestAngle(start, to) +{ + var difference = differenceAngles(to, start) + var sign = differenceAnglesSign(to, start) + var delta = difference * sign + return delta + start +} + +/** + * returns the normalized angle (0 - PI x 2) + * @param {number} radians + * @return {number} normalized angle in radians + */ +function normalize(radians) +{ + return radians - PI_2 * Math.floor(radians / PI_2) +} + +/** + * returns angle between two points (in radians) + * @param {Point} [point1] {x: x, y: y} + * @param {Point} [point2] {x: x, y: y} + * @param {number} [x1] + * @param {number} [y1] + * @param {number} [x2] + * @param {number} [y2] + * @return {number} angle + */ +function angleTwoPoints(/* (point1, point2) OR (x1, y1, x2, y2) */) +{ + if (arguments.length === 4) + { + return Math.atan2(arguments[3] - arguments[1], arguments[2] - arguments[0]) + } + else + { + return Math.atan2(arguments[1].y - arguments[0].y, arguments[1].x - arguments[0].x) + } +} + +/** + * returns distance between two points + * @param {Point} [point1] {x: x, y: y} + * @param {Point} [point2] {x: x, y: y} + * @param {number} [x1] + * @param {number} [y1] + * @param {number} [x2] + * @param {number} [y2] + * @return {number} distance + */ +function distanceTwoPoints(/* (point1, point2) OR (x1, y1, x2, y2) */) +{ + if (arguments.length === 2) + { + return Math.sqrt(Math.pow(arguments[1].x - arguments[0].x, 2) + Math.pow(arguments[1].y - arguments[0].y, 2)) + } + else + { + return Math.sqrt(Math.pow(arguments[2] - arguments[0], 2) + Math.pow(arguments[3] - arguments[1], 2)) + } +} + +/** + * returns the squared distance between two points + * @param {Point} [point1] {x: x, y: y} + * @param {Point} [point2] {x: x, y: y} + * @param {number} [x1] + * @param {number} [y1] + * @param {number} [x2] + * @param {number} [y2] + * @return {number} squared distance + */ +function distanceTwoPointsSquared(/* (point1, point2) OR (x1, y1, x2, y2) */) +{ + if (arguments.length === 2) + { + return Math.pow(arguments[1].x - arguments[0].x, 2) + Math.pow(arguments[1].y - arguments[0].y, 2) + } + else + { + return Math.pow(arguments[2] - arguments[0], 2) + Math.pow(arguments[3] - arguments[1], 2) + } +} + +/** + * returns the closest cardinal (N, S, E, W) to the given angle (in radians) + * @param {number} angle + * @return {number} closest cardinal in radians + */ +function closestAngle(angle) +{ + var left = differenceAngles(angle, LEFT) + var right = differenceAngles(angle, RIGHT) + var up = differenceAngles(angle, UP) + var down = differenceAngles(angle, DOWN) + if (left <= right && left <= up && left <= down) + { + return LEFT + } + else if (right <= up && right <= down) + { + return RIGHT + } + else if (up <= down) + { + return UP + } + else + { + return DOWN + } +} + +/** + * checks whether angles a1 and a2 are equal (after normalizing) + * @param {number} a1 + * @param {number} a2 + * @param {number} [wiggle] return true if the difference between the angles is <= wiggle + * @return {boolean} a1 === a2 + */ +function equals(a1, a2, wiggle) +{ + if (wiggle) + { + return differenceAngles(a1, a2) < wiggle + } + else + { + return normalize(a1) === normalize(a2) + } +} + +/** + * return a text representation of the cardinal direction + * @param {number} angle + * @returns {string} UP, DOWN, LEFT, RIGHT, or NOT CARDINAL + */ +function explain(angle) +{ + switch (angle) + { + case UP: return 'UP' + case DOWN: return 'DOWN' + case LEFT: return 'LEFT' + case RIGHT: return 'RIGHT' + default: return 'NOT CARDINAL' + } +} + +module.exports = { + UP: UP, + DOWN: DOWN, + LEFT: LEFT, + RIGHT: RIGHT, + NORTH: NORTH, + SOUTH: SOUTH, + WEST: WEST, + EAST: EAST, + PI_2: PI_2, + PI_QUARTER: PI_QUARTER, + PI_HALF: PI_HALF, + + toDegrees: toDegrees, + toRadians: toRadians, + isAngleBetween: isAngleBetween, + differenceAnglesSign: differenceAnglesSign, + differenceAngles: differenceAngles, + shortestAngle: shortestAngle, + normalize: normalize, + angleTwoPoints: angleTwoPoints, + distanceTwoPoints: distanceTwoPoints, + distanceTwoPointsSquared: distanceTwoPointsSquared, + closestAngle: closestAngle, + equals: equals, + explain: explain +} +},{}],23:[function(require,module,exports){ +// yy-color +// by David Figatner +// MIT License +// (c) YOPEY YOPEY LLC 2017 +// https://github.com/davidfig/color + +var Random = require('yy-random') + +/** + * converts a #FFFFFF to 0x123456 + * @param {string} color + * @return {string} + */ +function poundToHex(color) +{ + return '0x' + parseInt(color.substr(1)).toString(16) +} + +/** + * converts a 0x123456 to #FFFFFF + * @param {string} color + * @return {string} + */ +function hexToPound(color) +{ + return '#' + color.substr(2) +} + +/** + * converts a number to #FFFFFF + * @param {number} color + * @return {string} + */ +function valueToPound(color) +{ + return '#' + color.toString(16) +} + +/** + * based on tinycolor + * https://github.com/bgrins/TinyColor + * BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE + * @param {string} color + * @returns {object} + */ +function hexToHsl (color) +{ + var rgb = this.hexToRgb(color), + r = rgb.r, + g = rgb.g, + b = rgb.b + var max = Math.max(r, g, b), + min = Math.min(r, g, b) + var h, s, l = (max + min) / 2 + + if (max === min) + { + h = s = 0 // achromatic + } + else + { + var d = max - min + s = l > 0.5 ? d / (2 - max - min) : d / (max + min) + switch (max) + { + case r: h = (g - b) / d + (g < b ? 6 : 0); break + case g: h = (b - r) / d + 2; break + case b: h = (r - g) / d + 4; break + } + + h /= 6 + } + + return { h: h, s: s, l: l } +} + +/** based on tinycolor +* https://github.com/bgrins/TinyColor +* BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE +* @param {object|number} color {h, s, b} or h +* @param {number} [s] +* @param {number} [l] +* @returns number +*/ +function hslToHex(color) +{ + var r, g, b, h, s, l + if (arguments.length === 1) + { + h = color.h, + s = color.s, + l = color.l + } + else + { + h = arguments[0] + s = arguments[1] + l = arguments[2] + } + + function hue2rgb(p, q, t) { + if (t < 0) t += 1 + if (t > 1) t -= 1 + if (t < 1/6) return p + (q - p) * 6 * t + if (t < 1/2) return q + if (t < 2/3) return p + (q - p) * (2/3 - t) * 6 + return p + } + + if (s === 0) + { + r = g = b = l // achromatic + } + else + { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s + var p = 2 * l - q + r = hue2rgb(p, q, h + 1/3) + g = hue2rgb(p, q, h) + b = hue2rgb(p, q, h - 1/3) + } + + return this.rgbToHex(r * 255, g * 255, b * 255) +} + +/* darkens a color by the percentage +* @param {object} color in hex (0xabcdef) +* @param {number} amount +* @return {number} +*/ +function darken(color, amount) +{ + return this.blend(amount, color, 0) +} + +/** based on tinycolor +* https://github.com/bgrins/TinyColor +* BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE +* @param {object} color +* @param {number} amount +*/ +function saturate(color, amount) +{ + amount = (amount === 0) ? 0 : (amount || 10) + var hsl = this.hexToHsl(color) + hsl.s += amount / 100 + hsl.s = Math.min(1, Math.max(0, hsl.s)) + return this.hslToHex(hsl) +} + +/** based on tinycolor +* https://github.com/bgrins/TinyColor +* BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE +* @param {object} color +* @param {number} amount +*/ +function desaturate(color, amount) +{ + amount = (amount === 0) ? 0 : (amount || 10) + var hsl = this.hexToHsl(color) + hsl.s -= amount / 100 + hsl.s = Math.min(1, Math.max(0, hsl.s)) + return this.hslToHex(hsl) +} + +/** + * blends two colors together + * @param {number} percent [0.0 - 1.0] + * @param {string} color1 first color in 0x123456 format + * @param {string} color2 second color in 0x123456 format + * @return {number} + */ +function blend(percent, color1, color2) +{ + if (percent === 0) + { + return color1 + } + if (percent === 1) + { + return color2 + } + var r1 = color1 >> 16 + var g1 = color1 >> 8 & 0x0000ff + var b1 = color1 & 0x0000ff + var r2 = color2 >> 16 + var g2 = color2 >> 8 & 0x0000ff + var b2 = color2 & 0x0000ff + var percent1 = 1 - percent + var r = percent1 * r1 + percent * r2 + var g = percent1 * g1 + percent * g2 + var b = percent1 * b1 + percent * b2 + return r << 16 | g << 8 | b +} + +/** + * returns a hex color into an rgb value + * @param {number} hex + * @return {string} + */ +function hexToRgb(hex) +{ + if (hex === 0) + { + hex = '0x000000' + } + else if (typeof hex !== 'string') + { + var s = '000000' + hex.toString(16) + hex = '0x' + s.substr(s.length - 6) + } + var result = /^0x?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null +} + +/** + * rgb color to hex in the form of 0x123456 + * @param {(number|string)} r first number or 'rgb(...)' string + * @param {(number|null)} g + * @param {(number|null)} b + * @return {string} + */ +function rgbToHex(r, g, b) +{ + if (arguments.length === 1) { + if (Array.isArray(arguments[0])) { + var number = arguments[0] + r = number[0] + g = number[1] + b = number[2] + } else { + var parse = r.replace(/( *rgb *\( *)|( )|(\) *;?)/,'') + var numbers = parse.split(',') + r = numbers[0] + g = numbers[1] + b = numbers[2] + } + } + return '0x' + ((1 << 24) + (parseInt(r) << 16) + (parseInt(g) << 8) + parseInt(b)).toString(16).slice(1) +} + +/** + * returns a random color with balanced r, g, b values (i.e., r, g, b either have the same value or are 0) + * @param {number} min value for random number + * @param {number} max value for random number + * @return {number} color + */ +function random(min, max) +{ + function random() + { + return Random.range(min, max) + } + + var colors = [{r:1, g:1, b:1}, {r:1, g:1, b:0}, {r:1,g:0,b:1}, {r:0,g:1,b:1}, {r:1,g:0,b:0}, {r:0,g:1,b:0}, {r:0,g:0,b:1}] + var color = Random.pick(colors) + min = min || 0 + max = max || 255 + return this.rgbToHex(color.r ? random() : 0, color.g ? random() : 0, color.b ? random() : 0) +} + +// h: 0-360, s: 0-1, l: 0-1 +/** + * returns a random color based on hsl + * @param {number} hMin [0, 360] + * @param {number} hMax [hMin, 360] + * @param {number} sMin [0, 1] + * @param {number} sMax [sMin, 1] + * @param {number} lMin [0, 1] + * @param {number} lMax [lMin, 1] + */ +function randomHSL(hMin, hMax, sMin, sMax, lMin, lMax) +{ + var color = { + h: Random.range(hMin, hMax), + s: Random.range(sMin, sMax, true), + l: Random.range(lMin, lMax, true) + } + return this.hslToHex(color) +} + +/** + * returns random colors based on HSL with different hues + * based on http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/ + * @returns {number[]} colors in hex format (0x123456) + */ +function randomGoldenRatioHSL(count, saturation, luminosity) +{ + var goldenRatio = 0.618033988749895 + var h = Random.get(1, true) + var colors = [] + for (var i = 0; i < count; i++) + { + colors.push(this.hslToHex(h, saturation, luminosity)) + h = (h + goldenRatio) % 1 + } + return colors +} + +module.exports = { + poundToHex: poundToHex, + hexToPound: hexToPound, + valueToPound: valueToPound, + hexToHsl: hexToHsl, + hslToHex: hslToHex, + hexToRgb: hexToRgb, + rgbToHex: rgbToHex, + darken: darken, + saturate: saturate, + desaturate: desaturate, + blend: blend, + random: random, + randomHSL: randomHSL, + randomGoldenRatioHSL: randomGoldenRatioHSL +} +},{"yy-random":24}],24:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// yy-random +// by David Figatner +// MIT license +// copyright YOPEY YOPEY LLC 2016-17 +// https://github.com/davidfig/random + +var seedrandom = require('seedrandom'); + +var Random = function () { + function Random() { + _classCallCheck(this, Random); + + this.generator = Math.random; + } + + /** + * generates a seeded number + * @param {number} seed + * @param {object} [options] + * @param {string} [PRNG="alea"] - name of algorithm, see https://github.com/davidbau/seedrandom + * @param {boolean} [save=true] + */ + + + _createClass(Random, [{ + key: 'seed', + value: function seed(_seed, options) { + options = options || {}; + this.generator = seedrandom[options.PRNG || 'alea'](_seed, { state: options.state }); + this.options = options; + } + + /** + * saves the state of the random generator + * can only be used after Random.seed() is called + * @returns {number} state + */ + + }, { + key: 'save', + value: function save() { + if (this.generator !== Math.random) { + return this.generator.state(); + } + } + + /** + * restores the state of the random generator + * @param {number} state + */ + + }, { + key: 'restore', + value: function restore(state) { + this.generator = seedrandom[this.options.PRNG || 'alea']('', { state: state }); + } + + /** + * changes the generator to use the old Math.sin-based random function + * based on : http://stackoverflow.com/questions/521295/javascript-random-seeds + * (deprecated) Use only for compatibility purposes + * @param {number} seed + */ + + }, { + key: 'seedOld', + value: function seedOld(seed) { + this.generator = function () { + var x = Math.sin(seed++) * 10000; + return x - Math.floor(x); + }; + } + + /** + * create a separate random generator using the seed + * @param {number} seed + * @return {object} + */ + + }, { + key: 'separateSeed', + value: function separateSeed(seed) { + var random = new Random(); + random.seed(seed); + return random; + } + + /** + * resets the random number this.generator to Math.random() + */ + + }, { + key: 'reset', + value: function reset() { + this.generator = Math.random; + } + + /** + * returns a random number using the this.generator between [0, ceiling - 1] + * @param {number} ceiling + * @param {boolean} [useFloat=false] + * @return {number} + */ + + }, { + key: 'get', + value: function get(ceiling, useFloat) { + var negative = ceiling < 0 ? -1 : 1; + ceiling *= negative; + var result = void 0; + if (useFloat) { + result = this.generator() * ceiling; + } else { + result = Math.floor(this.generator() * ceiling); + } + return result * negative; + } + + /** + * returns a random integer between 0 - Number.MAX_SAFE_INTEGER + * @return {number} + */ + + }, { + key: 'getHuge', + value: function getHuge() { + return this.get(Number.MAX_SAFE_INTEGER); + } + + /** + * random number [middle - range, middle + range] + * @param {number} middle + * @param {number} delta + * @param {boolean} [useFloat=false] + * @return {number} + */ + + }, { + key: 'middle', + value: function middle(_middle, delta, useFloat) { + var half = delta / 2; + return this.range(_middle - half, _middle + half, useFloat); + } + + /** + * random number [start, end] + * @param {number} start + * @param {number} end + * @param {boolean} [useFloat=false] if true, then range is (start, end)--i.e., not inclusive to start and end + * @return {number} + */ + + }, { + key: 'range', + value: function range(start, end, useFloat) { + // case where there is no range + if (end === start) { + return end; + } + + if (useFloat) { + return this.get(end - start, true) + start; + } else { + var range = void 0; + if (start < 0 && end > 0) { + range = -start + end + 1; + } else if (start === 0 && end > 0) { + range = end + 1; + } else if (start < 0 && end === 0) { + range = start - 1; + start = 1; + } else if (start < 0 && end < 0) { + range = end - start - 1; + } else { + range = end - start + 1; + } + return Math.floor(this.generator() * range) + start; + } + } + + /** + * an array of random numbers between [start, end] + * @param {number} start + * @param {number} end + * @param {number} count + * @param {boolean} [useFloat=false] + * @return {number[]} + */ + + }, { + key: 'rangeMultiple', + value: function rangeMultiple(start, end, count, useFloat) { + var array = []; + for (var i = 0; i < count; i++) { + array.push(this.range(start, end, useFloat)); + } + return array; + } + + /** + * an array of random numbers between [middle - range, middle + range] + * @param {number} middle + * @param {number} range + * @param {number} count + * @param {boolean} [useFloat=false] + * @return {number[]} + */ + + }, { + key: 'middleMultiple', + value: function middleMultiple(middle, range, count, useFloat) { + var array = []; + for (var i = 0; i < count; i++) { + array.push(middle(middle, range, useFloat)); + } + return array; + } + + /** + * @param {number} [chance=0.5] + * returns random sign (either +1 or -1) + * @return {number} + */ + + }, { + key: 'sign', + value: function sign(chance) { + chance = chance || 0.5; + return this.generator() < chance ? 1 : -1; + } + + /** + * tells you whether a random chance was achieved + * @param {number} [percent=0.5] + * @return {boolean} + */ + + }, { + key: 'chance', + value: function chance(percent) { + return this.generator() < (percent || 0.5); + } + + /** + * returns a random angle in radians [0 - 2 * Math.PI) + */ + + }, { + key: 'angle', + value: function angle() { + return this.get(Math.PI * 2, true); + } + + /** + * Shuffle array (either in place or copied) + * from http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array + * @param {Array} array + * @param {boolean} [copy=false] whether to shuffle in place (default) or return a new shuffled array + * @return {Array} a shuffled array + */ + + }, { + key: 'shuffle', + value: function shuffle(array, copy) { + if (copy) { + array = array.slice(); + } + if (array.length === 0) { + return array; + } + + var currentIndex = array.length, + temporaryValue = void 0, + randomIndex = void 0; + + // While there remain elements to shuffle... + while (0 !== currentIndex) { + // Pick a remaining element... + randomIndex = this.get(currentIndex); + currentIndex -= 1; + + // And swap it with the current element. + temporaryValue = array[currentIndex]; + array[currentIndex] = array[randomIndex]; + array[randomIndex] = temporaryValue; + } + return array; + } + + /** + * picks a random element from an array + * @param {Array} array + * @return {*} + */ + + }, { + key: 'pick', + value: function pick(array, remove) { + if (!remove) { + return array[this.get(array.length)]; + } else { + var pick = this.get(array.length); + var temp = array[pick]; + array.splice(pick, 1); + return temp; + } + } + + /** + * returns a random property from an object + * from http://stackoverflow.com/questions/2532218/pick-random-property-from-a-javascript-object + * @param {object} obj + * @return {*} + */ + + }, { + key: 'property', + value: function property(obj) { + var result; + var count = 0; + for (var prop in obj) { + if (this.chance(1 / ++count)) { + result = prop; + } + } + return result; + } + + /** + * creates a random set where each entry is a value between [min, max] + * @param {number} min + * @param {number} max + * @param {number} amount of numbers in set + * @param {number[]} + */ + + }, { + key: 'set', + value: function set(min, max, amount) { + var set = [], + all = [], + i; + for (i = min; i < max; i++) { + all.push(i); + } + + for (i = 0; i < amount; i++) { + var found = this.get(all.length); + set.push(all[found]); + all.splice(found, 1); + } + return set; + } + + /** + * returns a set of numbers with a randomly even distribution (i.e., no overlapping and filling the space) + * @param {number} start position + * @param {number} end position + * @param {number} count of non-start/end points + * @param {boolean} [includeStart=false] includes start point (count++) + * @param {boolean} [includeEnd=false] includes end point (count++) + * @param {boolean} [useFloat=false] + * @param {number[]} + */ + + }, { + key: 'distribution', + value: function distribution(start, end, count, includeStart, includeEnd, useFloat) { + var interval = Math.floor((end - start) / count); + var halfInterval = interval / 2; + var quarterInterval = interval / 4; + var set = []; + if (includeStart) { + set.push(start); + } + for (var i = 0; i < count; i++) { + set.push(start + i * interval + halfInterval + this.range(-quarterInterval, quarterInterval, useFloat)); + } + if (includeEnd) { + set.push(end); + } + return set; + } + + /** + * returns a random number based on weighted probability between [min, max] + * from http://stackoverflow.com/questions/22656126/javascript-random-number-with-weighted-probability + * @param {number} min value + * @param {number} max value + * @param {number} target for average value + * @param {number} stddev - standard deviation + */ + + }, { + key: 'weightedProbabilityInt', + value: function weightedProbabilityInt(min, max, target, stddev) { + function normRand() { + var x1 = void 0, + x2 = void 0, + rad = void 0; + do { + x1 = 2 * this.get(1, true) - 1; + x2 = 2 * this.get(1, true) - 1; + rad = x1 * x1 + x2 * x2; + } while (rad >= 1 || rad === 0); + var c = Math.sqrt(-2 * Math.log(rad) / rad); + return x1 * c; + } + + stddev = stddev || 1; + if (Math.random() < 0.81546) { + while (true) { + var sample = normRand() * stddev + target; + if (sample >= min && sample <= max) { + return sample; + } + } + } else { + return this.range(min, max); + } + } + + /* + * returns a random hex color (0 - 0xffffff) + * @return {number} + */ + + }, { + key: 'color', + value: function color() { + return this.get(0xffffff); + } + }]); + + return Random; +}(); + +module.exports = new Random(); + +},{"seedrandom":14}],25:[function(require,module,exports){ + +},{}]},{},[3]); + +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= this.time) { + this.parent.x = toX.end; + this.toX = null; + this.parent.emit('bounce-x-end', this.parent); + } else { + this.parent.x = this.ease(toX.time, toX.start, toX.delta, this.time); + } + this.parent.dirty = true; + } + if (this.toY) { + var toY = this.toY; + toY.time += elapsed; + this.parent.emit('moved', { viewport: this.parent, type: 'bounce-y' }); + if (toY.time >= this.time) { + this.parent.y = toY.end; + this.toY = null; + this.parent.emit('bounce-y-end', this.parent); + } else { + this.parent.y = this.ease(toY.time, toY.start, toY.delta, this.time); + } + this.parent.dirty = true; + } + } + }, { + key: 'calcUnderflowX', + value: function calcUnderflowX() { + var x = void 0; + switch (this.underflowX) { + case -1: + x = 0; + break; + case 1: + x = this.parent.screenWidth - this.parent.screenWorldWidth; + break; + default: + x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2; + } + return x; + } + }, { + key: 'calcUnderflowY', + value: function calcUnderflowY() { + var y = void 0; + switch (this.underflowY) { + case -1: + y = 0; + break; + case 1: + y = this.parent.screenHeight - this.parent.screenWorldHeight; + break; + default: + y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2; + } + return y; + } + }, { + key: 'bounce', + value: function bounce() { + if (this.paused) { + return; + } + + var oob = void 0; + var decelerate = this.parent.plugins['decelerate']; + if (decelerate && (decelerate.x || decelerate.y)) { + if (decelerate.x && decelerate.percentChangeX === decelerate.friction || decelerate.y && decelerate.percentChangeY === decelerate.friction) { + oob = this.parent.OOB(); + if (oob.left && this.left || oob.right && this.right) { + decelerate.percentChangeX = this.friction; + } + if (oob.top && this.top || oob.bottom && this.bottom) { + decelerate.percentChangeY = this.friction; + } + } + } + var drag = this.parent.plugins['drag'] || {}; + var pinch = this.parent.plugins['pinch'] || {}; + decelerate = decelerate || {}; + if (!drag.active && !pinch.active && (!this.toX || !this.toY) && (!decelerate.x || !decelerate.y)) { + oob = oob || this.parent.OOB(); + var point = oob.cornerPoint; + if (!this.toX && !decelerate.x) { + var x = null; + if (oob.left && this.left) { + x = this.parent.screenWorldWidth < this.parent.screenWidth ? this.calcUnderflowX() : 0; + } else if (oob.right && this.right) { + x = this.parent.screenWorldWidth < this.parent.screenWidth ? this.calcUnderflowX() : -point.x; + } + if (x !== null && this.parent.x !== x) { + this.toX = { time: 0, start: this.parent.x, delta: x - this.parent.x, end: x }; + this.parent.emit('bounce-x-start', this.parent); + } + } + if (!this.toY && !decelerate.y) { + var y = null; + if (oob.top && this.top) { + y = this.parent.screenWorldHeight < this.parent.screenHeight ? this.calcUnderflowY() : 0; + } else if (oob.bottom && this.bottom) { + y = this.parent.screenWorldHeight < this.parent.screenHeight ? this.calcUnderflowY() : -point.y; + } + if (y !== null && this.parent.y !== y) { + this.toY = { time: 0, start: this.parent.y, delta: y - this.parent.y, end: y }; + this.parent.emit('bounce-y-start', this.parent); + } + } + } + } + }, { + key: 'reset', + value: function reset() { + this.toX = this.toY = null; + } + }]); + + return Bounce; +}(Plugin); + +},{"./plugin":9,"./utils":12}],2:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(ClampZoom, _Plugin); + + /** + * @private + * @param {object} [options] + * @param {number} [options.minWidth] minimum width + * @param {number} [options.minHeight] minimum height + * @param {number} [options.maxWidth] maximum width + * @param {number} [options.maxHeight] maximum height + */ + function ClampZoom(parent, options) { + _classCallCheck(this, ClampZoom); + + var _this = _possibleConstructorReturn(this, (ClampZoom.__proto__ || Object.getPrototypeOf(ClampZoom)).call(this, parent)); + + _this.minWidth = options.minWidth; + _this.minHeight = options.minHeight; + _this.maxWidth = options.maxWidth; + _this.maxHeight = options.maxHeight; + return _this; + } + + _createClass(ClampZoom, [{ + key: 'resize', + value: function resize() { + this.clamp(); + } + }, { + key: 'clamp', + value: function clamp() { + if (this.paused) { + return; + } + + var width = this.parent.worldScreenWidth; + var height = this.parent.worldScreenHeight; + if (this.minWidth && width < this.minWidth) { + this.parent.fitWidth(this.minWidth); + width = this.parent.worldScreenWidth; + height = this.parent.worldScreenHeight; + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + if (this.maxWidth && width > this.maxWidth) { + this.parent.fitWidth(this.maxWidth); + width = this.parent.worldScreenWidth; + height = this.parent.worldScreenHeight; + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + if (this.minHeight && height < this.minHeight) { + this.parent.fitHeight(this.minHeight); + width = this.parent.worldScreenWidth; + height = this.parent.worldScreenHeight; + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + if (this.maxHeight && height > this.maxHeight) { + this.parent.fitHeight(this.maxHeight); + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + } + }]); + + return ClampZoom; +}(Plugin); + +},{"./plugin":9}],3:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); +var utils = require('./utils'); + +module.exports = function (_Plugin) { + _inherits(clamp, _Plugin); + + /** + * @private + * @param {object} options + * @param {(number|boolean)} [options.left] clamp left; true=0 + * @param {(number|boolean)} [options.right] clamp right; true=viewport.worldWidth + * @param {(number|boolean)} [options.top] clamp top; true=0 + * @param {(number|boolean)} [options.bottom] clamp bottom; true=viewport.worldHeight + * @param {string} [options.direction] (all, x, or y) using clamps of [0, viewport.worldWidth/viewport.worldHeight]; replaces left/right/top/bottom if set + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + */ + function clamp(parent, options) { + _classCallCheck(this, clamp); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (clamp.__proto__ || Object.getPrototypeOf(clamp)).call(this, parent)); + + if (typeof options.direction === 'undefined') { + _this.left = utils.defaults(options.left, null); + _this.right = utils.defaults(options.right, null); + _this.top = utils.defaults(options.top, null); + _this.bottom = utils.defaults(options.bottom, null); + } else { + _this.left = options.direction === 'x' || options.direction === 'all'; + _this.right = options.direction === 'x' || options.direction === 'all'; + _this.top = options.direction === 'y' || options.direction === 'all'; + _this.bottom = options.direction === 'y' || options.direction === 'all'; + } + _this.parseUnderflow(options.underflow || 'center'); + _this.move(); + return _this; + } + + _createClass(clamp, [{ + key: 'parseUnderflow', + value: function parseUnderflow(clamp) { + clamp = clamp.toLowerCase(); + if (clamp === 'center') { + this.underflowX = 0; + this.underflowY = 0; + } else { + this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0; + this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0; + } + } + }, { + key: 'move', + value: function move() { + this.update(); + } + }, { + key: 'update', + value: function update() { + if (this.paused) { + return; + } + + var decelerate = this.parent.plugins['decelerate'] || {}; + if (this.left !== null || this.right !== null) { + var moved = void 0; + if (this.parent.screenWorldWidth < this.parent.screenWidth) { + switch (this.underflowX) { + case -1: + if (this.parent.x !== 0) { + this.parent.x = 0; + moved = true; + } + break; + case 1: + if (this.parent.x !== this.parent.screenWidth - this.parent.screenWorldWidth) { + this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth; + moved = true; + } + break; + default: + if (this.parent.x !== (this.parent.screenWidth - this.parent.screenWorldWidth) / 2) { + this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2; + moved = true; + } + } + } else { + if (this.left !== null) { + if (this.parent.left < (this.left === true ? 0 : this.left)) { + this.parent.x = -(this.left === true ? 0 : this.left) * this.parent.scale.x; + decelerate.x = 0; + moved = true; + } + } + if (this.right !== null) { + if (this.parent.right > (this.right === true ? this.parent.worldWidth : this.right)) { + this.parent.x = -(this.right === true ? this.parent.worldWidth : this.right) * this.parent.scale.x + this.parent.screenWidth; + decelerate.x = 0; + moved = true; + } + } + } + if (moved) { + this.parent.emit('moved', { viewport: this.parent, type: 'clamp-x' }); + } + } + if (this.top !== null || this.bottom !== null) { + var _moved = void 0; + if (this.parent.screenWorldHeight < this.parent.screenHeight) { + switch (this.underflowY) { + case -1: + if (this.parent.y !== 0) { + this.parent.y = 0; + _moved = true; + } + break; + case 1: + if (this.parent.y !== this.parent.screenHeight - this.parent.screenWorldHeight) { + this.parent.y = this.parent.screenHeight - this.parent.screenWorldHeight; + _moved = true; + } + break; + default: + if (this.parent.y !== (this.parent.screenHeight - this.parent.screenWorldHeight) / 2) { + this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2; + _moved = true; + } + } + } else { + if (this.top !== null) { + if (this.parent.top < (this.top === true ? 0 : this.top)) { + this.parent.y = -(this.top === true ? 0 : this.top) * this.parent.scale.y; + decelerate.y = 0; + _moved = true; + } + } + if (this.bottom !== null) { + if (this.parent.bottom > (this.bottom === true ? this.parent.worldHeight : this.bottom)) { + this.parent.y = -(this.bottom === true ? this.parent.worldHeight : this.bottom) * this.parent.scale.y + this.parent.screenHeight; + decelerate.y = 0; + _moved = true; + } + } + } + if (_moved) { + this.parent.emit('moved', { viewport: this.parent, type: 'clamp-y' }); + } + } + } + }]); + + return clamp; +}(Plugin); + +},{"./plugin":9,"./utils":12}],4:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Decelerate, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.friction=0.95] percent to decelerate after movement + * @param {number} [options.bounce=0.8] percent to decelerate when past boundaries (only applicable when viewport.bounce() is active) + * @param {number} [options.minSpeed=0.01] minimum velocity before stopping/reversing acceleration + */ + function Decelerate(parent, options) { + _classCallCheck(this, Decelerate); + + var _this = _possibleConstructorReturn(this, (Decelerate.__proto__ || Object.getPrototypeOf(Decelerate)).call(this, parent)); + + options = options || {}; + _this.friction = options.friction || 0.95; + _this.bounce = options.bounce || 0.5; + _this.minSpeed = typeof options.minSpeed !== 'undefined' ? options.minSpeed : 0.01; + _this.saved = []; + return _this; + } + + _createClass(Decelerate, [{ + key: 'down', + value: function down() { + this.saved = []; + this.x = this.y = false; + } + }, { + key: 'move', + value: function move() { + if (this.paused) { + return; + } + + var count = this.parent.countDownPointers(); + if (count === 1 || count > 1 && !this.parent.plugins['pinch']) { + this.saved.push({ x: this.parent.x, y: this.parent.y, time: performance.now() }); + if (this.saved.length > 60) { + this.saved.splice(0, 30); + } + } + } + }, { + key: 'up', + value: function up() { + if (this.parent.countDownPointers() === 0 && this.saved.length) { + var now = performance.now(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = this.saved[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var save = _step.value; + + if (save.time >= now - 100) { + var time = now - save.time; + this.x = (this.parent.x - save.x) / time; + this.y = (this.parent.y - save.y) / time; + this.percentChangeX = this.percentChangeY = this.friction; + break; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + + /** + * manually activate plugin + * @param {object} options + * @param {number} [options.x] + * @param {number} [options.y] + */ + + }, { + key: 'activate', + value: function activate(options) { + options = options || {}; + if (typeof options.x !== 'undefined') { + this.x = options.x; + this.percentChangeX = this.friction; + } + if (typeof options.y !== 'undefined') { + this.y = options.y; + this.percentChangeY = this.friction; + } + } + }, { + key: 'update', + value: function update(elapsed) { + if (this.paused) { + return; + } + + var moved = void 0; + if (this.x) { + this.parent.x += this.x * elapsed; + this.x *= this.percentChangeX; + if (Math.abs(this.x) < this.minSpeed) { + this.x = 0; + } + moved = true; + } + if (this.y) { + this.parent.y += this.y * elapsed; + this.y *= this.percentChangeY; + if (Math.abs(this.y) < this.minSpeed) { + this.y = 0; + } + moved = true; + } + if (moved) { + this.parent.dirty = true; + this.parent.emit('moved', { viewport: this.parent, type: 'decelerate' }); + } + } + }, { + key: 'reset', + value: function reset() { + this.x = this.y = null; + } + }]); + + return Decelerate; +}(Plugin); + +},{"./plugin":9,"./utils":12}],5:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Drag, _Plugin); + + /** + * enable one-finger touch to drag + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {string} [options.direction=all] direction to drag (all, x, or y) + * @param {boolean} [options.wheel=true] use wheel to scroll in y direction (unless wheel plugin is active) + * @param {number} [options.wheelScroll=1] number of pixels to scroll with each wheel spin + * @param {boolean} [options.reverse] reverse the direction of the wheel scroll + * @param {boolean|string} [options.clampWheel] (true, x, or y) clamp wheel (to avoid weird bounce with mouse wheel) + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + */ + function Drag(parent, options) { + _classCallCheck(this, Drag); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (Drag.__proto__ || Object.getPrototypeOf(Drag)).call(this, parent)); + + _this.moved = false; + _this.wheelActive = utils.defaults(options.wheel, true); + _this.wheelScroll = options.wheelScroll || 1; + _this.reverse = options.reverse ? 1 : -1; + _this.clampWheel = options.clampWheel; + _this.xDirection = !options.direction || options.direction === 'all' || options.direction === 'x'; + _this.yDirection = !options.direction || options.direction === 'all' || options.direction === 'y'; + _this.parseUnderflow(options.underflow || 'center'); + return _this; + } + + _createClass(Drag, [{ + key: 'parseUnderflow', + value: function parseUnderflow(clamp) { + clamp = clamp.toLowerCase(); + if (clamp === 'center') { + this.underflowX = 0; + this.underflowY = 0; + } else { + this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0; + this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0; + } + } + }, { + key: 'down', + value: function down(e) { + if (this.paused) { + return; + } + var count = this.parent.countDownPointers(); + if ((count === 1 || count > 1 && !this.parent.plugins['pinch']) && this.parent.parent) { + var parent = this.parent.parent.toLocal(e.data.global); + this.last = { x: e.data.global.x, y: e.data.global.y, parent: parent }; + this.current = e.data.pointerId; + } else { + this.last = null; + } + } + }, { + key: 'move', + value: function move(e) { + if (this.paused) { + return; + } + if (this.last && this.current === e.data.pointerId) { + var x = e.data.global.x; + var y = e.data.global.y; + var count = this.parent.countDownPointers(); + if (count === 1 || count > 1 && !this.parent.plugins['pinch']) { + var distX = x - this.last.x; + var distY = y - this.last.y; + if (this.moved || this.xDirection && this.parent.checkThreshold(distX) || this.yDirection && this.parent.checkThreshold(distY)) { + var newParent = this.parent.parent.toLocal(e.data.global); + if (this.xDirection) { + this.parent.x += newParent.x - this.last.parent.x; + } + if (this.yDirection) { + this.parent.y += newParent.y - this.last.parent.y; + } + this.last = { x: x, y: y, parent: newParent }; + if (!this.moved) { + this.parent.emit('drag-start', { screen: this.last, world: this.parent.toWorld(this.last), viewport: this.parent }); + } + this.moved = true; + this.parent.dirty = true; + this.parent.emit('moved', { viewport: this.parent, type: 'drag' }); + } + } else { + this.moved = false; + } + } + } + }, { + key: 'up', + value: function up() { + var touches = this.parent.getTouchPointers(); + if (touches.length === 1) { + var pointer = touches[0]; + if (pointer.last) { + var parent = this.parent.parent.toLocal(pointer.last); + this.last = { x: pointer.last.x, y: pointer.last.y, parent: parent }; + this.current = pointer.last.data.pointerId; + } + this.moved = false; + } else if (this.last) { + if (this.moved) { + this.parent.emit('drag-end', { screen: this.last, world: this.parent.toWorld(this.last), viewport: this.parent }); + this.last = this.moved = false; + } + } + } + }, { + key: 'wheel', + value: function wheel(e) { + if (this.paused) { + return; + } + + if (this.wheelActive) { + var wheel = this.parent.plugins['wheel']; + if (!wheel) { + this.parent.x += e.deltaX * this.wheelScroll * this.reverse; + this.parent.y += e.deltaY * this.wheelScroll * this.reverse; + if (this.clampWheel) { + this.clamp(); + } + this.parent.emit('wheel-scroll', this.parent); + this.parent.emit('moved', this.parent); + this.parent.dirty = true; + e.preventDefault(); + return true; + } + } + } + }, { + key: 'resume', + value: function resume() { + this.last = null; + this.paused = false; + } + }, { + key: 'clamp', + value: function clamp() { + var decelerate = this.parent.plugins['decelerate'] || {}; + if (this.clampWheel !== 'y') { + if (this.parent.screenWorldWidth < this.parent.screenWidth) { + switch (this.underflowX) { + case -1: + this.parent.x = 0; + break; + case 1: + this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth; + break; + default: + this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2; + } + } else { + if (this.parent.left < 0) { + this.parent.x = 0; + decelerate.x = 0; + } else if (this.parent.right > this.parent.worldWidth) { + this.parent.x = -this.parent.worldWidth * this.parent.scale.x + this.parent.screenWidth; + decelerate.x = 0; + } + } + } + if (this.clampWheel !== 'x') { + if (this.parent.screenWorldHeight < this.parent.screenHeight) { + switch (this.underflowY) { + case -1: + this.parent.y = 0; + break; + case 1: + this.parent.y = this.parent.screenHeight - this.parent.screenWorldHeight; + break; + default: + this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2; + } + } else { + if (this.parent.top < 0) { + this.parent.y = 0; + decelerate.y = 0; + } + if (this.parent.bottom > this.parent.worldHeight) { + this.parent.y = -this.parent.worldHeight * this.parent.scale.y + this.parent.screenHeight; + decelerate.y = 0; + } + } + } + } + }, { + key: 'active', + get: function get() { + return this.moved; + } + }]); + + return Drag; +}(Plugin); + +},{"./plugin":9,"./utils":12}],6:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Follow, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {PIXI.DisplayObject} target to follow (object must include {x: x-coordinate, y: y-coordinate}) + * @param {object} [options] + * @param {number} [options.speed=0] to follow in pixels/frame (0=teleport to location) + * @param {number} [options.radius] radius (in world coordinates) of center circle where movement is allowed without moving the viewport + */ + function Follow(parent, target, options) { + _classCallCheck(this, Follow); + + var _this = _possibleConstructorReturn(this, (Follow.__proto__ || Object.getPrototypeOf(Follow)).call(this, parent)); + + options = options || {}; + _this.speed = options.speed || 0; + _this.target = target; + _this.radius = options.radius; + return _this; + } + + _createClass(Follow, [{ + key: 'update', + value: function update() { + if (this.paused) { + return; + } + + var center = this.parent.center; + var toX = this.target.x, + toY = this.target.y; + if (this.radius) { + var distance = Math.sqrt(Math.pow(this.target.y - center.y, 2) + Math.pow(this.target.x - center.x, 2)); + if (distance > this.radius) { + var angle = Math.atan2(this.target.y - center.y, this.target.x - center.x); + toX = this.target.x - Math.cos(angle) * this.radius; + toY = this.target.y - Math.sin(angle) * this.radius; + } else { + return; + } + } + if (this.speed) { + var deltaX = toX - center.x; + var deltaY = toY - center.y; + if (deltaX || deltaY) { + var _angle = Math.atan2(toY - center.y, toX - center.x); + var changeX = Math.cos(_angle) * this.speed; + var changeY = Math.sin(_angle) * this.speed; + var x = Math.abs(changeX) > Math.abs(deltaX) ? toX : center.x + changeX; + var y = Math.abs(changeY) > Math.abs(deltaY) ? toY : center.y + changeY; + this.parent.moveCenter(x, y); + this.parent.emit('moved', { viewport: this.parent, type: 'follow' }); + } + } else { + this.parent.moveCenter(toX, toY); + this.parent.emit('moved', { viewport: this.parent, type: 'follow' }); + } + } + }]); + + return Follow; +}(Plugin); + +},{"./plugin":9}],7:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(MouseEdges, _Plugin); + + /** + * Scroll viewport when mouse hovers near one of the edges. + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.radius] distance from center of screen in screen pixels + * @param {number} [options.distance] distance from all sides in screen pixels + * @param {number} [options.top] alternatively, set top distance (leave unset for no top scroll) + * @param {number} [options.bottom] alternatively, set bottom distance (leave unset for no top scroll) + * @param {number} [options.left] alternatively, set left distance (leave unset for no top scroll) + * @param {number} [options.right] alternatively, set right distance (leave unset for no top scroll) + * @param {number} [options.speed=8] speed in pixels/frame to scroll viewport + * @param {boolean} [options.reverse] reverse direction of scroll + * @param {boolean} [options.noDecelerate] don't use decelerate plugin even if it's installed + * @param {boolean} [options.linear] if using radius, use linear movement (+/- 1, +/- 1) instead of angled movement (Math.cos(angle from center), Math.sin(angle from center)) + * + * @event mouse-edge-start(Viewport) emitted when mouse-edge starts + * @event mouse-edge-end(Viewport) emitted when mouse-edge ends + */ + function MouseEdges(parent, options) { + _classCallCheck(this, MouseEdges); + + var _this = _possibleConstructorReturn(this, (MouseEdges.__proto__ || Object.getPrototypeOf(MouseEdges)).call(this, parent)); + + options = options || {}; + _this.options = options; + _this.reverse = options.reverse ? 1 : -1; + _this.noDecelerate = options.noDecelerate; + _this.linear = options.linear; + _this.radiusSquared = Math.pow(options.radius, 2); + _this.resize(); + _this.speed = options.speed || 8; + return _this; + } + + _createClass(MouseEdges, [{ + key: 'resize', + value: function resize() { + var options = this.options; + var distance = options.distance; + if (utils.exists(distance)) { + this.left = distance; + this.top = distance; + this.right = window.innerWidth - distance; + this.bottom = window.innerHeight - distance; + } else if (!this.radius) { + this.left = utils.exists(options.left) ? options.left : null; + this.top = utils.exists(options.top) ? options.top : null; + this.right = utils.exists(options.right) ? window.innerWidth - options.right : null; + this.bottom = utils.exists(options.bottom) ? window.innerHeight - options.bottom : null; + } + } + }, { + key: 'down', + value: function down() { + this.horizontal = this.vertical = null; + } + }, { + key: 'move', + value: function move(e) { + if (e.data.identifier !== 'MOUSE' || e.data.buttons !== 0) { + return; + } + var x = e.data.global.x; + var y = e.data.global.y; + + if (this.radiusSquared) { + var center = this.parent.toScreen(this.parent.center); + var distance = Math.pow(center.x - x, 2) + Math.pow(center.y - y, 2); + if (distance >= this.radiusSquared) { + var angle = Math.atan2(center.y - y, center.x - x); + if (this.linear) { + this.horizontal = Math.round(Math.cos(angle)) * this.speed * this.reverse * (60 / 1000); + this.vertical = Math.round(Math.sin(angle)) * this.speed * this.reverse * (60 / 1000); + } else { + this.horizontal = Math.cos(angle) * this.speed * this.reverse * (60 / 1000); + this.vertical = Math.sin(angle) * this.speed * this.reverse * (60 / 1000); + } + } else { + if (this.horizontal) { + this.decelerateHorizontal(); + } + if (this.vertical) { + this.decelerateVertical(); + } + this.horizontal = this.vertical = 0; + } + } else { + if (utils.exists(this.left) && x < this.left) { + this.horizontal = 1 * this.reverse * this.speed * (60 / 1000); + } else if (utils.exists(this.right) && x > this.right) { + this.horizontal = -1 * this.reverse * this.speed * (60 / 1000); + } else { + this.decelerateHorizontal(); + this.horizontal = 0; + } + if (utils.exists(this.top) && y < this.top) { + this.vertical = 1 * this.reverse * this.speed * (60 / 1000); + } else if (utils.exists(this.bottom) && y > this.bottom) { + this.vertical = -1 * this.reverse * this.speed * (60 / 1000); + } else { + this.decelerateVertical(); + this.vertical = 0; + } + } + } + }, { + key: 'decelerateHorizontal', + value: function decelerateHorizontal() { + var decelerate = this.parent.plugins['decelerate']; + if (this.horizontal && decelerate && !this.noDecelerate) { + decelerate.activate({ x: this.horizontal * this.speed * this.reverse / (1000 / 60) }); + } + } + }, { + key: 'decelerateVertical', + value: function decelerateVertical() { + var decelerate = this.parent.plugins['decelerate']; + if (this.vertical && decelerate && !this.noDecelerate) { + decelerate.activate({ y: this.vertical * this.speed * this.reverse / (1000 / 60) }); + } + } + }, { + key: 'up', + value: function up() { + if (this.horizontal) { + this.decelerateHorizontal(); + } + if (this.vertical) { + this.decelerateVertical(); + } + this.horizontal = this.vertical = null; + } + }, { + key: 'update', + value: function update() { + if (this.paused) { + return; + } + + if (this.horizontal || this.vertical) { + var center = this.parent.center; + if (this.horizontal) { + center.x += this.horizontal * this.speed; + } + if (this.vertical) { + center.y += this.vertical * this.speed; + } + this.parent.moveCenter(center); + this.parent.emit('moved', { viewport: this.parent, type: 'mouse-edges' }); + } + } + }]); + + return MouseEdges; +}(Plugin); + +},{"./plugin":9,"./utils":12}],8:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Pinch, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {boolean} [options.noDrag] disable two-finger dragging + * @param {number} [options.percent=1.0] percent to modify pinch speed + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of two fingers + */ + function Pinch(parent, options) { + _classCallCheck(this, Pinch); + + var _this = _possibleConstructorReturn(this, (Pinch.__proto__ || Object.getPrototypeOf(Pinch)).call(this, parent)); + + options = options || {}; + _this.percent = options.percent || 1.0; + _this.noDrag = options.noDrag; + _this.center = options.center; + return _this; + } + + _createClass(Pinch, [{ + key: 'down', + value: function down() { + if (this.parent.countDownPointers() >= 2) { + this.active = true; + } + } + }, { + key: 'move', + value: function move(e) { + if (this.paused || !this.active) { + return; + } + + var x = e.data.global.x; + var y = e.data.global.y; + + var pointers = this.parent.getTouchPointers(); + if (pointers.length >= 2) { + var first = pointers[0]; + var second = pointers[1]; + var last = first.last && second.last ? Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2)) : null; + if (first.pointerId === e.data.pointerId) { + first.last = { x: x, y: y, data: e.data }; + } else if (second.pointerId === e.data.pointerId) { + second.last = { x: x, y: y, data: e.data }; + } + if (last) { + var oldPoint = void 0; + var point = { x: first.last.x + (second.last.x - first.last.x) / 2, y: first.last.y + (second.last.y - first.last.y) / 2 }; + if (!this.center) { + oldPoint = this.parent.toLocal(point); + } + var dist = Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2)); + var change = (dist - last) / this.parent.screenWidth * this.parent.scale.x * this.percent; + this.parent.scale.x += change; + this.parent.scale.y += change; + this.parent.emit('zoomed', { viewport: this.parent, type: 'pinch' }); + var clamp = this.parent.plugins['clamp-zoom']; + if (clamp) { + clamp.clamp(); + } + if (this.center) { + this.parent.moveCenter(this.center); + } else { + var newPoint = this.parent.toGlobal(oldPoint); + this.parent.x += point.x - newPoint.x; + this.parent.y += point.y - newPoint.y; + this.parent.emit('moved', { viewport: this.parent, type: 'pinch' }); + } + if (!this.noDrag && this.lastCenter) { + this.parent.x += point.x - this.lastCenter.x; + this.parent.y += point.y - this.lastCenter.y; + this.parent.emit('moved', { viewport: this.parent, type: 'pinch' }); + } + this.lastCenter = point; + this.moved = true; + } else { + if (!this.pinching) { + this.parent.emit('pinch-start', this.parent); + this.pinching = true; + } + } + this.parent.dirty = true; + } + } + }, { + key: 'up', + value: function up() { + if (this.pinching) { + if (this.parent.touches.length <= 1) { + this.active = false; + this.lastCenter = null; + this.pinching = false; + this.moved = false; + this.parent.emit('pinch-end', this.parent); + } + } + } + }]); + + return Pinch; +}(Plugin); + +},{"./plugin":9}],9:[function(require,module,exports){ +"use strict"; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +module.exports = function () { + function Plugin(parent) { + _classCallCheck(this, Plugin); + + this.parent = parent; + this.paused = false; + } + + _createClass(Plugin, [{ + key: "down", + value: function down() {} + }, { + key: "move", + value: function move() {} + }, { + key: "up", + value: function up() {} + }, { + key: "wheel", + value: function wheel() {} + }, { + key: "update", + value: function update() {} + }, { + key: "resize", + value: function resize() {} + }, { + key: "reset", + value: function reset() {} + }, { + key: "pause", + value: function pause() { + this.paused = true; + } + }, { + key: "resume", + value: function resume() { + this.paused = false; + } + }]); + + return Plugin; +}(); + +},{}],10:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); +var utils = require('./utils'); + +module.exports = function (_Plugin) { + _inherits(SnapZoom, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired zoom + * @param {boolean} [options.noMove] zoom but do not move + * + * @event snap-zoom-start(Viewport) emitted each time a fit animation starts + * @event snap-zoom-end(Viewport) emitted each time fit reaches its target + * @event snap-zoom-end(Viewport) emitted each time fit reaches its target + */ + function SnapZoom(parent, options) { + _classCallCheck(this, SnapZoom); + + var _this = _possibleConstructorReturn(this, (SnapZoom.__proto__ || Object.getPrototypeOf(SnapZoom)).call(this, parent)); + + options = options || {}; + _this.width = options.width; + _this.height = options.height; + if (_this.width > 0) { + _this.x_scale = parent._screenWidth / _this.width; + } + if (_this.height > 0) { + _this.y_scale = parent._screenHeight / _this.height; + } + _this.xIndependent = utils.exists(_this.x_scale); + _this.yIndependent = utils.exists(_this.y_scale); + _this.x_scale = _this.xIndependent ? _this.x_scale : _this.y_scale; + _this.y_scale = _this.yIndependent ? _this.y_scale : _this.x_scale; + + _this.time = utils.defaults(options.time, 1000); + _this.ease = utils.ease(options.ease, 'easeInOutSine'); + _this.center = options.center; + _this.noMove = options.noMove; + _this.stopOnResize = options.stopOnResize; + _this.removeOnInterrupt = options.removeOnInterrupt; + _this.removeOnComplete = utils.defaults(options.removeOnComplete, true); + _this.interrupt = utils.defaults(options.interrupt, true); + if (_this.time === 0) { + parent.container.scale.x = _this.x_scale; + parent.container.scale.y = _this.y_scale; + if (_this.removeOnComplete) { + _this.parent.removePlugin('snap-zoom'); + } + } else if (options.forceStart) { + _this.createSnapping(); + } + return _this; + } + + _createClass(SnapZoom, [{ + key: 'createSnapping', + value: function createSnapping() { + var scale = this.parent.scale; + this.snapping = { time: 0, startX: scale.x, startY: scale.y, deltaX: this.x_scale - scale.x, deltaY: this.y_scale - scale.y }; + this.parent.emit('snap-zoom-start', this.parent); + } + }, { + key: 'resize', + value: function resize() { + this.snapping = null; + + if (this.width > 0) { + this.x_scale = this.parent._screenWidth / this.width; + } + if (this.height > 0) { + this.y_scale = this.parent._screenHeight / this.height; + } + this.x_scale = this.xIndependent ? this.x_scale : this.y_scale; + this.y_scale = this.yIndependent ? this.y_scale : this.x_scale; + } + }, { + key: 'reset', + value: function reset() { + this.snapping = null; + } + }, { + key: 'wheel', + value: function wheel() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap-zoom'); + } + } + }, { + key: 'down', + value: function down() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap-zoom'); + } else if (this.interrupt) { + this.snapping = null; + } + } + }, { + key: 'update', + value: function update(elapsed) { + if (this.paused) { + return; + } + if (this.interrupt && this.parent.countDownPointers() !== 0) { + return; + } + + var oldCenter = void 0; + if (!this.center && !this.noMove) { + oldCenter = this.parent.center; + } + if (!this.snapping) { + if (this.parent.scale.x !== this.x_scale || this.parent.scale.y !== this.y_scale) { + this.createSnapping(); + } + } else if (this.snapping) { + var snapping = this.snapping; + snapping.time += elapsed; + if (snapping.time >= this.time) { + this.parent.scale.set(this.x_scale, this.y_scale); + if (this.removeOnComplete) { + this.parent.removePlugin('snap-zoom'); + } + this.parent.emit('snap-zoom-end', this.parent); + this.snapping = null; + } else { + var _snapping = this.snapping; + this.parent.scale.x = this.ease(_snapping.time, _snapping.startX, _snapping.deltaX, this.time); + this.parent.scale.y = this.ease(_snapping.time, _snapping.startY, _snapping.deltaY, this.time); + } + var clamp = this.parent.plugins['clamp-zoom']; + if (clamp) { + clamp.clamp(); + } + if (!this.noMove) { + if (!this.center) { + this.parent.moveCenter(oldCenter); + } else { + this.parent.moveCenter(this.center); + } + } + } + } + }, { + key: 'resume', + value: function resume() { + this.snapping = null; + _get(SnapZoom.prototype.__proto__ || Object.getPrototypeOf(SnapZoom.prototype), 'resume', this).call(this); + } + }]); + + return SnapZoom; +}(Plugin); + +},{"./plugin":9,"./utils":12}],11:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); +var utils = require('./utils'); + +module.exports = function (_Plugin) { + _inherits(Snap, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {number} x + * @param {number} y + * @param {object} [options] + * @param {boolean} [options.topLeft] snap to the top-left of viewport instead of center + * @param {number} [options.friction=0.8] friction/frame to apply if decelerate is active + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired location + * + * @event snap-start(Viewport) emitted each time a snap animation starts + * @event snap-restart(Viewport) emitted each time a snap resets because of a change in viewport size + * @event snap-end(Viewport) emitted each time snap reaches its target + * @event snap-remove(Viewport) emitted if snap plugin is removed + */ + function Snap(parent, x, y, options) { + _classCallCheck(this, Snap); + + var _this = _possibleConstructorReturn(this, (Snap.__proto__ || Object.getPrototypeOf(Snap)).call(this, parent)); + + options = options || {}; + _this.friction = options.friction || 0.8; + _this.time = options.time || 1000; + _this.ease = utils.ease(options.ease, 'easeInOutSine'); + _this.x = x; + _this.y = y; + _this.topLeft = options.topLeft; + _this.interrupt = utils.defaults(options.interrupt, true); + _this.removeOnComplete = options.removeOnComplete; + _this.removeOnInterrupt = options.removeOnInterrupt; + if (options.forceStart) { + _this.startEase(); + } + return _this; + } + + _createClass(Snap, [{ + key: 'snapStart', + value: function snapStart() { + this.percent = 0; + this.snapping = { time: 0 }; + var current = this.topLeft ? this.parent.corner : this.parent.center; + this.deltaX = this.x - current.x; + this.deltaY = this.y - current.y; + this.startX = current.x; + this.startY = current.y; + this.parent.emit('snap-start', this.parent); + } + }, { + key: 'wheel', + value: function wheel() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap'); + } + } + }, { + key: 'down', + value: function down() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap'); + } else if (this.interrupt) { + this.snapping = null; + } + } + }, { + key: 'up', + value: function up() { + if (this.parent.countDownPointers() === 0) { + var decelerate = this.parent.plugins['decelerate']; + if (decelerate && (decelerate.x || decelerate.y)) { + decelerate.percentChangeX = decelerate.percentChangeY = this.friction; + } + } + } + }, { + key: 'update', + value: function update(elapsed) { + if (this.paused) { + return; + } + if (this.interrupt && this.parent.countDownPointers() !== 0) { + return; + } + if (!this.snapping) { + var current = this.topLeft ? this.parent.corner : this.parent.center; + if (current.x !== this.x || current.y !== this.y) { + this.snapStart(); + } + } else { + var snapping = this.snapping; + snapping.time += elapsed; + var finished = void 0, + x = void 0, + y = void 0; + if (snapping.time > this.time) { + finished = true; + x = this.startX + this.deltaX; + y = this.startY + this.deltaY; + } else { + var percent = this.ease(snapping.time, 0, 1, this.time); + x = this.startX + this.deltaX * percent; + y = this.startY + this.deltaY * percent; + } + if (this.topLeft) { + this.parent.moveCorner(x, y); + } else { + this.parent.moveCenter(x, y); + } + this.parent.emit('moved', { viewport: this.parent, type: 'snap' }); + if (finished) { + if (this.removeOnComplete) { + this.parent.removePlugin('snap'); + } + this.parent.emit('snap-end', this.parent); + this.snapping = null; + } + } + } + }]); + + return Snap; +}(Plugin); + +},{"./plugin":9,"./utils":12}],12:[function(require,module,exports){ +'use strict'; + +var Penner = require('penner'); + +function exists(a) { + return a !== undefined && a !== null; +} + +function defaults(a, defaults) { + return a !== undefined && a !== null ? a : defaults; +} + +/** + * @param {(function|string)} [ease] + * @param {string} defaults for pennr equation + * @private + * @returns {function} correct penner equation + */ +function ease(ease, defaults) { + if (!exists(ease)) { + return Penner[defaults]; + } else if (typeof ease === 'function') { + return ease; + } else if (typeof ease === 'string') { + return Penner[ease]; + } +} + +module.exports = { + exists: exists, + defaults: defaults, + ease: ease +}; + +},{"penner":15}],13:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Drag = require('./drag'); +var Pinch = require('./pinch'); +var Clamp = require('./clamp'); +var ClampZoom = require('./clamp-zoom'); +var Decelerate = require('./decelerate'); +var Bounce = require('./bounce'); +var Snap = require('./snap'); +var SnapZoom = require('./snap-zoom'); +var Follow = require('./follow'); +var Wheel = require('./wheel'); +var MouseEdges = require('./mouse-edges'); + +var PLUGIN_ORDER = ['drag', 'pinch', 'wheel', 'follow', 'mouse-edges', 'decelerate', 'bounce', 'snap-zoom', 'clamp-zoom', 'snap', 'clamp']; + +var Viewport = function (_PIXI$Container) { + _inherits(Viewport, _PIXI$Container); + + /** + * @extends PIXI.Container + * @extends EventEmitter + * @param {object} [options] + * @param {number} [options.screenWidth=window.innerWidth] + * @param {number} [options.screenHeight=window.innerHeight] + * @param {number} [options.worldWidth=this.width] + * @param {number} [options.worldHeight=this.height] + * @param {number} [options.threshold = 5] number of pixels to move to trigger an input event (e.g., drag, pinch) + * @param {(PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle)} [options.forceHitArea] change the default hitArea from world size to a new value + * @param {PIXI.ticker.Ticker} [options.ticker=PIXI.ticker.shared] use this PIXI.ticker for updates + * @param {PIXI.InteractionManager} [options.interaction=null] InteractionManager, available from instantiated WebGLRenderer/CanvasRenderer.plugins.interaction - used to calculate pointer postion relative to canvas location on screen + * @param {HTMLElement} [options.divWheel=document.body] div to attach the wheel event + * @fires clicked + * @fires drag-start + * @fires drag-end + * @fires drag-remove + * @fires pinch-start + * @fires pinch-end + * @fires pinch-remove + * @fires snap-start + * @fires snap-end + * @fires snap-remove + * @fires snap-zoom-start + * @fires snap-zoom-end + * @fires snap-zoom-remove + * @fires bounce-x-start + * @fires bounce-x-end + * @fires bounce-y-start + * @fires bounce-y-end + * @fires bounce-remove + * @fires wheel + * @fires wheel-remove + * @fires wheel-scroll + * @fires wheel-scroll-remove + * @fires mouse-edge-start + * @fires mouse-edge-end + * @fires mouse-edge-remove + * @fires moved + */ + function Viewport(options) { + _classCallCheck(this, Viewport); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (Viewport.__proto__ || Object.getPrototypeOf(Viewport)).call(this)); + + _this.plugins = {}; + _this.pluginsList = []; + _this._screenWidth = options.screenWidth; + _this._screenHeight = options.screenHeight; + _this._worldWidth = options.worldWidth; + _this._worldHeight = options.worldHeight; + _this.hitAreaFullScreen = utils.defaults(options.hitAreaFullScreen, true); + _this.forceHitArea = options.forceHitArea; + _this.threshold = utils.defaults(options.threshold, 5); + _this.interaction = options.interaction || null; + _this.div = options.divWheel || document.body; + _this.listeners(_this.div); + + /** + * active touch point ids on the viewport + * @type {number[]} + * @readonly + */ + _this.touches = []; + + _this.ticker = options.ticker || PIXI.ticker.shared; + _this.tickerFunction = function () { + return _this.update(); + }; + _this.ticker.add(_this.tickerFunction); + return _this; + } + + /** + * removes all event listeners from viewport + * (useful for cleanup of wheel and ticker events when removing viewport) + */ + + + _createClass(Viewport, [{ + key: 'removeListeners', + value: function removeListeners() { + this.ticker.remove(this.tickerFunction); + this.div.removeEventListener('wheel', this.wheelFunction); + } + + /** + * overrides PIXI.Container's destroy to also remove the 'wheel' and PIXI.Ticker listeners + */ + + }, { + key: 'destroy', + value: function destroy(options) { + _get(Viewport.prototype.__proto__ || Object.getPrototypeOf(Viewport.prototype), 'destroy', this).call(this, options); + this.removeListeners(); + } + + /** + * update animations + * @private + */ + + }, { + key: 'update', + value: function update() { + if (!this.pause) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = this.pluginsList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var plugin = _step.value; + + plugin.update(this.ticker.elapsedMS); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + if (!this.forceHitArea) { + this.hitArea.x = this.left; + this.hitArea.y = this.top; + this.hitArea.width = this.worldScreenWidth; + this.hitArea.height = this.worldScreenHeight; + } + } + + /** + * use this to set screen and world sizes--needed for pinch/wheel/clamp/bounce + * @param {number} screenWidth + * @param {number} screenHeight + * @param {number} [worldWidth] + * @param {number} [worldHeight] + */ + + }, { + key: 'resize', + value: function resize(screenWidth, screenHeight, worldWidth, worldHeight) { + this._screenWidth = screenWidth || window.innerWidth; + this._screenHeight = screenHeight || window.innerHeight; + this._worldWidth = worldWidth; + this._worldHeight = worldHeight; + this.resizePlugins(); + } + + /** + * called after a worldWidth/Height change + * @private + */ + + }, { + key: 'resizePlugins', + value: function resizePlugins() { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = this.pluginsList[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var plugin = _step2.value; + + plugin.resize(); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + + /** + * screen width in screen pixels + * @type {number} + */ + + }, { + key: 'listeners', + + + /** + * add input listeners + * @private + */ + value: function listeners(div) { + var _this2 = this; + + this.interactive = true; + if (!this.forceHitArea) { + this.hitArea = new PIXI.Rectangle(0, 0, this.worldWidth, this.worldHeight); + } + this.on('pointerdown', this.down); + this.on('pointermove', this.move); + this.on('pointerup', this.up); + this.on('pointerupoutside', this.up); + this.on('pointercancel', this.up); + this.on('pointerout', this.up); + this.wheelFunction = function (e) { + return _this2.handleWheel(e); + }; + div.addEventListener('wheel', this.wheelFunction); + this.leftDown = false; + } + + /** + * handle down events + * @private + */ + + }, { + key: 'down', + value: function down(e) { + if (this.pause) { + return; + } + if (e.data.pointerType === 'mouse') { + if (e.data.originalEvent.button == 0) { + this.leftDown = true; + } + } else { + this.touches.push(e.data.pointerId); + } + + if (this.countDownPointers() === 1) { + this.last = { x: e.data.global.x, y: e.data.global.y + + // clicked event does not fire if viewport is decelerating or bouncing + };var decelerate = this.plugins['decelerate']; + var bounce = this.plugins['bounce']; + if ((!decelerate || !decelerate.x && !decelerate.y) && (!bounce || !bounce.toX && !bounce.toY)) { + this.clickedAvailable = true; + } + } else { + this.clickedAvailable = false; + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = this.pluginsList[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var plugin = _step3.value; + + plugin.down(e); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + + /** + * whether change exceeds threshold + * @private + * @param {number} change + */ + + }, { + key: 'checkThreshold', + value: function checkThreshold(change) { + if (Math.abs(change) >= this.threshold) { + return true; + } + return false; + } + + /** + * handle move events + * @private + */ + + }, { + key: 'move', + value: function move(e) { + if (this.pause) { + return; + } + + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = this.pluginsList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var plugin = _step4.value; + + plugin.move(e); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + if (this.clickedAvailable) { + var distX = e.data.global.x - this.last.x; + var distY = e.data.global.y - this.last.y; + if (this.checkThreshold(distX) || this.checkThreshold(distY)) { + this.clickedAvailable = false; + } + } + } + + /** + * handle up events + * @private + */ + + }, { + key: 'up', + value: function up(e) { + if (this.pause) { + return; + } + + if (e.data.originalEvent instanceof MouseEvent && e.data.originalEvent.button == 0) { + this.leftDown = false; + } + + if (e.data.pointerType !== 'mouse') { + for (var i = 0; i < this.touches.length; i++) { + if (this.touches[i] === e.data.pointerId) { + this.touches.splice(i, 1); + break; + } + } + } + + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = this.pluginsList[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var plugin = _step5.value; + + plugin.up(e); + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + if (this.clickedAvailable && this.countDownPointers() === 0) { + this.emit('clicked', { screen: this.last, world: this.toWorld(this.last), viewport: this }); + this.clickedAvailable = false; + } + } + + /** + * gets pointer position if this.interaction is set + * @param {UIEvent} evt + * @private + */ + + }, { + key: 'getPointerPosition', + value: function getPointerPosition(evt) { + var point = new PIXI.Point(); + if (this.interaction) { + this.interaction.mapPositionToPoint(point, evt.clientX, evt.clientY); + } else { + point.x = evt.clientX; + point.y = evt.clientY; + } + return point; + } + + /** + * handle wheel events + * @private + */ + + }, { + key: 'handleWheel', + value: function handleWheel(e) { + if (this.pause) { + return; + } + + // only handle wheel events where the mouse is over the viewport + var point = this.toLocal(this.getPointerPosition(e)); + if (this.left <= point.x && point.x <= this.right && this.top <= point.y && point.y <= this.bottom) { + var result = void 0; + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + for (var _iterator6 = this.pluginsList[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var plugin = _step6.value; + + if (plugin.wheel(e)) { + result = true; + } + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + + return result; + } + } + + /** + * change coordinates from screen to world + * @param {number|PIXI.Point} x + * @param {number} [y] + * @returns {PIXI.Point} + */ + + }, { + key: 'toWorld', + value: function toWorld() { + if (arguments.length === 2) { + var x = arguments[0]; + var y = arguments[1]; + return this.toLocal({ x: x, y: y }); + } else { + return this.toLocal(arguments[0]); + } + } + + /** + * change coordinates from world to screen + * @param {number|PIXI.Point} x + * @param {number} [y] + * @returns {PIXI.Point} + */ + + }, { + key: 'toScreen', + value: function toScreen() { + if (arguments.length === 2) { + var x = arguments[0]; + var y = arguments[1]; + return this.toGlobal({ x: x, y: y }); + } else { + var point = arguments[0]; + return this.toGlobal(point); + } + } + + /** + * screen width in world coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'moveCenter', + + + /** + * move center of viewport to point + * @param {(number|PIXI.PointLike)} x or point + * @param {number} [y] + * @return {Viewport} this + */ + value: function moveCenter() /*x, y | PIXI.Point*/{ + var x = void 0, + y = void 0; + if (!isNaN(arguments[0])) { + x = arguments[0]; + y = arguments[1]; + } else { + x = arguments[0].x; + y = arguments[0].y; + } + this.position.set((this.worldScreenWidth / 2 - x) * this.scale.x, (this.worldScreenHeight / 2 - y) * this.scale.y); + this._reset(); + return this; + } + + /** + * top-left corner + * @type {PIXI.PointLike} + */ + + }, { + key: 'moveCorner', + + + /** + * move viewport's top-left corner; also clamps and resets decelerate and bounce (as needed) + * @param {number|PIXI.Point} x|point + * @param {number} y + * @return {Viewport} this + */ + value: function moveCorner() /*x, y | point*/{ + if (arguments.length === 1) { + this.position.set(-arguments[0].x * this.scale.x, -arguments[0].y * this.scale.y); + } else { + this.position.set(-arguments[0] * this.scale.x, -arguments[1] * this.scale.y); + } + this._reset(); + return this; + } + + /** + * change zoom so the width fits in the viewport + * @param {number} [width=this._worldWidth] in world coordinates + * @param {boolean} [center] maintain the same center + * @return {Viewport} this + */ + + }, { + key: 'fitWidth', + value: function fitWidth(width, center) { + var save = void 0; + if (center) { + save = this.center; + } + width = width || this.worldWidth; + this.scale.x = this.screenWidth / width; + this.scale.y = this.scale.x; + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * change zoom so the height fits in the viewport + * @param {number} [height=this._worldHeight] in world coordinates + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} this + */ + + }, { + key: 'fitHeight', + value: function fitHeight(height, center) { + var save = void 0; + if (center) { + save = this.center; + } + height = height || this.worldHeight; + this.scale.y = this.screenHeight / height; + this.scale.x = this.scale.y; + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * change zoom so it fits the entire world in the viewport + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} this + */ + + }, { + key: 'fitWorld', + value: function fitWorld(center) { + var save = void 0; + if (center) { + save = this.center; + } + this.scale.x = this._screenWidth / this._worldWidth; + this.scale.y = this._screenHeight / this._worldHeight; + if (this.scale.x < this.scale.y) { + this.scale.y = this.scale.x; + } else { + this.scale.x = this.scale.y; + } + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * change zoom so it fits the size or the entire world in the viewport + * @param {boolean} [center] maintain the same center of the screen after zoom + * @param {number} [width] desired width + * @param {number} [height] desired height + * @return {Viewport} this + */ + + }, { + key: 'fit', + value: function fit(center, width, height) { + var save = void 0; + if (center) { + save = this.center; + } + width = width || this.worldWidth; + height = height || this.worldHeight; + this.scale.x = this.screenWidth / width; + this.scale.y = this.screenHeight / height; + if (this.scale.x < this.scale.y) { + this.scale.y = this.scale.x; + } else { + this.scale.x = this.scale.y; + } + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * zoom viewport by a certain percent (in both x and y direction) + * @param {number} percent change (e.g., 0.25 would increase a starting scale of 1.0 to 1.25) + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} the viewport + */ + + }, { + key: 'zoomPercent', + value: function zoomPercent(percent, center) { + var save = void 0; + if (center) { + save = this.center; + } + var scale = this.scale.x + this.scale.x * percent; + this.scale.set(scale); + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * zoom viewport by increasing/decreasing width by a certain number of pixels + * @param {number} change in pixels + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} the viewport + */ + + }, { + key: 'zoom', + value: function zoom(change, center) { + this.fitWidth(change + this.worldScreenWidth, center); + return this; + } + + /** + * @param {object} [options] + * @param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired zoom + */ + + }, { + key: 'snapZoom', + value: function snapZoom(options) { + this.plugins['snap-zoom'] = new SnapZoom(this, options); + this.pluginsSort(); + return this; + } + + /** + * @private + * @typedef OutOfBounds + * @type {object} + * @property {boolean} left + * @property {boolean} right + * @property {boolean} top + * @property {boolean} bottom + */ + + /** + * is container out of world bounds + * @return {OutOfBounds} + * @private + */ + + }, { + key: 'OOB', + value: function OOB() { + var result = {}; + result.left = this.left < 0; + result.right = this.right > this._worldWidth; + result.top = this.top < 0; + result.bottom = this.bottom > this._worldHeight; + result.cornerPoint = { + x: this._worldWidth * this.scale.x - this._screenWidth, + y: this._worldHeight * this.scale.y - this._screenHeight + }; + return result; + } + + /** + * world coordinates of the right edge of the screen + * @type {number} + */ + + }, { + key: 'countDownPointers', + + + /** + * count of mouse/touch pointers that are down on the viewport + * @private + * @return {number} + */ + value: function countDownPointers() { + return (this.leftDown ? 1 : 0) + this.touches.length; + } + + /** + * array of touch pointers that are down on the viewport + * @private + * @return {PIXI.InteractionTrackingData[]} + */ + + }, { + key: 'getTouchPointers', + value: function getTouchPointers() { + var results = []; + var pointers = this.trackedPointers; + for (var key in pointers) { + var pointer = pointers[key]; + if (this.touches.indexOf(pointer.pointerId) !== -1) { + results.push(pointer); + } + } + return results; + } + + /** + * array of pointers that are down on the viewport + * @private + * @return {PIXI.InteractionTrackingData[]} + */ + + }, { + key: 'getPointers', + value: function getPointers() { + var results = []; + var pointers = this.trackedPointers; + for (var key in pointers) { + results.push(pointers[key]); + } + return results; + } + + /** + * clamps and resets bounce and decelerate (as needed) after manually moving viewport + * @private + */ + + }, { + key: '_reset', + value: function _reset() { + if (this.plugins['bounce']) { + this.plugins['bounce'].reset(); + this.plugins['bounce'].bounce(); + } + if (this.plugins['decelerate']) { + this.plugins['decelerate'].reset(); + } + if (this.plugins['snap']) { + this.plugins['snap'].reset(); + } + if (this.plugins['clamp']) { + this.plugins['clamp'].update(); + } + if (this.plugins['clamp-zoom']) { + this.plugins['clamp-zoom'].clamp(); + } + this.dirty = true; + } + + // PLUGINS + + /** + * removes installed plugin + * @param {string} type of plugin (e.g., 'drag', 'pinch') + */ + + }, { + key: 'removePlugin', + value: function removePlugin(type) { + if (this.plugins[type]) { + this.plugins[type] = null; + this.emit(type + '-remove'); + this.pluginsSort(); + } + } + + /** + * pause plugin + * @param {string} type of plugin (e.g., 'drag', 'pinch') + */ + + }, { + key: 'pausePlugin', + value: function pausePlugin(type) { + if (this.plugins[type]) { + this.plugins[type].pause(); + } + } + + /** + * resume plugin + * @param {string} type of plugin (e.g., 'drag', 'pinch') + */ + + }, { + key: 'resumePlugin', + value: function resumePlugin(type) { + if (this.plugins[type]) { + this.plugins[type].resume(); + } + } + + /** + * sort plugins for updates + * @private + */ + + }, { + key: 'pluginsSort', + value: function pluginsSort() { + this.pluginsList = []; + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = PLUGIN_ORDER[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var plugin = _step7.value; + + if (this.plugins[plugin]) { + this.pluginsList.push(this.plugins[plugin]); + } + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + } + + /** + * enable one-finger touch to drag + * @param {object} [options] + * @param {string} [options.direction=all] direction to drag (all, x, or y) + * @param {boolean} [options.wheel=true] use wheel to scroll in y direction (unless wheel plugin is active) + * @param {number} [options.wheelScroll=10] number of pixels to scroll with each wheel spin + * @param {boolean} [options.reverse] reverse the direction of the wheel scroll + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + */ + + }, { + key: 'drag', + value: function drag(options) { + this.plugins['drag'] = new Drag(this, options); + this.pluginsSort(); + return this; + } + + /** + * clamp to world boundaries or other provided boundaries + * NOTES: + * clamp is disabled if called with no options; use { direction: 'all' } for all edge clamping + * screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {object} [options] + * @param {(number|boolean)} [options.left] clamp left; true=0 + * @param {(number|boolean)} [options.right] clamp right; true=viewport.worldWidth + * @param {(number|boolean)} [options.top] clamp top; true=0 + * @param {(number|boolean)} [options.bottom] clamp bottom; true=viewport.worldHeight + * @param {string} [options.direction] (all, x, or y) using clamps of [0, viewport.worldWidth/viewport.worldHeight]; replaces left/right/top/bottom if set + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + * @return {Viewport} this + */ + + }, { + key: 'clamp', + value: function clamp(options) { + this.plugins['clamp'] = new Clamp(this, options); + this.pluginsSort(); + return this; + } + + /** + * decelerate after a move + * @param {object} [options] + * @param {number} [options.friction=0.95] percent to decelerate after movement + * @param {number} [options.bounce=0.8] percent to decelerate when past boundaries (only applicable when viewport.bounce() is active) + * @param {number} [options.minSpeed=0.01] minimum velocity before stopping/reversing acceleration + * @return {Viewport} this + */ + + }, { + key: 'decelerate', + value: function decelerate(options) { + this.plugins['decelerate'] = new Decelerate(this, options); + this.pluginsSort(); + return this; + } + + /** + * bounce on borders + * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {object} [options] + * @param {string} [options.sides=all] all, horizontal, vertical, or combination of top, bottom, right, left (e.g., 'top-bottom-right') + * @param {number} [options.friction=0.5] friction to apply to decelerate if active + * @param {number} [options.time=150] time in ms to finish bounce + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + * @return {Viewport} this + */ + + }, { + key: 'bounce', + value: function bounce(options) { + this.plugins['bounce'] = new Bounce(this, options); + this.pluginsSort(); + return this; + } + + /** + * enable pinch to zoom and two-finger touch to drag + * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {number} [options.percent=1.0] percent to modify pinch speed + * @param {boolean} [options.noDrag] disable two-finger dragging + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of two fingers + * @return {Viewport} this + */ + + }, { + key: 'pinch', + value: function pinch(options) { + this.plugins['pinch'] = new Pinch(this, options); + this.pluginsSort(); + return this; + } + + /** + * snap to a point + * @param {number} x + * @param {number} y + * @param {object} [options] + * @param {boolean} [options.topLeft] snap to the top-left of viewport instead of center + * @param {number} [options.friction=0.8] friction/frame to apply if decelerate is active + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired location + * @return {Viewport} this + */ + + }, { + key: 'snap', + value: function snap(x, y, options) { + this.plugins['snap'] = new Snap(this, x, y, options); + this.pluginsSort(); + return this; + } + + /** + * follow a target + * @param {PIXI.DisplayObject} target to follow (object must include {x: x-coordinate, y: y-coordinate}) + * @param {object} [options] + * @param {number} [options.speed=0] to follow in pixels/frame (0=teleport to location) + * @param {number} [options.radius] radius (in world coordinates) of center circle where movement is allowed without moving the viewport + * @return {Viewport} this + */ + + }, { + key: 'follow', + value: function follow(target, options) { + this.plugins['follow'] = new Follow(this, target, options); + this.pluginsSort(); + return this; + } + + /** + * zoom using mouse wheel + * @param {object} [options] + * @param {number} [options.percent=0.1] percent to scroll with each spin + * @param {boolean} [options.reverse] reverse the direction of the scroll + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of current mouse position + * @return {Viewport} this + */ + + }, { + key: 'wheel', + value: function wheel(options) { + this.plugins['wheel'] = new Wheel(this, options); + this.pluginsSort(); + return this; + } + + /** + * enable clamping of zoom to constraints + * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {object} [options] + * @param {number} [options.minWidth] minimum width + * @param {number} [options.minHeight] minimum height + * @param {number} [options.maxWidth] maximum width + * @param {number} [options.maxHeight] maximum height + * @return {Viewport} this + */ + + }, { + key: 'clampZoom', + value: function clampZoom(options) { + this.plugins['clamp-zoom'] = new ClampZoom(this, options); + this.pluginsSort(); + return this; + } + + /** + * Scroll viewport when mouse hovers near one of the edges or radius-distance from center of screen. + * @param {object} [options] + * @param {number} [options.radius] distance from center of screen in screen pixels + * @param {number} [options.distance] distance from all sides in screen pixels + * @param {number} [options.top] alternatively, set top distance (leave unset for no top scroll) + * @param {number} [options.bottom] alternatively, set bottom distance (leave unset for no top scroll) + * @param {number} [options.left] alternatively, set left distance (leave unset for no top scroll) + * @param {number} [options.right] alternatively, set right distance (leave unset for no top scroll) + * @param {number} [options.speed=8] speed in pixels/frame to scroll viewport + * @param {boolean} [options.reverse] reverse direction of scroll + * @param {boolean} [options.noDecelerate] don't use decelerate plugin even if it's installed + * @param {boolean} [options.linear] if using radius, use linear movement (+/- 1, +/- 1) instead of angled movement (Math.cos(angle from center), Math.sin(angle from center)) + */ + + }, { + key: 'mouseEdges', + value: function mouseEdges(options) { + this.plugins['mouse-edges'] = new MouseEdges(this, options); + this.pluginsSort(); + return this; + } + + /** + * pause viewport (including animation updates such as decelerate) + * NOTE: when setting pause=true, all touches and mouse actions are cleared (i.e., if mousedown was active, it becomes inactive for purposes of the viewport) + * @type {boolean} + */ + + }, { + key: 'screenWidth', + get: function get() { + return this._screenWidth; + }, + set: function set(value) { + this._screenWidth = value; + } + + /** + * screen height in screen pixels + * @type {number} + */ + + }, { + key: 'screenHeight', + get: function get() { + return this._screenHeight; + }, + set: function set(value) { + this._screenHeight = value; + } + + /** + * world width in pixels + * @type {number} + */ + + }, { + key: 'worldWidth', + get: function get() { + if (this._worldWidth) { + return this._worldWidth; + } else { + return this.width; + } + }, + set: function set(value) { + this._worldWidth = value; + this.resizePlugins(); + } + + /** + * world height in pixels + * @type {number} + */ + + }, { + key: 'worldHeight', + get: function get() { + if (this._worldHeight) { + return this._worldHeight; + } else { + return this.height; + } + }, + set: function set(value) { + this._worldHeight = value; + this.resizePlugins(); + } + }, { + key: 'worldScreenWidth', + get: function get() { + return this._screenWidth / this.scale.x; + } + + /** + * screen height in world coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'worldScreenHeight', + get: function get() { + return this._screenHeight / this.scale.y; + } + + /** + * world width in screen coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'screenWorldWidth', + get: function get() { + return this._worldWidth * this.scale.x; + } + + /** + * world height in screen coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'screenWorldHeight', + get: function get() { + return this._worldHeight * this.scale.y; + } + + /** + * get center of screen in world coordinates + * @type {PIXI.PointLike} + */ + + }, { + key: 'center', + get: function get() { + return { x: this.worldScreenWidth / 2 - this.x / this.scale.x, y: this.worldScreenHeight / 2 - this.y / this.scale.y }; + }, + set: function set(value) { + this.moveCenter(value); + } + }, { + key: 'corner', + get: function get() { + return { x: -this.x / this.scale.x, y: -this.y / this.scale.y }; + }, + set: function set(value) { + this.moveCorner(value); + } + }, { + key: 'right', + get: function get() { + return -this.x / this.scale.x + this.worldScreenWidth; + }, + set: function set(value) { + this.x = -value * this.scale.x + this.screenWidth; + this._reset(); + } + + /** + * world coordinates of the left edge of the screen + * @type {number} + */ + + }, { + key: 'left', + get: function get() { + return -this.x / this.scale.x; + }, + set: function set(value) { + this.x = -value * this.scale.x; + this._reset(); + } + + /** + * world coordinates of the top edge of the screen + * @type {number} + */ + + }, { + key: 'top', + get: function get() { + return -this.y / this.scale.y; + }, + set: function set(value) { + this.y = -value * this.scale.y; + this._reset(); + } + + /** + * world coordinates of the bottom edge of the screen + * @type {number} + */ + + }, { + key: 'bottom', + get: function get() { + return -this.y / this.scale.y + this.worldScreenHeight; + }, + set: function set(value) { + this.y = -value * this.scale.y + this.screenHeight; + this._reset(); + } + /** + * determines whether the viewport is dirty (i.e., needs to be renderered to the screen because of a change) + * @type {boolean} + */ + + }, { + key: 'dirty', + get: function get() { + return this._dirty; + }, + set: function set(value) { + this._dirty = value; + } + + /** + * permanently changes the Viewport's hitArea + *

NOTE: normally the hitArea = PIXI.Rectangle(Viewport.left, Viewport.top, Viewport.worldScreenWidth, Viewport.worldScreenHeight)

+ * @type {(PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle)} + */ + + }, { + key: 'forceHitArea', + get: function get() { + return this._forceHitArea; + }, + set: function set(value) { + if (value) { + this._forceHitArea = value; + this.hitArea = value; + } else { + this._forceHitArea = false; + this.hitArea = new PIXI.Rectangle(0, 0, this.worldWidth, this.worldHeight); + } + } + }, { + key: 'pause', + get: function get() { + return this._pause; + }, + set: function set(value) { + this._pause = value; + if (value) { + this.touches = []; + this.leftDown = false; + } + } + }]); + + return Viewport; +}(PIXI.Container); + +/** + * fires after a mouse or touch click + * @event Viewport#clicked + * @type {object} + * @property {PIXI.PointLike} screen + * @property {PIXI.PointLike} world + * @property {Viewport} viewport + */ + +/** + * fires when a drag starts + * @event Viewport#drag-start + * @type {object} + * @property {PIXI.PointLike} screen + * @property {PIXI.PointLike} world + * @property {Viewport} viewport + */ + +/** + * fires when a drag ends + * @event Viewport#drag-end + * @type {object} + * @property {PIXI.PointLike} screen + * @property {PIXI.PointLike} world + * @property {Viewport} viewport + */ + +/** + * fires when a pinch starts + * @event Viewport#pinch-start + * @type {Viewport} + */ + +/** + * fires when a pinch end + * @event Viewport#pinch-end + * @type {Viewport} + */ + +/** + * fires when a snap starts + * @event Viewport#snap-start + * @type {Viewport} + */ + +/** + * fires when a snap ends + * @event Viewport#snap-end + * @type {Viewport} + */ + +/** + * fires when a snap-zoom starts + * @event Viewport#snap-zoom-start + * @type {Viewport} + */ + +/** + * fires when a snap-zoom ends + * @event Viewport#snap-zoom-end + * @type {Viewport} + */ + +/** + * fires when a bounce starts in the x direction + * @event Viewport#bounce-x-start + * @type {Viewport} + */ + +/** + * fires when a bounce ends in the x direction + * @event Viewport#bounce-x-end + * @type {Viewport} + */ + +/** + * fires when a bounce starts in the y direction + * @event Viewport#bounce-y-start + * @type {Viewport} + */ + +/** + * fires when a bounce ends in the y direction + * @event Viewport#bounce-y-end + * @type {Viewport} + */ + +/** + * fires when for a mouse wheel event + * @event Viewport#wheel + * @type {object} + * @property {object} wheel + * @property {number} wheel.dx + * @property {number} wheel.dy + * @property {number} wheel.dz + * @property {Viewport} viewport + */ + +/** + * fires when a wheel-scroll occurs + * @event Viewport#wheel-scroll + * @type {Viewport} + */ + +/** + * fires when a mouse-edge starts to scroll + * @event Viewport#mouse-edge-start + * @type {Viewport} + */ + +/** + * fires when the mouse-edge scrolling ends + * @event Viewport#mouse-edge-end + * @type {Viewport} + */ + +/** + * fires when viewport moves through UI interaction, deceleration, or follow + * @event Viewport#moved + * @type {object} + * @property {Viewport} viewport + * @property {string} type (drag, snap, pinch, follow, bounce-x, bounce-y, clamp-x, clamp-y, decelerate, mouse-edges, wheel) + */ + +/** + * fires when viewport moves through UI interaction, deceleration, or follow + * @event Viewport#zoomed + * @type {object} + * @property {Viewport} viewport + * @property {string} type (drag-zoom, pinch, wheel, clamp-zoom) + */ + +PIXI.extras.Viewport = Viewport; + +module.exports = Viewport; + +},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Wheel, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.percent=0.1] percent to scroll with each spin + * @param {boolean} [options.reverse] reverse the direction of the scroll + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of current mouse position + * + * @event wheel({wheel: {dx, dy, dz}, event, viewport}) + */ + function Wheel(parent, options) { + _classCallCheck(this, Wheel); + + var _this = _possibleConstructorReturn(this, (Wheel.__proto__ || Object.getPrototypeOf(Wheel)).call(this, parent)); + + options = options || {}; + _this.percent = options.percent || 0.1; + _this.center = options.center; + _this.reverse = options.reverse; + return _this; + } + + _createClass(Wheel, [{ + key: 'wheel', + value: function wheel(e) { + if (this.paused) { + return; + } + + var change = void 0; + if (this.reverse) { + change = e.deltaY > 0 ? 1 + this.percent : 1 - this.percent; + } else { + change = e.deltaY > 0 ? 1 - this.percent : 1 + this.percent; + } + var point = this.parent.getPointerPosition(e); + + var oldPoint = void 0; + if (!this.center) { + oldPoint = this.parent.toLocal(point); + } + this.parent.scale.x *= change; + this.parent.scale.y *= change; + this.parent.emit('zoomed', { viewport: this.parent, type: 'wheel' }); + var clamp = this.parent.plugins['clamp-zoom']; + if (clamp) { + clamp.clamp(); + } + + if (this.center) { + this.parent.moveCenter(this.center); + } else { + var newPoint = this.parent.toGlobal(oldPoint); + this.parent.x += point.x - newPoint.x; + this.parent.y += point.y - newPoint.y; + } + this.parent.emit('moved', { viewport: this.parent, type: 'wheel' }); + this.parent.emit('wheel', { wheel: { dx: e.deltaX, dy: e.deltaY, dz: e.deltaZ }, event: e, viewport: this.parent }); + e.preventDefault(); + } + }]); + + return Wheel; +}(Plugin); + +},{"./plugin":9}],15:[function(require,module,exports){ + +/* + Copyright © 2001 Robert Penner + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + Neither the name of the author nor the names of contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +(function() { + var penner, umd; + + umd = function(factory) { + if (typeof exports === 'object') { + return module.exports = factory; + } else if (typeof define === 'function' && define.amd) { + return define([], factory); + } else { + return this.penner = factory; + } + }; + + penner = { + linear: function(t, b, c, d) { + return c * t / d + b; + }, + easeInQuad: function(t, b, c, d) { + return c * (t /= d) * t + b; + }, + easeOutQuad: function(t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + }, + easeInOutQuad: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t + b; + } else { + return -c / 2 * ((--t) * (t - 2) - 1) + b; + } + }, + easeInCubic: function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + easeOutCubic: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOutCubic: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t + 2) + b; + } + }, + easeInQuart: function(t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + easeOutQuart: function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + easeInOutQuart: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } else { + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + } + }, + easeInQuint: function(t, b, c, d) { + return c * (t /= d) * t * t * t * t + b; + }, + easeOutQuint: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + easeInOutQuint: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + } + }, + easeInSine: function(t, b, c, d) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + easeOutSine: function(t, b, c, d) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + easeInOutSine: function(t, b, c, d) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + easeInExpo: function(t, b, c, d) { + if (t === 0) { + return b; + } else { + return c * Math.pow(2, 10 * (t / d - 1)) + b; + } + }, + easeOutExpo: function(t, b, c, d) { + if (t === d) { + return b + c; + } else { + return c * (-Math.pow(2, -10 * t / d) + 1) + b; + } + }, + easeInOutExpo: function(t, b, c, d) { + if (t === 0) { + b; + } + if (t === d) { + b + c; + } + if ((t /= d / 2) < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } else { + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + } + }, + easeInCirc: function(t, b, c, d) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + easeOutCirc: function(t, b, c, d) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + easeInOutCirc: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + } else { + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + } + }, + easeInElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + easeOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + }, + easeInOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d / 2) === 2) { + b + c; + } + if (!p) { + p = d * (.3 * 1.5); + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + if (t < 1) { + return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + } else { + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; + } + }, + easeInBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + easeOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + easeInOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + if ((t /= d / 2) < 1) { + return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b; + } else { + return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; + } + }, + easeInBounce: function(t, b, c, d) { + var v; + v = penner.easeOutBounce(d - t, 0, c, d); + return c - v + b; + }, + easeOutBounce: function(t, b, c, d) { + if ((t /= d) < 1 / 2.75) { + return c * (7.5625 * t * t) + b; + } else if (t < 2 / 2.75) { + return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b; + } else if (t < 2.5 / 2.75) { + return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b; + } else { + return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b; + } + }, + easeInOutBounce: function(t, b, c, d) { + var v; + if (t < d / 2) { + v = penner.easeInBounce(t * 2, 0, c, d); + return v * .5 + b; + } else { + v = penner.easeOutBounce(t * 2 - d, 0, c, d); + return v * .5 + c * .5 + b; + } + } + }; + + umd(penner); + +}).call(this); + +},{}]},{},[13]); + /*jslint plusplus: true, vars: true, indent: 2 */ /* convertPointFromPageToNode.js from diff --git a/dist/iwmlib.3rdparty.min.js b/dist/iwmlib.3rdparty.min.js index a6928c2..65a689e 100644 --- a/dist/iwmlib.3rdparty.min.js +++ b/dist/iwmlib.3rdparty.min.js @@ -1 +1 @@ -var e;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.OptimalSelect=t():e.OptimalSelect=t()}(this,function(){return function(r){var i={};function n(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}return n.m=r,n.c=i,n.i=function(e){return e},n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.convertNodeList=function(e){for(var t=e.length,r=new Array(t),i=0;i@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return h("",e,"",t);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),f=(i=n)&&i.__esModule?i:{default:i},l=r(0);function h(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(m(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,m(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,c=s.length;u/.test(i)){var f=i.replace(/>/,"");a=""+r+f+n;m(document.querySelectorAll(a),o)&&(i=f)}if(/:nth-child/.test(i)){var l=i.replace(/nth-child/g,"nth-of-type");a=""+r+l+n;m(document.querySelectorAll(a),o)&&(i=l)}if(/\.\S+\.\S+/.test(i)){for(var h=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var d=i.replace(h.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;m(document.querySelectorAll(a),o)&&(i=d)}if((h=i&&i.match(/\./g))&&2/.test(s):c=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===l||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;rt[r]}):i.sort()),i}function A(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;oh(c.y)?c.x:c.y,t.scale=a?function(e,t){return ie(t[0],t[1],J)/ie(e[0],e[1],J)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],J)+ne(e[1],e[0],J)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(Fh(f.y)?f.x:f.y,o=re(u,c),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var f=e.element;T(t.srcEvent.target,f)&&(f=t.srcEvent.target);t.target=f}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r=h(t)?e<0?X:q:t<0?G:H}function ie(e,t,r){r||(r=K);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=K);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(I(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}b(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:j,srcEvent:e}))}});var ce={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},fe={2:L,3:"pen",4:j,5:"kinect"},le="pointerdown",he="pointermove pointerup pointercancel";function de(){this.evEl=le,this.evWin=he,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(le="MSPointerDown",he="MSPointerMove MSPointerUp MSPointerCancel"),b(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=ce[i],o=fe[e.pointerType]||e.pointerType,a=o==L,s=M(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}b(ve,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=C(e.touches),i=C(e.changedTouches);t&(N|U)&&(r=P(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var me={touchstart:B,touchmove:2,touchend:N,touchcancel:U},be="touchstart touchmove touchend touchcancel";function ge(){this.evTarget=be,this.targetIds={},Z.apply(this,arguments)}b(ge,Z,{handler:function(e){var t=me[e.type],r=function(e,t){var r=C(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=C(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return je.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),b(Be,je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),b(Ne,Re,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),b(Ue,je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),b(ze,je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:V|W,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(V|W)?t=e.overallVelocity:r&V?t=e.overallVelocityX:r&W&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),b(Xe,Re,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance]+>|\t|)+|(?:\n)))/gm,y="
",_={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function w(e){return e.replace(/&/g,"&").replace(//g,">")}function h(e){return e.nodeName.toLowerCase()}function x(e,t){var r=e&&e.exec(t);return r&&0===r.index}function f(e){return t.test(e)}function d(e){var t,r={},i=Array.prototype.slice.call(arguments,1);for(t in e)r[t]=e[t];return i.forEach(function(e){for(t in e)r[t]=e[t]}),r}function p(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),h(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n}function o(e){if(r&&!e.langApiRestored){for(var t in e.langApiRestored=!0,r)e[t]&&(e[r[t]]=e[t]);(e.contains||[]).concat(e.variants||[]).forEach(o)}}function T(a){function c(e){return e&&e.source||e}function s(e,t){return new RegExp(c(e),"m"+(a.case_insensitive?"i":"")+(t?"g":""))}!function t(r,e){if(!r.compiled){if(r.compiled=!0,r.keywords=r.keywords||r.beginKeywords,r.keywords){var i={},n=function(r,e){a.case_insensitive&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var t=e.split("|");i[t[0]]=[r,t[1]?Number(t[1]):1]})};"string"==typeof r.keywords?n("keyword",r.keywords):u(r.keywords).forEach(function(e){n(e,r.keywords[e])}),r.keywords=i}r.lexemesRe=s(r.lexemes||/\w+/,!0),e&&(r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")\\b"),r.begin||(r.begin=/\B|\b/),r.beginRe=s(r.begin),r.endSameAsBegin&&(r.end=r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(r.endRe=s(r.end)),r.terminator_end=c(r.end)||"",r.endsWithParent&&e.terminator_end&&(r.terminator_end+=(r.end?"|":"")+e.terminator_end)),r.illegal&&(r.illegalRe=s(r.illegal)),null==r.relevance&&(r.relevance=1),r.contains||(r.contains=[]),r.contains=Array.prototype.concat.apply([],r.contains.map(function(e){return function(t){return t.variants&&!t.cached_variants&&(t.cached_variants=t.variants.map(function(e){return d(t,{variants:null},e)})),t.cached_variants||t.endsWithParent&&[d(t)]||[t]}("self"===e?r:e)})),r.contains.forEach(function(e){t(e,r)}),r.starts&&t(r.starts,e);var o=r.contains.map(function(e){return e.beginKeywords?"\\.?(?:"+e.begin+")\\.?":e.begin}).concat([r.terminator_end,r.illegal]).map(c).filter(Boolean);r.terminators=o.length?s(function(e,t){for(var r=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,i=0,n="",o=0;o')+t+(r?"":y)}function a(){h+=null!=f.subLanguage?function(){var e="string"==typeof f.subLanguage;if(e&&!g[f.subLanguage])return w(d);var t=e?S(f.subLanguage,d,!0,l[f.subLanguage]):E(d,f.subLanguage.length?f.subLanguage:void 0);return 0")+'"');return d+=t,t.length||1}var c=M(e);if(!c)throw new Error('Unknown language: "'+e+'"');T(c);var n,f=r||c,l={},h="";for(n=f;n!==c;n=n.parent)n.className&&(h=s(n.className,"",!0)+h);var d="",p=0;try{for(var v,m,b=0;f.terminators.lastIndex=b,v=f.terminators.exec(t);)m=i(t.substring(b,v.index),v[0]),b=v.index+m;for(i(t.substr(b)),n=f;n.parent;n=n.parent)n.className&&(h+=y);return{relevance:p,value:h,language:e,top:f}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{relevance:0,value:w(t)};throw e}}function E(r,e){e=e||_.languages||u(g);var i={relevance:0,value:w(r)},n=i;return e.filter(M).filter(b).forEach(function(e){var t=S(e,r,!1);t.language=e,t.relevance>n.relevance&&(n=t),t.relevance>i.relevance&&(n=i,i=t)}),n.language&&(i.second_best=n),i}function v(e){return _.tabReplace||_.useBR?e.replace(i,function(e,t){return _.useBR&&"\n"===e?"
":_.tabReplace?t.replace(/\t/g,_.tabReplace):""}):e}function a(e){var t,r,i,n,o,a=function(e){var t,r,i,n,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",r=c.exec(o))return M(r[1])?r[1]:"no-highlight";for(t=0,i=(o=o.split(/\s+/)).length;t/g,"\n"):t=e,o=t.textContent,i=a?S(a,o,!0):E(o),(r=p(t)).length&&((n=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=i.value,i.value=function(e,t,r){var i=0,n="",o=[];function a(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function u(e){n+=""}function c(e){("start"===e.event?s:u)(e.node)}for(;e.length||t.length;){var f=a();if(n+=w(r.substring(i,f[0].offset)),i=f[0].offset,f===e){for(o.reverse().forEach(u);c(f.splice(0,1)[0]),(f=a())===e&&f.length&&f[0].offset===i;);o.reverse().forEach(s)}else"start"===f[0].event?o.push(f[0].node):o.pop(),c(f.splice(0,1)[0])}return n+w(r.substr(i))}(r,p(n),o)),i.value=v(i.value),e.innerHTML=i.value,e.className=function(e,t,r){var i=t?s[t]:r,n=[e.trim()];return e.match(/\bhljs\b/)||n.push("hljs"),-1===e.indexOf(i)&&n.push(i),n.join(" ").trim()}(e.className,a,i.language),e.result={language:i.language,re:i.relevance},i.second_best&&(e.second_best={language:i.second_best.language,re:i.second_best.relevance}))}function m(){if(!m.called){m.called=!0;var e=document.querySelectorAll("pre code");l.forEach.call(e,a)}}function M(e){return e=(e||"").toLowerCase(),g[e]||g[s[e]]}function b(e){var t=M(e);return t&&!t.disableAutodetect}return n.highlight=S,n.highlightAuto=E,n.fixMarkup=v,n.highlightBlock=a,n.configure=function(e){_=d(_,e)},n.initHighlighting=m,n.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",m,!1),addEventListener("load",m,!1)},n.registerLanguage=function(t,e){var r=g[t]=e(n);o(r),r.aliases&&r.aliases.forEach(function(e){s[e]=t})},n.listLanguages=function(){return u(g)},n.getLanguage=M,n.autoDetection=b,n.inherit=d,n.IDENT_RE="[a-zA-Z]\\w*",n.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",n.NUMBER_RE="\\b\\d+(\\.\\d+)?",n.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",n.BINARY_NUMBER_RE="\\b(0b[01]+)",n.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",n.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},n.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},n.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[n.BACKSLASH_ESCAPE]},n.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},n.COMMENT=function(e,t,r){var i=n.inherit({className:"comment",begin:e,end:t,contains:[]},r||{});return i.contains.push(n.PHRASAL_WORDS_MODE),i.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),i},n.C_LINE_COMMENT_MODE=n.COMMENT("//","$"),n.C_BLOCK_COMMENT_MODE=n.COMMENT("/\\*","\\*/"),n.HASH_COMMENT_MODE=n.COMMENT("#","$"),n.NUMBER_MODE={className:"number",begin:n.NUMBER_RE,relevance:0},n.C_NUMBER_MODE={className:"number",begin:n.C_NUMBER_RE,relevance:0},n.BINARY_NUMBER_MODE={className:"number",begin:n.BINARY_NUMBER_RE,relevance:0},n.CSS_NUMBER_MODE={className:"number",begin:n.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},n.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[n.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[n.BACKSLASH_ESCAPE]}]},n.TITLE_MODE={className:"title",begin:n.IDENT_RE,relevance:0},n.UNDERSCORE_TITLE_MODE={className:"title",begin:n.UNDERSCORE_IDENT_RE,relevance:0},n.METHOD_GUARD={begin:"\\.\\s*"+n.UNDERSCORE_IDENT_RE,relevance:0},n}),function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).PIXI=e()}}(function(){return function o(a,s,u){function c(r,e){if(!s[r]){if(!a[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(f)return f(r,!0);var i=new Error("Cannot find module '"+r+"'");throw i.code="MODULE_NOT_FOUND",i}var n=s[r]={exports:{}};a[r][0].call(n.exports,function(e){var t=a[r][1][e];return c(t||e)},n,n.exports,o,a,s,u)}return s[r].exports}for(var f="function"==typeof require&&require,e=0;e>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1},r.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return 1+t|(~t&-~t)-1>>>i(e)+1}},{}],2:[function(e,t,r){"use strict";function i(e,t,r){r=r||2;var i,n,o,a,s,u,c,f=t&&t.length,l=f?t[0]*r:e.length,h=v(e,0,l,r,!0),d=[];if(!h||h.next===h.prev)return d;if(f&&(h=function(e,t,r,i){var n,o,a,s,u,c=[];for(n=0,o=t.length;n80*r){i=o=e[0],n=a=e[1];for(var p=r;po.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,f=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,l=_(s,u,t,r,i),h=_(c,f,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=l&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=l;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function h(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!s(n,o)&&p(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),M(i),M(i.next),i=e=o),i=i.next}while(i!==e);return i}function d(e,t,r,i,n,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&p(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var f=E(u,c);return u=m(u,u.next),f=m(f,f.next),b(u,t,r,i,n,o),void b(f,t,r,i,n,o)}c=c.next}u=u.next}while(u!==e)}function g(e,t){return e.x-t.x}function y(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=f&&n!==i.x&&x(or.x)&&S(i,e)&&(r=i,h=u),i=i.next;return r}(e,t)){var r=E(t,e);m(r,r.next)}}function _(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,r=e;t.x=e.byteLength?i.bufferSubData(this.type,t,e):i.bufferData(this.type,e,this.drawType),this.data=e},o.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},o.createVertexBuffer=function(e,t,r){return new o(e,e.ARRAY_BUFFER,t,r)},o.createIndexBuffer=function(e,t,r){return new o(e,e.ELEMENT_ARRAY_BUFFER,t,r)},o.create=function(e,t,r,i){return new o(e,t,r,i)},o.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=o},{}],10:[function(e,t,r){var a=e("./GLTexture"),s=function(e,t,r){this.gl=e,this.framebuffer=e.createFramebuffer(),this.stencil=null,this.texture=null,this.width=t||100,this.height=r||100};s.prototype.enableTexture=function(e){var t=this.gl;this.texture=e||new a(t),this.texture.bind(),this.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var e=this.gl;this.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencil),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(e,t,r,i){this.bind();var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},s.prototype.resize=function(e,t){var r=this.gl;this.width=e,this.height=t,this.texture&&this.texture.uploadData(null,e,t),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,t))},s.prototype.destroy=function(){var e=this.gl;this.texture&&this.texture.destroy(),e.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(e,t,r,i){var n=a.fromData(e,null,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(e,t,r,i){var n=new a.fromData(e,i,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},t.exports=s},{"./GLTexture":12}],11:[function(e,t,r){var o=e("./shader/compileProgram"),a=e("./shader/extractAttributes"),s=e("./shader/extractUniforms"),u=e("./shader/setPrecision"),c=e("./shader/generateUniformAccessObject"),i=function(e,t,r,i,n){this.gl=e,i&&(t=u(t,i),r=u(r,i)),this.program=o(e,t,r,n),this.attributes=a(e,this.program),this.uniformData=s(e,this.program),this.uniforms=c(e,this.uniformData)};i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},t.exports=i},{"./shader/compileProgram":17,"./shader/extractAttributes":19,"./shader/extractUniforms":20,"./shader/generateUniformAccessObject":21,"./shader/setPrecision":25}],12:[function(e,t,r){var o=function(e,t,r,i,n){this.gl=e,this.texture=e.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=t||-1,this.height=r||-1,this.format=i||e.RGBA,this.type=n||e.UNSIGNED_BYTE},n=!(o.prototype.upload=function(e){this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=e.videoWidth||e.width,i=e.videoHeight||e.height;i!==this.height||r!==this.width?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,this.type,e):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.format,this.type,e),this.width=r,this.height=i});o.prototype.uploadData=function(e,t,r){this.bind();var i=this.gl;if(e instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,t,r,0,this.format,this.type,e||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,t,r,this.format,this.type,e||null),this.width=t,this.height=r},o.prototype.bind=function(e){var t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var e=this.gl;e.bindTexture(e.TEXTURE_2D,null)},o.prototype.minFilter=function(e){var t=this.gl;this.bind(),this.mipmap?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.magFilter=function(e){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.enableMipmap=function(){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.MIRRORED_REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(e,t,r){var i=new o(e);return i.premultiplyAlpha=r||!1,i.upload(t),i},o.fromData=function(e,t,r,i){var n=new o(e);return n.uploadData(t,r,i),n},t.exports=o},{}],13:[function(e,t,r){var n=e("./setVertexAttribArrays");function i(e,t){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=t,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=e,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(t.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var e=this.gl,t=null,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=g-y,S=Math.floor,E=String.fromCharCode;function M(e){throw new RangeError(l[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function A(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((b-p)/a))&&M("overflow"),p+=u*a,!(u<(c=s<=m?y:m+_<=s?_:s-m));s+=g)a>S(b/(f=g-c))&&M("overflow"),a*=f;m=k(p-o,t=h.length+1,0==o),S(p/t)>b-v&&M("overflow"),v+=S(p/t),p%=t,h.splice(p++,0,v)}return P(h)}function m(e){var t,r,i,n,o,a,s,u,c,f,l,h,d,p,v,m=[];for(h=(e=C(e)).length,t=x,o=w,a=r=0;aS((b-r)/(d=i+1))&&M("overflow"),r+=(s-t)*d,t=s,a=0;ab&&M("overflow"),l==t){for(u=r,c=g;!(u<(f=c<=o?y:o+_<=c?_:c-o));c+=g)v=u-f,p=g-f,m.push(E(A(f+v%p,0))),u=S(v/p);m.push(E(A(u,0))),o=k(r,d,i==n),r=0,++i}++r,++t}return m.join("")}if(n={version:"1.4.1",ucs2:{decode:C,encode:P},decode:v,encode:m,toASCII:function(e){return p(e,function(e){return c.test(e)?"xn--"+m(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e})}},t&&r)if(R.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,c=e.length;0>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(n),B=["%","/","?",";","#"].concat(F),N=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,X={javascript:!0,"javascript:":!0},q={javascript:!0,"javascript:":!0},G={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&D.isObject(e)&&e instanceof C)return e;var i=new C;return i.parse(e,t,r),i}C.prototype.parse=function(e,t,r){if(!D.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&ithis.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],47:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("../math");var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((e=e||new i.Rectangle(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=oi?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},e.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxXt.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxXthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);(0,a.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(e){var t=arguments.length;if(1T.CURVES.maxSegments&&(t=T.CURVES.maxSegments),t},T.prototype.lineStyle=function(){var e=0>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,n=0;n>16&255)/255*t*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255,o._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255}},t.prototype.renderPolygon=function(e,t,r){r.moveTo(e[0],e[1]);for(var i=1;i=this.x&&e=this.y&&t=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},o}();r.default=i},{"../../const":46}],76:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var e=this.renderer.textureManager,t=e._managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")}}]),n}();r.default=f},{"../../../const":46,"../../../settings":101,"../../../utils":125,"./extractUniformsFromSrc":87}],87:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){var i=o(e),n=o(t);return Object.assign(i,n)};var i,n=e("pixi-gl-core");var l=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(e){for(var t=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=e.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&f.x=n&&f.y>16)+(65280&e)+((255&e)<<16)}},{key:"texture",get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}]),i}(i.default);r.default=l},{"../const":46,"../display/Container":48,"../math":70,"../textures/Texture":115,"../utils":125}],103:[function(e,t,r){"use strict";r.__esModule=!0;var i=n(e("../../renderers/canvas/CanvasRenderer")),f=e("../../const"),l=e("../../math"),h=n(e("./CanvasTinter"));function n(e){return e&&e.__esModule?e:{default:e}}var d=new l.Matrix,o=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(e){var t=e._texture,r=this.renderer,i=t._frame.width,n=t._frame.height,o=e.transform.worldTransform,a=0,s=0;if(!(t.orig.width<=0||t.orig.height<=0)&&t.baseTexture.source&&(r.setBlendMode(e.blendMode),t.valid)){r.context.globalAlpha=e.worldAlpha;var u=t.baseTexture.scaleMode===f.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),s=t.trim?(a=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(a=(.5-e.anchor.x)*t.orig.width,(.5-e.anchor.y)*t.orig.height),t.rotate&&(o.copy(d),o=d,l.GroupD8.matrixAppendRotationInv(o,t.rotate,a,s),s=a=0),a-=i/2,s-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),a|=0,s|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var c=t.baseTexture.resolution;16777215!==e.tint?(e.cachedTint===e.tint&&e.tintedTexture.tintId===e._texture._updateID||(e.cachedTint=e.tint,e.tintedTexture=h.default.getTintedTexture(e,e.tint)),r.context.drawImage(e.tintedTexture,0,0,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(t.baseTexture.source,t._frame.x*c,t._frame.y*c,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":46,"../../math":70,"../../renderers/canvas/CanvasRenderer":77,"./CanvasTinter":104}],104:[function(e,t,r){"use strict";r.__esModule=!0;var i,d=e("../../utils"),n=e("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var s={getTintedTexture:function(e,t){var r=e._texture,i="#"+("00000"+(0|(t=s.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=s.canvas||document.createElement("canvas");if(s.tintMethod(r,t,o),o.tintId=r._updateID,s.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,s.canvas=null;return o},tintWithMultiply:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var a=(0,d.hex2rgb)(t),s=a[0],u=a[1],c=a[2],f=i.getImageData(0,0,n.width,n.height),l=f.data,h=0;h=this.size&&this.flush(),e._texture._uvs&&(this.sprites[this.currentIndex++]=e)},o.prototype.flush=function(){if(0!==this.currentIndex){var e=this.renderer.gl,t=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,a=this.groups,s=n.float32View,u=n.uint32View,c=this.boundTextures,f=this.renderer.boundTextures,l=this.renderer.textureGC.count,h=0,d=void 0,p=void 0,v=1,m=0,b=a[0],g=void 0,y=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];b.textureCount=0,b.start=0,b.blend=_,z++;var w=void 0;for(w=0;w=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var a=o;this.animations[t].push(this.textures[a])}}},l.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},l.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*l.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*l.BATCH_SIZEthis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,c="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),u}(s.default);function d(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}(r.default=h).EMPTY=new h(new o.default),d(h.EMPTY),d(h.EMPTY.baseTexture),h.WHITE=function(){var e=document.createElement("canvas");e.width=10,e.height=10;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,10,10),new h(new o.default(e))}(),d(h.WHITE),d(h.WHITE.baseTexture)},{"../math":70,"../settings":101,"../utils":125,"./BaseTexture":112,"./TextureUvs":117,"./VideoBaseTexture":118,eventemitter3:3}],116:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=function(){function i(e,t){for(var r=0;rt.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null},e.prototype.update=function(){var e=0this.lastTime){(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*n.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=e},i(e,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,n.default.TARGET_FPMS);this._maxElapsedMS=1/t}}]),e}();r.default=u},{"../const":46,"../settings":101,"./TickerListener":120}],120:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function n(e){var t=1>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},r.hex2string=function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},r.rgb2hex=function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},r.getResolutionOfUrl=function(e,t){var r=n.default.RETINA_PREFIX.exec(e);if(r)return parseFloat(r[1]);return void 0!==t?t:1},r.decomposeDataUri=function(e){var t=i.DATA_URI.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]};return},r.getUrlFileExtension=function(e){var t=i.URL_FILE_EXTENSION.exec(e);if(t)return t[1].toLowerCase();return},r.getSvgSize=function(e){var t=i.SVG_SIZE.exec(e),r={};t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(e){if(v)return;if(-1>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)},r.premultiplyRgba=function(e,t,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]);return r[3]=t,r},r.premultiplyTintToRgba=function(e,t,r,i){(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t);return r[3]=t,r};var i=e("../const"),n=d(e("../settings")),o=d(e("eventemitter3")),a=d(e("./pluginTarget")),s=h(e("./mixin")),u=h(e("ismobilejs")),c=d(e("remove-array-items")),f=d(e("./mapPremultipliedBlendModes")),l=d(e("earcut"));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e){return e&&e.__esModule?e:{default:e}}var p=0,v=!1;r.isMobile=u,r.removeItems=c.default,r.EventEmitter=o.default,r.pluginTarget=a.default,r.mixins=s,r.earcut=l.default;var m=r.TextureCache=Object.create(null),b=r.BaseTextureCache=Object.create(null);var g=r.premultiplyBlendMode=(0,f.default)()},{"../const":46,"../settings":101,"./mapPremultipliedBlendModes":126,"./mixin":128,"./pluginTarget":129,earcut:2,eventemitter3:3,ismobilejs:4,"remove-array-items":31}],126:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,e[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,e[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,t[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,t[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,t[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i};var n=e("../const")},{"../const":46}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){if(o.default.tablet||o.default.phone)return 4;return e};var i,n=e("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:4}],128:[function(e,t,r){"use strict";function i(e,t){if(e&&t)for(var r=Object.keys(t),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(0r&&this.onLoop()),this.updateTexture())},n.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},n.prototype.destroy=function(e){this.stop(),i.prototype.destroy.call(this,e)},n.fromFrames=function(e){for(var t=[],r=0;rs&&(++p,I.utils.removeItems(i,1+h-p,1+m-h),m=h,h=-1,n.push(d),f=Math.max(f,d),l++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(c),f=Math.max(f,c),++l,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(c=d),n.push(c),f=Math.max(f,c));for(var w=[],x=0;x<=l;x++){var T=0;"right"===this._font.align?T=f-n[x]:"center"===this._font.align&&(T=(f-n[x])/2),w.push(T)}for(var S=i.length,E=this.tint,M=0;M=i&&s.x=n&&s.y 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n"));return e.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],e.alpha=1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,t),r.prototype._loadMatrix=function(e){var t=e;1>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,c=(i>>8&255)/255,f=(255&i)/255,l=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,c,f,t=t||.15,0,o-u,a-c,s-f,0,0];this._loadMatrix(l,n)},r.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},r.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i(r,[{key:"matrix",get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e}}]),r}(n.Filter);(r.default=o).prototype.grayscale=o.prototype.greyscale},{"../../core":65,path:8}],151:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;r lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n vec4 color;\n\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.Filter);r.default=n},{"../../core":65,path:8}],153:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return l(i).default}});var n=e("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return l(n).default}});var o=e("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return l(o).default}});var a=e("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return l(a).default}});var s=e("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return l(s).default}});var u=e("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return l(u).default}});var c=e("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return l(c).default}});var f=e("./alpha/AlphaFilter");function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return l(f).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(e,t,r){"use strict";r.__esModule=!0;var o=function(){function i(e,t){for(var r=0;r 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n"));return r.noise=e,r.seed=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i),o(n,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e}}]),n}(i.Filter);r.default=n},{"../../core":65,path:8}],155:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rt?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},s.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},s.prototype._renderCanvas=function(e){var t=e.context,r=this.worldTransform,i=e.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=w.default.getTintedTexture(this,this.tint));var a=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,u=this._canvasUvs,c=n?0:o.frame.x,f=n?0:o.frame.y,l=c+o.frame.width,h=f+o.frame.height;u[0]=c,u[1]=c+this._leftWidth,u[2]=l-this._rightWidth,u[3]=l,u[4]=f,u[5]=f+this._topHeight,u[6]=h-this._bottomHeight,u[7]=h;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;t.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),e.roundPixels?t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var m=2*v+8*p,b=Math.max(1,u[v+1]-u[v]),g=Math.max(1,u[p+5]-u[p+4]),y=Math.max(1,s[10+m]-s[m]),_=Math.max(1,s[11+m]-s[1+m]);t.drawImage(a,u[v],u[p+4],b,g,s[m],s[1+m],y,_)}},s.prototype._refresh=function(){a.prototype._refresh.call(this);var e=this.uvs,t=this._texture;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(s,[{key:"width",get:function(){return this._width},set:function(e){this._width=e,this._refresh()}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()}}]),s}(n.default);r.default=a},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=e("./Mesh"),a=(i=n)&&i.__esModule?i:{default:i};var o=function(n){function o(e,t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e));return i._ready=!0,i.verticesX=t||10,i.verticesY=r||10,i.drawMode=a.default.DRAW_MODES.TRIANGLES,i.refresh(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype._refresh=function(){for(var e=this._texture,t=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,s=e.width/o,u=e.height/a,c=0;c=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[h];p.uploadDynamic(t,l,d);var v=e._bufferUpdateIDs[h]||0;(f=f||p._updateID 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;l>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var f=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var l=new u(r);var h=new c(r);var ee=new f(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var g=0;var y=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,C=0.0,P=0,A=0,k=0,I=0.0;var re=0;var R=0;var O=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var q=e.Math.sqrt;var G=e.Math.pow;var H=e.Math.cos;var V=e.Math.sin;var W=e.Math.tan;var Y=e.Math.acos;var K=e.Math.asin;var J=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ge=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var fe=t.invoke_viiiii;var le=t.invoke_vi;var he=t.invoke_ii;var ye=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Ce=t._emscripten_set_main_loop_timing;var Pe=t.__ZSt18uncaught_exceptionv;var Ae=t.___setErrNo;var ke=t._sbrk;var Ie=t.___cxa_begin_catch;var Re=t._emscripten_memcpy_big;var Oe=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var qe=t._pthread_cleanup_push;var Ge=t._time;var He=t.___syscall140;var Ve=t.___syscall146;var We=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);l=new u(e);h=new c(e);ee=new f(e);r=e;return true}function Ke(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Je(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;g=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;l=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;f=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(f,1100,o)|0;yr(f,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(f,1100,a)|0;yr(f,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(f,1100,s)|0;yr(f,u)|0}r=ge(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}ki[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Oi[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(f,1100,l)|0;yr(f,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;yr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;yr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Oi[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;yr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;yr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Oi[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;yr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;yr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;O=B+208|0;R=B+192|0;I=B+184|0;k=B+168|0;A=B+160|0;P=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;y=B+88|0;g=B+72|0;b=B+64|0;m=B+48|0;l=B+40|0;d=B+24|0;h=B+16|0;f=B;C=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[f>>2]=1154;pe[f+4>>2]=644;pe[f+8>>2]=1863;_r(C,1100,f)|0;yr(C,h)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(C,1100,d)|0;yr(C,l)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(C,1100,m)|0;yr(C,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[g>>2]=1154;pe[g+4>>2]=2277;pe[g+8>>2]=1274;_r(C,1100,g)|0;yr(C,y)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;y=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=y;g=(y|0)!=0;if(g){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(C,1100,x)|0;yr(C,T)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(C,1100,S)|0;yr(C,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=y-m|0;v=1<>2]|0;if(o>>>0>=16){pe[P>>2]=1154;pe[P+4>>2]=1953;pe[P+8>>2]=1737;_r(C,1100,P)|0;yr(C,A)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){l=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(l+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[k>>2]=1154;pe[k+4>>2]=2319;pe[k+8>>2]=1303;_r(C,1100,k)|0;yr(C,I)|0}f=s<>>0>=b>>>0){pe[R>>2]=1154;pe[R+4>>2]=2325;pe[R+8>>2]=1337;_r(C,1100,R)|0;yr(C,O)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(C,1100,D)|0;yr(C,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(y>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(g){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=y+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=qr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=qr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function ft(e){e=e|0;Ie(e|0)|0;zt()}function lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;yr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;l=d+96|0;f=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;yr(a,n)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;yr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;yr(a,u)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;yr(a,f)|0;break}}}while(0);if(!(e&7)){Oi[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(a,1100,l)|0;yr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+560|0;a=f+40|0;s=f+24|0;t=f;o=f+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;yr(o,f+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;yr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=f;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=f;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0;L=be;be=be+800|0;k=L+256|0;A=L+240|0;P=L+232|0;C=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;y=L+120|0;g=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;l=L+64|0;f=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;O=L+288|0;D=L+264|0;I=vt(e,14)|0;if(!I){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Oi[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(O,1100,n)|0;yr(O,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(I|0)){if(r>>>0<=I>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,I,(r+1|0)==(I|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,I-r|0)|0}pe[p>>2]=I}Yr(pe[d>>2]|0,0,I|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(O,1100,u)|0;yr(O,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[f>>2]=1154;pe[f+4>>2]=3199;pe[f+8>>2]=1650;_r(O,1100,f)|0;yr(O,l)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=I-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(O,1100,v)|0;yr(O,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(O,1100,b)|0;yr(O,g)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[y>>2]=1154;pe[y+4>>2]=3199;pe[y+8>>2]=1650;_r(O,1100,y)|0;yr(O,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){R=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(O,1100,w)|0;yr(O,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(O,1100,T)|0;yr(O,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(O,1100,E)|0;yr(O,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[C>>2]=1154;pe[C+4>>2]=903;pe[C+8>>2]=1781;_r(O,1100,C)|0;yr(O,P)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(I>>>0>r>>>0)i=r;else break}if((R|0)==90){pe[A>>2]=1154;pe[A+4>>2]=3140;pe[A+8>>2]=1632;_r(O,1100,A)|0;yr(O,k)|0;r=0;break}if((I|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);lt(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+544|0;s=f+16|0;a=f;o=f+24|0;if(!t){c=0;be=f;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=f;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;yr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=f;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0;y=be;be=be+608|0;v=y+88|0;p=y+72|0;h=y+64|0;l=y+48|0;f=y+40|0;d=y+24|0;c=y+16|0;u=y;b=y+96|0;m=pe[t+20>>2]|0;g=e+20|0;s=pe[g>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[g>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[g>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;yr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;yr(b,f)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[l>>2]=1154;pe[l+4>>2]=3248;pe[l+8>>2]=1694;_r(b,1100,l)|0;yr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;yr(b,v)|0;g=0;be=y;return g|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[g>>2]|0)-i;g=r;be=y;return g|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+560|0;s=f+40|0;u=f+24|0;r=f;a=f+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;yr(a,f+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=f;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;yr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=f;return u|0}function gt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;l=p;f=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Ct(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(Pt(c)|0))break;if(!(At(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(kt(c)|0?It(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Oi[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(f,1100,l)|0;yr(f,h)|0;m=0;be=p;return m|0}return 0}function yt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+544|0;c=f;u=f+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=f;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;yr(u,f+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=f;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,f=0;f=pe[e+88>>2]|0;u=((ve[f+12>>0]|0)<<8|(ve[f+13>>0]|0))>>>a;c=((ve[f+14>>0]|0)<<8|(ve[f+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;f=f+18|0;a=de[f>>0]|0;a=ge(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ge(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[f>>0]|0|0){case 0:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Ot(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;yr(n,a)|0;e=0}c=ge(ge(t,i)|0,e)|0;be=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;f=p+88|0;v=p;l=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(f,1100,a)|0;yr(f,s)|0;o=0}s=ge(o,u)|0;a=gt(e,t)|0;pe[l>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)yt(a,l,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Oi[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(f,1100,d)|0;yr(f,h)|0;be=p;return}}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);f=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(f,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[f>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(l=d+24|0,pt(c,l)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[f>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,l)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,l)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;lt(d+24|0);lt(d);d=t;be=p;return d|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(g,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[g>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;f=w+36|0;l=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{M=mt(y,S)|0;g=t<<1;C=w+(g<<2)|0;pe[C>>2]=(pe[C>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[f>>2]|0)>>0]|0)<<18|(ve[1725+(pe[l>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;lt(S);C=t;be=E;return C|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;l=h+24|0;n=pe[e+88>>2]|0;f=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){l=0;be=h;return l|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[l+20>>2]=0;pe[l>>2]=0;pe[l+4>>2]=0;pe[l+8>>2]=0;pe[l+12>>2]=0;de[l+16>>0]=0;e:do{if(pt(c,l)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(f|0)){if(t>>>0<=f>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,f,(t+1|0)==(f|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,f-t<<1|0)|0}pe[r>>2]=f}if(!f){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,l)|0;r=u+r&255;i=(mt(c,l)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(f|0)){t=1;break}else t=t+2|0}}else t=0}while(0);lt(l);l=t;be=h;return l|0}function It(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(g,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[g>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;f=w+36|0;l=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{M=mt(y,S)|0;g=t<<1;C=w+(g<<2)|0;pe[C>>2]=(pe[C>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;C=ve[1729+(pe[l>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[f>>2]|0)>>0]|0)<<11|C<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|C>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;lt(S);C=t;be=E;return C|0}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,fe=0,le=0,he=0;fe=be;be=be+720|0;ce=fe+184|0;se=fe+168|0;ae=fe+160|0;oe=fe+144|0;ne=fe+136|0;ie=fe+120|0;re=fe+112|0;ee=fe+96|0;$=fe+88|0;Q=fe+72|0;Z=fe+64|0;J=fe+48|0;K=fe+40|0;ue=fe+24|0;te=fe+16|0;Y=fe;V=fe+208|0;W=fe+192|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;G=pe[q>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=fe;return 1}z=(s|0)==0;X=s+-1|0;R=(o&1|0)!=0;O=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;I=(n&1|0)!=0;k=e+188|0;E=e+252|0;M=H+1|0;C=H+2|0;P=H+3|0;A=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){g=x&1;u=(g|0)==0;b=(g<<5^32)+-16|0;g=(g<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);y=R&e;if((c|0)!=(_|0)){m=R&e^1;v=u?w:w+A|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(V,1100,Y)|0;yr(V,te)|0}pe[W+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=I&(c|0)==(B|0);if(y|d){h=0;do{f=ge(h,i)|0;e=v+f|0;u=(h|0)==0|m;l=h<<1;he=(mt(D,k)|0)+r|0;le=he-G|0;r=le>>31;r=r&he|le&~r;do{if(d){if(!u){le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;break}pe[e>>2]=pe[W+((ve[1831+(p<<2)+l>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(V,1100,oe)|0;yr(V,ae)|0}pe[v+(f+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r}else{if(!u){le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;break}pe[e>>2]=pe[W+((ve[1831+(p<<2)+l>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(V,1100,ie)|0;yr(V,ne)|0}pe[v+(f+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;pe[v+(f+8)>>2]=pe[W+((ve[(l|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(V,1100,se)|0;yr(V,ce)|0}pe[v+(f+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[W+((ve[1831+(p<<2)>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(V,1100,ue)|0;yr(V,K)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[W+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[J>>2]=1154;pe[J+4>>2]=903;pe[J+8>>2]=1781;_r(V,1100,J)|0;yr(V,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[W+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(V,1100,Q)|0;yr(V,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(C<<2)>>2]=pe[W+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(V,1100,ee)|0;yr(V,re)|0}pe[v+(P<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+g|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+O|0}}S=S+1|0}while((S|0)!=(T|0));be=fe;return 1}function Ot(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,fe=0,le=0,he=0;le=be;be=be+640|0;ue=le+88|0;se=le+72|0;ae=le+64|0;oe=le+48|0;ne=le+40|0;fe=le+24|0;ce=le+16|0;ie=le;te=le+128|0;re=le+112|0;ee=le+96|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;Z=pe[q>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=le;return 1}X=(s|0)==0;G=s+-1|0;H=i<<1;V=e+92|0;W=e+116|0;Y=a+-1|0;K=e+212|0;J=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;I=e+288|0;R=e+284|0;O=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;A=e+268|0;k=Y<<5;C=r&255;r=0;n=0;o=0;e=0;u=1;P=0;do{if(!X){E=pe[t+(P<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;f=c?0:Y;if((f|0)!=(S|0)){w=F|(M|0)!=(G|0);_=c?E:E+k|0;while(1){if((u|0)==1)u=mt(V,W)|0|512;y=u&7;u=u>>>3;l=ve[1823+y>>0]|0;c=0;do{b=(mt(V,j)|0)+n|0;g=b-$|0;n=g>>31;n=n&b|g&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;yr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[A>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(V,D)|0)+e|0;g=b-U|0;e=g>>31;e=e&b|g&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[fe>>2]=1154;pe[fe+4>>2]=903;pe[fe+8>>2]=1781;_r(te,1100,fe)|0;yr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);g=B|(f|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){l=(mt(V,K)|0)+r|0;c=l-z|0;r=c>>31;r=r&l|c&~r;c=(mt(V,J)|0)+o|0;l=c-Z|0;o=l>>31;o=o&c|l&~o;if((g|(h|0)==0)&v){c=ve[h+p+(1831+(y<<2))>>0]|0;l=r*3|0;if((pe[I>>2]|0)>>>0<=l>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;yr(te,ae)|0}he=pe[R>>2]|0;pe[d>>2]=(me[he+(l<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(l+2<<1)>>1]|0)<<16|(me[he+(l+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[q>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;yr(te,ue)|0}pe[d+12>>2]=pe[(pe[O>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}f=f+T|0;if((f|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}P=P+1|0}while((P|0)!=(C|0));be=le;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;W=Z+48|0;V=Z+40|0;J=Z+24|0;K=Z+16|0;H=Z;G=Z+88|0;q=Z+72|0;O=e+272|0;D=pe[O>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;R=(o&1|0)==0;A=e+288|0;k=e+284|0;I=e+164|0;C=e+268|0;P=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;y=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){g=R|(T|0)!=(F|0);b=n?x:x+P|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,I)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[O>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(G,1100,H)|0;yr(G,K)|0}pe[q+(n<<2)>>2]=me[(pe[C>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=b;while(1){h=g|(d|0)==0;l=d<<1;n=(mt(N,X)|0)+r|0;f=n-L|0;c=f>>31;c=c&n|f&~c;if(h){r=ve[1831+(m<<2)+l>>0]|0;n=c*3|0;if((pe[A>>2]|0)>>>0<=n>>>0){pe[J>>2]=1154;pe[J+4>>2]=903;pe[J+8>>2]=1781;_r(G,1100,J)|0;yr(G,V)|0}f=pe[k>>2]|0;pe[p>>2]=(me[f+(n<<1)>>1]|0)<<16|pe[q+(r<<2)>>2];pe[p+4>>2]=(me[f+(n+2<<1)>>1]|0)<<16|(me[f+(n+1<<1)>>1]|0)}f=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(l|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[A>>2]|0)>>>0<=c>>>0){pe[W>>2]=1154;pe[W+4>>2]=903;pe[W+8>>2]=1781;_r(G,1100,W)|0;yr(G,Y)|0}h=pe[k>>2]|0;pe[f>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[q+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+y|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;K=ae+112|0;J=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;q=s+-1|0;G=i<<1;H=e+92|0;V=e+116|0;W=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;R=e+268|0;O=W<<5;k=r&255;r=0;n=0;o=0;e=0;u=1;I=0;do{if(!X){P=pe[t+(I<<2)>>2]|0;A=0;while(1){M=A&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;C=c?a:-1;f=c?0:W;if((f|0)!=(C|0)){S=F|(A|0)!=(q|0);T=c?P:P+O|0;while(1){if((u|0)==1)u=mt(H,V)|0|512;x=u&7;u=u>>>3;l=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;yr(Z,ne)|0}pe[K+(c<<2)>>2]=me[(pe[R>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;yr(Z,$)|0}pe[J+(c<<2)>>2]=me[(pe[R>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(f|0)!=(W|0);y=0;_=T;while(1){g=S|(y|0)==0;b=y<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&g){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;yr(Z,te)|0;c=pe[D>>2]|0}l=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=l;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;yr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[l+(p<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+4>>2]=(me[l+(p+2<<1)>>1]|0)<<16|(me[l+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}y=y+1|0;if((y|0)==2)break;else _=_+i|0}f=f+M|0;if((f|0)==(C|0))break;else T=T+E|0}}A=A+1|0;if((A|0)==(s|0))break;else P=P+G|0}}I=I+1|0}while((I|0)!=(k|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0;h=be;be=be+608|0;l=h+88|0;f=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;yr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;yr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;yr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){l=e+248|0;de[l>>0]=0;l=e+212|0;lt(l);l=e+188|0;lt(l);l=e+164|0;lt(l);l=e+140|0;lt(l);l=e+116|0;lt(l);be=h;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(c,1100,f)|0;yr(c,l)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;l=e+248|0;de[l>>0]=0;l=e+212|0;lt(l);l=e+188|0;lt(l);l=e+164|0;lt(l);l=e+140|0;lt(l);l=e+116|0;lt(l);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Ii[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function qt(e){e=e|0;return}function Gt(e){e=e|0;return}function Ht(e){e=e|0;return}function Vt(e){e=e|0;Nt(e);return}function Wt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Kt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Kt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0;d=be;be=be+64|0;h=d;l=pe[e>>2]|0;f=e+(pe[l+-8>>2]|0)|0;l=pe[l+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(l|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ri[pe[(pe[r>>2]|0)+20>>2]&3](r,h,f,f,1,0);i=(pe[t>>2]|0)==1?f:0}else{Ci[pe[(pe[l>>2]|0)+24>>2]&3](l,h,f,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Ci[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ai[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function fr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function lr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=fr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Kr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=fr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Or(e)|0;break}r=(Sr(e)|0)==0;t=Or(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Or(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function gr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function yr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;l=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[l>>2]=pe[r>>2];if((Dr(0,t,l,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;f=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,l,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,l,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|f;if(c)Er(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+128|0;n=f+112|0;c=f;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=fr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=f;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Cr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=lr(Me(6,r|0)|0)|0;be=t;return e|0}function Pr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((lr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;p=be;be=be+48|0;l=p+16|0;f=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=lr(Ve(146,l|0)|0)|0}else{qe(7,e|0);pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=lr(Ve(146,f|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){l=pe[c>>2]|0;pe[e+16>>2]=l+(pe[e+48>>2]|0);e=l;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Ar(e,t,r)|0;be=n;return i|0}function Ir(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Rr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ge(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Or(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,f=0,l=0,h=0,d=0,p=0.0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0;Q=be;be=be+624|0;W=Q+24|0;K=Q+16|0;Y=Q+588|0;X=Q+576|0;V=Q;N=Q+536|0;Z=Q+8|0;J=Q+528|0;k=(e|0)!=0;I=N+40|0;B=I;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;q=Y;G=z;H=G-q|0;R=-2-q|0;O=G+2|0;D=W+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=fr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){A=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;A=9;break t}case 0:{a=s;break t}default:{}}P=s+1|0;a=de[P>>0]|0;s=P}t:do{if((A|0)==9)while(1){A=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)A=9;else break}}while(0);b=s-v|0;if(k?(pe[e>>2]&32|0)==0:0)gr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}f=a+1|0;s=de[f>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){P=(de[a+2>>0]|0)==36;f=P?a+3|0:f;s=de[f>>0]|0;d=P?u:-1;t=P?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;f=f+1|0;s=de[f>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){l=u;a=f;break}}}else{l=0;a=f}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!k){m=l;a=u;t=0;P=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=l|8192;P=0-s|0}else{m=l;P=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=l;P=s}}else{m=l;P=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){f=(s<<24>>24)+-48|0;if(f>>>0<10){a=u;s=0}else{a=u;f=0;break}while(1){s=(s*10|0)+f|0;a=a+1|0;f=(de[a>>0]|0)+-48|0;if(f>>>0>=10){f=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;f=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(k){a=(pe[r>>2]|0)+(4-1)&~(4-1);f=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;f=0}}else f=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;l=s&255;if((l+-1|0)>>>0<8){a=u;h=l}else{C=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else A=52;else{if(u){pe[n+(d<<2)>>2]=l;E=i+(d<<3)|0;M=pe[E+4>>2]|0;A=V;pe[A>>2]=pe[E>>2];pe[A+4>>2]=M;A=52;break}if(!k){o=0;break e}Fr(V,l,r)}}while(0);if((A|0)==52?(A=0,!k):0){v=C;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;M=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[V>>2]>>2]=o;v=C;a=b;continue e}case 1:{pe[pe[V>>2]>>2]=o;v=C;a=b;continue e}case 2:{v=pe[V>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=C;a=b;continue e}case 3:{$[pe[V>>2]>>1]=o;v=C;a=b;continue e}case 4:{de[pe[V>>2]>>0]=o;v=C;a=b;continue e}case 6:{pe[pe[V>>2]>>2]=o;v=C;a=b;continue e}case 7:{v=pe[V>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=C;a=b;continue e}default:{v=C;a=b;continue e}}case 112:{h=M|8;f=f>>>0>8?f:8;d=120;A=64;break}case 88:case 120:{h=M;A=64;break}case 111:{u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=I;else{a=I;do{a=a+-1|0;de[a>>0]=s&7|48;s=Kr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;l=5839;A=77}else{h=B-a+1|0;s=M;f=(f|0)<(h|0)?h:f;h=0;l=5839;A=77}break}case 105:case 100:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Wr(0,0,a|0,s|0)|0;s=re;u=V;pe[u>>2]=a;pe[u+4>>2]=s;u=1;l=5839;A=76;break t}if(!(M&2048)){l=M&1;u=l;l=(l|0)==0?5839:5841;A=76}else{u=1;l=5840;A=76}break}case 117:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;l=5839;A=76;break}case 99:{de[N>>0]=pe[V>>2];v=N;s=1;h=0;d=5839;a=I;break}case 109:{a=fr()|0;a=cr(pe[a>>2]|0)|0;A=82;break}case 115:{a=pe[V>>2]|0;a=(a|0)!=0?a:5849;A=82;break}case 67:{pe[Z>>2]=pe[V>>2];pe[U>>2]=0;pe[V>>2]=Z;f=-1;A=86;break}case 83:{if(!f){Nr(e,32,P,0,M);a=0;A=98}else A=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[V>>3];pe[K>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,K)*2.0;s=p!=0.0;if(s)pe[K>>2]=(pe[K>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?E:E+9|0;m=S|2;a=12-f|0;do{if(!(f>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[K>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;l=(f|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-q|0)==1){if(u&(l&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}f=(f|0)!=0&(R+a|0)<(f|0)?O+f-h|0:H-h+a|0;u=f+m|0;Nr(e,32,P,u,M);if(!(pe[e>>2]&32))gr(b,m,e)|0;Nr(e,48,P,u,M^65536);a=a-q|0;if(!(pe[e>>2]&32))gr(Y,a,e)|0;s=G-h|0;Nr(e,48,f-(a+s)|0,0,0);if(!(pe[e>>2]&32))gr(h,s,e)|0;Nr(e,32,P,u,M^8192);a=(u|0)<(P|0)?P:u;break}a=(f|0)<0?6:f;if(s){s=(pe[K>>2]|0)+-28|0;pe[K>>2]=s;c=p*268435456.0}else{c=p;s=pe[K>>2]|0}T=(s|0)<0?W:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[K>>2]|0;if((s|0)>0){l=T;while(1){h=(s|0)>29?29:s;f=u+-4|0;do{if(f>>>0>>0)f=l;else{s=0;do{_=Jr(pe[f>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;y=ai(_|0,s|0,1e9,0)|0;pe[f>>2]=y;s=oi(_|0,s|0,1e9,0)|0;f=f+-4|0}while(f>>>0>=l>>>0);if(!s){f=l;break}f=l+-4|0;pe[f>>2]=s}}while(0);while(1){if(u>>>0<=f>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[K>>2]|0)-h|0;pe[K>>2]=s;if((s|0)>0)l=f;else break}}else f=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;g=(w|0)==102;v=f;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;f=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+f;f=ge(_&s,l)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!f){f=s;break}pe[u>>2]=f;f=s;u=u+4|0}else f=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=g?T:f;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[K>>2]|0)+m|0;pe[K>>2]=s;if((s|0)>=0){v=f;break}else v=f}}else v=f;do{if(v>>>0>>0){s=(x-v>>2)*9|0;l=pe[v>>2]|0;if(l>>>0<10)break;else f=10;do{f=f*10|0;s=s+1|0}while(l>>>0>=f>>>0)}else s=0}while(0);y=(w|0)==103;_=(a|0)!=0;f=a-((w|0)!=102?s:0)+((_&y)<<31>>31)|0;if((f|0)<(((u-x>>2)*9|0)+-9|0)){h=f+9216|0;g=(h|0)/9|0;f=T+(g+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){l=10;do{l=l*10|0;h=h+1|0}while((h|0)!=9)}else l=10;m=pe[f>>2]|0;b=(m>>>0)%(l>>>0)|0;if((b|0)==0?(T+(g+-1022<<2)|0)==(u|0):0)l=v;else A=163;do{if((A|0)==163){A=0;p=(((m>>>0)/(l>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(l|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(g+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[f>>2]=h;if(!(p+c!=p)){l=v;break}w=h+l|0;pe[f>>2]=w;if(w>>>0>999999999){s=v;while(1){l=f+-4|0;pe[f>>2]=0;if(l>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[l>>2]|0)+1|0;pe[l>>2]=w;if(w>>>0>999999999)f=l;else{v=s;f=l;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){l=v;break}else l=10;do{l=l*10|0;s=s+1|0}while(h>>>0>=l>>>0);l=v}}while(0);w=f+4|0;v=l;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){g=0;w=u;break}f=u+-4|0;if(!(pe[f>>2]|0))u=f;else{g=1;w=u;break}}do{if(y){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(g){u=pe[w+-4>>2]|0;if(!u){f=9;break}if(!((u>>>0)%10|0)){l=10;f=0}else{f=0;break}do{l=l*10|0;f=f+1|0}while(((u>>>0)%(l>>>0)|0|0)==0)}else f=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-f|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-f|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);m=a|u;l=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{f=(s|0)<0?b:s;f=Br(f,((f|0)<0)<<31>>31,z)|0;if((G-f|0)<2)do{f=f+-1|0;de[f>>0]=48}while((G-f|0)<2);de[f+-1>>0]=(s>>31&2)+43;x=f+-2|0;de[x>>0]=d;s=G-x|0;d=x}b=S+1+a+l+s|0;Nr(e,32,P,b,M);if(!(pe[e>>2]&32))gr(E,S,e)|0;Nr(e,48,P,b,M^65536);do{if(h){f=v>>>0>T>>>0?T:v;s=f;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(f|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))gr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;gr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))gr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=g?w:v+4|0;if((a|0)>-1){l=(u|0)==0;f=v;do{s=Br(pe[f>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((f|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))gr(s,1,e)|0;if(l&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}gr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))gr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;f=f+4|0}while(f>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;gr(d,G-d|0,e)|0}}while(0);Nr(e,32,P,b,M^8192);a=(b|0)<(P|0)?P:b}else{h=(d&32|0)!=0;l=c!=c|0.0!=0.0;s=l?0:S;f=s+3|0;Nr(e,32,P,f,u);a=pe[e>>2]|0;if(!(a&32)){gr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))gr(l?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,P,f,M^8192);a=(f|0)<(P|0)?P:f}}while(0);v=C;continue e}default:{u=M;s=f;h=0;d=5839;a=I}}}while(0);t:do{if((A|0)==64){u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;l=d&32;if(!((s|0)==0&(u|0)==0)){a=I;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|l;s=Kr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));A=V;if((h&8|0)==0|(pe[A>>2]|0)==0&(pe[A+4>>2]|0)==0){s=h;h=0;l=5839;A=77}else{s=h;h=2;l=5839+(d>>4)|0;A=77}}else{a=I;s=h;h=0;l=5839;A=77}}else if((A|0)==76){a=Br(a,s,I)|0;s=M;h=u;A=77}else if((A|0)==82){A=0;M=Rr(a,0,f)|0;E=(M|0)==0;v=a;s=E?f:M-a|0;h=0;d=5839;a=E?a+f|0:M}else if((A|0)==86){A=0;s=0;a=0;l=pe[V>>2]|0;while(1){u=pe[l>>2]|0;if(!u)break;a=vr(J,u)|0;if((a|0)<0|a>>>0>(f-s|0)>>>0)break;s=a+s|0;if(f>>>0>s>>>0)l=l+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,P,s,M);if(!s){a=0;A=98}else{u=0;f=pe[V>>2]|0;while(1){a=pe[f>>2]|0;if(!a){a=s;A=98;break t}a=vr(J,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;A=98;break t}if(!(pe[e>>2]&32))gr(J,a,e)|0;if(u>>>0>=s>>>0){a=s;A=98;break}else f=f+4|0}}}}while(0);if((A|0)==98){A=0;Nr(e,32,P,a,M^8192);v=C;a=(P|0)>(a|0)?P:a;continue}if((A|0)==77){A=0;u=(f|0)>-1?s&-65537:s;s=V;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((f|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(f|0)>(s|0)?f:s;d=l;a=I}else{v=I;s=0;d=l;a=I}}l=a-v|0;s=(s|0)<(l|0)?l:s;f=h+s|0;a=(P|0)<(f|0)?f:P;Nr(e,32,a,f,u);if(!(pe[e>>2]&32))gr(d,h,e)|0;Nr(e,48,a,f,u^65536);Nr(e,48,s,l,0);if(!(pe[e>>2]&32))gr(v,l,e)|0;Nr(e,32,a,f,u^8192);v=C}e:do{if((A|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){gr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;gr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{f=e;l=t}}else{pe[151]=e|r;f=644+(t+2<<2)|0;l=i}pe[f>>2]=n;pe[l+12>>2]=n;pe[n+8>>2]=l;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;l=e&-8;f=pe[152]|0;if(f){r=0-l|0;e=e>>>8;if(e)if(l>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=l>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=l<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-l|0;if(r>>>0>>0)if((o|0)==(l|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;f=e>>>5&8;e=e>>>f;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((f|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-l|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-l|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+l|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=l|3;pe[u+(l|4)>>2]=s|1;pe[u+(s+l)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;g=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;g=i}pe[b>>2]=a;pe[g+12>>2]=a;pe[u+(l+8)>>2]=g;pe[u+(l+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(l+28)>>2]=i;pe[u+(l+20)>>2]=0;pe[u+(l+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(l+24)>>2]=t;pe[u+(l+12)>>2]=a;pe[u+(l+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(l+24)>>2]=t;pe[u+(l+12)>>2]=a;pe[u+(l+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(l+8)>>2]=e;pe[u+(l+12)>>2]=T;pe[u+(l+24)>>2]=0;break}else Xe()}else{F=s+l|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=l}else v=l}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Oe(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(Ge(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;f=a&s;if(f>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(g=pe[259]|0,T=g+f|0,T>>>0<=g>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=ke(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=ke(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=f;else r=f-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=ke(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(y=pe[271]|0,y=c-r+y&0-y,y>>>0<2147483647):0)if((ke(y|0)|0)==(-1|0)){ke(o|0)|0;break t}else{r=y+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?f>>>0<2147483647:0)?(w=ke(f|0)|0,x=ke(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;C=r;P=n;A=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[A+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[C>>2]=P+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;l=h+v|0;d=w+l|0;f=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+f|0;pe[153]=F;pe[156]=d;pe[w+(l+4)>>2]=F|1;pe[w+(F+l)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){k=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[k>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+f|0}else n=f;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(l+4)>>2]=n|1;pe[w+(n+l)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(l+8)>>2]=j;pe[w+(l+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(l+28)>>2]=i;pe[w+(l+20)>>2]=0;pe[w+(l+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(l+24)>>2]=t;pe[w+(l+12)>>2]=d;pe[w+(l+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(l+24)>>2]=t;pe[w+(l+12)>>2]=d;pe[w+(l+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(l+8)>>2]=e;pe[w+(l+12)>>2]=F;pe[w+(l+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+f|0;pe[154]=F;pe[157]=d;pe[w+(l+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{I=t;R=e}}else{pe[151]=r|t;I=644+(e+2<<2)|0;R=i}pe[I>>2]=a;pe[R+12>>2]=a;pe[a+8>>2]=R;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){O=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else O=t}while(0);t=O+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&O>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=O;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=fr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;f=e+u|0;l=t+d|0;if(f>>>0>>0)Xe();if((f|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){y=f;o=l;break}pe[153]=l;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=l|1;pe[v>>2]=l;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(f|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(f|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;y=f;o=l;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(f|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(f|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(f|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((f|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(f|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){y=f;o=l;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;y=f;o=l;break}else{y=f;o=l}}else{y=f;o=l}}else{y=t;o=d}}while(0);if(y>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){g=(pe[154]|0)+o|0;pe[154]=g;pe[157]=y;pe[y+4>>2]=g|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){g=(pe[153]|0)+o|0;pe[153]=g;pe[156]=y;pe[y+4>>2]=g|1;pe[y+g>>2]=g;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[y+4>>2]=o|1;pe[y+o>>2]=o;if((y|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[y+4>>2]=o|1;pe[y+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[y+28>>2]=n;pe[y+20>>2]=0;pe[y+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){g=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y;break e}}else g=t}while(0);t=g+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&g>>>0>=b>>>0){pe[r+12>>2]=y;pe[t>>2]=y;pe[y+8>>2]=r;pe[y+12>>2]=g;pe[y+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y}}while(0);y=(pe[159]|0)+-1|0;pe[159]=y;if(!y)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=fr()|0;pe[e>>2]=12;e=0;return e|0}r=Gr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function qr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Gr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;f=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((f|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((f|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}l=(n&-8)+u|0;if(l>>>0>>0){e=0;return e|0}h=l-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(f|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(f|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(f|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((f|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(f|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(f|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(f|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=l|p&1|2;t=e+(l|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(l|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;l=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){g=h;a=l;break}pe[153]=l;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=l|1;pe[v>>2]=l;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;g=h;a=l;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){f=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;f=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;f=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=f;if(!f){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=f;else pe[s+20>>2]=f;if(!f){g=h;a=l;break}}n=pe[155]|0;if(f>>>0>>0)Xe();pe[f+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[f+16>>2]=i;pe[i+24>>2]=f;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[f+20>>2]=r;pe[r+24>>2]=f;g=h;a=l;break}else{g=h;a=l}}else{g=h;a=l}}else{g=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=g;pe[g+4>>2]=b|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=g;pe[g+4>>2]=b|1;pe[g+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[g+4>>2]=a|1;pe[g+a>>2]=a;if((g|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[g+4>>2]=a|1;pe[g+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[g+28>>2]=o;pe[g+20>>2]=0;pe[g+16>>2]=0;i=pe[152]|0;n=1<>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=g;pe[i>>2]=g;pe[g+8>>2]=n;pe[g+12>>2]=r;pe[g+24>>2]=0;return}function Vr(){}function Wr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Re(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ge(n,o)|0;i=e>>>16;e=(r>>>16)+(ge(n,i)|0)|0;n=t>>>16;t=ge(n,o)|0;return(re=(e>>>16)+(ge(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Wr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Wr((si(s,a,Wr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Wr(a^e,o^t,a,o)|0;t=re;si(e,t,Wr(c^r,u^i,c,u)|0,re,s)|0;i=Wr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ge(t,o)|0)+(ge(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;f=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(f>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(f>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){l=o+1|0;s=31-o|0;t=o-31>>31;a=l;e=f>>>(l>>>0)&t|c<>>(l>>>0)&t;o=0;s=f<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;l=32-s|0;u=l>>31;d=s-32|0;t=d>>31;a=s;e=l-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=f<>>(d>>>0))&u|f<>31;break}if(n){pe[n>>2]=o&f;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|f>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!f){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=f<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{l=r|0|0;f=h|i&0;c=Zr(l|0,f|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Wr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Wr(i,h,d&l,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&f)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Ci[e&3](t|0,r|0,i|0,n|0,o|0)}function fi(e,t){e=e|0;t=t|0;Pi[e&7](t|0)}function li(e,t){e=e|0;t=t|0;return Ai[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;ki[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Ii[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ri[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Oi[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function gi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function yi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[bi,Yt,jr,Ar,Pr,kr,bi,bi];var Ci=[gi,tr,er,gi];var Pi=[yi,qt,Vt,Gt,Ht,Wt,ur,Lr];var Ai=[_i,Cr];var ki=[wi];var Ii=[xi,ar,sr,xi];var Ri=[Ti,ir,rr,Ti];var Oi=[Si,ut];var Di=[Ei,Jt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Wr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Kr,_fflush:mr,_bitshift64Shl:Jr,_crn_get_height:xt,___errno_location:fr,_crn_get_dxt_format:St,runPostSets:Vr,_emscripten_replace_memory:Ye,stackAlloc:Ke,stackSave:Je,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:fi,dynCall_ii:li,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;l>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var f=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var me=new s(r);var l=new u(r);var h=new c(r);var ee=new f(r);var d=e.byteLength;var be=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var m=t.cttz_i8|0;var b=0;var g=0;var y=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,C=0.0,P=0,A=0,k=0,I=0.0;var re=0;var R=0;var O=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var q=e.Math.sqrt;var G=e.Math.pow;var H=e.Math.cos;var V=e.Math.sin;var W=e.Math.tan;var Y=e.Math.acos;var K=e.Math.asin;var J=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ge=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var fe=t.invoke_viiiii;var le=t.invoke_vi;var he=t.invoke_ii;var ye=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Ce=t._emscripten_set_main_loop_timing;var Pe=t.__ZSt18uncaught_exceptionv;var Ae=t.___setErrNo;var ke=t._sbrk;var Ie=t.___cxa_begin_catch;var Re=t._emscripten_memcpy_big;var Oe=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var qe=t._pthread_cleanup_push;var Ge=t._time;var He=t.___syscall140;var Ve=t.___syscall146;var We=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);me=new s(e);l=new u(e);h=new c(e);ee=new f(e);r=e;return true}function Ke(e){e=e|0;var t=0;t=be;be=be+e|0;be=be+15&-16;return t|0}function Je(){return be|0}function Ze(e){e=e|0;be=e}function Qe(e,t){e=e|0;t=t|0;be=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!b){b=e;g=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0;v=be;be=be+608|0;h=v+88|0;l=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;f=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(f,1100,o)|0;yr(f,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(f,1100,a)|0;yr(f,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;be=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(f,1100,s)|0;yr(f,u)|0}r=ge(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;be=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;be=v;return p|0}ki[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Oi[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(f,1100,l)|0;yr(f,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;be=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=be;be=be+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;yr(s,c+16|0)|0;u=0;be=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;yr(s,c+40|0)|0;u=0;be=c;return u|0}pe[a>>2]=t;i=Oi[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;be=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;yr(s,c+64|0)|0;u=i;be=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;yr(o,u+16|0)|0;s=0;be=u;return s|0}pe[n>>2]=i;r=Oi[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;yr(o,u+40|0)|0;s=0;be=u;return s|0}if(!(r&7)){s=r;be=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;yr(o,u+64|0)|0;s=r;be=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0;B=be;be=be+960|0;L=B+232|0;D=B+216|0;O=B+208|0;R=B+192|0;I=B+184|0;k=B+168|0;A=B+160|0;P=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;y=B+88|0;g=B+72|0;b=B+64|0;m=B+48|0;l=B+40|0;d=B+24|0;h=B+16|0;f=B;C=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;be=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[f>>2]=1154;pe[f+4>>2]=644;pe[f+8>>2]=1863;_r(C,1100,f)|0;yr(C,h)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(C,1100,d)|0;yr(C,l)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[m>>2]=1154;pe[m+4>>2]=2273;pe[m+8>>2]=1261;_r(C,1100,m)|0;yr(C,b)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[g>>2]=1154;pe[g+4>>2]=2277;pe[g+8>>2]=1274;_r(C,1100,g)|0;yr(C,y)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;y=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=y;g=(y|0)!=0;if(g){b=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=b;a=e+168|0;n=pe[a>>2]|0;do{if(n){m=pe[n+-4>>2]|0;n=n+-8|0;if(!((m|0)!=0?(m|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(C,1100,x)|0;yr(C,T)|0}if(!(n&7)){Oi[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(C,1100,S)|0;yr(C,E)|0;break}}}while(0);n=b<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=b;pe[o>>2]=~b;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=b<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;m=1;do{if(pe[F+(m<<2)>>2]|0){t=y-m|0;v=1<>2]|0;if(o>>>0>=16){pe[P>>2]=1154;pe[P+4>>2]=1953;pe[P+8>>2]=1737;_r(C,1100,P)|0;yr(C,A)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-m|0);if(s>>>0<=d>>>0){l=(pe[e+96+(o<<2)>>2]|0)-s|0;h=m<<16;do{n=me[(pe[p>>2]|0)+(l+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(m|0)){pe[k>>2]=1154;pe[k+4>>2]=2319;pe[k+8>>2]=1303;_r(C,1100,k)|0;yr(C,I)|0}f=s<>>0>=b>>>0){pe[R>>2]=1154;pe[R+4>>2]=2325;pe[R+8>>2]=1337;_r(C,1100,R)|0;yr(C,O)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(C,1100,D)|0;yr(C,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}m=m+1|0}while(y>>>0>=m>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(g){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=y+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;be=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=qr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=qr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function ft(e){e=e|0;Ie(e|0)|0;zt()}function lt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=be;be=be+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;be=o;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;yr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;be=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;d=be;be=be+640|0;h=d+112|0;l=d+96|0;f=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){be=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;yr(a,n)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;yr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;yr(a,u)|0}if(!(t&7)){Oi[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;yr(a,f)|0;break}}}while(0);if(!(e&7)){Oi[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;be=d;return}else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(a,1100,l)|0;yr(a,h)|0;be=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+560|0;a=f+40|0;s=f+24|0;t=f;o=f+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;yr(o,f+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;yr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;be=f;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;be=f;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0;L=be;be=be+800|0;k=L+256|0;A=L+240|0;P=L+232|0;C=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;y=L+120|0;g=L+112|0;b=L+96|0;m=L+88|0;v=L+72|0;l=L+64|0;f=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;O=L+288|0;D=L+264|0;I=vt(e,14)|0;if(!I){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Oi[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(O,1100,n)|0;yr(O,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;be=L;return t|0}ht(i);pe[r>>2]=0;t=1;be=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(I|0)){if(r>>>0<=I>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,I,(r+1|0)==(I|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;be=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,I-r|0)|0}pe[p>>2]=I}Yr(pe[d>>2]|0,0,I|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(O,1100,u)|0;yr(O,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;be=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[f>>2]=1154;pe[f+4>>2]=3199;pe[f+8>>2]=1650;_r(O,1100,f)|0;yr(O,l)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=I-i|0;r=mt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(O,1100,v)|0;yr(O,m)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[b>>2]=1154;pe[b+4>>2]=3199;pe[b+8>>2]=1650;_r(O,1100,b)|0;yr(O,g)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[y>>2]=1154;pe[y+4>>2]=3199;pe[y+8>>2]=1650;_r(O,1100,y)|0;yr(O,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){R=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(O,1100,w)|0;yr(O,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(O,1100,T)|0;yr(O,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(O,1100,E)|0;yr(O,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[C>>2]=1154;pe[C+4>>2]=903;pe[C+8>>2]=1781;_r(O,1100,C)|0;yr(O,P)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(I>>>0>r>>>0)i=r;else break}if((R|0)==90){pe[A>>2]=1154;pe[A+4>>2]=3140;pe[A+8>>2]=1632;_r(O,1100,A)|0;yr(O,k)|0;r=0;break}if((I|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);lt(D);t=r;be=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+544|0;s=f+16|0;a=f;o=f+24|0;if(!t){c=0;be=f;return c|0}if(t>>>0<=16){c=bt(e,t)|0;be=f;return c|0}u=bt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;yr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;be=f;return c|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0;y=be;be=be+608|0;v=y+88|0;p=y+72|0;h=y+64|0;l=y+48|0;f=y+40|0;d=y+24|0;c=y+16|0;u=y;b=y+96|0;m=pe[t+20>>2]|0;g=e+20|0;s=pe[g>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[g>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[g>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[m+16>>2]|0)>>>0){i=pe[(pe[m+168>>2]|0)+(o>>>(32-(pe[m+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(b,1100,u)|0;yr(b,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(b,1100,d)|0;yr(b,f)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[l>>2]=1154;pe[l+4>>2]=3248;pe[l+8>>2]=1694;_r(b,1100,l)|0;yr(b,h)|0}}else{i=pe[m+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[m+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[m+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=me[(pe[m+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(b,1100,p)|0;yr(b,v)|0;g=0;be=y;return g|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[g>>2]|0)-i;g=r;be=y;return g|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+560|0;s=f+40|0;u=f+24|0;r=f;a=f+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;yr(a,f+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;be=f;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;yr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;be=f;return u|0}function gt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0;p=be;be=be+544|0;h=p+16|0;l=p;f=p+24|0;if((e|0)==0|t>>>0<62){d=0;be=p;return d|0}c=at(300,0)|0;if(!c){d=0;be=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;m=c+252|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+268|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;m=c+284|0;pe[m>>2]=0;pe[m+4>>2]=0;pe[m+8>>2]=0;de[m+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Ct(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(Pt(c)|0))break;if(!(At(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){m=c;be=p;return m|0}if(kt(c)|0?It(c)|0:0){m=c;be=p;return m|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Oi[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;m=0;be=p;return m|0}else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(f,1100,l)|0;yr(f,h)|0;m=0;be=p;return m|0}return 0}function yt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+544|0;c=f;u=f+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=f;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;yr(u,f+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;be=f;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,f=0;f=pe[e+88>>2]|0;u=((ve[f+12>>0]|0)<<8|(ve[f+13>>0]|0))>>>a;c=((ve[f+14>>0]|0)<<8|(ve[f+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;f=f+18|0;a=de[f>>0]|0;a=ge(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ge(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[f>>0]|0|0){case 0:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Ot(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=be;be=be+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;be=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=be;be=be+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;yr(n,a)|0;e=0}c=ge(ge(t,i)|0,e)|0;be=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0;p=be;be=be+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;f=p+88|0;v=p;l=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(f,1100,a)|0;yr(f,s)|0;o=0}s=ge(o,u)|0;a=gt(e,t)|0;pe[l>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)yt(a,l,i,s,n)|0;if(o){be=p;return}if((pe[a>>2]|0)!=519686845){be=p;return}jt(a);if(!(a&7)){Oi[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;be=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(f,1100,d)|0;yr(f,h)|0;be=p;return}}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;p=be;be=be+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);f=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(f,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;be=p;return d|0}else t=r}while(0);Yr((pe[f>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;be=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(l=d+24|0,pt(c,l)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[f>>2]|0;while(1){i=(mt(c,d)|0)+i&31;n=(mt(c,l)|0)+n&63;o=(mt(c,d)|0)+o&31;t=(mt(c,d)|0)+t|0;a=(mt(c,l)|0)+a&63;e=(mt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;lt(d+24|0);lt(d);d=t;be=p;return d|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0;E=be;be=be+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(g,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[g>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;f=w+36|0;l=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{M=mt(y,S)|0;g=t<<1;C=w+(g<<2)|0;pe[C>>2]=(pe[C>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[f>>2]|0)>>0]|0)<<18|(ve[1725+(pe[l>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[m>>2]|0)>>0]|0)<<30;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;lt(S);C=t;be=E;return C|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0;h=be;be=be+560|0;u=h+16|0;s=h;a=h+48|0;l=h+24|0;n=pe[e+88>>2]|0;f=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){l=0;be=h;return l|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[l+20>>2]=0;pe[l>>2]=0;pe[l+4>>2]=0;pe[l+8>>2]=0;pe[l+12>>2]=0;de[l+16>>0]=0;e:do{if(pt(c,l)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(f|0)){if(t>>>0<=f>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,f,(t+1|0)==(f|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,f-t<<1|0)|0}pe[r>>2]=f}if(!f){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;yr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=mt(c,l)|0;r=u+r&255;i=(mt(c,l)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(f|0)){t=1;break}else t=t+2|0}}else t=0}while(0);lt(l);l=t;be=h;return l|0}function It(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0;E=be;be=be+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);y=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;be=E;return S|0}pe[y>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(y,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));g=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(g,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[g>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;yr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;f=w+36|0;l=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;m=w+60|0;b=0;r=pe[g>>2]|0;while(1){t=0;do{M=mt(y,S)|0;g=t<<1;C=w+(g<<2)|0;pe[C>>2]=(pe[C>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;g=w+((g|1)<<2)|0;pe[g>>2]=(pe[g>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;C=ve[1729+(pe[l>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[f>>2]|0)>>0]|0)<<11|C<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|C>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[m>>2]|0)>>0]|0)<<13;b=b+1|0;if((b|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;lt(S);C=t;be=E;return C|0}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,fe=0,le=0,he=0;fe=be;be=be+720|0;ce=fe+184|0;se=fe+168|0;ae=fe+160|0;oe=fe+144|0;ne=fe+136|0;ie=fe+120|0;re=fe+112|0;ee=fe+96|0;$=fe+88|0;Q=fe+72|0;Z=fe+64|0;J=fe+48|0;K=fe+40|0;ue=fe+24|0;te=fe+16|0;Y=fe;V=fe+208|0;W=fe+192|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;G=pe[q>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){be=fe;return 1}z=(s|0)==0;X=s+-1|0;R=(o&1|0)!=0;O=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;I=(n&1|0)!=0;k=e+188|0;E=e+252|0;M=H+1|0;C=H+2|0;P=H+3|0;A=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){g=x&1;u=(g|0)==0;b=(g<<5^32)+-16|0;g=(g<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);y=R&e;if((c|0)!=(_|0)){m=R&e^1;v=u?w:w+A|0;while(1){if((n|0)==1)n=mt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(mt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(V,1100,Y)|0;yr(V,te)|0}pe[W+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=I&(c|0)==(B|0);if(y|d){h=0;do{f=ge(h,i)|0;e=v+f|0;u=(h|0)==0|m;l=h<<1;he=(mt(D,k)|0)+r|0;le=he-G|0;r=le>>31;r=r&he|le&~r;do{if(d){if(!u){le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;break}pe[e>>2]=pe[W+((ve[1831+(p<<2)+l>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(V,1100,oe)|0;yr(V,ae)|0}pe[v+(f+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r}else{if(!u){le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;break}pe[e>>2]=pe[W+((ve[1831+(p<<2)+l>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(V,1100,ie)|0;yr(V,ne)|0}pe[v+(f+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;pe[v+(f+8)>>2]=pe[W+((ve[(l|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[q>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(V,1100,se)|0;yr(V,ce)|0}pe[v+(f+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[W+((ve[1831+(p<<2)>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(V,1100,ue)|0;yr(V,K)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[W+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[J>>2]=1154;pe[J+4>>2]=903;pe[J+8>>2]=1781;_r(V,1100,J)|0;yr(V,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[W+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(V,1100,Q)|0;yr(V,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(C<<2)>>2]=pe[W+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];le=(mt(D,k)|0)+r|0;he=le-G|0;r=he>>31;r=r&le|he&~r;if((pe[q>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(V,1100,ee)|0;yr(V,re)|0}pe[v+(P<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+g|0;if((c|0)==(_|0))break;else v=v+b|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+O|0}}S=S+1|0}while((S|0)!=(T|0));be=fe;return 1}function Ot(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,fe=0,le=0,he=0;le=be;be=be+640|0;ue=le+88|0;se=le+72|0;ae=le+64|0;oe=le+48|0;ne=le+40|0;fe=le+24|0;ce=le+16|0;ie=le;te=le+128|0;re=le+112|0;ee=le+96|0;N=e+240|0;U=pe[N>>2]|0;q=e+256|0;Z=pe[q>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=le;return 1}X=(s|0)==0;G=s+-1|0;H=i<<1;V=e+92|0;W=e+116|0;Y=a+-1|0;K=e+212|0;J=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;I=e+288|0;R=e+284|0;O=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;A=e+268|0;k=Y<<5;C=r&255;r=0;n=0;o=0;e=0;u=1;P=0;do{if(!X){E=pe[t+(P<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;f=c?0:Y;if((f|0)!=(S|0)){w=F|(M|0)!=(G|0);_=c?E:E+k|0;while(1){if((u|0)==1)u=mt(V,W)|0|512;y=u&7;u=u>>>3;l=ve[1823+y>>0]|0;c=0;do{b=(mt(V,j)|0)+n|0;g=b-$|0;n=g>>31;n=n&b|g&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;yr(te,ce)|0}pe[ee+(c<<2)>>2]=me[(pe[A>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{b=(mt(V,D)|0)+e|0;g=b-U|0;e=g>>31;e=e&b|g&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[fe>>2]=1154;pe[fe+4>>2]=903;pe[fe+8>>2]=1781;_r(te,1100,fe)|0;yr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);g=B|(f|0)!=(Y|0);m=0;b=_;while(1){v=w|(m|0)==0;p=m<<1;h=0;d=b;while(1){l=(mt(V,K)|0)+r|0;c=l-z|0;r=c>>31;r=r&l|c&~r;c=(mt(V,J)|0)+o|0;l=c-Z|0;o=l>>31;o=o&c|l&~o;if((g|(h|0)==0)&v){c=ve[h+p+(1831+(y<<2))>>0]|0;l=r*3|0;if((pe[I>>2]|0)>>>0<=l>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;yr(te,ae)|0}he=pe[R>>2]|0;pe[d>>2]=(me[he+(l<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(me[he+(l+2<<1)>>1]|0)<<16|(me[he+(l+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[q>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;yr(te,ue)|0}pe[d+12>>2]=pe[(pe[O>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}m=m+1|0;if((m|0)==2)break;else b=b+i|0}f=f+T|0;if((f|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}P=P+1|0}while((P|0)!=(C|0));be=le;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0;Z=be;be=be+608|0;Y=Z+64|0;W=Z+48|0;V=Z+40|0;J=Z+24|0;K=Z+16|0;H=Z;G=Z+88|0;q=Z+72|0;O=e+272|0;D=pe[O>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;R=(o&1|0)==0;A=e+288|0;k=e+284|0;I=e+164|0;C=e+268|0;P=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;y=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){g=R|(T|0)!=(F|0);b=n?x:x+P|0;while(1){if((e|0)==1)e=mt(N,U)|0|512;m=e&7;e=e>>>3;c=ve[1823+m>>0]|0;n=0;do{p=(mt(N,I)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[O>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(G,1100,H)|0;yr(G,K)|0}pe[q+(n<<2)>>2]=me[(pe[C>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=b;while(1){h=g|(d|0)==0;l=d<<1;n=(mt(N,X)|0)+r|0;f=n-L|0;c=f>>31;c=c&n|f&~c;if(h){r=ve[1831+(m<<2)+l>>0]|0;n=c*3|0;if((pe[A>>2]|0)>>>0<=n>>>0){pe[J>>2]=1154;pe[J+4>>2]=903;pe[J+8>>2]=1781;_r(G,1100,J)|0;yr(G,V)|0}f=pe[k>>2]|0;pe[p>>2]=(me[f+(n<<1)>>1]|0)<<16|pe[q+(r<<2)>>2];pe[p+4>>2]=(me[f+(n+2<<1)>>1]|0)<<16|(me[f+(n+1<<1)>>1]|0)}f=p+8|0;n=(mt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(l|1)+(1831+(m<<2))>>0]|0;c=r*3|0;if((pe[A>>2]|0)>>>0<=c>>>0){pe[W>>2]=1154;pe[W+4>>2]=903;pe[W+8>>2]=1781;_r(G,1100,W)|0;yr(G,Y)|0}h=pe[k>>2]|0;pe[f>>2]=(me[h+(c<<1)>>1]|0)<<16|pe[q+(n<<2)>>2];pe[p+12>>2]=(me[h+(c+2<<1)>>1]|0)<<16|(me[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else b=b+y|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));be=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=be;be=be+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;K=ae+112|0;J=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){be=ae;return 1}X=(s|0)==0;q=s+-1|0;G=i<<1;H=e+92|0;V=e+116|0;W=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;R=e+268|0;O=W<<5;k=r&255;r=0;n=0;o=0;e=0;u=1;I=0;do{if(!X){P=pe[t+(I<<2)>>2]|0;A=0;while(1){M=A&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;C=c?a:-1;f=c?0:W;if((f|0)!=(C|0)){S=F|(A|0)!=(q|0);T=c?P:P+O|0;while(1){if((u|0)==1)u=mt(H,V)|0|512;x=u&7;u=u>>>3;l=ve[1823+x>>0]|0;c=0;do{_=(mt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;yr(Z,ne)|0}pe[K+(c<<2)>>2]=me[(pe[R>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(mt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;yr(Z,$)|0}pe[J+(c<<2)>>2]=me[(pe[R>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(f|0)!=(W|0);y=0;_=T;while(1){g=S|(y|0)==0;b=y<<1;v=0;m=_;while(1){p=(mt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(mt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&g){d=ve[v+b+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;yr(Z,te)|0;c=pe[D>>2]|0}l=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=l;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;yr(Z,ie)|0;c=pe[L>>2]|0}pe[m>>2]=(me[l+(p<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[m+4>>2]=(me[l+(p+2<<1)>>1]|0)<<16|(me[l+(p+1<<1)>>1]|0);pe[m+8>>2]=(me[c+(h<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[m+12>>2]=(me[c+(h+2<<1)>>1]|0)<<16|(me[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else m=m+16|0}y=y+1|0;if((y|0)==2)break;else _=_+i|0}f=f+M|0;if((f|0)==(C|0))break;else T=T+E|0}}A=A+1|0;if((A|0)==(s|0))break;else P=P+G|0}}I=I+1|0}while((I|0)!=(k|0));be=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0;h=be;be=be+608|0;l=h+88|0;f=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;yr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;yr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;yr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){l=e+248|0;de[l>>0]=0;l=e+212|0;lt(l);l=e+188|0;lt(l);l=e+164|0;lt(l);l=e+140|0;lt(l);l=e+116|0;lt(l);be=h;return}if(!(r&7))Oi[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(c,1100,f)|0;yr(c,l)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;l=e+248|0;de[l>>0]=0;l=e+212|0;lt(l);l=e+188|0;lt(l);l=e+164|0;lt(l);l=e+140|0;lt(l);l=e+116|0;lt(l);be=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=be;be=be+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;br(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=be;be=be+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;be=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=be;be=be+16|0;Ii[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function qt(e){e=e|0;return}function Gt(e){e=e|0;return}function Ht(e){e=e|0;return}function Vt(e){e=e|0;Nt(e);return}function Wt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=be;be=be+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;be=a;return t|0}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Kt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Kt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0;d=be;be=be+64|0;h=d;l=pe[e>>2]|0;f=e+(pe[l+-8>>2]|0)|0;l=pe[l+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(l|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ri[pe[(pe[r>>2]|0)+20>>2]&3](r,h,f,f,1,0);i=(pe[t>>2]|0)==1?f:0}else{Ci[pe[(pe[l>>2]|0)+24>>2]&3](l,h,f,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);be=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Ci[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ri[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];be=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=be;be=be+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ai[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=be;be=be+16|0;if(!(Fe(196,6)|0)){be=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=be;be=be+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){be=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function fr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function lr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=fr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Kr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=fr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function mr(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Or(e)|0;break}r=(Sr(e)|0)==0;t=Or(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=mr(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Or(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function br(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function gr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function yr(e,t){e=e|0;t=t|0;var r=0,i=0;r=be;be=be+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;be=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=be;be=be+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;be=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0;v=be;be=be+224|0;l=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[l>>2]=pe[r>>2];if((Dr(0,t,l,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;f=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,l,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,l,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|f;if(c)Er(e);r=(r&32|0)==0?i:-1}be=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,f=0;f=be;be=be+128|0;n=f+112|0;c=f;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=fr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}be=f;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=be;be=be+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Ir(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);be=u;return r|0}function Cr(e){e=e|0;var t=0,r=0;t=be;be=be+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=lr(Me(6,r|0)|0)|0;be=t;return e|0}function Pr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=be;be=be+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((lr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;be=n;return e|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;p=be;be=be+48|0;l=p+16|0;f=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=lr(Ve(146,l|0)|0)|0}else{qe(7,e|0);pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=lr(Ve(146,f|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){l=pe[c>>2]|0;pe[e+16>>2]=l+(pe[e+48>>2]|0);e=l;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}be=p;return r|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=be;be=be+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Ar(e,t,r)|0;be=n;return i|0}function Ir(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Rr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ge(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Or(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,f=0,l=0,h=0,d=0,p=0.0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,q=0,G=0,H=0,V=0,W=0,Y=0,K=0,J=0,Z=0,Q=0;Q=be;be=be+624|0;W=Q+24|0;K=Q+16|0;Y=Q+588|0;X=Q+576|0;V=Q;N=Q+536|0;Z=Q+8|0;J=Q+528|0;k=(e|0)!=0;I=N+40|0;B=I;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;q=Y;G=z;H=G-q|0;R=-2-q|0;O=G+2|0;D=W+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=fr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){A=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;A=9;break t}case 0:{a=s;break t}default:{}}P=s+1|0;a=de[P>>0]|0;s=P}t:do{if((A|0)==9)while(1){A=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)A=9;else break}}while(0);b=s-v|0;if(k?(pe[e>>2]&32|0)==0:0)gr(v,b,e)|0;if((s|0)!=(v|0)){v=a;a=b;continue}f=a+1|0;s=de[f>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){P=(de[a+2>>0]|0)==36;f=P?a+3|0:f;s=de[f>>0]|0;d=P?u:-1;t=P?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;f=f+1|0;s=de[f>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){l=u;a=f;break}}}else{l=0;a=f}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!k){m=l;a=u;t=0;P=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){m=l|8192;P=0-s|0}else{m=l;P=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{m=l;P=s}}else{m=l;P=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){f=(s<<24>>24)+-48|0;if(f>>>0<10){a=u;s=0}else{a=u;f=0;break}while(1){s=(s*10|0)+f|0;a=a+1|0;f=(de[a>>0]|0)+-48|0;if(f>>>0>=10){f=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;f=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(k){a=(pe[r>>2]|0)+(4-1)&~(4-1);f=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;f=0}}else f=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;l=s&255;if((l+-1|0)>>>0<8){a=u;h=l}else{C=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else A=52;else{if(u){pe[n+(d<<2)>>2]=l;E=i+(d<<3)|0;M=pe[E+4>>2]|0;A=V;pe[A>>2]=pe[E>>2];pe[A+4>>2]=M;A=52;break}if(!k){o=0;break e}Fr(V,l,r)}}while(0);if((A|0)==52?(A=0,!k):0){v=C;a=b;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=m&-65537;M=(m&8192|0)==0?m:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[V>>2]>>2]=o;v=C;a=b;continue e}case 1:{pe[pe[V>>2]>>2]=o;v=C;a=b;continue e}case 2:{v=pe[V>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=C;a=b;continue e}case 3:{$[pe[V>>2]>>1]=o;v=C;a=b;continue e}case 4:{de[pe[V>>2]>>0]=o;v=C;a=b;continue e}case 6:{pe[pe[V>>2]>>2]=o;v=C;a=b;continue e}case 7:{v=pe[V>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=C;a=b;continue e}default:{v=C;a=b;continue e}}case 112:{h=M|8;f=f>>>0>8?f:8;d=120;A=64;break}case 88:case 120:{h=M;A=64;break}case 111:{u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=I;else{a=I;do{a=a+-1|0;de[a>>0]=s&7|48;s=Kr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;l=5839;A=77}else{h=B-a+1|0;s=M;f=(f|0)<(h|0)?h:f;h=0;l=5839;A=77}break}case 105:case 100:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Wr(0,0,a|0,s|0)|0;s=re;u=V;pe[u>>2]=a;pe[u+4>>2]=s;u=1;l=5839;A=76;break t}if(!(M&2048)){l=M&1;u=l;l=(l|0)==0?5839:5841;A=76}else{u=1;l=5840;A=76}break}case 117:{s=V;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;l=5839;A=76;break}case 99:{de[N>>0]=pe[V>>2];v=N;s=1;h=0;d=5839;a=I;break}case 109:{a=fr()|0;a=cr(pe[a>>2]|0)|0;A=82;break}case 115:{a=pe[V>>2]|0;a=(a|0)!=0?a:5849;A=82;break}case 67:{pe[Z>>2]=pe[V>>2];pe[U>>2]=0;pe[V>>2]=Z;f=-1;A=86;break}case 83:{if(!f){Nr(e,32,P,0,M);a=0;A=98}else A=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[V>>3];pe[K>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,K)*2.0;s=p!=0.0;if(s)pe[K>>2]=(pe[K>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;b=(v|0)==0?E:E+9|0;m=S|2;a=12-f|0;do{if(!(f>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[b>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[K>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;l=(f|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-q|0)==1){if(u&(l&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}f=(f|0)!=0&(R+a|0)<(f|0)?O+f-h|0:H-h+a|0;u=f+m|0;Nr(e,32,P,u,M);if(!(pe[e>>2]&32))gr(b,m,e)|0;Nr(e,48,P,u,M^65536);a=a-q|0;if(!(pe[e>>2]&32))gr(Y,a,e)|0;s=G-h|0;Nr(e,48,f-(a+s)|0,0,0);if(!(pe[e>>2]&32))gr(h,s,e)|0;Nr(e,32,P,u,M^8192);a=(u|0)<(P|0)?P:u;break}a=(f|0)<0?6:f;if(s){s=(pe[K>>2]|0)+-28|0;pe[K>>2]=s;c=p*268435456.0}else{c=p;s=pe[K>>2]|0}T=(s|0)<0?W:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[K>>2]|0;if((s|0)>0){l=T;while(1){h=(s|0)>29?29:s;f=u+-4|0;do{if(f>>>0>>0)f=l;else{s=0;do{_=Jr(pe[f>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;y=ai(_|0,s|0,1e9,0)|0;pe[f>>2]=y;s=oi(_|0,s|0,1e9,0)|0;f=f+-4|0}while(f>>>0>=l>>>0);if(!s){f=l;break}f=l+-4|0;pe[f>>2]=s}}while(0);while(1){if(u>>>0<=f>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[K>>2]|0)-h|0;pe[K>>2]=s;if((s|0)>0)l=f;else break}}else f=T;if((s|0)<0){b=((a+25|0)/9|0)+1|0;g=(w|0)==102;v=f;while(1){m=0-s|0;m=(m|0)>9?9:m;do{if(v>>>0>>0){s=(1<>>m;f=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>m)+f;f=ge(_&s,l)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!f){f=s;break}pe[u>>2]=f;f=s;u=u+4|0}else f=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=g?T:f;u=(u-s>>2|0)>(b|0)?s+(b<<2)|0:u;s=(pe[K>>2]|0)+m|0;pe[K>>2]=s;if((s|0)>=0){v=f;break}else v=f}}else v=f;do{if(v>>>0>>0){s=(x-v>>2)*9|0;l=pe[v>>2]|0;if(l>>>0<10)break;else f=10;do{f=f*10|0;s=s+1|0}while(l>>>0>=f>>>0)}else s=0}while(0);y=(w|0)==103;_=(a|0)!=0;f=a-((w|0)!=102?s:0)+((_&y)<<31>>31)|0;if((f|0)<(((u-x>>2)*9|0)+-9|0)){h=f+9216|0;g=(h|0)/9|0;f=T+(g+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){l=10;do{l=l*10|0;h=h+1|0}while((h|0)!=9)}else l=10;m=pe[f>>2]|0;b=(m>>>0)%(l>>>0)|0;if((b|0)==0?(T+(g+-1022<<2)|0)==(u|0):0)l=v;else A=163;do{if((A|0)==163){A=0;p=(((m>>>0)/(l>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(l|0)/2|0;do{if(b>>>0>>0)c=.5;else{if((b|0)==(h|0)?(T+(g+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=m-b|0;pe[f>>2]=h;if(!(p+c!=p)){l=v;break}w=h+l|0;pe[f>>2]=w;if(w>>>0>999999999){s=v;while(1){l=f+-4|0;pe[f>>2]=0;if(l>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[l>>2]|0)+1|0;pe[l>>2]=w;if(w>>>0>999999999)f=l;else{v=s;f=l;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){l=v;break}else l=10;do{l=l*10|0;s=s+1|0}while(h>>>0>=l>>>0);l=v}}while(0);w=f+4|0;v=l;u=u>>>0>w>>>0?w:u}b=0-s|0;while(1){if(u>>>0<=v>>>0){g=0;w=u;break}f=u+-4|0;if(!(pe[f>>2]|0))u=f;else{g=1;w=u;break}}do{if(y){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(g){u=pe[w+-4>>2]|0;if(!u){f=9;break}if(!((u>>>0)%10|0)){l=10;f=0}else{f=0;break}do{l=l*10|0;f=f+1|0}while(((u>>>0)%(l>>>0)|0|0)==0)}else f=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-f|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-f|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);m=a|u;l=(m|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{f=(s|0)<0?b:s;f=Br(f,((f|0)<0)<<31>>31,z)|0;if((G-f|0)<2)do{f=f+-1|0;de[f>>0]=48}while((G-f|0)<2);de[f+-1>>0]=(s>>31&2)+43;x=f+-2|0;de[x>>0]=d;s=G-x|0;d=x}b=S+1+a+l+s|0;Nr(e,32,P,b,M);if(!(pe[e>>2]&32))gr(E,S,e)|0;Nr(e,48,P,b,M^65536);do{if(h){f=v>>>0>T>>>0?T:v;s=f;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(f|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))gr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(m){if(pe[e>>2]&32)break;gr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))gr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=g?w:v+4|0;if((a|0)>-1){l=(u|0)==0;f=v;do{s=Br(pe[f>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((f|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))gr(s,1,e)|0;if(l&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}gr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))gr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;f=f+4|0}while(f>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;gr(d,G-d|0,e)|0}}while(0);Nr(e,32,P,b,M^8192);a=(b|0)<(P|0)?P:b}else{h=(d&32|0)!=0;l=c!=c|0.0!=0.0;s=l?0:S;f=s+3|0;Nr(e,32,P,f,u);a=pe[e>>2]|0;if(!(a&32)){gr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))gr(l?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,P,f,M^8192);a=(f|0)<(P|0)?P:f}}while(0);v=C;continue e}default:{u=M;s=f;h=0;d=5839;a=I}}}while(0);t:do{if((A|0)==64){u=V;s=pe[u>>2]|0;u=pe[u+4>>2]|0;l=d&32;if(!((s|0)==0&(u|0)==0)){a=I;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|l;s=Kr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));A=V;if((h&8|0)==0|(pe[A>>2]|0)==0&(pe[A+4>>2]|0)==0){s=h;h=0;l=5839;A=77}else{s=h;h=2;l=5839+(d>>4)|0;A=77}}else{a=I;s=h;h=0;l=5839;A=77}}else if((A|0)==76){a=Br(a,s,I)|0;s=M;h=u;A=77}else if((A|0)==82){A=0;M=Rr(a,0,f)|0;E=(M|0)==0;v=a;s=E?f:M-a|0;h=0;d=5839;a=E?a+f|0:M}else if((A|0)==86){A=0;s=0;a=0;l=pe[V>>2]|0;while(1){u=pe[l>>2]|0;if(!u)break;a=vr(J,u)|0;if((a|0)<0|a>>>0>(f-s|0)>>>0)break;s=a+s|0;if(f>>>0>s>>>0)l=l+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,P,s,M);if(!s){a=0;A=98}else{u=0;f=pe[V>>2]|0;while(1){a=pe[f>>2]|0;if(!a){a=s;A=98;break t}a=vr(J,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;A=98;break t}if(!(pe[e>>2]&32))gr(J,a,e)|0;if(u>>>0>=s>>>0){a=s;A=98;break}else f=f+4|0}}}}while(0);if((A|0)==98){A=0;Nr(e,32,P,a,M^8192);v=C;a=(P|0)>(a|0)?P:a;continue}if((A|0)==77){A=0;u=(f|0)>-1?s&-65537:s;s=V;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((f|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(f|0)>(s|0)?f:s;d=l;a=I}else{v=I;s=0;d=l;a=I}}l=a-v|0;s=(s|0)<(l|0)?l:s;f=h+s|0;a=(P|0)<(f|0)?f:P;Nr(e,32,a,f,u);if(!(pe[e>>2]&32))gr(d,h,e)|0;Nr(e,48,a,f,u^65536);Nr(e,48,s,l,0);if(!(pe[e>>2]&32))gr(v,l,e)|0;Nr(e,32,a,f,u^8192);v=C}e:do{if((A|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);be=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=be;be=be+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){gr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;gr(a,n,e)|0}}while(0);be=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,C=0,P=0,A=0,k=0,I=0,R=0,O=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{f=e;l=t}}else{pe[151]=e|r;f=644+(t+2<<2)|0;l=i}pe[f>>2]=n;pe[l+12>>2]=n;pe[n+8>>2]=l;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;l=e&-8;f=pe[152]|0;if(f){r=0-l|0;e=e>>>8;if(e)if(l>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=l>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=l<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-l|0;if(r>>>0>>0)if((o|0)==(l|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;f=e>>>5&8;e=e>>>f;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((f|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-l|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-l|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+l|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=l|3;pe[u+(l|4)>>2]=s|1;pe[u+(s+l)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{b=t;g=e}}else{pe[151]=r|t;b=644+(e+2<<2)|0;g=i}pe[b>>2]=a;pe[g+12>>2]=a;pe[u+(l+8)>>2]=g;pe[u+(l+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(l+28)>>2]=i;pe[u+(l+20)>>2]=0;pe[u+(l+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(l+24)>>2]=t;pe[u+(l+12)>>2]=a;pe[u+(l+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(l+24)>>2]=t;pe[u+(l+12)>>2]=a;pe[u+(l+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(l+8)>>2]=e;pe[u+(l+12)>>2]=T;pe[u+(l+24)>>2]=0;break}else Xe()}else{F=s+l|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=l}else v=l}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Oe(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(Ge(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;f=a&s;if(f>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(g=pe[259]|0,T=g+f|0,T>>>0<=g>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(m=n+4|0,(r+(pe[m>>2]|0)|0)>>>0>e>>>0):0){o=n;e=m;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=ke(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=ke(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=f;else r=f-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=ke(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(y=pe[271]|0,y=c-r+y&0-y,y>>>0<2147483647):0)if((ke(y|0)|0)==(-1|0)){ke(o|0)|0;break t}else{r=y+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?f>>>0<2147483647:0)?(w=ke(f|0)|0,x=ke(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;C=r;P=n;A=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[A+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[C>>2]=P+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;l=h+v|0;d=w+l|0;f=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+f|0;pe[153]=F;pe[156]=d;pe[w+(l+4)>>2]=F|1;pe[w+(F+l)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){k=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[k>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+f|0}else n=f;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(l+4)>>2]=n|1;pe[w+(n+l)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(l+8)>>2]=j;pe[w+(l+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(l+28)>>2]=i;pe[w+(l+20)>>2]=0;pe[w+(l+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(l+24)>>2]=t;pe[w+(l+12)>>2]=d;pe[w+(l+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(l+24)>>2]=t;pe[w+(l+12)>>2]=d;pe[w+(l+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(l+8)>>2]=e;pe[w+(l+12)>>2]=F;pe[w+(l+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+f|0;pe[154]=F;pe[157]=d;pe[w+(l+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{I=t;R=e}}else{pe[151]=r|t;I=644+(e+2<<2)|0;R=i}pe[I>>2]=a;pe[R+12>>2]=a;pe[a+8>>2]=R;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){O=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else O=t}while(0);t=O+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&O>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=O;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=fr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0,y=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;f=e+u|0;l=t+d|0;if(f>>>0>>0)Xe();if((f|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){y=f;o=l;break}pe[153]=l;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=l|1;pe[v>>2]=l;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(f|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(f|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;y=f;o=l;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(f|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(f|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(f|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((f|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(f|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){y=f;o=l;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;y=f;o=l;break}else{y=f;o=l}}else{y=f;o=l}}else{y=t;o=d}}while(0);if(y>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){g=(pe[154]|0)+o|0;pe[154]=g;pe[157]=y;pe[y+4>>2]=g|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){g=(pe[153]|0)+o|0;pe[153]=g;pe[156]=y;pe[y+4>>2]=g|1;pe[y+g>>2]=g;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[y+4>>2]=o|1;pe[y+o>>2]=o;if((y|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[y+4>>2]=o|1;pe[y+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{m=t;b=r}}else{pe[151]=i|t;m=644+(r+2<<2)|0;b=n}pe[m>>2]=y;pe[b+12>>2]=y;pe[y+8>>2]=b;pe[y+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{m=(t+1048320|0)>>>16&8;b=t<>>16&4;b=b<>>16&2;n=14-(v|m|n)+(b<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[y+28>>2]=n;pe[y+20>>2]=0;pe[y+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){g=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y;break e}}else g=t}while(0);t=g+8|0;r=pe[t>>2]|0;b=pe[155]|0;if(r>>>0>=b>>>0&g>>>0>=b>>>0){pe[r+12>>2]=y;pe[t>>2]=y;pe[y+8>>2]=r;pe[y+12>>2]=g;pe[y+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=y;pe[y+24>>2]=t;pe[y+12>>2]=y;pe[y+8>>2]=y}}while(0);y=(pe[159]|0)+-1|0;pe[159]=y;if(!y)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=fr()|0;pe[e>>2]=12;e=0;return e|0}r=Gr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function qr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function Gr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;f=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((f|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((f|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}l=(n&-8)+u|0;if(l>>>0>>0){e=0;return e|0}h=l-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(f|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(f|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(f|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((f|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(f|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(f|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(f|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=l|p&1|2;t=e+(l|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(l|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0,v=0,m=0,b=0,g=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;l=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){g=h;a=l;break}pe[153]=l;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=l|1;pe[v>>2]=l;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;g=h;a=l;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){f=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;f=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;f=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=f;if(!f){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=f;else pe[s+20>>2]=f;if(!f){g=h;a=l;break}}n=pe[155]|0;if(f>>>0>>0)Xe();pe[f+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[f+16>>2]=i;pe[i+24>>2]=f;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[f+20>>2]=r;pe[r+24>>2]=f;g=h;a=l;break}else{g=h;a=l}}else{g=h;a=l}}else{g=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){b=(pe[154]|0)+a|0;pe[154]=b;pe[157]=g;pe[g+4>>2]=b|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){b=(pe[153]|0)+a|0;pe[153]=b;pe[156]=g;pe[g+4>>2]=b|1;pe[g+b>>2]=b;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[g+4>>2]=a|1;pe[g+a>>2]=a;if((g|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[g+4>>2]=a|1;pe[g+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{m=r;b=i}}else{pe[151]=n|r;m=644+(i+2<<2)|0;b=o}pe[m>>2]=g;pe[b+12>>2]=g;pe[g+8>>2]=b;pe[g+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{m=(r+1048320|0)>>>16&8;b=r<>>16&4;b=b<>>16&2;o=14-(v|m|o)+(b<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[g+28>>2]=o;pe[g+20>>2]=0;pe[g+16>>2]=0;i=pe[152]|0;n=1<>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=g;pe[g+24>>2]=r;pe[g+12>>2]=g;pe[g+8>>2]=g;return}}while(0);i=r+8|0;n=pe[i>>2]|0;b=pe[155]|0;if(!(n>>>0>=b>>>0&r>>>0>=b>>>0))Xe();pe[n+12>>2]=g;pe[i>>2]=g;pe[g+8>>2]=n;pe[g+12>>2]=r;pe[g+24>>2]=0;return}function Vr(){}function Wr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Re(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[m+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[m+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[m+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[m+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ge(n,o)|0;i=e>>>16;e=(r>>>16)+(ge(n,i)|0)|0;n=t>>>16;t=ge(n,o)|0;return(re=(e>>>16)+(ge(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Wr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Wr((si(s,a,Wr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=be;be=be+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Wr(a^e,o^t,a,o)|0;t=re;si(e,t,Wr(c^r,u^i,c,u)|0,re,s)|0;i=Wr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;be=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ge(t,o)|0)+(ge(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=be;be=be+16|0;n=o|0;si(e,t,r,i,n)|0;be=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,f=0,l=0,h=0,d=0,p=0;f=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(f>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(f>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){l=o+1|0;s=31-o|0;t=o-31>>31;a=l;e=f>>>(l>>>0)&t|c<>>(l>>>0)&t;o=0;s=f<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;l=32-s|0;u=l>>31;d=s-32|0;t=d>>31;a=s;e=l-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=f<>>(d>>>0))&u|f<>31;break}if(n){pe[n>>2]=o&f;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|f>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!f){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=f<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{l=r|0|0;f=h|i&0;c=Zr(l|0,f|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Wr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Wr(i,h,d&l,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&f)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Ci[e&3](t|0,r|0,i|0,n|0,o|0)}function fi(e,t){e=e|0;t=t|0;Pi[e&7](t|0)}function li(e,t){e=e|0;t=t|0;return Ai[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;ki[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Ii[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ri[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Oi[e&1](t|0,r|0,i|0,n|0,o|0)|0}function mi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function bi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function gi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function yi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[bi,Yt,jr,Ar,Pr,kr,bi,bi];var Ci=[gi,tr,er,gi];var Pi=[yi,qt,Vt,Gt,Ht,Wt,ur,Lr];var Ai=[_i,Cr];var ki=[wi];var Ii=[xi,ar,sr,xi];var Ri=[Ti,ir,rr,Ti];var Oi=[Si,ut];var Di=[Ei,Jt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Wr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Kr,_fflush:mr,_bitshift64Shl:Jr,_crn_get_height:xt,___errno_location:fr,_crn_get_dxt_format:St,runPostSets:Vr,_emscripten_replace_memory:Ye,stackAlloc:Ke,stackSave:Je,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:fi,dynCall_ii:li,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:mi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function l(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)a++;(n=new c(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new c(2*e.length),i=0;i>=7)n++}var a=new c(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new c(r)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new c(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new c(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],c=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function m(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function b(e,t,r){if(b.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=b:t.BN=b,(b.BN=b).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},b.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},b.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,c=r;c"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;f+=(a=(n=0|e.words[p])*(o=0|t.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}b.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],c=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var l=f.modn(c).toString(e);r=(f=f.idivn(c)).isZero()?l+r:h[u-l.length]+l+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}m(!1,"Base should be between 2 and 36")},b.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},b.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},b.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},b.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},b.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},b.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},b.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},b.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},b.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},b.prototype.inotn=function(e){m("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},b.prototype.notn=function(e){return this.clone().inotn(e)},b.prototype.setn=function(e,t){m("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},b.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,m=0|a[2],b=8191&m,g=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,x=0|a[4],T=8191&x,S=x>>>13,E=0|a[5],M=8191&E,C=E>>>13,P=0|a[6],A=8191&P,k=P>>>13,I=0|a[7],R=8191&I,O=I>>>13,D=0|a[8],L=8191&D,j=D>>>13,F=0|a[9],B=8191&F,N=F>>>13,U=0|s[0],z=8191&U,X=U>>>13,q=0|s[1],G=8191&q,H=q>>>13,V=0|s[2],W=8191&V,Y=V>>>13,K=0|s[3],J=8191&K,Z=K>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],le=8191&fe,he=fe>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(i=Math.imul(l,z))|0)+((8191&(n=(n=Math.imul(l,X))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,X))+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(v,z)|0,o=Math.imul(v,X);var be=(c+(i=i+Math.imul(l,G)|0)|0)+((8191&(n=(n=n+Math.imul(l,H)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,X))+Math.imul(g,z)|0,o=Math.imul(g,X),i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,H)|0;var ge=(c+(i=i+Math.imul(l,W)|0)|0)+((8191&(n=(n=n+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(b,G)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,H)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,Y)|0;var ye=(c+(i=i+Math.imul(l,J)|0)|0)+((8191&(n=(n=n+Math.imul(l,Z)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,Y)|0,i=i+Math.imul(p,J)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Z)|0;var _e=(c+(i=i+Math.imul(l,$)|0)|0)+((8191&(n=(n=n+Math.imul(l,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,X))+Math.imul(C,z)|0,o=Math.imul(C,X),i=i+Math.imul(T,G)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var we=(c+(i=i+Math.imul(l,re)|0)|0)+((8191&(n=(n=n+Math.imul(l,ie)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(A,z),n=(n=Math.imul(A,X))+Math.imul(k,z)|0,o=Math.imul(k,X),i=i+Math.imul(M,G)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,H)|0,i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var xe=(c+(i=i+Math.imul(l,oe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(R,z),n=(n=Math.imul(R,X))+Math.imul(O,z)|0,o=Math.imul(O,X),i=i+Math.imul(A,G)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,H)|0,i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,Y)|0,i=i+Math.imul(T,J)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(b,re)|0,n=(n=n+Math.imul(b,ie)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Te=(c+(i=i+Math.imul(l,ue)|0)|0)+((8191&(n=(n=n+Math.imul(l,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(j,z)|0,o=Math.imul(j,X),i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,H)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(M,J)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(C,J)|0,o=o+Math.imul(C,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(b,oe)|0,n=(n=n+Math.imul(b,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(i=i+Math.imul(l,le)|0)|0)+((8191&(n=(n=n+Math.imul(l,he)|0)+Math.imul(h,le)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,G)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,H)|0,i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Y)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Z)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(b,ue)|0,n=(n=n+Math.imul(b,ce)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,ce)|0,i=i+Math.imul(p,le)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(v,le)|0,o=o+Math.imul(v,he)|0;var Ee=(c+(i=i+Math.imul(l,pe)|0)|0)+((8191&(n=(n=n+Math.imul(l,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,G),n=(n=Math.imul(B,H))+Math.imul(N,G)|0,o=Math.imul(N,H),i=i+Math.imul(L,W)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(R,J)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Z)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(C,re)|0,o=o+Math.imul(C,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(b,le)|0,n=(n=n+Math.imul(b,he)|0)+Math.imul(g,le)|0,o=o+Math.imul(g,he)|0;var Me=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,W),n=(n=Math.imul(B,Y))+Math.imul(N,W)|0,o=Math.imul(N,Y),i=i+Math.imul(L,J)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,ee)|0,i=i+Math.imul(A,re)|0,n=(n=n+Math.imul(A,ie)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(C,oe)|0,o=o+Math.imul(C,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,i=i+Math.imul(_,le)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,le)|0,o=o+Math.imul(w,he)|0;var Ce=(c+(i=i+Math.imul(b,pe)|0)|0)+((8191&(n=(n=n+Math.imul(b,ve)|0)+Math.imul(g,pe)|0))<<13)|0;c=((o=o+Math.imul(g,ve)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,J),n=(n=Math.imul(B,Z))+Math.imul(N,J)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ie)|0,i=i+Math.imul(A,oe)|0,n=(n=n+Math.imul(A,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(C,ue)|0,o=o+Math.imul(C,ce)|0,i=i+Math.imul(T,le)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,le)|0,o=o+Math.imul(S,he)|0;var Pe=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ve)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ie)|0,i=i+Math.imul(R,oe)|0,n=(n=n+Math.imul(R,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,i=i+Math.imul(A,ue)|0,n=(n=n+Math.imul(A,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,i=i+Math.imul(M,le)|0,n=(n=n+Math.imul(M,he)|0)+Math.imul(C,le)|0,o=o+Math.imul(C,he)|0;var Ae=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,i=i+Math.imul(R,ue)|0,n=(n=n+Math.imul(R,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,i=i+Math.imul(A,le)|0,n=(n=n+Math.imul(A,he)|0)+Math.imul(k,le)|0,o=o+Math.imul(k,he)|0;var ke=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(C,pe)|0))<<13)|0;c=((o=o+Math.imul(C,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,i=i+Math.imul(R,le)|0,n=(n=n+Math.imul(R,he)|0)+Math.imul(O,le)|0,o=o+Math.imul(O,he)|0;var Ie=(c+(i=i+Math.imul(A,pe)|0)|0)+((8191&(n=(n=n+Math.imul(A,ve)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,ce))+Math.imul(N,ue)|0,o=Math.imul(N,ce),i=i+Math.imul(L,le)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(j,le)|0,o=o+Math.imul(j,he)|0;var Re=(c+(i=i+Math.imul(R,pe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ve)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(B,le),n=(n=Math.imul(B,he))+Math.imul(N,le)|0,o=Math.imul(N,he);var Oe=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var De=(c+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(N,pe)|0))<<13)|0;return c=((o=Math.imul(N,ve))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=me,u[1]=be,u[2]=ge,u[3]=ye,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Ee,u[10]=Me,u[11]=Ce,u[12]=Pe,u[13]=Ae,u[14]=ke,u[15]=Ie,u[16]=Re,u[17]=Oe,u[18]=De,0!==c&&(u[19]=c,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),b.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=b.prototype._countBits(e)-1,i=0;i>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},b.prototype.muln=function(e){return this.clone().imuln(e)},b.prototype.sqr=function(){return this.mul(this)},b.prototype.isqr=function(){return this.imul(this.clone())},b.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new b(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<o)for(this.length-=o,u=0;u>>n,c=f&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},b.prototype.ishrn=function(e,t,r){return m(0===this.negative),this.iushrn(e,t,r)},b.prototype.shln=function(e){return this.clone().ishln(e)},b.prototype.ushln=function(e){return this.clone().iushln(e)},b.prototype.shrn=function(e){return this.clone().ishrn(e)},b.prototype.ushrn=function(e){return this.clone().iushrn(e)},b.prototype.testn=function(e){m("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(m(-1===a),i=a=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},b.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new b(null)).length=1+s,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new b(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new b(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new b(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},b.prototype.div=function(e){return this.divmod(e,"div",!1).div},b.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},b.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},b.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},b.prototype.modn=function(e){m(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},b.prototype.idivn=function(e){m(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},b.prototype.divn=function(e){return this.clone().idivn(e)},b.prototype.egcd=function(e){m(0===e.negative),m(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new b(1),n=new b(0),o=new b(0),a=new b(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var f=0,l=1;0==(t.words[0]&l)&&f<26;++f,l<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},b.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},b.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},b._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new g;else if("p192"===e)t=new y;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return c[e]=t},w.prototype._verify1=function(e){m(0===e.negative,"red works only with positives"),m(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){m(0==(e.negative|t.negative),"red works only with positives"),m(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(m(t%2==1),3===t){var r=this.m.add(new b(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);m(!i.isZero());var o=new b(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new b(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,i),f=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),h=n;0!==l.cmp(o);){for(var d=l,p=0;0!==d.cmp(o);p++)d=d.redSqr();m(p>c&1;n!==r[0]&&(n=this.sqr(n)),0!=f||0!==o?(o<<=1,o|=f,(4===++a||0===i&&0===c)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},b.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new b(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^f[p>>>16&255]^l[v>>>8&255]^h[255&m]^t[b++],a=c[p>>>24]^f[v>>>16&255]^l[m>>>8&255]^h[255&d]^t[b++],s=c[v>>>24]^f[m>>>16&255]^l[d>>>8&255]^h[255&p]^t[b++],u=c[m>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&v]^t[b++],d=o,p=a,v=s,m=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[v>>>8&255]<<8|i[255&m])^t[b++],a=(i[p>>>24]<<24|i[v>>>16&255]<<16|i[m>>>8&255]<<8|i[255&d])^t[b++],s=(i[v>>>24]<<24|i[m>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[b++],u=(i[m>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&v])^t[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var l=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99;var f=e[i[r[a]=c]=a],l=e[f],h=e[l],d=257*e[c]^16843008*c;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=l[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[f>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[f>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&f]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),c=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),f=e("./ghash"),n=e("buffer-xor"),l=e("./incr32");function o(e,t,r,i){s.call(this);var n=c.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new f(o),r=function(e,t,r){if(12===t.length)return e._finID=c.concat([t,c.from([0,0,0,1])]),c.concat([t,c.from([0,0,0,2])]);var i=new f(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(c.alloc(o,0))),i.update(c.alloc(8,0));var a=8*n,s=c.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=c.from(e._finID);return l(u),u}(this,r,o),this._prev=c.from(r),this._cache=c.allocUnsafe(0),this._secCache=c.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=c.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=v(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=m[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=v.signature.decode(e,"der"),u=s.s,c=s.r;b(u,n),b(c,n);var f=d.mont(i),l=u.invm(n);return 0===o.toRed(f).redPow(new d(t).mul(l).mod(n)).fromRed().mul(a.toRed(f).redPow(c.mul(l).mod(n)).fromRed()).mod(i).mod(n).cmp(c)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(l.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=l.from(t,i)),l.isBuffer(t))return 0===t.length?-1:m(e,t,r,i,n);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var f=-1;for(o=r;o>>10&1023|55296),f=56320|1023&f),i.push(f),n+=l}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return y(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},l.prototype.compare=function(e,t,r,i,n){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),c=e.slice(t,r),f=0;fthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,c,f,l,h,d,p=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return h=t,d=r,j(D(e,(l=this).length-h),l,h,d);case"ascii":return g(this,e,t,r);case"latin1":case"binary":return g(this,e,t,r);case"base64":return u=this,c=t,f=r,j(L(e),u,c,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,j(function(e,t){for(var r,i,n,o=[],a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function P(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function A(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function k(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(e,t,r,i,n){return n||k(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function R(e,t,r,i,n){return n||k(e,0,r,8),o.write(e,t,r,i,52,8),r+8}l.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):A(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):A(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):A(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return I(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return I(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length>>2),i=0,n=0;i>5]|=128<>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a>>32-t}(v(v(t,e),v(i,o)),n),r)}function l(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function h(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),f=s.alloc(128);function l(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1];r=h.r28shl(r,o),i=h.r28shl(i,o),h.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],h.writeUInt32BE(r,o,i),h.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=l}h.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];h.expand(o,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];var f=h.substitute(u,c),l=o;o=(a^h.permute(f))>>>0,a=l}h.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),(t.exports=c).create=function(e){return new c(e)},c.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(f))for(;r.mod(l).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(m(i=r.shrn(1))&&m(r)&&b(i)&&b(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,E=n.getNAF,M=n.getJSF,l=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(n[-u-1>>1].neg()):0>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(T=a[m][-S-1>>1].neg()),y="affine"===T.type?y.mixedAdd(T):y.add(T))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),c=o.redMul(s),f=n.redMul(s),l=a.redMul(o);return this.curve.point(u,c,l,f)},f.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(n.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),l=o.redMul(u),h=a.redMul(s);return this.curve.point(c,f,h,l)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),c=n.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),l=i.redMul(u).redMul(f);return r=this.curve.twisted?(t=i.redMul(c).redMul(a.redSub(this.curve._mulA(o))),u.redMul(c)):(t=i.redMul(c).redMul(a.redSub(o)),this.curve._mulC(u).redMul(c)),this.curve.point(l,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,c,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=e,h=this.n.clone(),d=new w(1),p=new w(0),v=new w(0),m=new w(1),b=0;0!==l.cmpn(0);){var g=h.div(l);u=h.sub(g.mul(l)),c=v.sub(g.mul(d));var y=m.sub(g.mul(p));if(!i&&u.cmp(f)<0)t=s.neg(),r=d,i=u.neg(),n=c;else if(i&&2==++b)break;h=l,l=s=u,v=d,d=c,m=p,p=y}o=u.neg(),a=c;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),c=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),l=i.redMul(c),h=u.redSqr().redIAdd(f).redISub(l).redISub(l),d=u.redMul(l.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),l=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(l)).redISub(n.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(l,h,d)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var m=e("bn.js"),b=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),g=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new b({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new m(2));;){var n=new m(t.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var f=t.r.invm(n),l=n.sub(o).mul(f).umod(n),h=s.mul(f).umod(n);return this.g.mulAdd(l,a,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new g(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;if(f(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=f(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=f(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];l(i,t.length),(i=i.concat(t)).push(2),l(i,r.length);var n=i.concat(r),o=[48];return l(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),c=e("./signature");function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=f).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},f.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;ur&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(o=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var f=0,l=t;return f+=(l=l+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length>1,f=-7,l=r?n-1:0,h=r?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;0>=-f,f+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+l?h/u:h*Math.pow(2,1-l))*u&&(a++,u/=2),f<=a+l?(s=0,a=f):1<=a+l?(s=(t*u-1)*Math.pow(2,n),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function l(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=l(i=l(i=l(i=l(i=f(i=f(i=f(i=f(i=c(i=c(i=c(i=c(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=c(n,o=c(o,r=c(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=c(n,o=c(o,r=c(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=c(n,o=c(o,r=c(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=f(n,o=f(o,r=f(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=f(n,o=f(o,r=f(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=f(n,o=f(o,r=f(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=f(n,o=f(o,r=f(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=l(n,o=l(o,r=l(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=l(n,o=l(o,r=l(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=l(n,o=l(o,r=l(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=l(n,o=l(o,r=l(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var n=this._blockOffset;n>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var f=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=f,r.DSAparam=i.define("DSAparam",function(){this.int()});var l=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=l;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),c=i.define("RDNSequence",function(){this.seqof(u)}),f=i.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),l=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(f),this.key("validity").use(l),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(h){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,v=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,m=e("evp_bytestokey"),b=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new h(n[2],"hex"),s=new h(n[3].replace(/\r?\n/g,""),"base64"),u=m(t,a.slice(0,8),parseInt(n[1],10)).key,c=[],f=b.createDecipheriv(o,u,a);c.push(f.update(s)),c.push(f.final()),r=h.concat(c)}else{var l=i.match(v);r=new h(l[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(l){var s=t("./asn1"),h=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||l.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new l(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=h[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),c=d.createDecipheriv(n,u,o),f=[];return f.push(c.update(a)),f.push(c.final()),l.concat(f)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,c){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;in?t=i(t):t.lengtha||0<=new c(t).cmp(o.modulus))throw new Error("decryption error");n=r?v(new c(t),o):d(t,o);var s=new f(a-n.length);if(s.fill(0),n=f.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new f("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=h(o,l(a,n)),u=h(a,l(s,r-n-1));if(function(e,t){e=new f(e),t=new f(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(h){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),v=e("./mgf"),m=e("./xor"),b=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new h("")).digest(),o=n.length,a=2*o;if(r-a-2t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function f(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(y("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?m(l,e):l(e))}function l(e){y("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.highWaterMark||t.ended))return y("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):f(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return y("need readable",n),(0===t.length||t.length-e>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function g(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=v(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=m(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=b(i=d(i,10),n=b(n,o=m(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=g(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=g(o=d(o,10),a=g(a,r=g(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=g(r=d(r,10),i=g(i,n=g(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=g(n=d(n,10),o=g(o,a=g(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=g(a=d(a,10),r=g(r,i=g(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=g(i=d(i,10),n=g(n,o=g(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,c=this._c,f=this._d,l=this._e;l=g(l,s=g(s,u,c,f,l,e[5],1352829926,8),u,c=d(c,10),f,e[14],1352829926,9),u=g(u=d(u,10),c=g(c,f=g(f,l,s,u,c,e[7],1352829926,9),l,s=d(s,10),u,e[0],1352829926,11),f,l=d(l,10),s,e[9],1352829926,13),f=g(f=d(f,10),l=g(l,s=g(s,u,c,f,l,e[2],1352829926,15),u,c=d(c,10),f,e[11],1352829926,15),s,u=d(u,10),c,e[4],1352829926,5),s=g(s=d(s,10),u=g(u,c=g(c,f,l,s,u,e[13],1352829926,7),f,l=d(l,10),s,e[6],1352829926,7),c,f=d(f,10),l,e[15],1352829926,8),c=g(c=d(c,10),f=g(f,l=g(l,s,u,c,f,e[8],1352829926,11),s,u=d(u,10),c,e[1],1352829926,14),l,s=d(s,10),u,e[10],1352829926,14),l=b(l=d(l,10),s=g(s,u=g(u,c,f,l,s,e[3],1352829926,12),c,f=d(f,10),l,e[12],1352829926,6),u,c=d(c,10),f,e[6],1548603684,9),u=b(u=d(u,10),c=b(c,f=b(f,l,s,u,c,e[11],1548603684,13),l,s=d(s,10),u,e[3],1548603684,15),f,l=d(l,10),s,e[7],1548603684,7),f=b(f=d(f,10),l=b(l,s=b(s,u,c,f,l,e[0],1548603684,12),u,c=d(c,10),f,e[13],1548603684,8),s,u=d(u,10),c,e[5],1548603684,9),s=b(s=d(s,10),u=b(u,c=b(c,f,l,s,u,e[10],1548603684,11),f,l=d(l,10),s,e[14],1548603684,7),c,f=d(f,10),l,e[15],1548603684,7),c=b(c=d(c,10),f=b(f,l=b(l,s,u,c,f,e[8],1548603684,12),s,u=d(u,10),c,e[12],1548603684,7),l,s=d(s,10),u,e[4],1548603684,6),l=b(l=d(l,10),s=b(s,u=b(u,c,f,l,s,e[9],1548603684,15),c,f=d(f,10),l,e[1],1548603684,13),u,c=d(c,10),f,e[2],1548603684,11),u=m(u=d(u,10),c=m(c,f=m(f,l,s,u,c,e[15],1836072691,9),l,s=d(s,10),u,e[5],1836072691,7),f,l=d(l,10),s,e[1],1836072691,15),f=m(f=d(f,10),l=m(l,s=m(s,u,c,f,l,e[3],1836072691,11),u,c=d(c,10),f,e[7],1836072691,8),s,u=d(u,10),c,e[14],1836072691,6),s=m(s=d(s,10),u=m(u,c=m(c,f,l,s,u,e[6],1836072691,6),f,l=d(l,10),s,e[9],1836072691,14),c,f=d(f,10),l,e[11],1836072691,12),c=m(c=d(c,10),f=m(f,l=m(l,s,u,c,f,e[8],1836072691,13),s,u=d(u,10),c,e[12],1836072691,5),l,s=d(s,10),u,e[2],1836072691,14),l=m(l=d(l,10),s=m(s,u=m(u,c,f,l,s,e[10],1836072691,13),c,f=d(f,10),l,e[0],1836072691,13),u,c=d(c,10),f,e[4],1836072691,7),u=v(u=d(u,10),c=v(c,f=m(f,l,s,u,c,e[13],1836072691,5),l,s=d(s,10),u,e[8],2053994217,15),f,l=d(l,10),s,e[6],2053994217,5),f=v(f=d(f,10),l=v(l,s=v(s,u,c,f,l,e[4],2053994217,8),u,c=d(c,10),f,e[1],2053994217,11),s,u=d(u,10),c,e[3],2053994217,14),s=v(s=d(s,10),u=v(u,c=v(c,f,l,s,u,e[11],2053994217,14),f,l=d(l,10),s,e[15],2053994217,6),c,f=d(f,10),l,e[0],2053994217,14),c=v(c=d(c,10),f=v(f,l=v(l,s,u,c,f,e[5],2053994217,6),s,u=d(u,10),c,e[12],2053994217,9),l,s=d(s,10),u,e[2],2053994217,12),l=v(l=d(l,10),s=v(s,u=v(u,c,f,l,s,e[13],2053994217,9),c,f=d(f,10),l,e[9],2053994217,12),u,c=d(c,10),f,e[7],2053994217,5),u=p(u=d(u,10),c=v(c,f=v(f,l,s,u,c,e[10],2053994217,15),l,s=d(s,10),u,e[14],2053994217,8),f,l=d(l,10),s,e[12],0,8),f=p(f=d(f,10),l=p(l,s=p(s,u,c,f,l,e[15],0,5),u,c=d(c,10),f,e[10],0,12),s,u=d(u,10),c,e[4],0,9),s=p(s=d(s,10),u=p(u,c=p(c,f,l,s,u,e[1],0,12),f,l=d(l,10),s,e[5],0,5),c,f=d(f,10),l,e[8],0,14),c=p(c=d(c,10),f=p(f,l=p(l,s,u,c,f,e[7],0,6),s,u=d(u,10),c,e[6],0,8),l,s=d(s,10),u,e[2],0,13),l=p(l=d(l,10),s=p(s,u=p(u,c,f,l,s,e[13],0,6),c,f=d(f,10),l,e[14],0,5),u,c=d(c,10),f,e[0],0,15),u=p(u=d(u,10),c=p(c,f=p(f,l,s,u,c,e[3],0,13),l,s=d(s,10),u,e[9],0,11),f,l=d(l,10),s,e[11],0,11),f=d(f,10);var h=this._b+n+f|0;this._b=this._c+o+l|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=h},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,b=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,c=0|this._b,f=0|this._c,l=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var v=~~(p/20),m=0|((a=u)<<5|a>>>27)+(i=c,n=f,o=l,0===(r=v)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+h+s[p]+b[v];h=l,l=f,f=(t=c)<<30|t>>>2,c=u,u=m}this._a=u+this._a|0,this._b=c+this._b|0,this._c=f+this._c|0,this._d=l+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,g=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,f=0|this._b,l=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var v=0;v<80;++v){var m=~~(v/20),b=0|((s=c)<<5|s>>>27)+(n=f,o=l,a=h,0===(i=m)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[v]+g[m];d=h,h=l,l=(r=f)<<30|r>>>2,f=c,c=b}this._a=c+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,f=0|this._b,l=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,v=0|this._g,m=0|this._h,b=0;b<16;++b)u[b]=e.readInt32BE(4*b);for(;b<64;++b)u[b]=0|(((r=u[b-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[b-7]+(((t=u[b-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[b-16];for(var g=0;g<64;++g){var y=m+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=v)^d&(p^a))+w[g]+u[g]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=c)&(n=f)|l&(i|n));m=v,v=p,p=d,d=h+y|0,h=l,l=f,f=c,c=y+_|0}this._a=c+this._a|0,this._b=f+this._b|0,this._c=l+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=m+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,c=this._w,f=0|this._ah,l=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,v=0|this._fh,m=0|this._gh,b=0|this._hh,g=0|this._al,y=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,E=0|this._hl,M=0;M<32;M+=2)c[M]=e.readInt32BE(4*M),c[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var C=c[M-30],P=c[M-30+1],A=((s=C)>>>1|(u=P)<<31)^(s>>>8|u<<24)^s>>>7,k=((o=P)>>>1|(a=C)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);C=c[M-4],P=c[M-4+1];var I=((i=C)>>>19|(n=P)<<13)^(n>>>29|i<<3)^i>>>6,R=((t=P)>>>19|(r=C)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),O=c[M-14],D=c[M-14+1],L=c[M-32],j=c[M-32+1],F=k+D|0,B=A+O+oe(F,k)|0;B=(B=B+I+oe(F=F+R|0,R)|0)+L+oe(F=F+j|0,j)|0,c[M]=B,c[M+1]=F}for(var N=0;N<160;N+=2){B=c[N],F=c[N+1];var U=re(f,l,h),z=re(g,y,_),X=ie(f,g),q=ie(g,f),G=ne(p,x),H=ne(x,p),V=ee[N],W=ee[N+1],Y=te(p,v,m),K=te(x,T,S),J=E+H|0,Z=b+G+oe(J,E)|0;Z=(Z=(Z=Z+Y+oe(J=J+K|0,K)|0)+V+oe(J=J+W|0,W)|0)+B+oe(J=J+F|0,F)|0;var Q=q+z|0,$=X+U+oe(Q,q)|0;b=m,E=S,m=v,S=T,v=p,T=x,p=d+Z+oe(x=w+J|0,w)|0,d=h,w=_,h=l,_=y,l=f,y=g,f=Z+$+oe(g=J+Q|0,J)|0}this._al=this._al+g|0,this._bl=this._bl+y|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+f+oe(this._al,g)|0,this._bh=this._bh+l+oe(this._bl,y)|0,this._ch=this._ch+h+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+v+oe(this._fl,T)|0,this._gh=this._gh+m+oe(this._gl,S)|0,this._hh=this._hh+b+oe(this._hl,E)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var f=e("events").EventEmitter;function i(){f.call(this)}e("inherits")(i,f),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(c(),0===f.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r>2)*(r+3>>2)*8;case p:case v:case f:case m:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case b:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case g:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case y:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case I:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case R:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case O:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case E:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case M:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case C:case j:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case P:case F:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case A:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case k:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=l).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},l.prototype.dispose=function(){this.data=null},l.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[V]&z&&(n=Math.max(1,t[K]));var o=t[Y],a=t[W],s=t[H]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},l.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Ee);if(new Uint32Array(e.slice(0,4))!=Me)throw"Invalid magic number in ASTC header";for(var r=[b,g,y,_,w,x,T,S,E,M,C,P,A,k],i=e.byteLength-Ee,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,c=0;c 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(h.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new h.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),c=t,f=u,l=this._quality-1,h=0;h threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(h.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:h.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),n=function(t){function e(e){void 0===e&&(e=8),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(h.Filter),o=function(t){function e(e){void 0===e&&(e={}),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/h.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*h.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return h.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return h.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(h.Filter),a=h.filters,c=a.BlurXFilter,f=a.BlurYFilter,l=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=h.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof h.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new c(n,t,r,i),this.blurYFilter=new f(o,t,r,i),this.blurYFilter.blendMode=h.BLEND_MODES.SCREEN,this.defaultFilter=new l}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(h.Filter),v=function(i){function e(e,t,r){i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(h.Filter),m=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof h.Texture||(e=h.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?h.SCALE_MODES.NEAREST:h.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(h.Filter),b=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=h.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=h.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(h.Filter),g=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(h.Filter),y=function(e){function t(){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(h.Filter),_=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(h.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),x=function(l){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:h.settings.RESOLUTION},e),l.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new h.Filter("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new h.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,c=e.alpha,f=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=c,this.color=f,this._updatePadding()}l&&(e.__proto__=l);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(l&&l.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/h.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*h.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return h.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){h.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),T=function(t){function e(e){void 0===e&&(e=5),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(h.Filter),S=function(t){function e(e){void 0===e&&(e={}),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","// precision highp float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=h.Texture.fromCanvas(this._canvas,h.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(h.Filter),k=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return h.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){h.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(h.Filter);k.MIN_SAMPLES=1,k.MAX_SAMPLES=100;var I=function(t){function e(e){void 0===e&&(e=10),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(h.Filter),R=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),O=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(h.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(h.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),j=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=h.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(h.Filter),F=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new h.Point(0,window.innerHeight/2),this.uniforms.end=i||new h.Point(600,window.innerHeight/2),this.uniforms.delta=new h.Point(30,30),this.uniforms.texSize=new h.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(h.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(F),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(F),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(h.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=v,e.ColorMapFilter=m,e.ColorReplaceFilter=b,e.ConvolutionFilter=g,e.CrossHatchFilter=y,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=E,e.GodrayFilter=M,e.KawaseBlurFilter=d,e.MotionBlurFilter=C,e.MultiColorReplaceFilter=P,e.OldFilmFilter=A,e.OutlineFilter=k,e.PixelateFilter=I,e.RadialBlurFilter=R,e.ReflectionFilter=O,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=j,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=F,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,m){"use strict";var h,p=function(){function h(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return h.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new h("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var c=h.hexToRGB(n.value),f=h.hexToRGB(a.value),l={r:(f.r-c.r)*u+c.r,g:(f.g-c.g)*u+c.g,b:(f.b-c.b)*u+c.b};i.next=new p(l,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var f,l=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new m.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new m.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||m.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var c=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+c)/2*e,this.rotationSpeed=c}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=m.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||m.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,c=r.y-i.y,f=r.y-e.y,l=o*c-u*a;if(Math.abs(l)<1e-7)return n.x=o,n.y=u,0;var h=(s*c-f*a)/l,d=(o*f-u*s)/l;return d<1e-6||-1e-6=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=O.utils.nextPow2(this.currentIndex),a=O.utils.log2(o),s=this.buffers[a],u=this.sprites,c=this.groups,f=s.float32View,l=s.uint32View,h=0,d=null,p=1,v=0,m=c[0],b=I[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(m.textureCount=0,m.start=0,m.blend=b,R++,r=0;rt[s]&&(i=t[s]),ot[s+1]&&(n=t[s+1]),ah[c]){u=l[s];l[s]=l[c],l[c]=u;var f=h[s];h[s]=h[c],h[c]=f}if(t[0]=l[0].x,t[1]=l[0].y,t[2]=l[1].x,t[3]=l[1].y,t[4]=l[2].x,t[5]=l[2].y,t[6]=l[3].x,t[7]=l[3].y,(l[3].x-l[2].x)*(l[1].y-l[2].y)-(l[1].x-l[2].x)*(l[3].y-l[2].y)<0)return t[4]=l[3].x,void(t[5]=l[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,f=0;f<4;f++)e[r]=a[2*f],e[r+1]=a[2*f+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,f=0;f<4;f++)e[r]=a[2*f],e[r+1]=a[2*f+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,c=t[0].x*(1-o)+t[1].x*o,f=t[0].y*(1-o)+t[1].y*o,l=t[3].x*(1-i)+t[2].x*i,h=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,v=s*(1-n)+l*n,m=u*(1-n)+h*n,b=c*(1-n)+d*n,g=f*(1-n)+p*n,y=s*(1-a)+l*a,_=u*(1-a)+h*a,w=c*(1-a)+d*a,x=f*(1-a)+p*a,T=S;return T.tx=v,T.ty=m,T.a=b-v,T.b=g-m,T.c=y-v,T.d=_-m,E.set(w,x),T.applyInverse(E,E),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,b=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new b;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],f=r[7],l=r[2],h=r[5],d=r[8],p=(d*c-f*h)*i+(-d*a+s*h)*n+(f*a-s*c),v=(-d*u+f*l)*i+(d*o-s*l)*n+(-f*o+s*u),m=(h*u-c*l)*i+(-h*o+a*l)*n+(c*o-a*u);return t.x=p/m,t.y=v/m,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],f=c*o-a*u,l=-c*n+a*s,h=u*n-o*s,d=t*f+r*l+i*h;return d&&(d=1/d,e[0]=f*d,e[1]=(-c*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=l*d,e[4]=(c*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=h*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0=r&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(b||m.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return b||m.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(R.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==h&&e[0]&&(e[0]===h||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?J[L.defaultOverwrite]:"number"==typeof s?s>>0:J[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=m.frame+(parseInt(L.autoSleep,10)||120),W){for(e=(t=W[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete W[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===m._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||m.sleep()}}},m.addEventListener("tick",R._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(W[o||(e._gsTweenID=o="t"+Y++)]||(W[o]={target:e,tweens:[]}),t&&((i=W[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return W[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;of&&((d||!s._initted)&&f-s._startTime<=2e-8||(l[h++]=s)));for(o=h;-1<--o;)if(u=(s=l[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?y:(o+=e.totalDuration()/e._timeScale/n)>t+y?0:o-t-y};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,c=!!a.immediateRender,f=a.ease,l=this._startAt;if(a.startAt){for(i in l&&(l.render(-1,!0),l.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=c&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),c)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(V[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=h._gsQueue){for(r=0;r@~]/g,"\\$&").replace(/\n/g,"A")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getCommonAncestor=function(e){var t=(1 /g,">").split(/\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/);if(i.length<2)return h("",e,"",t);var n=[i.pop()];for(;1/g,"> ").trim()};var i,n=r(3),l=(i=n)&&i.__esModule?i:{default:i},f=r(0);function h(r,i,n,o){if(r.length&&(r+=" "),n.length&&(n=" "+n),/\[*\]/.test(i)){var e=i.replace(/=.*$/,"]"),a=""+r+e+n;if(b(document.querySelectorAll(a),o))i=e;else for(var s=document.querySelectorAll(""+r+e),t=function(){var t=s[u];if(o.some(function(e){return t.contains(e)})){var e=t.tagName.toLowerCase();return a=""+r+e+n,b(document.querySelectorAll(a),o)&&(i=e),"break"}},u=0,c=s.length;u/.test(i)){var l=i.replace(/>/,"");a=""+r+l+n;b(document.querySelectorAll(a),o)&&(i=l)}if(/:nth-child/.test(i)){var f=i.replace(/nth-child/g,"nth-of-type");a=""+r+f+n;b(document.querySelectorAll(a),o)&&(i=f)}if(/\.\S+\.\S+/.test(i)){for(var h=i.trim().split(".").slice(1).map(function(e){return"."+e}).sort(function(e,t){return e.length-t.length});h.length;){var d=i.replace(h.shift(),"").trim();if(!(a=(""+r+d+n).trim()).length||">"===a.charAt(0)||">"===a.charAt(a.length-1))break;b(document.querySelectorAll(a),o)&&(i=d)}if((h=i&&i.match(/\./g))&&2/.test(s):c=function(t){return function(e){return e(t.parent)&&t.parent}};break;case/^\./.test(s):var r=s.substr(1).split(".");u=function(e){var t=e.attribs.class;return t&&r.every(function(e){return-1)(\S)/g,"$1 $2").trim()),t=i.shift(),n=i.length;return t(this).filter(function(e){for(var t=0;t\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=o.console&&(o.console.warn||o.console.log);return r&&r.call(o.console,n,t),i.apply(this,arguments)}}a="function"!=typeof Object.assign?function(e){if(e===f||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;rt[r]}):i.sort()),i}function C(e,t){for(var r,i,n=t[0].toUpperCase()+t.slice(1),o=0;oh(c.y)?c.x:c.y,t.scale=a?function(e,t){return ie(t[0],t[1],K)/ie(e[0],e[1],K)}(a.pointers,i):1,t.rotation=a?function(e,t){return ne(t[1],t[0],K)+ne(e[1],e[0],K)}(a.pointers,i):0,t.maxPointers=r.prevInput?t.pointers.length>r.prevInput.maxPointers?t.pointers.length:r.prevInput.maxPointers:t.pointers.length,function(e,t){var r,i,n,o,a=e.lastInterval||t,s=t.timeStamp-a.timeStamp;if(t.eventType!=U&&(Fh(l.y)?l.x:l.y,o=re(u,c),e.lastInterval=t}else r=a.velocity,i=a.velocityX,n=a.velocityY,o=a.direction;t.velocity=r,t.velocityX=i,t.velocityY=n,t.direction=o}(r,t);var l=e.element;T(t.srcEvent.target,l)&&(l=t.srcEvent.target);t.target=l}(e,r),e.emit("hammer.input",r),e.recognize(r),e.session.prevInput=r}function $(e){for(var t=[],r=0;r=h(t)?e<0?X:W:t<0?q:H}function ie(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return Math.sqrt(i*i+n*n)}function ne(e,t,r){r||(r=J);var i=t[r[0]]-e[r[0]],n=t[r[1]]-e[r[1]];return 180*Math.atan2(n,i)/Math.PI}Z.prototype={handler:function(){},init:function(){this.evEl&&w(this.element,this.evEl,this.domHandler),this.evTarget&&w(this.target,this.evTarget,this.domHandler),this.evWin&&w(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(O(this.element),this.evWin,this.domHandler)}};var oe={mousedown:B,mousemove:2,mouseup:N},ae="mousedown",se="mousemove mouseup";function ue(){this.evEl=ae,this.evWin=se,this.pressed=!1,Z.apply(this,arguments)}m(ue,Z,{handler:function(e){var t=oe[e.type];t&B&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=N),this.pressed&&(t&N&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:j,srcEvent:e}))}});var ce={pointerdown:B,pointermove:2,pointerup:N,pointercancel:U,pointerout:U},le={2:L,3:"pen",4:j,5:"kinect"},fe="pointerdown",he="pointermove pointerup pointercancel";function de(){this.evEl=fe,this.evWin=he,Z.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}o.MSPointerEvent&&!o.PointerEvent&&(fe="MSPointerDown",he="MSPointerMove MSPointerUp MSPointerCancel"),m(de,Z,{handler:function(e){var t=this.store,r=!1,i=e.type.toLowerCase().replace("ms",""),n=ce[i],o=le[e.pointerType]||e.pointerType,a=o==L,s=M(t,e.pointerId,"pointerId");n&B&&(0===e.button||a)?s<0&&(t.push(e),s=t.length-1):n&(N|U)&&(r=!0),s<0||(t[s]=e,this.callback(this.manager,n,{pointers:t,changedPointers:[e],pointerType:o,srcEvent:e}),r&&t.splice(s,1))}});var pe={touchstart:B,touchmove:2,touchend:N,touchcancel:U};function ve(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Z.apply(this,arguments)}m(ve,Z,{handler:function(e){var t=pe[e.type];if(t===B&&(this.started=!0),this.started){var r=function(e,t){var r=P(e.touches),i=P(e.changedTouches);t&(N|U)&&(r=k(r.concat(i),"identifier",!0));return[r,i]}.call(this,e,t);t&(N|U)&&r[0].length-r[1].length==0&&(this.started=!1),this.callback(this.manager,t,{pointers:r[0],changedPointers:r[1],pointerType:L,srcEvent:e})}}});var be={touchstart:B,touchmove:2,touchend:N,touchcancel:U},me="touchstart touchmove touchend touchcancel";function ye(){this.evTarget=me,this.targetIds={},Z.apply(this,arguments)}m(ye,Z,{handler:function(e){var t=be[e.type],r=function(e,t){var r=P(e.touches),i=this.targetIds;if(t&(2|B)&&1===r.length)return i[r[0].identifier]=!0,[r,r];var n,o,a=P(e.changedTouches),s=[],u=this.target;if(o=r.filter(function(e){return T(e.target,u)}),t===B)for(n=0;nt.threshold&&n&t.direction},attrTest:function(e){return je.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=De(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),m(Be,je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){if(1!==e.scale){var t=e.scale<1?"in":"out";e.additionalEvent=this.options.event+t}this._super.emit.call(this,e)}}),m(Ne,Ie,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distancet.time;if(this._input=e,!i||!r||e.eventType&(N|U)&&!n)this.reset();else if(e.eventType&B)this.reset(),this._timer=c(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&N)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&N?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=d(),this.manager.emit(this.options.event,this._input)))}}),m(Ue,je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Me]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),m(ze,je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:G|V,pointers:1},getTouchAction:function(){return Fe.prototype.getTouchAction.call(this)},attrTest:function(e){var t,r=this.options.direction;return r&(G|V)?t=e.overallVelocity:r&G?t=e.overallVelocityX:r&V&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&r&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&h(t)>this.options.velocity&&e.eventType&N},emit:function(e){var t=De(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),m(Xe,Ie,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ee]},process:function(e){var t=this.options,r=e.pointers.length===t.pointers,i=e.distance>31;return(e^t)-t},r.min=function(e,t){return t^(e^t)&-(e>>=t))<<3,t|=r=(15<(e>>>=r))<<2,(t|=r=(3<(e>>>=r))<<1)|(e>>>=r)>>1},r.log10=function(e){return 1e9<=e?9:1e8<=e?8:1e7<=e?7:1e6<=e?6:1e5<=e?5:1e4<=e?4:1e3<=e?3:100<=e?2:10<=e?1:0},r.popCount=function(e){return 16843009*((e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135)>>>24},r.countTrailingZeros=i,r.nextPow2=function(e){return e+=0===e,--e,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)+1},r.prevPow2=function(e){return e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,(e|=e>>>16)-(e>>>1)},r.parity=function(e){return e^=e>>>16,e^=e>>>8,e^=e>>>4,27030>>>(e&=15)&1};var n=new Array(256);!function(e){for(var t=0;t<256;++t){var r=t,i=t,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;e[t]=i<>>8&255]<<16|n[e>>>16&255]<<8|n[e>>>24&255]},r.interleave2=function(e,t){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))<<1},r.deinterleave2=function(e,t){return(e=65535&((e=16711935&((e=252645135&((e=858993459&((e=e>>>t&1431655765)|e>>>1))|e>>>2))|e>>>4))|e>>>16))<<16>>16},r.interleave3=function(e,t,r){return e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2),(e|=(t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(e,t){return(e=1023&((e=4278190335&((e=251719695&((e=3272356035&((e=e>>>t&1227133513)|e>>>2))|e>>>4))|e>>>8))|e>>>16))<<22>>22},r.nextCombination=function(e){var t=e|e-1;return 1+t|(~t&-~t)-1>>>i(e)+1}},{}],2:[function(e,t,r){"use strict";function i(e,t,r){r=r||2;var i,n,o,a,s,u,c,l=t&&t.length,f=l?t[0]*r:e.length,h=v(e,0,f,r,!0),d=[];if(!h||h.next===h.prev)return d;if(l&&(h=function(e,t,r,i){var n,o,a,s,u,c=[];for(n=0,o=t.length;n80*r){i=o=e[0],n=a=e[1];for(var p=r;po.x?n.x>a.x?n.x:a.x:o.x>a.x?o.x:a.x,l=n.y>o.y?n.y>a.y?n.y:a.y:o.y>a.y?o.y:a.y,f=_(s,u,t,r,i),h=_(c,l,t,r,i),d=e.prevZ,p=e.nextZ;d&&d.z>=f&&p&&p.z<=h;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=f;){if(d!==e.prev&&d!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=h;){if(p!==e.prev&&p!==e.next&&x(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function h(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!s(n,o)&&p(n,i,i.next,o)&&S(n,o)&&S(o,n)&&(t.push(n.i/r),t.push(i.i/r),t.push(o.i/r),M(i),M(i.next),i=e=o),i=i.next}while(i!==e);return i}function d(e,t,r,i,n,o){var a,s,u=e;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(s=c,(a=u).next.i!==s.i&&a.prev.i!==s.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&p(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(a,s)&&S(a,s)&&S(s,a)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==e;);return i}(a,s))){var l=E(u,c);return u=b(u,u.next),l=b(l,l.next),m(u,t,r,i,n,o),void m(l,t,r,i,n,o)}c=c.next}u=u.next}while(u!==e)}function y(e,t){return e.x-t.x}function g(e,t){if(t=function(e,t){var r,i=t,n=e.x,o=e.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a=i.x&&i.x>=l&&n!==i.x&&x(or.x)&&S(i,e)&&(r=i,h=u),i=i.next;return r}(e,t)){var r=E(t,e);b(r,r.next)}}function _(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*n)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*n)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){for(var t=e,r=e;t.x=e.byteLength?i.bufferSubData(this.type,t,e):i.bufferData(this.type,e,this.drawType),this.data=e},o.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},o.createVertexBuffer=function(e,t,r){return new o(e,e.ARRAY_BUFFER,t,r)},o.createIndexBuffer=function(e,t,r){return new o(e,e.ELEMENT_ARRAY_BUFFER,t,r)},o.create=function(e,t,r,i){return new o(e,t,r,i)},o.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},t.exports=o},{}],10:[function(e,t,r){var a=e("./GLTexture"),s=function(e,t,r){this.gl=e,this.framebuffer=e.createFramebuffer(),this.stencil=null,this.texture=null,this.width=t||100,this.height=r||100};s.prototype.enableTexture=function(e){var t=this.gl;this.texture=e||new a(t),this.texture.bind(),this.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var e=this.gl;this.stencil=e.createRenderbuffer(),e.bindRenderbuffer(e.RENDERBUFFER,this.stencil),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,this.stencil),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(e,t,r,i){this.bind();var n=this.gl;n.clearColor(e,t,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,null)},s.prototype.resize=function(e,t){var r=this.gl;this.width=e,this.height=t,this.texture&&this.texture.uploadData(null,e,t),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,e,t))},s.prototype.destroy=function(){var e=this.gl;this.texture&&this.texture.destroy(),e.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(e,t,r,i){var n=a.fromData(e,null,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(e,t,r,i){var n=new a.fromData(e,i,t,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(e,t,r);return o.enableTexture(n),o.unbind(),o},t.exports=s},{"./GLTexture":12}],11:[function(e,t,r){var o=e("./shader/compileProgram"),a=e("./shader/extractAttributes"),s=e("./shader/extractUniforms"),u=e("./shader/setPrecision"),c=e("./shader/generateUniformAccessObject"),i=function(e,t,r,i,n){this.gl=e,i&&(t=u(t,i),r=u(r,i)),this.program=o(e,t,r,n),this.attributes=a(e,this.program),this.uniformData=s(e,this.program),this.uniforms=c(e,this.uniformData)};i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},t.exports=i},{"./shader/compileProgram":17,"./shader/extractAttributes":19,"./shader/extractUniforms":20,"./shader/generateUniformAccessObject":21,"./shader/setPrecision":25}],12:[function(e,t,r){var o=function(e,t,r,i,n){this.gl=e,this.texture=e.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=t||-1,this.height=r||-1,this.format=i||e.RGBA,this.type=n||e.UNSIGNED_BYTE},n=!(o.prototype.upload=function(e){this.bind();var t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=e.videoWidth||e.width,i=e.videoHeight||e.height;i!==this.height||r!==this.width?t.texImage2D(t.TEXTURE_2D,0,this.format,this.format,this.type,e):t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.format,this.type,e),this.width=r,this.height=i});o.prototype.uploadData=function(e,t,r){this.bind();var i=this.gl;if(e instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),t!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,t,r,0,this.format,this.type,e||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,t,r,this.format,this.type,e||null),this.width=t,this.height=r},o.prototype.bind=function(e){var t=this.gl;void 0!==e&&t.activeTexture(t.TEXTURE0+e),t.bindTexture(t.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var e=this.gl;e.bindTexture(e.TEXTURE_2D,null)},o.prototype.minFilter=function(e){var t=this.gl;this.bind(),this.mipmap?t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR_MIPMAP_LINEAR:t.NEAREST_MIPMAP_NEAREST):t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.magFilter=function(e){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,e?t.LINEAR:t.NEAREST)},o.prototype.enableMipmap=function(){var e=this.gl;this.bind(),this.mipmap=!0,e.generateMipmap(e.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.MIRRORED_REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(e,t,r){var i=new o(e);return i.premultiplyAlpha=r||!1,i.upload(t),i},o.fromData=function(e,t,r,i){var n=new o(e);return n.uploadData(t,r,i),n},t.exports=o},{}],13:[function(e,t,r){var n=e("./setVertexAttribArrays");function i(e,t){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=t,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=e.getParameter(e.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=e,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(t.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var e=this.gl,t=null,r=0;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=y-g,S=Math.floor,E=String.fromCharCode;function M(e){throw new RangeError(f[e])}function d(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function p(e,t){var r=e.split("@"),i="";return 1>>10&1023|55296),e=56320|1023&e),t+=E(e)}).join("")}function C(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var i=0;for(e=r?S(e/s):e>>1,e+=S(e/t);h*_>>1S((m-p)/a))&&M("overflow"),p+=u*a,!(u<(c=s<=b?g:b+_<=s?_:s-b));s+=y)a>S(m/(l=y-c))&&M("overflow"),a*=l;b=A(p-o,t=h.length+1,0==o),S(p/t)>m-v&&M("overflow"),v+=S(p/t),p%=t,h.splice(p++,0,v)}return k(h)}function b(e){var t,r,i,n,o,a,s,u,c,l,f,h,d,p,v,b=[];for(h=(e=P(e)).length,t=x,o=w,a=r=0;aS((m-r)/(d=i+1))&&M("overflow"),r+=(s-t)*d,t=s,a=0;am&&M("overflow"),f==t){for(u=r,c=y;!(u<(l=c<=o?g:o+_<=c?_:c-o));c+=y)v=u-l,p=y-l,b.push(E(C(l+v%p,0))),u=S(v/p);b.push(E(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++t}return b.join("")}if(n={version:"1.4.1",ucs2:{decode:P,encode:k},decode:v,encode:b,toASCII:function(e){return p(e,function(e){return c.test(e)?"xn--"+b(e):e})},toUnicode:function(e){return p(e,function(e){return u.test(e)?v(e.slice(4).toLowerCase()):e})}},t&&r)if(I.exports==t)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(t[o]=n[o]);else e.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s,u,c=e.length;0>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(e.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var a=0;a",'"',"`"," ","\r","\n","\t"]),F=["'"].concat(n),B=["%","/","?",";","#"].concat(F),N=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,z=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,X={javascript:!0,"javascript:":!0},W={javascript:!0,"javascript:":!0},q={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},H=e("querystring");function o(e,t,r){if(e&&D.isObject(e)&&e instanceof P)return e;var i=new P;return i.parse(e,t,r),i}P.prototype.parse=function(e,t,r){if(!D.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&ithis.renderer.width&&(e.width=this.renderer.width-e.x),e.y+e.height>this.renderer.height&&(e.height=this.renderer.height-e.y)},r.prototype.addChild=function(e){var t=this.pool.pop();t||((t=document.createElement("button")).style.width="100px",t.style.height="100px",t.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=2,t.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],47:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("../math");var n=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null}return e.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},e.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},e.prototype.getRectangle=function(e){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((e=e||new i.Rectangle(0,0,1,1)).x=this.minX,e.y=this.minY,e.width=this.maxX-this.minX,e.height=this.maxY-this.minY,e)},e.prototype.addPoint=function(e){this.minX=Math.min(this.minX,e.x),this.maxX=Math.max(this.maxX,e.x),this.minY=Math.min(this.minY,e.y),this.maxY=Math.max(this.maxY,e.y)},e.prototype.addQuad=function(e){var t=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=e[0],a=e[1];t=oi?e.maxX:i,this.maxY=e.maxY>n?e.maxY:n},e.prototype.addBoundsMask=function(e,t){var r=e.minX>t.minX?e.minX:t.minX,i=e.minY>t.minY?e.minY:t.minY,n=e.maxXt.x?e.minX:t.x,i=e.minY>t.y?e.minY:t.y,n=e.maxXthis.children.length)throw new Error(e+"addChildAt: The index "+t+" supplied is out of bounds "+this.children.length);return e.parent&&e.parent.removeChild(e),e.parent=this,e.transform._parentID=-1,this.children.splice(t,0,e),this._boundsID++,this.onChildrenChange(t),e.emit("added",this),e},t.prototype.swapChildren=function(e,t){if(e!==t){var r=this.getChildIndex(e),i=this.getChildIndex(t);this.children[r]=t,this.children[i]=e,this.onChildrenChange(r=this.children.length)throw new Error("The index "+t+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(e);(0,a.removeItems)(this.children,r,1),this.children.splice(t,0,e),this.onChildrenChange(t)},t.prototype.getChildAt=function(e){if(e<0||e>=this.children.length)throw new Error("getChildAt: Index ("+e+") does not exist.");return this.children[e]},t.prototype.removeChild=function(e){var t=arguments.length;if(1T.CURVES.maxSegments&&(t=T.CURVES.maxSegments),t},T.prototype.lineStyle=function(){var e=0>16&255)/255,r=(e.tint>>8&255)/255,i=(255&e.tint)/255,n=0;n>16&255)/255*t*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255,o._lineTint=((s>>16&255)/255*t*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255}},t.prototype.renderPolygon=function(e,t,r){r.moveTo(e[0],e[1]);for(var i=1;i=this.x&&e=this.y&&t=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){if(t>=this.y+this.radius&&t<=this.y+this.height-this.radius||e>=this.x+this.radius&&e<=this.x+this.width-this.radius)return!0;var r=e-(this.x+this.radius),i=t-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=e-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=t-(this.y+this.height-this.radius))*i<=n)return!0;if((r=e-(this.x+this.radius))*r+i*i<=n)return!0}return!1},o}();r.default=i},{"../../const":46}],76:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rthis.checkCountMax&&(this.checkCount=0,this.run()))},t.prototype.run=function(){for(var e=this.renderer.textureManager,t=e._managedTextures,r=!1,i=0;ithis.maxIdle&&(e.destroyTexture(n,!0),r=!(t[i]=null))}if(r){for(var o=0,a=0;a 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")}}]),n}();r.default=l},{"../../../const":46,"../../../settings":101,"../../../utils":125,"./extractUniformsFromSrc":87}],87:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e,t,r){var i=o(e),n=o(t);return Object.assign(i,n)};var i,n=e("pixi-gl-core");var f=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(e){for(var t=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=e.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&l.x=n&&l.y>16)+(65280&e)+((255&e)<<16)}},{key:"texture",get:function(){return this._texture},set:function(e){this._texture!==e&&(this._texture=e||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,e&&(e.baseTexture.hasLoaded?this._onTextureUpdate():e.once("update",this._onTextureUpdate,this)))}}]),i}(i.default);r.default=f},{"../const":46,"../display/Container":48,"../math":70,"../textures/Texture":115,"../utils":125}],103:[function(e,t,r){"use strict";r.__esModule=!0;var i=n(e("../../renderers/canvas/CanvasRenderer")),l=e("../../const"),f=e("../../math"),h=n(e("./CanvasTinter"));function n(e){return e&&e.__esModule?e:{default:e}}var d=new f.Matrix,o=function(){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.renderer=e}return t.prototype.render=function(e){var t=e._texture,r=this.renderer,i=t._frame.width,n=t._frame.height,o=e.transform.worldTransform,a=0,s=0;if(!(t.orig.width<=0||t.orig.height<=0)&&t.baseTexture.source&&(r.setBlendMode(e.blendMode),t.valid)){r.context.globalAlpha=e.worldAlpha;var u=t.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),s=t.trim?(a=t.trim.width/2+t.trim.x-e.anchor.x*t.orig.width,t.trim.height/2+t.trim.y-e.anchor.y*t.orig.height):(a=(.5-e.anchor.x)*t.orig.width,(.5-e.anchor.y)*t.orig.height),t.rotate&&(o.copy(d),o=d,f.GroupD8.matrixAppendRotationInv(o,t.rotate,a,s),s=a=0),a-=i/2,s-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),a|=0,s|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var c=t.baseTexture.resolution;16777215!==e.tint?(e.cachedTint===e.tint&&e.tintedTexture.tintId===e._texture._updateID||(e.cachedTint=e.tint,e.tintedTexture=h.default.getTintedTexture(e,e.tint)),r.context.drawImage(e.tintedTexture,0,0,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(t.baseTexture.source,t._frame.x*c,t._frame.y*c,i*c,n*c,a*r.resolution,s*r.resolution,i*r.resolution,n*r.resolution)}},t.prototype.destroy=function(){this.renderer=null},t}();r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":46,"../../math":70,"../../renderers/canvas/CanvasRenderer":77,"./CanvasTinter":104}],104:[function(e,t,r){"use strict";r.__esModule=!0;var i,d=e("../../utils"),n=e("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var s={getTintedTexture:function(e,t){var r=e._texture,i="#"+("00000"+(0|(t=s.roundColor(t))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=s.canvas||document.createElement("canvas");if(s.tintMethod(r,t,o),o.tintId=r._updateID,s.convertTintToImage){var a=new Image;a.src=o.toDataURL(),r.tintCache[i]=a}else r.tintCache[i]=o,s.canvas=null;return o},tintWithMultiply:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|t).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(e,t,r){var i=r.getContext("2d"),n=e._frame.clone(),o=e.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(e.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var a=(0,d.hex2rgb)(t),s=a[0],u=a[1],c=a[2],l=i.getImageData(0,0,n.width,n.height),f=l.data,h=0;h=this.size&&this.flush(),e._texture._uvs&&(this.sprites[this.currentIndex++]=e)},o.prototype.flush=function(){if(0!==this.currentIndex){var e=this.renderer.gl,t=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,a=this.groups,s=n.float32View,u=n.uint32View,c=this.boundTextures,l=this.renderer.boundTextures,f=this.renderer.textureGC.count,h=0,d=void 0,p=void 0,v=1,b=0,m=a[0],y=void 0,g=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];m.textureCount=0,m.start=0,m.blend=_,z++;var w=void 0;for(w=0;w=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var a=o;this.animations[t].push(this.textures[a])}}},f.prototype._parseComplete=function(){var e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)},f.prototype._nextBatch=function(){var e=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){e._batchIndex*f.BATCH_SIZEthis.baseTexture.width,a=r+n>this.baseTexture.height;if(o||a){var s=o&&a?"and":"or",u="X: "+t+" + "+i+" = "+(t+i)+" > "+this.baseTexture.width,c="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+s+" "+c)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=e),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(e){this._rotate=e,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),u}(s.default);function d(e){e.destroy=function(){},e.on=function(){},e.once=function(){},e.emit=function(){}}(r.default=h).EMPTY=new h(new o.default),d(h.EMPTY),d(h.EMPTY.baseTexture),h.WHITE=function(){var e=document.createElement("canvas");e.width=10,e.height=10;var t=e.getContext("2d");return t.fillStyle="white",t.fillRect(0,0,10,10),new h(new o.default(e))}(),d(h.WHITE),d(h.WHITE.baseTexture)},{"../math":70,"../settings":101,"../utils":125,"./BaseTexture":112,"./TextureUvs":117,"./VideoBaseTexture":118,eventemitter3:3}],116:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=function(){function i(e,t){for(var r=0;rt.priority){e.connect(r);break}t=(r=t).next}e.previous||e.connect(r)}else e.connect(r);return this._startIfPossible(),this},e.prototype.remove=function(e,t){for(var r=this._head.next;r;)r=r.match(e,t)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},e.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},e.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},e.prototype.destroy=function(){this.stop();for(var e=this._head.next;e;)e=e.destroy(!0);this._head.destroy(),this._head=null},e.prototype.update=function(){var e=0this.lastTime){(t=this.elapsedMS=e-this.lastTime)>this._maxElapsedMS&&(t=this._maxElapsedMS),this.deltaTime=t*n.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=e},i(e,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(e){var t=Math.min(Math.max(0,e)/1e3,n.default.TARGET_FPMS);this._maxElapsedMS=1/t}}]),e}();r.default=u},{"../const":46,"../settings":101,"./TickerListener":120}],120:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function n(e){var t=1>16&255)/255,t[1]=(e>>8&255)/255,t[2]=(255&e)/255,t},r.hex2string=function(e){return e=e.toString(16),"#"+(e="000000".substr(0,6-e.length)+e)},r.rgb2hex=function(e){return(255*e[0]<<16)+(255*e[1]<<8)+(255*e[2]|0)},r.getResolutionOfUrl=function(e,t){var r=n.default.RETINA_PREFIX.exec(e);if(r)return parseFloat(r[1]);return void 0!==t?t:1},r.decomposeDataUri=function(e){var t=i.DATA_URI.exec(e);if(t)return{mediaType:t[1]?t[1].toLowerCase():void 0,subType:t[2]?t[2].toLowerCase():void 0,charset:t[3]?t[3].toLowerCase():void 0,encoding:t[4]?t[4].toLowerCase():void 0,data:t[5]};return},r.getUrlFileExtension=function(e){var t=i.URL_FILE_EXTENSION.exec(e);if(t)return t[1].toLowerCase();return},r.getSvgSize=function(e){var t=i.SVG_SIZE.exec(e),r={};t&&(r[t[1]]=Math.round(parseFloat(t[3])),r[t[5]]=Math.round(parseFloat(t[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(e){if(v)return;if(-1>16&255,i=e>>8&255,n=255&e;return(255*t<<24)+((r=r*t+.5|0)<<16)+((i=i*t+.5|0)<<8)+(n=n*t+.5|0)},r.premultiplyRgba=function(e,t,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t):(r[0]=e[0],r[1]=e[1],r[2]=e[2]);return r[3]=t,r},r.premultiplyTintToRgba=function(e,t,r,i){(r=r||new Float32Array(4))[0]=(e>>16&255)/255,r[1]=(e>>8&255)/255,r[2]=(255&e)/255,(i||void 0===i)&&(r[0]*=t,r[1]*=t,r[2]*=t);return r[3]=t,r};var i=e("../const"),n=d(e("../settings")),o=d(e("eventemitter3")),a=d(e("./pluginTarget")),s=h(e("./mixin")),u=h(e("ismobilejs")),c=d(e("remove-array-items")),l=d(e("./mapPremultipliedBlendModes")),f=d(e("earcut"));function h(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function d(e){return e&&e.__esModule?e:{default:e}}var p=0,v=!1;r.isMobile=u,r.removeItems=c.default,r.EventEmitter=o.default,r.pluginTarget=a.default,r.mixins=s,r.earcut=f.default;var b=r.TextureCache=Object.create(null),m=r.BaseTextureCache=Object.create(null);var y=r.premultiplyBlendMode=(0,l.default)()},{"../const":46,"../settings":101,"./mapPremultipliedBlendModes":126,"./mixin":128,"./pluginTarget":129,earcut:2,eventemitter3:3,ismobilejs:4,"remove-array-items":31}],126:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(){for(var e=[],t=[],r=0;r<32;r++)e[r]=r,t[r]=r;e[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,e[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,e[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,t[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,t[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,t[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(t),i.push(e),i};var n=e("../const")},{"../const":46}],127:[function(e,t,r){"use strict";r.__esModule=!0,r.default=function(e){if(o.default.tablet||o.default.phone)return 4;return e};var i,n=e("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:4}],128:[function(e,t,r){"use strict";function i(e,t){if(e&&t)for(var r=Object.keys(t),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=t;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(0r&&this.onLoop()),this.updateTexture())},n.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},n.prototype.destroy=function(e){this.stop(),i.prototype.destroy.call(this,e)},n.fromFrames=function(e){for(var t=[],r=0;rs&&(++p,O.utils.removeItems(i,1+h-p,1+b-h),b=h,h=-1,n.push(d),l=Math.max(l,d),f++,r.x=0,r.y+=e.lineHeight,u=null))}else n.push(c),l=Math.max(l,c),++f,++p,r.x=0,r.y+=e.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(c=d),n.push(c),l=Math.max(l,c));for(var w=[],x=0;x<=f;x++){var T=0;"right"===this._font.align?T=l-n[x]:"center"===this._font.align&&(T=(l-n[x])/2),w.push(T)}for(var S=i.length,E=this.tint,M=0;M=i&&s.x=n&&s.y 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n"));return e.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],e.alpha=1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,t),r.prototype._loadMatrix=function(e){var t=e;1>16&255)/255,a=(r>>8&255)/255,s=(255&r)/255,u=((i=i||3375104)>>16&255)/255,c=(i>>8&255)/255,l=(255&i)/255,f=[.3,.59,.11,0,0,o,a,s,e=e||.2,0,u,c,l,t=t||.15,0,o-u,a-c,s-l,0,0];this._loadMatrix(f,n)},r.prototype.night=function(e,t){var r=[-2*(e=e||.1),-e,0,0,0,-e,0,e,0,0,0,e,2*e,0,0,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.predator=function(e,t){var r=[11.224130630493164*e,-4.794486999511719*e,-2.8746118545532227*e,0*e,.40342438220977783*e,-3.6330697536468506*e,9.193157196044922*e,-2.951810836791992*e,0*e,-1.316135048866272*e,-3.2184197902679443*e,-4.2375030517578125*e,7.476448059082031*e,0*e,.8044459223747253*e,0,0,0,1,0];this._loadMatrix(r,t)},r.prototype.lsd=function(e){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],e)},r.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i(r,[{key:"matrix",get:function(){return this.uniforms.m},set:function(e){this.uniforms.m=e}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(e){this.uniforms.uAlpha=e}}]),r}(n.Filter);(r.default=o).prototype.grayscale=o.prototype.greyscale},{"../../core":65,path:8}],151:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;r lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n vec4 color;\n\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.Filter);r.default=n},{"../../core":65,path:8}],153:[function(e,t,r){"use strict";r.__esModule=!0;var i=e("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return f(i).default}});var n=e("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return f(n).default}});var o=e("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return f(o).default}});var a=e("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return f(a).default}});var s=e("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return f(s).default}});var u=e("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return f(u).default}});var c=e("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return f(c).default}});var l=e("./alpha/AlphaFilter");function f(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return f(l).default}})},{"./alpha/AlphaFilter":143,"./blur/BlurFilter":144,"./blur/BlurXFilter":145,"./blur/BlurYFilter":146,"./colormatrix/ColorMatrixFilter":150,"./displacement/DisplacementFilter":151,"./fxaa/FXAAFilter":152,"./noise/NoiseFilter":154}],154:[function(e,t,r){"use strict";r.__esModule=!0;var o=function(){function i(e,t){for(var r=0;r 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n"));return r.noise=e,r.seed=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,i),o(n,[{key:"noise",get:function(){return this.uniforms.uNoise},set:function(e){this.uniforms.uNoise=e}},{key:"seed",get:function(){return this.uniforms.uSeed},set:function(e){this.uniforms.uSeed=e}}]),n}(i.Filter);r.default=n},{"../../core":65,path:8}],155:[function(e,t,r){"use strict";r.__esModule=!0;var i=function(){function i(e,t){for(var r=0;rt?1:this._height/t;e[9]=e[11]=e[13]=e[15]=this._topHeight*r,e[17]=e[19]=e[21]=e[23]=this._height-this._bottomHeight*r,e[25]=e[27]=e[29]=e[31]=this._height},s.prototype.updateVerticalVertices=function(){var e=this.vertices,t=this._leftWidth+this._rightWidth,r=this._width>t?1:this._width/t;e[2]=e[10]=e[18]=e[26]=this._leftWidth*r,e[4]=e[12]=e[20]=e[28]=this._width-this._rightWidth*r,e[6]=e[14]=e[22]=e[30]=this._width},s.prototype._renderCanvas=function(e){var t=e.context,r=this.worldTransform,i=e.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=w.default.getTintedTexture(this,this.tint));var a=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var s=this.vertices,u=this._canvasUvs,c=n?0:o.frame.x,l=n?0:o.frame.y,f=c+o.frame.width,h=l+o.frame.height;u[0]=c,u[1]=c+this._leftWidth,u[2]=f-this._rightWidth,u[3]=f,u[4]=l,u[5]=l+this._topHeight,u[6]=h-this._bottomHeight,u[7]=h;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;t.globalAlpha=this.worldAlpha,e.setBlendMode(this.blendMode),e.roundPixels?t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):t.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var b=2*v+8*p,m=Math.max(1,u[v+1]-u[v]),y=Math.max(1,u[p+5]-u[p+4]),g=Math.max(1,s[10+b]-s[b]),_=Math.max(1,s[11+b]-s[1+b]);t.drawImage(a,u[v],u[p+4],m,y,s[b],s[1+b],g,_)}},s.prototype._refresh=function(){a.prototype._refresh.call(this);var e=this.uvs,t=this._texture;this._origWidth=t.orig.width,this._origHeight=t.orig.height;var r=1/this._origWidth,i=1/this._origHeight;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1,e[2]=e[10]=e[18]=e[26]=r*this._leftWidth,e[4]=e[12]=e[20]=e[28]=1-r*this._rightWidth,e[9]=e[11]=e[13]=e[15]=i*this._topHeight,e[17]=e[19]=e[21]=e[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(s,[{key:"width",get:function(){return this._width},set:function(e){this._width=e,this._refresh()}},{key:"height",get:function(){return this._height},set:function(e){this._height=e,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(e){this._leftWidth=e,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(e){this._rightWidth=e,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(e){this._topHeight=e,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(e){this._bottomHeight=e,this._refresh()}}]),s}(n.default);r.default=a},{"../core/sprites/canvas/CanvasTinter":104,"./Plane":168}],168:[function(e,t,r){"use strict";r.__esModule=!0;var i,n=e("./Mesh"),a=(i=n)&&i.__esModule?i:{default:i};var o=function(n){function o(e,t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var i=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,n.call(this,e));return i._ready=!0,i.verticesX=t||10,i.verticesY=r||10,i.drawMode=a.default.DRAW_MODES.TRIANGLES,i.refresh(),i}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype._refresh=function(){for(var e=this._texture,t=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,a=this.verticesY-1,s=e.width/o,u=e.height/a,c=0;c=a.length){if(!e.autoResize)break;a.push(this._generateOneMoreBuffer(e))}var p=a[h];p.uploadDynamic(t,f,d);var v=e._bufferUpdateIDs[h]||0;(l=l||p._updateID 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},"undefined"!=typeof arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var be=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var me=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var b=t.cttz_i8|0;var m=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);be=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=me;me=me+e|0;me=me+15&-16;return t|0}function Ke(){return me|0}function Ze(e){e=e|0;me=e}function Qe(e,t){e=e|0;t=t|0;me=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!m){m=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;me=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;me=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;me=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;me=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=me;me=me+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;me=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;me=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;me=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;me=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;me=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;me=u;return s|0}if(!(r&7)){s=r;me=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;me=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=me;me=me+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;m=B+64|0;b=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;me=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[b>>2]=1154;pe[b+4>>2]=2273;pe[b+8>>2]=1261;_r(P,1100,b)|0;gr(P,m)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){m=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=m;a=e+168|0;n=pe[a>>2]|0;do{if(n){b=pe[n+-4>>2]|0;n=n+-8|0;if(!((b|0)!=0?(b|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=m<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=m;pe[o>>2]=~m;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=m<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;b=1;do{if(pe[F+(b<<2)>>2]|0){t=g-b|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-b|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=b<<16;do{n=be[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(b|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=m>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}b=b+1|0}while(g>>>0>=b>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;me=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=me;me=me+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;me=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;me=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=me;me=me+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){me=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;me=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;me=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;me=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;me=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=me;me=me+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;m=L+96|0;b=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;me=L;return t|0}ht(i);pe[r>>2]=0;t=1;me=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;me=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;me=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=bt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,b)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[m>>2]=1154;pe[m+4>>2]=3199;pe[m+8>>2]=1650;_r(R,1100,m)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;me=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;me=l;return c|0}if(t>>>0<=16){c=mt(e,t)|0;me=l;return c|0}u=mt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;me=l;return c|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;g=me;me=me+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;m=g+96|0;b=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[b+16>>2]|0)>>>0){i=pe[(pe[b+168>>2]|0)+(o>>>(32-(pe[b+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(m,1100,u)|0;gr(m,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(m,1100,d)|0;gr(m,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(m,1100,f)|0;gr(m,h)|0}}else{i=pe[b+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[b+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[b+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=be[(pe[b+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(m,1100,p)|0;gr(m,v)|0;y=0;me=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;me=g;return y|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;me=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;me=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0;p=me;me=me+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;me=p;return d|0}c=at(300,0)|0;if(!c){d=0;me=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;b=c+252|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+268|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+284|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){b=c;me=p;return b|0}if(At(c)|0?Ot(c)|0:0){b=c;me=p;return b|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;b=0;me=p;return b|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;b=0;me=p;return b|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=me;me=me+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;me=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=me;me=me+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){me=p;return}if((pe[a>>2]|0)!=519686845){me=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;me=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;me=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;me=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;me=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(bt(c,d)|0)+i&31;n=(bt(c,f)|0)+n&63;o=(bt(c,d)|0)+o&31;t=(bt(c,d)|0)+t|0;a=(bt(c,f)|0)+a&63;e=(bt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;me=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[b>>2]|0)>>0]|0)<<30;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;me=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=bt(c,f)|0;r=u+r&255;i=(bt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;me=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[b>>2]|0)>>0]|0)<<13;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=me;me=me+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){me=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;m=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){b=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=bt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(bt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|b;f=h<<1;he=(bt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+m|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));me=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=me;me=me+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=bt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{m=(bt(G,j)|0)+n|0;y=m-$|0;n=y>>31;n=n&m|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=be[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{m=(bt(G,D)|0)+e|0;y=m-U|0;e=y>>31;e=e&m|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);b=0;m=_;while(1){v=w|(b|0)==0;p=b<<1;h=0;d=m;while(1){f=(bt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(bt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(be[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(be[he+(f+2<<1)>>1]|0)<<16|(be[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}b=b+1|0;if((b|0)==2)break;else m=m+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));me=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=me;me=me+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);m=n?x:x+k|0;while(1){if((e|0)==1)e=bt(N,U)|0|512;b=e&7;e=e>>>3;c=ve[1823+b>>0]|0;n=0;do{p=(bt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=be[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=m;while(1){h=y|(d|0)==0;f=d<<1;n=(bt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(b<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(be[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(be[l+(n+2<<1)>>1]|0)<<16|(be[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(bt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(b<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(be[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(be[h+(c+2<<1)>>1]|0)<<16|(be[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else m=m+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));me=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=me;me=me+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=bt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(bt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=be[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(bt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=be[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;m=g<<1;v=0;b=_;while(1){p=(bt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(bt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+m+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[b>>2]=(be[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[b+4>>2]=(be[f+(p+2<<1)>>1]|0)<<16|(be[f+(p+1<<1)>>1]|0);pe[b+8>>2]=(be[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[b+12>>2]=(be[c+(h+2<<1)>>1]|0)<<16|(be[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else b=b+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));me=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=me;me=me+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;mr(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=me;me=me+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;me=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=me;me=me+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=me;me=me+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;me=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=me;me=me+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);me=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];me=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=me;me=me+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=me;me=me+16|0;if(!(Fe(196,6)|0)){me=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=me;me=me+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){me=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function br(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=br(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=me;me=me+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;me=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=me;me=me+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;me=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}me=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}me=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);me=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=me;me=me+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;me=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=me;me=me+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;me=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}me=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;me=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=me;me=me+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);m=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,m,e)|0;if((s|0)!=(v|0)){v=a;a=m;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){b=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){b=f|8192;k=0-s|0}else{b=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{b=f;k=s}}else{b=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=m;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=b&-65537;M=(b&8192|0)==0?b:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=m;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=m;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}default:{v=P;a=m;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;m=(v|0)==0?E:E+9|0;b=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[m>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+b|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(m,b,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){m=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){b=0-s|0;b=(b|0)>9?9:b;do{if(v>>>0>>0){s=(1<>>b;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>b)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(m|0)?s+(m<<2)|0:u;s=(pe[J>>2]|0)+b|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;b=pe[l>>2]|0;m=(b>>>0)%(f>>>0)|0;if((m|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((b>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(m>>>0>>0)c=.5;else{if((m|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=b-m|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}m=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);b=a|u;f=(b|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?m:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}m=S+1+a+f+s|0;Nr(e,32,k,m,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,m,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(b){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,m,M^8192);a=(m|0)<(k|0)?k:m}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);me=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=me;me=me+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);me=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{m=t;y=e}}else{pe[151]=r|t;m=644+(e+2<<2)|0;y=i}pe[m>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(b=n+4|0,(r+(pe[b>>2]|0)|0)>>>0>e>>>0):0){o=n;e=b;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{b=t;m=r}}else{pe[151]=i|t;b=644+(r+2<<2)|0;m=n}pe[b>>2]=g;pe[m+12>>2]=g;pe[g+8>>2]=m;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{b=(t+1048320|0)>>>16&8;m=t<>>16&4;m=m<>>16&2;n=14-(v|b|n)+(m<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;m=pe[155]|0;if(r>>>0>=m>>>0&y>>>0>=m>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){m=(pe[154]|0)+a|0;pe[154]=m;pe[157]=y;pe[y+4>>2]=m|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){m=(pe[153]|0)+a|0;pe[153]=m;pe[156]=y;pe[y+4>>2]=m|1;pe[y+m>>2]=m;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{b=r;m=i}}else{pe[151]=n|r;b=644+(i+2<<2)|0;m=o}pe[b>>2]=y;pe[m+12>>2]=y;pe[y+8>>2]=m;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{b=(r+1048320|0)>>>16&8;m=r<>>16&4;m=m<>>16&2;o=14-(v|b|o)+(m<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;m=pe[155]|0;if(!(n>>>0>=m>>>0&r>>>0>=m>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[b+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[b+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[b+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[b+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=me;me=me+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;me=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=me;me=me+16|0;n=o|0;si(e,t,r,i,n)|0;me=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function bi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function mi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[mi,Yt,jr,Cr,kr,Ar,mi,mi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:br,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:bi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0 0) var gc = undefined");else{if(!ba&&!ca)throw"Unknown runtime environment. Where are we?";e.read=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},void 0!==arguments&&(e.arguments=arguments),"undefined"!=typeof console?(e.print||(e.print=function(e){console.log(e)}),e.printErr||(e.printErr=function(e){console.log(e)})):e.print||(e.print=function(){}),ca&&(e.load=importScripts),void 0===e.setWindowTitle&&(e.setWindowTitle=function(e){document.title=e})}function ha(e){eval.call(null,e)}for(k in!e.load&&e.read&&(e.load=function(t){ha(e.read(t))}),e.print||(e.print=function(){}),e.printErr||(e.printErr=e.print),e.arguments||(e.arguments=[]),e.thisProgram||(e.thisProgram="./this.program"),e.print=e.print,e.W=e.printErr,e.preRun=[],e.postRun=[],aa)aa.hasOwnProperty(k)&&(e[k]=aa[k]);var n={rb:function(e){ka=e},fb:function(){return ka},ua:function(){return m},ba:function(e){m=e},Ka:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:return"*"===e[e.length-1]?n.J:"i"===e[0]?(assert(0==(e=parseInt(e.substr(1)))%8),e/8):0}},eb:function(e){return Math.max(n.Ka(e),n.J)},ud:16,Qd:function(e,t){return"double"===t||"i64"===t?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},Ed:function(e,t,r){return r||"i64"!=e&&"double"!=e?e?Math.min(t||(e?n.eb(e):0),n.J):Math.min(t,8):8},L:function(t,r,i){return i&&i.length?(i.splice||(i=Array.prototype.slice.call(i)),i.splice(0,0,r),e["dynCall_"+t].apply(null,i)):e["dynCall_"+t].call(null,r)},Z:[],Xa:function(e){for(var t=0;t>>0)+4294967296*+(t>>>0):+(e>>>0)+4294967296*+(0|t)},Ua:8,J:4,vd:0};e.Runtime=n,n.addFunction=n.Xa,n.removeFunction=n.nb;var na=!1,oa,pa,ka,ra,sa;function assert(e,t){e||x("Assertion failed: "+t)}function qa(a){var b=e["_"+a];if(!b)try{b=eval("_"+a)}catch(e){}return assert(b,"Cannot call unknown function "+a+" (perhaps LLVM optimizations or closure removed it?)"),b}function wa(e,t,r){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":y[e>>0]=t;break;case"i16":z[e>>1]=t;break;case"i32":C[e>>2]=t;break;case"i64":pa=[t>>>0,(oa=t,1<=+xa(oa)?0>>0:~~+Aa((oa-+(~~oa>>>0))/4294967296)>>>0:0)],C[e>>2]=pa[0],C[e+4>>2]=pa[1];break;case"float":Ba[e>>2]=t;break;case"double":Ca[e>>3]=t;break;default:x("invalid type for setValue: "+r)}}function Da(e,t){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return y[e>>0];case"i16":return z[e>>1];case"i32":case"i64":return C[e>>2];case"float":return Ba[e>>2];case"double":return Ca[e>>3];default:x("invalid type for setValue: "+t)}return null}function D(e,t,r,i){var o,a;a="number"==typeof e?(o=!0,e):(o=!1,e.length);var s,u,c="string"==typeof t?t:null;if(r=4==r?i:[Ea,n.aa,n.Ra,n.R][void 0===r?2:r](Math.max(a,c?1:t.length)),o){for(assert(0==(3&(i=r))),e=r+(-4&a);i>2]=0;for(e=r+a;i>0]=0;return r}if("i8"===c)return e.subarray||e.slice?E.set(e,r):E.set(new Uint8Array(e),r),r;for(i=0;i>0],0!=i||r)&&(o++,!r||o!=r););if(r||(r=o),i="",n<128){for(;0>10,56320|1023&r)))):s+=String.fromCharCode(r)}}function Ka(e,t,r,i){if(!(0>6}else{if(a<=65535){if(i<=r+2)break;t[r++]=224|a>>12}else{if(a<=2097151){if(i<=r+3)break;t[r++]=240|a>>18}else{if(a<=67108863){if(i<=r+4)break;t[r++]=248|a>>24}else{if(i<=r+5)break;t[r++]=252|a>>30,t[r++]=128|a>>24&63}t[r++]=128|a>>18&63}t[r++]=128|a>>12&63}t[r++]=128|a>>6&63}t[r++]=128|63&a}}return t[r]=0,r-n}function La(e){for(var t=0,r=0;r"):o=n;e:for(;f>0];if(!r)return t;t+=String.fromCharCode(r)}},e.stringToAscii=function(e,t){return Ia(e,t,!1)},e.UTF8ArrayToString=Ja,e.UTF8ToString=function(e){return Ja(E,e)},e.stringToUTF8Array=Ka,e.stringToUTF8=function(e,t,r){return Ka(e,E,t,r)},e.lengthBytesUTF8=La,e.UTF16ToString=function(e){for(var t=0,r="";;){var i=z[e+2*t>>1];if(0==i)return r;++t,r+=String.fromCharCode(i)}},e.stringToUTF16=function(e,t,r){if(void 0===r&&(r=2147483647),r<2)return 0;var i=t;r=(r-=2)<2*e.length?r/2:e.length;for(var n=0;n>1]=e.charCodeAt(n),t+=2;return z[t>>1]=0,t-i},e.lengthBytesUTF16=function(e){return 2*e.length},e.UTF32ToString=function(e){for(var t=0,r="";;){var i=C[e+4*t>>2];if(0==i)return r;++t,65536<=i?(i-=65536,r+=String.fromCharCode(55296|i>>10,56320|1023&i)):r+=String.fromCharCode(i)}},e.stringToUTF32=function(e,t,r){if(void 0===r&&(r=2147483647),r<4)return 0;var i=t;r=i+r-4;for(var n=0;n>2]=o,r<(t+=4)+4)break}return C[t>>2]=0,t-i},e.lengthBytesUTF32=function(e){for(var t=0,r=0;r>0]=e[r],r+=1}function ta(e,t){for(var r=0;r>0]=e[r]}function Ia(e,t,r){for(var i=0;i>0]=e.charCodeAt(i);r||(y[t>>0]=0)}e.addOnPreRun=fb,e.addOnInit=function(e){cb.unshift(e)},e.addOnPreMain=function(e){db.unshift(e)},e.addOnExit=function(e){H.unshift(e)},e.addOnPostRun=gb,e.intArrayFromString=hb,e.intArrayToString=function(e){for(var t=[],r=0;r>>16)*i+r*(t>>>16)<<16)|0}),Math.Jd=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var t=0;t<32;t++)if(e&1<<31-t)return t;return 32}),Math.Ad=Math.clz32;var xa=Math.abs,Aa=Math.ceil,za=Math.floor,ya=Math.min,I=0,ib=null,jb=null;function kb(){I++,e.monitorRunDependencies&&e.monitorRunDependencies(I)}function lb(){if(I--,e.monitorRunDependencies&&e.monitorRunDependencies(I),0==I&&(null!==ib&&(clearInterval(ib),ib=null),jb)){var t=jb;jb=null,t()}}e.addRunDependency=kb,e.removeRunDependency=lb,e.preloadedImages={},e.preloadedAudios={},Ta=8,la=Ta+5888,cb.push(),D([124,0,0,0,98,7,0,0,124,0,0,0,111,7,0,0,164,0,0,0,124,7,0,0,16,0,0,0,0,0,0,0,164,0,0,0,157,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,227,7,0,0,24,0,0,0,0,0,0,0,164,0,0,0,191,7,0,0,56,0,0,0,0,0,0,0,164,0,0,0,5,8,0,0,40,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,40,0,0,0,1,0,0,0,2,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,88,0,0,0,1,0,0,0,5,0,0,0,3,0,0,0,4,0,0,0,1,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,114,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,124,1,0,0,236,1,0,0,236,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,4,0,0,0,239,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,231,16,0,0,0,4,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,255,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,115,40,37,117,41,58,32,65,115,115,101,114,116,105,111,110,32,102,97,105,108,117,114,101,58,32,34,37,115,34,10,0,109,95,115,105,122,101,32,60,61,32,109,95,99,97,112,97,99,105,116,121,0,46,47,99,114,110,95,100,101,99,111,109,112,46,104,0,109,105,110,95,110,101,119,95,99,97,112,97,99,105,116,121,32,60,32,40,48,120,55,70,70,70,48,48,48,48,85,32,47,32,101,108,101,109,101,110,116,95,115,105,122,101,41,0,110,101,119,95,99,97,112,97,99,105,116,121,32,38,38,32,40,110,101,119,95,99,97,112,97,99,105,116,121,32,62,32,109,95,99,97,112,97,99,105,116,121,41,0,110,117,109,95,99,111,100,101,115,91,99,93,0,115,111,114,116,101,100,95,112,111,115,32,60,32,116,111,116,97,108,95,117,115,101,100,95,115,121,109,115,0,112,67,111,100,101,115,105,122,101,115,91,115,121,109,95,105,110,100,101,120,93,32,61,61,32,99,111,100,101,115,105,122,101,0,116,32,60,32,40,49,85,32,60,60,32,116,97,98,108,101,95,98,105,116,115,41,0,109,95,108,111,111,107,117,112,91,116,93,32,61,61,32,99,85,73,78,84,51,50,95,77,65,88,0,99,114,110,100,95,109,97,108,108,111,99,58,32,115,105,122,101,32,116,111,111,32,98,105,103,0,99,114,110,100,95,109,97,108,108,111,99,58,32,111,117,116,32,111,102,32,109,101,109,111,114,121,0,40,40,117,105,110,116,51,50,41,112,95,110,101,119,32,38,32,40,67,82,78,68,95,77,73,78,95,65,76,76,79,67,95,65,76,73,71,78,77,69,78,84,32,45,32,49,41,41,32,61,61,32,48,0,99,114,110,100,95,114,101,97,108,108,111,99,58,32,98,97,100,32,112,116,114,0,99,114,110,100,95,102,114,101,101,58,32,98,97,100,32,112,116,114,0,102,97,108,115,101,0,40,116,111,116,97,108,95,115,121,109,115,32,62,61,32,49,41,32,38,38,32,40,116,111,116,97,108,95,115,121,109,115,32,60,61,32,112,114,101,102,105,120,95,99,111,100,105,110,103,58,58,99,77,97,120,83,117,112,112,111,114,116,101,100,83,121,109,115,41,0,17,18,19,20,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15,16,48,0,110,117,109,95,98,105,116,115,32,60,61,32,51,50,85,0,109,95,98,105,116,95,99,111,117,110,116,32,60,61,32,99,66,105,116,66,117,102,83,105,122,101,0,116,32,33,61,32,99,85,73,78,84,51,50,95,77,65,88,0,109,111,100,101,108,46,109,95,99,111,100,101,95,115,105,122,101,115,91,115,121,109,93,32,61,61,32,108,101,110,0,0,2,3,1,0,2,3,4,5,6,7,1,40,108,101,110,32,62,61,32,49,41,32,38,38,32,40,108,101,110,32,60,61,32,99,77,97,120,69,120,112,101,99,116,101,100,67,111,100,101,83,105,122,101,41,0,105,32,60,32,109,95,115,105,122,101,0,110,101,120,116,95,108,101,118,101,108,95,111,102,115,32,62,32,99,117,114,95,108,101,118,101,108,95,111,102,115,0,1,2,2,3,3,3,3,4,0,0,0,0,0,0,1,1,0,1,0,1,0,0,1,2,1,2,0,0,0,1,0,2,1,0,2,0,0,1,2,3,110,117,109,32,38,38,32,40,110,117,109,32,61,61,32,126,110,117,109,95,99,104,101,99,107,41,0,83,116,57,101,120,99,101,112,116,105,111,110,0,83,116,57,116,121,112,101,95,105,110,102,111,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,54,95,95,115,104,105,109,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,57,95,95,112,111,105,110,116,101,114,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,49,55,95,95,112,98,97,115,101,95,116,121,112,101,95,105,110,102,111,69,0,78,49,48,95,95,99,120,120,97,98,105,118,49,50,48,95,95,115,105,95,99,108,97,115,115,95,116,121,112,101,95,105,110,102,111,69,0,112,116,104,114,101,97,100,95,111,110,99,101,32,102,97,105,108,117,114,101,32,105,110,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,95,102,97,115,116,40,41,0,116,101,114,109,105,110,97,116,101,95,104,97,110,100,108,101,114,32,117,110,101,120,112,101,99,116,101,100,108,121,32,114,101,116,117,114,110,101,100,0,99,97,110,110,111,116,32,99,114,101,97,116,101,32,112,116,104,114,101,97,100,32,107,101,121,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,99,97,110,110,111,116,32,122,101,114,111,32,111,117,116,32,116,104,114,101,97,100,32,118,97,108,117,101,32,102,111,114,32,95,95,99,120,97,95,103,101,116,95,103,108,111,98,97,108,115,40,41,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,58,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,101,120,99,101,112,116,105,111,110,32,111,102,32,116,121,112,101,32,37,115,0,116,101,114,109,105,110,97,116,105,110,103,32,119,105,116,104,32,37,115,32,102,111,114,101,105,103,110,32,101,120,99,101,112,116,105,111,110,0,116,101,114,109,105,110,97,116,105,110,103,0,117,110,99,97,117,103,104,116,0,84,33,34,25,13,1,2,3,17,75,28,12,16,4,11,29,18,30,39,104,110,111,112,113,98,32,5,6,15,19,20,21,26,8,22,7,40,36,23,24,9,10,14,27,31,37,35,131,130,125,38,42,43,60,61,62,63,67,71,74,77,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,105,106,107,108,114,115,116,121,122,123,124,0,73,108,108,101,103,97,108,32,98,121,116,101,32,115,101,113,117,101,110,99,101,0,68,111,109,97,105,110,32,101,114,114,111,114,0,82,101,115,117,108,116,32,110,111,116,32,114,101,112,114,101,115,101,110,116,97,98,108,101,0,78,111,116,32,97,32,116,116,121,0,80,101,114,109,105,115,115,105,111,110,32,100,101,110,105,101,100,0,79,112,101,114,97,116,105,111,110,32,110,111,116,32,112,101,114,109,105,116,116,101,100,0,78,111,32,115,117,99,104,32,102,105,108,101,32,111,114,32,100,105,114,101,99,116,111,114,121,0,78,111,32,115,117,99,104,32,112,114,111,99,101,115,115,0,70,105,108,101,32,101,120,105,115,116,115,0,86,97,108,117,101,32,116,111,111,32,108,97,114,103,101,32,102,111,114,32,100,97,116,97,32,116,121,112,101,0,78,111,32,115,112,97,99,101,32,108,101,102,116,32,111,110,32,100,101,118,105,99,101,0,79,117,116,32,111,102,32,109,101,109,111,114,121,0,82,101,115,111,117,114,99,101,32,98,117,115,121,0,73,110,116,101,114,114,117,112,116,101,100,32,115,121,115,116,101,109,32,99,97,108,108,0,82,101,115,111,117,114,99,101,32,116,101,109,112,111,114,97,114,105,108,121,32,117,110,97,118,97,105,108,97,98,108,101,0,73,110,118,97,108,105,100,32,115,101,101,107,0,67,114,111,115,115,45,100,101,118,105,99,101,32,108,105,110,107,0,82,101,97,100,45,111,110,108,121,32,102,105,108,101,32,115,121,115,116,101,109,0,68,105,114,101,99,116,111,114,121,32,110,111,116,32,101,109,112,116,121,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,112,101,101,114,0,79,112,101,114,97,116,105,111,110,32,116,105,109,101,100,32,111,117,116,0,67,111,110,110,101,99,116,105,111,110,32,114,101,102,117,115,101,100,0,72,111,115,116,32,105,115,32,100,111,119,110,0,72,111,115,116,32,105,115,32,117,110,114,101,97,99,104,97,98,108,101,0,65,100,100,114,101,115,115,32,105,110,32,117,115,101,0,66,114,111,107,101,110,32,112,105,112,101,0,73,47,79,32,101,114,114,111,114,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,32,111,114,32,97,100,100,114,101,115,115,0,66,108,111,99,107,32,100,101,118,105,99,101,32,114,101,113,117,105,114,101,100,0,78,111,32,115,117,99,104,32,100,101,118,105,99,101,0,78,111,116,32,97,32,100,105,114,101,99,116,111,114,121,0,73,115,32,97,32,100,105,114,101,99,116,111,114,121,0,84,101,120,116,32,102,105,108,101,32,98,117,115,121,0,69,120,101,99,32,102,111,114,109,97,116,32,101,114,114,111,114,0,73,110,118,97,108,105,100,32,97,114,103,117,109,101,110,116,0,65,114,103,117,109,101,110,116,32,108,105,115,116,32,116,111,111,32,108,111,110,103,0,83,121,109,98,111,108,105,99,32,108,105,110,107,32,108,111,111,112,0,70,105,108,101,110,97,109,101,32,116,111,111,32,108,111,110,103,0,84,111,111,32,109,97,110,121,32,111,112,101,110,32,102,105,108,101,115,32,105,110,32,115,121,115,116,101,109,0,78,111,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,115,32,97,118,97,105,108,97,98,108,101,0,66,97,100,32,102,105,108,101,32,100,101,115,99,114,105,112,116,111,114,0,78,111,32,99,104,105,108,100,32,112,114,111,99,101,115,115,0,66,97,100,32,97,100,100,114,101,115,115,0,70,105,108,101,32,116,111,111,32,108,97,114,103,101,0,84,111,111,32,109,97,110,121,32,108,105,110,107,115,0,78,111,32,108,111,99,107,115,32,97,118,97,105,108,97,98,108,101,0,82,101,115,111,117,114,99,101,32,100,101,97,100,108,111,99,107,32,119,111,117,108,100,32,111,99,99,117,114,0,83,116,97,116,101,32,110,111,116,32,114,101,99,111,118,101,114,97,98,108,101,0,80,114,101,118,105,111,117,115,32,111,119,110,101,114,32,100,105,101,100,0,79,112,101,114,97,116,105,111,110,32,99,97,110,99,101,108,101,100,0,70,117,110,99,116,105,111,110,32,110,111,116,32,105,109,112,108,101,109,101,110,116,101,100,0,78,111,32,109,101,115,115,97,103,101,32,111,102,32,100,101,115,105,114,101,100,32,116,121,112,101,0,73,100,101,110,116,105,102,105,101,114,32,114,101,109,111,118,101,100,0,68,101,118,105,99,101,32,110,111,116,32,97,32,115,116,114,101,97,109,0,78,111,32,100,97,116,97,32,97,118,97,105,108,97,98,108,101,0,68,101,118,105,99,101,32,116,105,109,101,111,117,116,0,79,117,116,32,111,102,32,115,116,114,101,97,109,115,32,114,101,115,111,117,114,99,101,115,0,76,105,110,107,32,104,97,115,32,98,101,101,110,32,115,101,118,101,114,101,100,0,80,114,111,116,111,99,111,108,32,101,114,114,111,114,0,66,97,100,32,109,101,115,115,97,103,101,0,70,105,108,101,32,100,101,115,99,114,105,112,116,111,114,32,105,110,32,98,97,100,32,115,116,97,116,101,0,78,111,116,32,97,32,115,111,99,107,101,116,0,68,101,115,116,105,110,97,116,105,111,110,32,97,100,100,114,101,115,115,32,114,101,113,117,105,114,101,100,0,77,101,115,115,97,103,101,32,116,111,111,32,108,97,114,103,101,0,80,114,111,116,111,99,111,108,32,119,114,111,110,103,32,116,121,112,101,32,102,111,114,32,115,111,99,107,101,116,0,80,114,111,116,111,99,111,108,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,80,114,111,116,111,99,111,108,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,83,111,99,107,101,116,32,116,121,112,101,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,78,111,116,32,115,117,112,112,111,114,116,101,100,0,80,114,111,116,111,99,111,108,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,0,65,100,100,114,101,115,115,32,102,97,109,105,108,121,32,110,111,116,32,115,117,112,112,111,114,116,101,100,32,98,121,32,112,114,111,116,111,99,111,108,0,65,100,100,114,101,115,115,32,110,111,116,32,97,118,97,105,108,97,98,108,101,0,78,101,116,119,111,114,107,32,105,115,32,100,111,119,110,0,78,101,116,119,111,114,107,32,117,110,114,101,97,99,104,97,98,108,101,0,67,111,110,110,101,99,116,105,111,110,32,114,101,115,101,116,32,98,121,32,110,101,116,119,111,114,107,0,67,111,110,110,101,99,116,105,111,110,32,97,98,111,114,116,101,100,0,78,111,32,98,117,102,102,101,114,32,115,112,97,99,101,32,97,118,97,105,108,97,98,108,101,0,83,111,99,107,101,116,32,105,115,32,99,111,110,110,101,99,116,101,100,0,83,111,99,107,101,116,32,110,111,116,32,99,111,110,110,101,99,116,101,100,0,67,97,110,110,111,116,32,115,101,110,100,32,97,102,116,101,114,32,115,111,99,107,101,116,32,115,104,117,116,100,111,119,110,0,79,112,101,114,97,116,105,111,110,32,97,108,114,101,97,100,121,32,105,110,32,112,114,111,103,114,101,115,115,0,79,112,101,114,97,116,105,111,110,32,105,110,32,112,114,111,103,114,101,115,115,0,83,116,97,108,101,32,102,105,108,101,32,104,97,110,100,108,101,0,82,101,109,111,116,101,32,73,47,79,32,101,114,114,111,114,0,81,117,111,116,97,32,101,120,99,101,101,100,101,100,0,78,111,32,109,101,100,105,117,109,32,102,111,117,110,100,0,87,114,111,110,103,32,109,101,100,105,117,109,32,116,121,112,101,0,78,111,32,101,114,114,111,114,32,105,110,102,111,114,109,97,116,105,111,110,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,10,0,17,17,17,0,0,0,0,5,0,0,0,0,0,0,9,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,15,10,17,17,17,3,10,7,0,1,19,9,11,11,0,0,9,6,11,0,0,11,0,6,17,0,0,0,17,17,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,17,0,10,10,17,17,17,0,10,0,0,2,0,9,11,0,0,0,9,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,0,0,0,0,0,13,0,0,0,4,13,0,0,0,0,9,14,0,0,0,0,0,14,0,0,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,9,16,0,0,0,0,0,16,0,0,16,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,18,18,18,0,0,0,0,0,0,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,9,11,0,0,0,0,0,11,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,0,0,0,0,0,0,0,12,0,0,0,0,12,0,0,0,0,9,12,0,0,0,0,0,12,0,0,12,0,0,48,49,50,51,52,53,54,55,56,57,65,66,67,68,69,70,45,43,32,32,32,48,88,48,120,0,40,110,117,108,108,41,0,45,48,88,43,48,88,32,48,88,45,48,120,43,48,120,32,48,120,0,105,110,102,0,73,78,70,0,110,97,110,0,78,65,78,0,46,0],"i8",4,n.Ua);var mb=n.ja(D(12,"i8",2),8);function ob(t){return e.___errno_location&&(C[e.___errno_location()>>2]=t),t}assert(0==mb%8),e._i64Subtract=nb;var J={I:1,F:2,ed:3,bc:4,H:5,Aa:6,vb:7,zc:8,ea:9,Jb:10,va:11,qd:11,Ta:12,da:13,Vb:14,Lc:15,fa:16,wa:17,rd:18,ha:19,ya:20,P:21,q:22,uc:23,Sa:24,Q:25,nd:26,Wb:27,Hc:28,ia:29,bd:30,nc:31,Vc:32,Sb:33,Zc:34,Dc:42,Zb:43,Kb:44,ec:45,fc:46,gc:47,mc:48,od:49,xc:50,dc:51,Pb:35,Ac:37,Bb:52,Eb:53,sd:54,vc:55,Fb:56,Gb:57,Qb:35,Hb:59,Jc:60,yc:61,kd:62,Ic:63,Ec:64,Fc:65,ad:66,Bc:67,yb:68,gd:69,Lb:70,Wc:71,pc:72,Tb:73,Db:74,Qc:76,Cb:77,$c:78,hc:79,ic:80,lc:81,kc:82,jc:83,Kc:38,za:39,qc:36,ga:40,Rc:95,Uc:96,Ob:104,wc:105,zb:97,Yc:91,Oc:88,Gc:92,cd:108,Nb:111,wb:98,Mb:103,tc:101,rc:100,ld:110,Xb:112,Yb:113,ac:115,Ab:114,Rb:89,oc:90,Xc:93,dd:94,xb:99,sc:102,cc:106,Mc:107,md:109,pd:87,Ub:122,hd:116,Pc:95,Cc:123,$b:84,Sc:75,Ib:125,Nc:131,Tc:130,jd:86};function pb(e,t){H.push(function(){n.L("vi",e,[t])}),pb.level=H.length}function tb(){return!!tb.p}e._memset=qb,e._bitshift64Lshr=rb,e._bitshift64Shl=sb;var ub=[],vb={};function wb(e,t){wb.p||(wb.p={}),e in wb.p||(n.L("v",t),wb.p[e]=1)}var xb={0:"Success",1:"Not super-user",2:"No such file or directory",3:"No such process",4:"Interrupted system call",5:"I/O error",6:"No such device or address",7:"Arg list too long",8:"Exec format error",9:"Bad file number",10:"No children",11:"No more processes",12:"Not enough core",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Mount device busy",17:"File exists",18:"Cross-device link",19:"No such device",20:"Not a directory",21:"Is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",25:"Not a typewriter",26:"Text file busy",27:"File too large",28:"No space left on device",29:"Illegal seek",30:"Read only file system",31:"Too many links",32:"Broken pipe",33:"Math arg out of domain of func",34:"Math result not representable",35:"File locking deadlock error",36:"File or path name too long",37:"No record locks available",38:"Function not implemented",39:"Directory not empty",40:"Too many symbolic links",42:"No message of desired type",43:"Identifier removed",44:"Channel number out of range",45:"Level 2 not synchronized",46:"Level 3 halted",47:"Level 3 reset",48:"Link number out of range",49:"Protocol driver not attached",50:"No CSI structure available",51:"Level 2 halted",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",57:"Invalid slot",59:"Bad font file fmt",60:"Device not a stream",61:"No data (for no delay io)",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",65:"Package not installed",66:"The object is remote",67:"The link has been severed",68:"Advertise error",69:"Srmount error",70:"Communication error on send",71:"Protocol error",72:"Multihop attempted",73:"Cross mount point (not really error)",74:"Trying to read unreadable message",75:"Value too large for defined data type",76:"Given log. name not unique",77:"f.d. invalid for this operation",78:"Remote address changed",79:"Can access a needed shared lib",80:"Accessing a corrupted shared lib",81:".lib section in a.out corrupted",82:"Attempting to link in too many libs",83:"Attempting to exec a shared library",84:"Illegal byte sequence",86:"Streams pipe error",87:"Too many users",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Unknown protocol",94:"Socket type not supported",95:"Not supported",96:"Protocol family not supported",97:"Address family not supported by protocol family",98:"Address already in use",99:"Address not available",100:"Network interface is not configured",101:"Network is unreachable",102:"Connection reset by network",103:"Connection aborted",104:"Connection reset by peer",105:"No buffer space available",106:"Socket is already connected",107:"Socket is not connected",108:"Can't send after socket shutdown",109:"Too many references",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"Host is unreachable",114:"Socket already connected",115:"Connection already in progress",116:"Stale file handle",122:"Quota exceeded",123:"No medium (in tape drive)",125:"Operation canceled",130:"Previous owner died",131:"State not recoverable"};function yb(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function zb(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function Ab(e){var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?(t&&(t=t.substr(0,t.length-1)),e+t):"."}function Bb(e){if("/"===e)return"/";var t=e.lastIndexOf("/");return-1===t?e:e.substr(t+1)}function Cb(){return zb(Array.prototype.slice.call(arguments,0).join("/"))}function K(e,t){return zb(e+"/"+t)}function Db(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=yb(e.split("/").filter(function(e){return!!e}),!t).join("/"))||"."}var Eb=[];function Fb(e,t){Eb[e]={input:[],output:[],N:t},Gb(e,Hb)}var Hb={open:function(e){var t=Eb[e.g.rdev];if(!t)throw new L(J.ha);e.tty=t,e.seekable=!1},close:function(e){e.tty.N.flush(e.tty)},flush:function(e){e.tty.N.flush(e.tty)},read:function(e,t,r,i){if(!e.tty||!e.tty.N.La)throw new L(J.Aa);for(var n=0,o=0;oe.e.length&&(e.e=M.cb(e),e.o=e.e.length),!e.e||e.e.subarray){var r=e.e?e.e.buffer.byteLength:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)|0),0!=r&&(t=Math.max(t,256)),r=e.e,e.e=new Uint8Array(t),0t)e.e.length=t;else for(;e.e.length=e.g.o)return 0;if(assert(0<=(e=Math.min(e.g.o-n,i))),8>1)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return t.mode},B:function(e){for(var t=[];e.parent!==e;)t.push(e.name),e=e.parent;return t.push(e.A.pa.root),t.reverse(),Cb.apply(null,t)},Ha:{0:"r",1:"r+",2:"r+",64:"r",65:"r+",66:"r+",129:"rx+",193:"rx+",514:"w+",577:"w",578:"w+",705:"wx",706:"wx+",1024:"a",1025:"a",1026:"a+",1089:"a",1090:"a+",1153:"ax",1154:"ax+",1217:"ax",1218:"ax+",4096:"rs",4098:"rs+"},$a:function(e){if((e&=-32769)in P.Ha)return P.Ha[e];throw new L(J.q)},k:{D:function(e){var t;e=P.B(e);try{t=fs.lstatSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return P.$&&!t.K&&(t.K=4096),P.$&&!t.blocks&&(t.blocks=(t.size+t.K-1)/t.K|0),{dev:t.dev,ino:t.ino,mode:t.mode,nlink:t.nlink,uid:t.uid,gid:t.gid,rdev:t.rdev,size:t.size,atime:t.atime,mtime:t.mtime,ctime:t.ctime,K:t.K,blocks:t.blocks}},u:function(e,t){var r=P.B(e);try{void 0!==t.mode&&(fs.chmodSync(r,t.mode),e.mode=t.mode),void 0!==t.size&&fs.truncateSync(r,t.size)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},lookup:function(e,t){var r=K(P.B(e),t);r=P.Ja(r);return P.createNode(e,t,r)},T:function(e,t,r,i){e=P.createNode(e,t,r,i),t=P.B(e);try{N(e.mode)?fs.mkdirSync(t,e.mode):fs.writeFileSync(t,"",{mode:e.mode})}catch(e){if(!e.code)throw e;throw new L(J[e.code])}return e},rename:function(e,t,r){e=P.B(e),t=K(P.B(t),r);try{fs.renameSync(e,t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},unlink:function(e,t){var r=K(P.B(e),t);try{fs.unlinkSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},rmdir:function(e,t){var r=K(P.B(e),t);try{fs.rmdirSync(r)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readdir:function(e){e=P.B(e);try{return fs.readdirSync(e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},symlink:function(e,t,r){e=K(P.B(e),t);try{fs.symlinkSync(r,e)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},readlink:function(e){var t=P.B(e);try{return t=fs.readlinkSync(t),t=Ob.relative(Ob.resolve(e.A.pa.root),t)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}}},n:{open:function(e){var t=P.B(e.g);try{32768==(61440&e.g.mode)&&(e.V=fs.openSync(t,P.$a(e.flags)))}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},close:function(e){try{32768==(61440&e.g.mode)&&e.V&&fs.closeSync(e.V)}catch(e){if(!e.code)throw e;throw new L(J[e.code])}},read:function(e,t,r,i,n){if(0===i)return 0;var o,a=new Buffer(i);try{o=fs.readSync(e.V,a,0,i,n)}catch(e){throw new L(J[e.code])}if(0>>0)%Q.length}function Xb(e){var t=Wb(e.parent.id,e.name);e.M=Q[t],Q[t]=e}function Nb(e,t){var r;if(r=(r=Yb(e,"x"))?r:e.k.lookup?0:J.da)throw new L(r,e);for(r=Q[Wb(e.id,t)];r;r=r.M){var i=r.name;if(r.parent.id===e.id&&i===t)return r}return e.k.lookup(e,t)}function Lb(e,t,r,i){return Zb||((Zb=function(e,t,r,i){e||(e=this),this.parent=e,this.A=e.A,this.U=null,this.id=Sb++,this.name=t,this.mode=r,this.k={},this.n={},this.rdev=i}).prototype={},Object.defineProperties(Zb.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},kb:{get:function(){return N(this.mode)}},jb:{get:function(){return 8192==(61440&this.mode)}}})),Xb(e=new Zb(e,t,r,i)),e}function N(e){return 16384==(61440&e)}var $b={r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218};function Yb(e,t){return Tb?0:(-1===t.indexOf("r")||292&e.mode)&&(-1===t.indexOf("w")||146&e.mode)&&(-1===t.indexOf("x")||73&e.mode)?0:J.da}function ac(e,t){try{return Nb(e,t),J.wa}catch(e){}return Yb(e,"wx")}function bc(){for(var e=0;e<=4096;e++)if(!Rb[e])return e;throw new L(J.Sa)}function cc(e){dc||((dc=function(){}).prototype={},Object.defineProperties(dc.prototype,{object:{get:function(){return this.g},set:function(e){this.g=e}},Ld:{get:function(){return 1!=(2097155&this.flags)}},Md:{get:function(){return 0!=(2097155&this.flags)}},Kd:{get:function(){return 1024&this.flags}}}));var t,r=new dc;for(t in e)r[t]=e[t];return e=r,r=bc(),e.fd=r,Rb[r]=e}var Kb={open:function(e){e.n=Qb[e.g.rdev].n,e.n.open&&e.n.open(e)},G:function(){throw new L(J.ia)}},qc;function Gb(e,t){Qb[e]={n:t}}function ec(e,t){var r,i="/"===t,n=!t;if(i&&Pb)throw new L(J.fa);if(!i&&!n){if(t=(r=S(t,{Ia:!1})).path,(r=r.g).U)throw new L(J.fa);if(!N(r.mode))throw new L(J.ya)}n={type:e,pa:{},Oa:t,lb:[]};var o=e.A(n);(o.A=n).root=o,i?Pb=o:r&&(r.U=n,r.A&&r.A.lb.push(n))}function fc(e,t,r){var i=S(e,{parent:!0}).g;if(!(e=Bb(e))||"."===e||".."===e)throw new L(J.q);var n=ac(i,e);if(n)throw new L(n);if(!i.k.T)throw new L(J.I);return i.k.T(i,e,t,r)}function gc(e,t){return t=4095&(void 0!==t?t:438),fc(e,t|=32768,0)}function V(e,t){return t=1023&(void 0!==t?t:511),fc(e,t|=16384,0)}function hc(e,t,r){return void 0===r&&(r=t,t=438),fc(e,8192|t,r)}function ic(e,t){if(!Db(e))throw new L(J.F);var r=S(t,{parent:!0}).g;if(!r)throw new L(J.F);var i=Bb(t),n=ac(r,i);if(n)throw new L(n);if(!r.k.symlink)throw new L(J.I);return r.k.symlink(r,i,e)}function Vb(e){if(!(e=S(e).g))throw new L(J.F);if(!e.k.readlink)throw new L(J.q);return Db(T(e.parent),e.k.readlink(e))}function jc(e,t){var r;if(!(r="string"==typeof e?S(e,{la:!0}).g:e).k.u)throw new L(J.I);r.k.u(r,{mode:4095&t|-4096&r.mode,timestamp:Date.now()})}function kc(t,r){var i,n,o;if(""===t)throw new L(J.F);if("string"==typeof r){if(void 0===(n=$b[r]))throw Error("Unknown file open mode: "+r)}else n=r;if(i=64&(r=n)?4095&(void 0===i?438:i)|32768:0,"object"==typeof t)o=t;else{t=zb(t);try{o=S(t,{la:!(131072&r)}).g}catch(e){}}if(n=!1,64&r)if(o){if(128&r)throw new L(J.wa)}else o=fc(t,i,0),n=!0;if(!o)throw new L(J.F);if(8192==(61440&o.mode)&&(r&=-513),65536&r&&!N(o.mode))throw new L(J.ya);if(!n&&(i=o?40960==(61440&o.mode)?J.ga:N(o.mode)&&(0!=(2097155&r)||512&r)?J.P:(i=["r","w","rw"][3&r],512&r&&(i+="w"),Yb(o,i)):J.F))throw new L(i);if(512&r){var a;if(!(a="string"==typeof(i=o)?S(i,{la:!0}).g:i).k.u)throw new L(J.I);if(N(a.mode))throw new L(J.P);if(32768!=(61440&a.mode))throw new L(J.q);if(i=Yb(a,"w"))throw new L(i);a.k.u(a,{size:0,timestamp:Date.now()})}r&=-641,(o=cc({g:o,path:T(o),flags:r,seekable:!0,position:0,n:o.n,tb:[],error:!1})).n.open&&o.n.open(o),!e.logReadFiles||1&r||(lc||(lc={}),t in lc||(lc[t]=1,e.printErr("read file: "+t)));try{R.onOpenFile&&(a=0,1!=(2097155&r)&&(a|=1),0!=(2097155&r)&&(a|=2),R.onOpenFile(t,a))}catch(e){console.log("FS.trackingDelegate['onOpenFile']('"+t+"', flags) threw an exception: "+e.message)}return o}function mc(e){e.na&&(e.na=null);try{e.n.close&&e.n.close(e)}catch(e){throw e}finally{Rb[e.fd]=null}}function nc(e,t,r){if(!e.seekable||!e.n.G)throw new L(J.ia);e.position=e.n.G(e,t,r),e.tb=[]}function oc(e,t,r,i,n,o){if(i<0||n<0)throw new L(J.q);if(0==(2097155&e.flags))throw new L(J.ea);if(N(e.g.mode))throw new L(J.P);if(!e.n.write)throw new L(J.q);1024&e.flags&&nc(e,0,2);var a=!0;if(void 0===n)n=e.position,a=!1;else if(!e.seekable)throw new L(J.ia);t=e.n.write(e,t,r,i,n,o),a||(e.position+=t);try{e.path&&R.onWriteToFile&&R.onWriteToFile(e.path)}catch(e){console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: "+e.message)}return t}function pc(){L||((L=function(e,t){this.g=t,this.qb=function(e){for(var t in this.S=e,J)if(J[t]===e){this.code=t;break}},this.qb(e),this.message=xb[e]}).prototype=Error(),L.prototype.constructor=L,[J.F].forEach(function(e){Mb[e]=new L(e),Mb[e].stack=""}))}function rc(e,t){var r=0;return e&&(r|=365),t&&(r|=146),r}function sc(e,t,r,i){return gc(e=K("string"==typeof e?e:T(e),t),rc(r,i))}function tc(e,t,r,i,n,o){if(n=gc(e=t?K("string"==typeof e?e:T(e),t):e,i=rc(i,n)),r){if("string"==typeof r){e=Array(r.length),t=0;for(var a=r.length;t>2]}function xc(){var e;if(e=X(),!(e=Rb[e]))throw new L(J.ea);return e}var yc={};function Ga(e){Ga.p||(r=Qa(r),Ga.p=!0,assert(n.R),Ga.bb=n.R,n.R=function(){x("cannot dynamically allocate, sbrk now has control")});var t=r;return 0==e||Ga.bb(e)?t:4294967295}e._i64Add=zc;var Ac=1;function Cc(e,t){if(Dc=e,Ec=t,!Fc)return 1;if(0==e)Y=function(){setTimeout(Gc,t)},Hc="timeout";else if(1==e)Y=function(){Ic(Gc)},Hc="rAF";else if(2==e){if(!window.setImmediate){var r=[];window.addEventListener("message",function(e){e.source===window&&"__emcc"===e.data&&(e.stopPropagation(),r.shift()())},!0),window.setImmediate=function(e){r.push(e),window.postMessage("__emcc","*")}}Y=function(){window.setImmediate(Gc)},Hc="immediate"}return 0}function Jc(a,t,r,s,i){e.noExitRuntime=!0,assert(!Fc,"emscripten_set_main_loop: there can only be one main loop function at once: call emscripten_cancel_main_loop to cancel the previous one before setting a new one with different parameters."),Fc=a,Kc=s;var u=Lc;if(Gc=function(){if(!na)if(0>r-6&63;r=r-6,e=e+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[n]}2==r?(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t)<<4],e+="=="):4==r&&(e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t)<<2],e+="="),c.src="data:audio/x-"+a.substr(-3)+";base64,"+e,s(c)}},c.src=n,ad(function(){s(c)})}});var r=e.canvas;r&&(r.sa=r.requestPointerLock||r.mozRequestPointerLock||r.webkitRequestPointerLock||r.msRequestPointerLock||function(){},r.Fa=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock||document.msExitPointerLock||function(){},r.Fa=r.Fa.bind(document),document.addEventListener("pointerlockchange",t,!1),document.addEventListener("mozpointerlockchange",t,!1),document.addEventListener("webkitpointerlockchange",t,!1),document.addEventListener("mspointerlockchange",t,!1),e.elementPointerLock&&r.addEventListener("click",function(e){!Tc&&r.sa&&(r.sa(),e.preventDefault())},!1))}}function bd(t,r,i,n){if(r&&e.ka&&t==e.canvas)return e.ka;var o,a;if(r){if(a={antialias:!1,alpha:!1},n)for(var s in n)a[s]=n[s];(a=GL.createContext(t,a))&&(o=GL.getContext(a).td),t.style.backgroundColor="black"}else o=t.getContext("2d");return o?(i&&(r||assert("undefined"==typeof GLctx,"cannot set in module if GLctx is used, but we are a non-GL context that would replace it"),e.ka=o,r&&GL.Od(a),e.Td=r,Uc.forEach(function(e){e()}),Vc()),o):null}var cd=!1,dd=void 0,ed=void 0;function fd(t,r,i){function n(){Sc=!1;var t=o.parentNode;(document.webkitFullScreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.mozFullscreenElement||document.fullScreenElement||document.fullscreenElement||document.msFullScreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement)===t?(o.Da=document.cancelFullScreen||document.mozCancelFullScreen||document.webkitCancelFullScreen||document.msExitFullscreen||document.exitFullscreen||function(){},o.Da=o.Da.bind(document),dd&&o.sa(),Sc=!0,ed&&gd()):(t.parentNode.insertBefore(o,t),t.parentNode.removeChild(t),ed&&hd()),e.onFullScreen&&e.onFullScreen(Sc),id(o)}void 0===(dd=t)&&(dd=!0),void 0===(ed=r)&&(ed=!1),void 0===(jd=i)&&(jd=null);var o=e.canvas;cd||(cd=!0,document.addEventListener("fullscreenchange",n,!1),document.addEventListener("mozfullscreenchange",n,!1),document.addEventListener("webkitfullscreenchange",n,!1),document.addEventListener("MSFullscreenChange",n,!1));var a=document.createElement("div");o.parentNode.insertBefore(a,o),a.appendChild(o),a.p=a.requestFullScreen||a.mozRequestFullScreen||a.msRequestFullscreen||(a.webkitRequestFullScreen?function(){a.webkitRequestFullScreen(Element.ALLOW_KEYBOARD_INPUT)}:null),i?a.p({Ud:i}):a.p()}var kd=0;function ld(e){var t=Date.now();if(0===kd)kd=t+1e3/60;else for(;kd<=t+2;)kd+=1e3/60;t=Math.max(kd-t,0),setTimeout(e,t)}function Ic(e){"undefined"==typeof window?ld(e):(window.requestAnimationFrame||(window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||ld),window.requestAnimationFrame(e))}function ad(t){e.noExitRuntime=!0,setTimeout(function(){na||t()},1e4)}function $c(e){return{jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",bmp:"image/bmp",ogg:"audio/ogg",wav:"audio/wav",mp3:"audio/mpeg"}[e.substr(e.lastIndexOf(".")+1)]}function md(e,t,r){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="arraybuffer",i.onload=function(){200==i.status||0==i.status&&i.response?t(i.response):r()},i.onerror=r,i.send(null)}function nd(t,r,e){md(t,function(e){assert(e,'Loading data file "'+t+'" failed (no arrayBuffer).'),r(new Uint8Array(e)),lb()},function(){if(!e)throw'Loading data file "'+t+'" failed.';e()}),kb()}var od=[],Wc,Xc,Yc,Zc,jd;function pd(){var t=e.canvas;od.forEach(function(e){e(t.width,t.height)})}function gd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=8388608|e}pd()}function hd(){if("undefined"!=typeof SDL){var e=Sa[SDL.screen+0*n.J>>2];C[SDL.screen+0*n.J>>2]=-8388609&e}pd()}function id(t,r,i){r&&i?(t.ub=r,t.hb=i):(r=t.ub,i=t.hb);var n=r,o=i;if(e.forcedAspectRatio&&0this.length-1||e<0)){var t=e%this.chunkSize;return this.gb(e/this.chunkSize|0)[t]}},a.prototype.pb=function(e){this.gb=e},a.prototype.Ca=function(){var e=new XMLHttpRequest;if(e.open("HEAD",u,!1),e.send(null),!(200<=e.status&&e.status<300||304===e.status))throw Error("Couldn't load "+u+". Status: "+e.status);var t,o=Number(e.getResponseHeader("Content-length")),a=1048576;(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t||(a=o);var s=this;s.pb(function(e){var t=e*a,r=(e+1)*a-1;r=Math.min(r,o-1);if(void 0===s.Y[e]){var i=s.Y;if(r=(e=e.g.e).length)return 0;if(assert(0<=(i=Math.min(e.length-n,i))),e.slice)for(var o=0;o>2]=0;case 21520:return r.tty?-J.q:-J.Q;case 21531:if(n=X(),!r.n.ib)throw new L(J.Q);return r.n.ib(r,i,n);default:x("bad ioctl syscall "+i)}}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall6:function(e,t){wc=t;try{return mc(xc()),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},_emscripten_set_main_loop_timing:Cc,__ZSt18uncaught_exceptionv:tb,___setErrNo:ob,_sbrk:Ga,___cxa_begin_catch:function(e){var t;tb.p--,ub.push(e);e:{if(e&&!vb[e])for(t in vb)if(vb[t].wd===e)break e;t=e}return t&&vb[t].Sd++,e},_emscripten_memcpy_big:function(e,t,r){return E.set(E.subarray(t,t+r),e),e},_sysconf:function(e){switch(e){case 30:return 4096;case 85:return F/4096;case 132:case 133:case 12:case 137:case 138:case 15:case 235:case 16:case 17:case 18:case 19:case 20:case 149:case 13:case 10:case 236:case 153:case 9:case 21:case 22:case 159:case 154:case 14:case 77:case 78:case 139:case 80:case 81:case 82:case 68:case 67:case 164:case 11:case 29:case 47:case 48:case 95:case 52:case 51:case 46:return 200809;case 79:return 0;case 27:case 246:case 127:case 128:case 23:case 24:case 160:case 161:case 181:case 182:case 242:case 183:case 184:case 243:case 244:case 245:case 165:case 178:case 179:case 49:case 50:case 168:case 169:case 175:case 170:case 171:case 172:case 97:case 76:case 32:case 173:case 35:return-1;case 176:case 177:case 7:case 155:case 8:case 157:case 125:case 126:case 92:case 93:case 129:case 130:case 131:case 94:case 91:return 1;case 74:case 60:case 69:case 70:case 4:return 1024;case 31:case 42:case 72:return 32;case 87:case 26:case 33:return 2147483647;case 34:case 1:return 47839;case 38:case 36:return 99;case 43:case 37:return 2048;case 0:return 2097152;case 3:return 65536;case 28:return 32768;case 44:return 32767;case 75:return 16384;case 39:return 1e3;case 89:return 700;case 71:return 256;case 40:return 255;case 2:return 100;case 180:return 64;case 25:return 20;case 5:return 16;case 6:return 6;case 73:return 4;case 84:return"object"==typeof navigator&&navigator.hardwareConcurrency||1}return ob(J.q),-1},_pthread_getspecific:function(e){return yc[e]||0},_pthread_self:function(){return 0},_pthread_once:wb,_pthread_key_create:function(e){return 0==e?J.q:(C[e>>2]=Ac,yc[Ac]=0,Ac++,0)},___unlock:function(){},_emscripten_set_main_loop:Jc,_pthread_setspecific:function(e,t){return e in yc?(yc[e]=t,0):J.q},___lock:function(){},_abort:function(){e.abort()},_pthread_cleanup_push:pb,_time:function(e){var t=Date.now()/1e3|0;return e&&(C[e>>2]=t),t},___syscall140:function(e,t){wc=t;try{var r=xc(),i=X(),n=X(),o=X(),a=X();return assert(0===i),nc(r,n,a),C[o>>2]=r.position,r.na&&0===n&&0===a&&(r.na=null),0}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},___syscall146:function(e,t){wc=t;try{var r,i=xc(),n=X();e:{for(var o=X(),a=0,s=0;s>2],C[n+(8*s+4)>>2],void 0);if(u<0){r=-1;break e}a+=u}r=a}return r}catch(e){return void 0!==vc&&e instanceof L||x(e),-e.S}},STACKTOP:m,STACK_MAX:Va,tempDoublePtr:mb,ABORT:na,cttz_i8:qd};var Z=function(e,t,r){"use asm";var i=e.Int8Array;var n=e.Int16Array;var o=e.Int32Array;var a=e.Uint8Array;var s=e.Uint16Array;var u=e.Uint32Array;var c=e.Float32Array;var l=e.Float64Array;var de=new i(r);var $=new n(r);var pe=new o(r);var ve=new a(r);var be=new s(r);var f=new u(r);var h=new c(r);var ee=new l(r);var d=e.byteLength;var me=t.STACKTOP|0;var p=t.STACK_MAX|0;var te=t.tempDoublePtr|0;var v=t.ABORT|0;var b=t.cttz_i8|0;var m=0;var y=0;var g=0;var _=0;var w=e.NaN,x=e.Infinity;var T=0,S=0,E=0,M=0,P=0.0,k=0,C=0,A=0,O=0.0;var re=0;var I=0;var R=0;var D=0;var L=0;var j=0;var F=0;var B=0;var N=0;var U=0;var z=e.Math.floor;var X=e.Math.abs;var W=e.Math.sqrt;var q=e.Math.pow;var H=e.Math.cos;var G=e.Math.sin;var V=e.Math.tan;var Y=e.Math.acos;var J=e.Math.asin;var K=e.Math.atan;var Z=e.Math.atan2;var Q=e.Math.exp;var ie=e.Math.log;var ne=e.Math.ceil;var ye=e.Math.imul;var oe=e.Math.min;var ae=e.Math.clz32;var se=t.abort;var ue=t.assert;var ce=t.invoke_iiii;var le=t.invoke_viiiii;var fe=t.invoke_vi;var he=t.invoke_ii;var ge=t.invoke_viii;var _e=t.invoke_v;var we=t.invoke_viiiiii;var xe=t.invoke_iiiiii;var Te=t.invoke_viiii;var Se=t._pthread_cleanup_pop;var Ee=t.___syscall54;var Me=t.___syscall6;var Pe=t._emscripten_set_main_loop_timing;var ke=t.__ZSt18uncaught_exceptionv;var Ce=t.___setErrNo;var Ae=t._sbrk;var Oe=t.___cxa_begin_catch;var Ie=t._emscripten_memcpy_big;var Re=t._sysconf;var De=t._pthread_getspecific;var Le=t._pthread_self;var je=t._pthread_once;var Fe=t._pthread_key_create;var Be=t.___unlock;var Ne=t._emscripten_set_main_loop;var Ue=t._pthread_setspecific;var ze=t.___lock;var Xe=t._abort;var We=t._pthread_cleanup_push;var qe=t._time;var He=t.___syscall140;var Ge=t.___syscall146;var Ve=0.0;function Ye(e){if(d(e)&16777215||d(e)<=16777215||d(e)>2147483648)return false;de=new i(e);$=new n(e);pe=new o(e);ve=new a(e);be=new s(e);f=new u(e);h=new c(e);ee=new l(e);r=e;return true}function Je(e){e=e|0;var t=0;t=me;me=me+e|0;me=me+15&-16;return t|0}function Ke(){return me|0}function Ze(e){e=e|0;me=e}function Qe(e,t){e=e|0;t=t|0;me=e;p=t}function $e(e,t){e=e|0;t=t|0;if(!m){m=e;y=t}}function et(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0]}function tt(e){e=e|0;de[te>>0]=de[e>>0];de[te+1>>0]=de[e+1>>0];de[te+2>>0]=de[e+2>>0];de[te+3>>0]=de[e+3>>0];de[te+4>>0]=de[e+4>>0];de[te+5>>0]=de[e+5>>0];de[te+6>>0]=de[e+6>>0];de[te+7>>0]=de[e+7>>0]}function rt(e){e=e|0;re=e}function it(){return re|0}function nt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+608|0;h=v+88|0;f=v+72|0;u=v+64|0;s=v+48|0;a=v+24|0;o=v;l=v+96|0;d=v+92|0;c=e+4|0;p=e+8|0;if((pe[c>>2]|0)>>>0>(pe[p>>2]|0)>>>0){pe[o>>2]=1154;pe[o+4>>2]=2120;pe[o+8>>2]=1133;_r(l,1100,o)|0;gr(l,v+16|0)|0}if((2147418112/(i>>>0)|0)>>>0<=t>>>0){pe[a>>2]=1154;pe[a+4>>2]=2121;pe[a+8>>2]=1169;_r(l,1100,a)|0;gr(l,v+40|0)|0}a=pe[p>>2]|0;if(a>>>0>=t>>>0){p=1;me=v;return p|0}do{if(r){if(t){o=t+-1|0;if(!(o&t)){o=11;break}else t=o}else t=-1;t=t>>>16|t;t=t>>>8|t;t=t>>>4|t;t=t>>>2|t;t=(t>>>1|t)+1|0;o=10}else o=10}while(0);if((o|0)==10)if(!t){t=0;o=12}else o=11;if((o|0)==11)if(t>>>0<=a>>>0)o=12;if((o|0)==12){pe[s>>2]=1154;pe[s+4>>2]=2130;pe[s+8>>2]=1217;_r(l,1100,s)|0;gr(l,u)|0}r=ye(t,i)|0;do{if(!n){o=ot(pe[e>>2]|0,r,d,1)|0;if(!o){p=0;me=v;return p|0}else{pe[e>>2]=o;break}}else{a=at(r,d)|0;if(!a){p=0;me=v;return p|0}Ai[n&0](a,pe[e>>2]|0,pe[c>>2]|0);o=pe[e>>2]|0;do{if(o)if(!(o&7)){Ri[pe[104>>2]&1](o,0,0,1,pe[27]|0)|0;break}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;break}}while(0);pe[e>>2]=a}}while(0);o=pe[d>>2]|0;if(o>>>0>r>>>0)t=(o>>>0)/(i>>>0)|0;pe[p>>2]=t;p=1;me=v;return p|0}function ot(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=me;me=me+592|0;u=c+48|0;o=c+24|0;n=c;s=c+72|0;a=c+68|0;if(e&7){pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1494;_r(s,1100,n)|0;gr(s,c+16|0)|0;u=0;me=c;return u|0}if(t>>>0>2147418112){pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1387;_r(s,1100,o)|0;gr(s,c+40|0)|0;u=0;me=c;return u|0}pe[a>>2]=t;i=Ri[pe[104>>2]&1](e,t,a,i,pe[27]|0)|0;if(r)pe[r>>2]=pe[a>>2];if(!(i&7)){u=i;me=c;return u|0}pe[u>>2]=1154;pe[u+4>>2]=2551;pe[u+8>>2]=1440;_r(s,1100,u)|0;gr(s,c+64|0)|0;u=i;me=c;return u|0}function at(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+592|0;a=u+48|0;s=u+24|0;r=u;o=u+72|0;n=u+68|0;i=e+3&-4;i=(i|0)!=0?i:4;if(i>>>0>2147418112){pe[r>>2]=1154;pe[r+4>>2]=2499;pe[r+8>>2]=1387;_r(o,1100,r)|0;gr(o,u+16|0)|0;s=0;me=u;return s|0}pe[n>>2]=i;r=Ri[pe[104>>2]&1](0,i,n,1,pe[27]|0)|0;e=pe[n>>2]|0;if(t)pe[t>>2]=e;if((r|0)==0|e>>>0>>0){pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1413;_r(o,1100,s)|0;gr(o,u+40|0)|0;s=0;me=u;return s|0}if(!(r&7)){s=r;me=u;return s|0}pe[a>>2]=1154;pe[a+4>>2]=2526;pe[a+8>>2]=1440;_r(o,1100,a)|0;gr(o,u+64|0)|0;s=r;me=u;return s|0}function st(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0;B=me;me=me+960|0;L=B+232|0;D=B+216|0;R=B+208|0;I=B+192|0;O=B+184|0;A=B+168|0;C=B+160|0;k=B+144|0;E=B+136|0;S=B+120|0;T=B+112|0;x=B+96|0;g=B+88|0;y=B+72|0;m=B+64|0;b=B+48|0;f=B+40|0;d=B+24|0;h=B+16|0;l=B;P=B+440|0;j=B+376|0;F=B+304|0;v=B+236|0;if((t|0)==0|i>>>0>11){e=0;me=B;return e|0}pe[e>>2]=t;n=F;o=n+68|0;do{pe[n>>2]=0;n=n+4|0}while((n|0)<(o|0));o=0;do{n=de[r+o>>0]|0;if(n<<24>>24){M=F+((n&255)<<2)|0;pe[M>>2]=(pe[M>>2]|0)+1}o=o+1|0}while((o|0)!=(t|0));o=0;c=1;a=0;s=-1;u=0;while(1){n=pe[F+(c<<2)>>2]|0;if(!n)pe[e+28+(c+-1<<2)>>2]=0;else{M=c+-1|0;pe[j+(M<<2)>>2]=o;o=n+o|0;w=16-c|0;pe[e+28+(M<<2)>>2]=(o+-1<>2]=u;pe[v+(c<<2)>>2]=u;a=a>>>0>c>>>0?a:c;s=s>>>0>>0?s:c;u=n+u|0}c=c+1|0;if((c|0)==17){M=a;break}else o=o<<1}pe[e+4>>2]=u;o=e+172|0;do{if(u>>>0>(pe[o>>2]|0)>>>0){pe[o>>2]=u;if(u){n=u+-1|0;if(n&u)p=14}else{n=-1;p=14}if((p|0)==14){w=n>>>16|n;w=w>>>8|w;w=w>>>4|w;w=w>>>2|w;w=(w>>>1|w)+1|0;pe[o>>2]=w>>>0>t>>>0?t:w}a=e+176|0;n=pe[a>>2]|0;do{if(n){w=pe[n+-4>>2]|0;n=n+-8|0;if(!((w|0)!=0?(w|0)==(~pe[n>>2]|0):0)){pe[l>>2]=1154;pe[l+4>>2]=644;pe[l+8>>2]=1863;_r(P,1100,l)|0;gr(P,h)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(P,1100,d)|0;gr(P,f)|0;break}}}while(0);o=pe[o>>2]|0;o=(o|0)!=0?o:1;n=at((o<<1)+8|0,0)|0;if(!n){pe[a>>2]=0;n=0;break}else{pe[n+4>>2]=o;pe[n>>2]=~o;pe[a>>2]=n+8;p=25;break}}else p=25}while(0);e:do{if((p|0)==25){w=e+24|0;de[w>>0]=s;de[e+25>>0]=M;o=e+176|0;a=0;do{_=de[r+a>>0]|0;n=_&255;if(_<<24>>24){if(!(pe[F+(n<<2)>>2]|0)){pe[b>>2]=1154;pe[b+4>>2]=2273;pe[b+8>>2]=1261;_r(P,1100,b)|0;gr(P,m)|0}_=v+(n<<2)|0;n=pe[_>>2]|0;pe[_>>2]=n+1;if(n>>>0>=u>>>0){pe[y>>2]=1154;pe[y+4>>2]=2277;pe[y+8>>2]=1274;_r(P,1100,y)|0;gr(P,g)|0}$[(pe[o>>2]|0)+(n<<1)>>1]=a}a=a+1|0}while((a|0)!=(t|0));n=de[w>>0]|0;g=(n&255)>>>0>>0?i:0;_=e+8|0;pe[_>>2]=g;y=(g|0)!=0;if(y){m=1<>>0>(pe[n>>2]|0)>>>0){pe[n>>2]=m;a=e+168|0;n=pe[a>>2]|0;do{if(n){b=pe[n+-4>>2]|0;n=n+-8|0;if(!((b|0)!=0?(b|0)==(~pe[n>>2]|0):0)){pe[x>>2]=1154;pe[x+4>>2]=644;pe[x+8>>2]=1863;_r(P,1100,x)|0;gr(P,T)|0}if(!(n&7)){Ri[pe[104>>2]&1](n,0,0,1,pe[27]|0)|0;break}else{pe[S>>2]=1154;pe[S+4>>2]=2499;pe[S+8>>2]=1516;_r(P,1100,S)|0;gr(P,E)|0;break}}}while(0);n=m<<2;o=at(n+8|0,0)|0;if(!o){pe[a>>2]=0;n=0;break e}else{E=o+8|0;pe[o+4>>2]=m;pe[o>>2]=~m;pe[a>>2]=E;o=E;break}}else{o=e+168|0;n=m<<2;a=o;o=pe[o>>2]|0}}while(0);Yr(o|0,-1,n|0)|0;p=e+176|0;b=1;do{if(pe[F+(b<<2)>>2]|0){t=g-b|0;v=1<>2]|0;if(o>>>0>=16){pe[k>>2]=1154;pe[k+4>>2]=1953;pe[k+8>>2]=1737;_r(P,1100,k)|0;gr(P,C)|0}n=pe[e+28+(o<<2)>>2]|0;if(!n)d=-1;else d=(n+-1|0)>>>(16-b|0);if(s>>>0<=d>>>0){f=(pe[e+96+(o<<2)>>2]|0)-s|0;h=b<<16;do{n=be[(pe[p>>2]|0)+(f+s<<1)>>1]|0;if((ve[r+n>>0]|0|0)!=(b|0)){pe[A>>2]=1154;pe[A+4>>2]=2319;pe[A+8>>2]=1303;_r(P,1100,A)|0;gr(P,O)|0}l=s<>>0>=m>>>0){pe[I>>2]=1154;pe[I+4>>2]=2325;pe[I+8>>2]=1337;_r(P,1100,I)|0;gr(P,R)|0}n=pe[a>>2]|0;if((pe[n+(u<<2)>>2]|0)!=-1){pe[D>>2]=1154;pe[D+4>>2]=2327;pe[D+8>>2]=1360;_r(P,1100,D)|0;gr(P,L)|0;n=pe[a>>2]|0}pe[n+(u<<2)>>2]=o;c=c+1|0}while(c>>>0>>0);s=s+1|0}while(s>>>0<=d>>>0)}}b=b+1|0}while(g>>>0>=b>>>0);n=de[w>>0]|0}o=e+96|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j>>2]|0);o=e+100|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+4>>2]|0);o=e+104|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+8>>2]|0);o=e+108|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+12>>2]|0);o=e+112|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+16>>2]|0);o=e+116|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+20>>2]|0);o=e+120|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+24>>2]|0);o=e+124|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+28>>2]|0);o=e+128|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+32>>2]|0);o=e+132|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+36>>2]|0);o=e+136|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+40>>2]|0);o=e+140|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+44>>2]|0);o=e+144|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+48>>2]|0);o=e+148|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+52>>2]|0);o=e+152|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+56>>2]|0);o=e+156|0;pe[o>>2]=(pe[o>>2]|0)-(pe[j+60>>2]|0);o=e+16|0;pe[o>>2]=0;a=e+20|0;pe[a>>2]=n&255;t:do{if(y){while(1){if(!i)break t;n=i+-1|0;if(!(pe[F+(i<<2)>>2]|0))i=n;else break}pe[o>>2]=pe[e+28+(n<<2)>>2];n=g+1|0;pe[a>>2]=n;if(n>>>0<=M>>>0){while(1){if(pe[F+(n<<2)>>2]|0)break;n=n+1|0;if(n>>>0>M>>>0)break t}pe[a>>2]=n}}}while(0);pe[e+92>>2]=-1;pe[e+160>>2]=1048575;pe[e+12>>2]=32-(pe[_>>2]|0);n=1}}while(0);e=n;me=B;return e|0}function ut(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0;if(!e){n=Ur(t)|0;if(!r){r=n;return r|0}if(!n)o=0;else o=Wr(n)|0;pe[r>>2]=o;r=n;return r|0}if(!t){zr(e);if(!r){r=0;return r|0}pe[r>>2]=0;r=0;return r|0}n=Xr(e,t)|0;o=(n|0)!=0;if(o|i^1)o=o?n:e;else{n=Xr(e,t)|0;o=(n|0)==0?e:n}if(!r){r=n;return r|0}t=Wr(o)|0;pe[r>>2]=t;r=n;return r|0}function ct(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(!((e|0)!=0&t>>>0>73&(r|0)!=0)){r=0;return r|0}if((pe[r>>2]|0)!=40|t>>>0<74){r=0;return r|0}if(((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)!=18552){r=0;return r|0}if(((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0<74){r=0;return r|0}if(((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0>t>>>0){r=0;return r|0}pe[r+4>>2]=(ve[e+12>>0]|0)<<8|(ve[e+13>>0]|0);pe[r+8>>2]=(ve[e+14>>0]|0)<<8|(ve[e+15>>0]|0);pe[r+12>>2]=ve[e+16>>0];pe[r+16>>2]=ve[e+17>>0];t=e+18|0;i=r+32|0;pe[i>>2]=ve[t>>0];pe[i+4>>2]=0;t=de[t>>0]|0;pe[r+20>>2]=t<<24>>24==0|t<<24>>24==9?8:16;pe[r+24>>2]=(ve[e+26>>0]|0)<<16|(ve[e+25>>0]|0)<<24|(ve[e+27>>0]|0)<<8|(ve[e+28>>0]|0);pe[r+28>>2]=(ve[e+30>>0]|0)<<16|(ve[e+29>>0]|0)<<24|(ve[e+31>>0]|0)<<8|(ve[e+32>>0]|0);r=1;return r|0}function lt(e){e=e|0;Oe(e|0)|0;zt()}function ft(e){e=e|0;var t=0,r=0,i=0,n=0,o=0;o=me;me=me+544|0;n=o;i=o+24|0;t=pe[e+20>>2]|0;if(t)ht(t);t=e+4|0;r=pe[t>>2]|0;if(!r){n=e+16|0;de[n>>0]=0;me=o;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(i,1100,n)|0;gr(i,o+16|0)|0}pe[t>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;n=e+16|0;de[n>>0]=0;me=o;return}function ht(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=me;me=me+640|0;h=d+112|0;f=d+96|0;l=d+88|0;c=d+72|0;u=d+64|0;s=d+48|0;i=d+40|0;o=d+24|0;n=d+16|0;r=d;a=d+120|0;if(!e){me=d;return}t=pe[e+168>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[r>>2]=1154;pe[r+4>>2]=644;pe[r+8>>2]=1863;_r(a,1100,r)|0;gr(a,n)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[o>>2]=1154;pe[o+4>>2]=2499;pe[o+8>>2]=1516;_r(a,1100,o)|0;gr(a,i)|0;break}}}while(0);t=pe[e+176>>2]|0;do{if(t){p=pe[t+-4>>2]|0;t=t+-8|0;if(!((p|0)!=0?(p|0)==(~pe[t>>2]|0):0)){pe[s>>2]=1154;pe[s+4>>2]=644;pe[s+8>>2]=1863;_r(a,1100,s)|0;gr(a,u)|0}if(!(t&7)){Ri[pe[104>>2]&1](t,0,0,1,pe[27]|0)|0;break}else{pe[c>>2]=1154;pe[c+4>>2]=2499;pe[c+8>>2]=1516;_r(a,1100,c)|0;gr(a,l)|0;break}}}while(0);if(!(e&7)){Ri[pe[104>>2]&1](e,0,0,1,pe[27]|0)|0;me=d;return}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(a,1100,f)|0;gr(a,h)|0;me=d;return}}function dt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;a=l+40|0;s=l+24|0;t=l;o=l+48|0;n=e+8|0;r=pe[n>>2]|0;if((r+-1|0)>>>0>=8192){pe[t>>2]=1154;pe[t+4>>2]=2997;pe[t+8>>2]=1541;_r(o,1100,t)|0;gr(o,l+16|0)|0}pe[e>>2]=r;i=e+20|0;t=pe[i>>2]|0;if(!t){t=at(180,0)|0;if(!t)t=0;else{c=t+164|0;pe[c>>2]=0;pe[c+4>>2]=0;pe[c+8>>2]=0;pe[c+12>>2]=0}pe[i>>2]=t;c=t;u=pe[e>>2]|0}else{c=t;u=r}if(!(pe[n>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(o,1100,s)|0;gr(o,a)|0;o=pe[e>>2]|0}else o=u;n=pe[e+4>>2]|0;if(o>>>0>16){r=o;t=0}else{e=0;c=st(c,u,n,e)|0;me=l;return c|0}while(1){i=t+1|0;if(r>>>0>3){r=r>>>1;t=i}else{r=i;break}}e=t+2+((r|0)!=32&1<>>0>>0&1)|0;e=e>>>0<11?e&255:11;c=st(c,u,n,e)|0;me=l;return c|0}function pt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0;L=me;me=me+800|0;A=L+256|0;C=L+240|0;k=L+232|0;P=L+216|0;M=L+208|0;E=L+192|0;S=L+184|0;T=L+168|0;x=L+160|0;w=L+144|0;_=L+136|0;g=L+120|0;y=L+112|0;m=L+96|0;b=L+88|0;v=L+72|0;f=L+64|0;l=L+48|0;s=L+40|0;u=L+24|0;o=L+16|0;n=L;R=L+288|0;D=L+264|0;O=vt(e,14)|0;if(!O){pe[t>>2]=0;r=t+4|0;i=pe[r>>2]|0;if(i){if(!(i&7))Ri[pe[104>>2]&1](i,0,0,1,pe[27]|0)|0;else{pe[n>>2]=1154;pe[n+4>>2]=2499;pe[n+8>>2]=1516;_r(R,1100,n)|0;gr(R,o)|0}pe[r>>2]=0;pe[t+8>>2]=0;pe[t+12>>2]=0}de[t+16>>0]=0;r=t+20|0;i=pe[r>>2]|0;if(!i){t=1;me=L;return t|0}ht(i);pe[r>>2]=0;t=1;me=L;return t|0}d=t+4|0;p=t+8|0;r=pe[p>>2]|0;if((r|0)!=(O|0)){if(r>>>0<=O>>>0){do{if((pe[t+12>>2]|0)>>>0>>0){if(nt(d,O,(r+1|0)==(O|0),1,0)|0){r=pe[p>>2]|0;break}de[t+16>>0]=1;t=0;me=L;return t|0}}while(0);Yr((pe[d>>2]|0)+r|0,0,O-r|0)|0}pe[p>>2]=O}Yr(pe[d>>2]|0,0,O|0)|0;h=e+20|0;r=pe[h>>2]|0;if((r|0)<5){o=e+4|0;a=e+8|0;n=e+16|0;do{i=pe[o>>2]|0;if((i|0)==(pe[a>>2]|0))i=0;else{pe[o>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(R,1100,u)|0;gr(R,s)|0;r=pe[h>>2]|0}i=i<<32-r|pe[n>>2];pe[n>>2]=i}while((r|0)<5)}else{i=e+16|0;n=i;i=pe[i>>2]|0}c=i>>>27;pe[n>>2]=i<<5;pe[h>>2]=r+-5;if((c+-1|0)>>>0>20){t=0;me=L;return t|0}pe[D+20>>2]=0;pe[D>>2]=0;pe[D+4>>2]=0;pe[D+8>>2]=0;pe[D+12>>2]=0;de[D+16>>0]=0;r=D+4|0;i=D+8|0;e:do{if(nt(r,21,0,1,0)|0){s=pe[i>>2]|0;u=pe[r>>2]|0;Yr(u+s|0,0,21-s|0)|0;pe[i>>2]=21;if(c){n=e+4|0;o=e+8|0;a=e+16|0;s=0;do{r=pe[h>>2]|0;if((r|0)<3)do{i=pe[n>>2]|0;if((i|0)==(pe[o>>2]|0))i=0;else{pe[n>>2]=i+1;i=ve[i>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[l>>2]=1154;pe[l+4>>2]=3199;pe[l+8>>2]=1650;_r(R,1100,l)|0;gr(R,f)|0;r=pe[h>>2]|0}i=i<<32-r|pe[a>>2];pe[a>>2]=i}while((r|0)<3);else i=pe[a>>2]|0;pe[a>>2]=i<<3;pe[h>>2]=r+-3;de[u+(ve[1611+s>>0]|0)>>0]=i>>>29;s=s+1|0}while((s|0)!=(c|0))}if(dt(D)|0){s=e+4|0;u=e+8|0;c=e+16|0;i=0;t:while(1){a=O-i|0;r=bt(e,D)|0;r:do{if(r>>>0<17){if((pe[p>>2]|0)>>>0<=i>>>0){pe[v>>2]=1154;pe[v+4>>2]=903;pe[v+8>>2]=1781;_r(R,1100,v)|0;gr(R,b)|0}de[(pe[d>>2]|0)+i>>0]=r;r=i+1|0}else switch(r|0){case 17:{r=pe[h>>2]|0;if((r|0)<3)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[m>>2]=1154;pe[m+4>>2]=3199;pe[m+8>>2]=1650;_r(R,1100,m)|0;gr(R,y)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<3);else n=pe[c>>2]|0;pe[c>>2]=n<<3;pe[h>>2]=r+-3;r=(n>>>29)+3|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}case 18:{r=pe[h>>2]|0;if((r|0)<7)do{n=pe[s>>2]|0;if((n|0)==(pe[u>>2]|0))n=0;else{pe[s>>2]=n+1;n=ve[n>>0]|0}r=r+8|0;pe[h>>2]=r;if((r|0)>=33){pe[g>>2]=1154;pe[g+4>>2]=3199;pe[g+8>>2]=1650;_r(R,1100,g)|0;gr(R,_)|0;r=pe[h>>2]|0}n=n<<32-r|pe[c>>2];pe[c>>2]=n}while((r|0)<7);else n=pe[c>>2]|0;pe[c>>2]=n<<7;pe[h>>2]=r+-7;r=(n>>>25)+11|0;if(r>>>0>a>>>0){r=0;break e}r=r+i|0;break r}default:{if((r+-19|0)>>>0>=2){I=90;break t}o=pe[h>>2]|0;if((r|0)==19){if((o|0)<2){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[w>>2]=1154;pe[w+4>>2]=3199;pe[w+8>>2]=1650;_r(R,1100,w)|0;gr(R,x)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<2)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<2;pe[h>>2]=r+-2;o=(n>>>30)+3|0}else{if((o|0)<6){n=o;while(1){r=pe[s>>2]|0;if((r|0)==(pe[u>>2]|0))o=0;else{pe[s>>2]=r+1;o=ve[r>>0]|0}r=n+8|0;pe[h>>2]=r;if((r|0)>=33){pe[T>>2]=1154;pe[T+4>>2]=3199;pe[T+8>>2]=1650;_r(R,1100,T)|0;gr(R,S)|0;r=pe[h>>2]|0}n=o<<32-r|pe[c>>2];pe[c>>2]=n;if((r|0)<6)n=r;else break}}else{n=pe[c>>2]|0;r=o}pe[c>>2]=n<<6;pe[h>>2]=r+-6;o=(n>>>26)+7|0}if((i|0)==0|o>>>0>a>>>0){r=0;break e}r=i+-1|0;if((pe[p>>2]|0)>>>0<=r>>>0){pe[E>>2]=1154;pe[E+4>>2]=903;pe[E+8>>2]=1781;_r(R,1100,E)|0;gr(R,M)|0}n=de[(pe[d>>2]|0)+r>>0]|0;if(!(n<<24>>24)){r=0;break e}r=o+i|0;if(i>>>0>=r>>>0){r=i;break r}do{if((pe[p>>2]|0)>>>0<=i>>>0){pe[P>>2]=1154;pe[P+4>>2]=903;pe[P+8>>2]=1781;_r(R,1100,P)|0;gr(R,k)|0}de[(pe[d>>2]|0)+i>>0]=n;i=i+1|0}while((i|0)!=(r|0))}}}while(0);if(O>>>0>r>>>0)i=r;else break}if((I|0)==90){pe[C>>2]=1154;pe[C+4>>2]=3140;pe[C+8>>2]=1632;_r(R,1100,C)|0;gr(R,A)|0;r=0;break}if((O|0)==(r|0))r=dt(t)|0;else r=0}else r=0}else{de[D+16>>0]=1;r=0}}while(0);ft(D);t=r;me=L;return t|0}function vt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;s=l+16|0;a=l;o=l+24|0;if(!t){c=0;me=l;return c|0}if(t>>>0<=16){c=mt(e,t)|0;me=l;return c|0}u=mt(e,t+-16|0)|0;c=e+20|0;t=pe[c>>2]|0;if((t|0)<16){i=e+4|0;n=e+8|0;r=e+16|0;do{e=pe[i>>2]|0;if((e|0)==(pe[n>>2]|0))e=0;else{pe[i>>2]=e+1;e=ve[e>>0]|0}t=t+8|0;pe[c>>2]=t;if((t|0)>=33){pe[a>>2]=1154;pe[a+4>>2]=3199;pe[a+8>>2]=1650;_r(o,1100,a)|0;gr(o,s)|0;t=pe[c>>2]|0}e=e<<32-t|pe[r>>2];pe[r>>2]=e}while((t|0)<16)}else{e=e+16|0;r=e;e=pe[e>>2]|0}pe[r>>2]=e<<16;pe[c>>2]=t+-16;c=e>>>16|u<<16;me=l;return c|0}function bt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;g=me;me=me+608|0;v=g+88|0;p=g+72|0;h=g+64|0;f=g+48|0;l=g+40|0;d=g+24|0;c=g+16|0;u=g;m=g+96|0;b=pe[t+20>>2]|0;y=e+20|0;s=pe[y>>2]|0;do{if((s|0)<24){a=e+4|0;i=pe[a>>2]|0;n=pe[e+8>>2]|0;r=i>>>0>>0;if((s|0)>=16){if(r){pe[a>>2]=i+1;r=ve[i>>0]|0}else r=0;pe[y>>2]=s+8;a=e+16|0;o=r<<24-s|pe[a>>2];pe[a>>2]=o;break}if(r){o=(ve[i>>0]|0)<<8;r=i+1|0}else{o=0;r=i}if(r>>>0>>0){i=ve[r>>0]|0;r=r+1|0}else i=0;pe[a>>2]=r;pe[y>>2]=s+16;a=e+16|0;o=(i|o)<<16-s|pe[a>>2];pe[a>>2]=o}else{o=e+16|0;a=o;o=pe[o>>2]|0}}while(0);n=(o>>>16)+1|0;do{if(n>>>0<=(pe[b+16>>2]|0)>>>0){i=pe[(pe[b+168>>2]|0)+(o>>>(32-(pe[b+8>>2]|0)|0)<<2)>>2]|0;if((i|0)==-1){pe[u>>2]=1154;pe[u+4>>2]=3244;pe[u+8>>2]=1677;_r(m,1100,u)|0;gr(m,c)|0}r=i&65535;i=i>>>16;if((pe[t+8>>2]|0)>>>0<=r>>>0){pe[d>>2]=1154;pe[d+4>>2]=902;pe[d+8>>2]=1781;_r(m,1100,d)|0;gr(m,l)|0}if((ve[(pe[t+4>>2]|0)+r>>0]|0|0)!=(i|0)){pe[f>>2]=1154;pe[f+4>>2]=3248;pe[f+8>>2]=1694;_r(m,1100,f)|0;gr(m,h)|0}}else{i=pe[b+20>>2]|0;while(1){r=i+-1|0;if(n>>>0>(pe[b+28+(r<<2)>>2]|0)>>>0)i=i+1|0;else break}r=(o>>>(32-i|0))+(pe[b+96+(r<<2)>>2]|0)|0;if(r>>>0<(pe[t>>2]|0)>>>0){r=be[(pe[b+176>>2]|0)+(r<<1)>>1]|0;break}pe[p>>2]=1154;pe[p+4>>2]=3266;pe[p+8>>2]=1632;_r(m,1100,p)|0;gr(m,v)|0;y=0;me=g;return y|0}}while(0);pe[a>>2]=pe[a>>2]<>2]=(pe[y>>2]|0)-i;y=r;me=g;return y|0}function mt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+560|0;s=l+40|0;u=l+24|0;r=l;a=l+48|0;if(t>>>0>=33){pe[r>>2]=1154;pe[r+4>>2]=3190;pe[r+8>>2]=1634;_r(a,1100,r)|0;gr(a,l+16|0)|0}c=e+20|0;r=pe[c>>2]|0;if((r|0)>=(t|0)){o=e+16|0;a=o;o=pe[o>>2]|0;s=r;u=32-t|0;u=o>>>u;o=o<>2]=o;t=s-t|0;pe[c>>2]=t;me=l;return u|0}n=e+4|0;o=e+8|0;i=e+16|0;do{e=pe[n>>2]|0;if((e|0)==(pe[o>>2]|0))e=0;else{pe[n>>2]=e+1;e=ve[e>>0]|0}r=r+8|0;pe[c>>2]=r;if((r|0)>=33){pe[u>>2]=1154;pe[u+4>>2]=3199;pe[u+8>>2]=1650;_r(a,1100,u)|0;gr(a,s)|0;r=pe[c>>2]|0}e=e<<32-r|pe[i>>2];pe[i>>2]=e}while((r|0)<(t|0));u=32-t|0;u=e>>>u;s=e<>2]=s;t=r-t|0;pe[c>>2]=t;me=l;return u|0}function yt(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0;p=me;me=me+544|0;h=p+16|0;f=p;l=p+24|0;if((e|0)==0|t>>>0<62){d=0;me=p;return d|0}c=at(300,0)|0;if(!c){d=0;me=p;return d|0}pe[c>>2]=519686845;r=c+4|0;pe[r>>2]=0;i=c+8|0;pe[i>>2]=0;u=c+88|0;n=c+136|0;o=c+160|0;a=u;s=a+44|0;do{pe[a>>2]=0;a=a+4|0}while((a|0)<(s|0));de[u+44>>0]=0;v=c+184|0;a=c+208|0;s=c+232|0;b=c+252|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+268|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;b=c+284|0;pe[b>>2]=0;pe[b+4>>2]=0;pe[b+8>>2]=0;de[b+12>>0]=0;pe[n>>2]=0;pe[n+4>>2]=0;pe[n+8>>2]=0;pe[n+12>>2]=0;pe[n+16>>2]=0;de[n+20>>0]=0;pe[o>>2]=0;pe[o+4>>2]=0;pe[o+8>>2]=0;pe[o+12>>2]=0;pe[o+16>>2]=0;de[o+20>>0]=0;pe[v>>2]=0;pe[v+4>>2]=0;pe[v+8>>2]=0;pe[v+12>>2]=0;pe[v+16>>2]=0;de[v+20>>0]=0;pe[a>>2]=0;pe[a+4>>2]=0;pe[a+8>>2]=0;pe[a+12>>2]=0;pe[a+16>>2]=0;de[a+20>>0]=0;pe[s>>2]=0;pe[s+4>>2]=0;pe[s+8>>2]=0;pe[s+12>>2]=0;de[s+16>>0]=0;do{if(((t>>>0>=74?((ve[e>>0]|0)<<8|(ve[e+1>>0]|0)|0)==18552:0)?((ve[e+2>>0]|0)<<8|(ve[e+3>>0]|0))>>>0>=74:0)?((ve[e+7>>0]|0)<<16|(ve[e+6>>0]|0)<<24|(ve[e+8>>0]|0)<<8|(ve[e+9>>0]|0))>>>0<=t>>>0:0){pe[u>>2]=e;pe[r>>2]=e;pe[i>>2]=t;if(Pt(c)|0){r=pe[u>>2]|0;if((ve[r+39>>0]|0)<<8|(ve[r+40>>0]|0)){if(!(kt(c)|0))break;if(!(Ct(c)|0))break;r=pe[u>>2]|0}if(!((ve[r+55>>0]|0)<<8|(ve[r+56>>0]|0))){b=c;me=p;return b|0}if(At(c)|0?Ot(c)|0:0){b=c;me=p;return b|0}}}else d=7}while(0);if((d|0)==7)pe[u>>2]=0;jt(c);if(!(c&7)){Ri[pe[104>>2]&1](c,0,0,1,pe[27]|0)|0;b=0;me=p;return b|0}else{pe[f>>2]=1154;pe[f+4>>2]=2499;pe[f+8>>2]=1516;_r(l,1100,f)|0;gr(l,h)|0;b=0;me=p;return b|0}return 0}function gt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+544|0;c=l;u=l+24|0;o=pe[e+88>>2]|0;s=(ve[o+70+(n<<2)+1>>0]|0)<<16|(ve[o+70+(n<<2)>>0]|0)<<24|(ve[o+70+(n<<2)+2>>0]|0)<<8|(ve[o+70+(n<<2)+3>>0]|0);a=n+1|0;if(a>>>0<(ve[o+16>>0]|0)>>>0)o=(ve[o+70+(a<<2)+1>>0]|0)<<16|(ve[o+70+(a<<2)>>0]|0)<<24|(ve[o+70+(a<<2)+2>>0]|0)<<8|(ve[o+70+(a<<2)+3>>0]|0);else o=pe[e+8>>2]|0;if(o>>>0>s>>>0){u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}pe[c>>2]=1154;pe[c+4>>2]=3704;pe[c+8>>2]=1792;_r(u,1100,c)|0;gr(u,l+16|0)|0;u=e+4|0;u=pe[u>>2]|0;u=u+s|0;c=o-s|0;c=_t(e,u,c,t,r,i,n)|0;me=l;return c|0}function _t(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;var s=0,u=0,c=0,l=0;l=pe[e+88>>2]|0;u=((ve[l+12>>0]|0)<<8|(ve[l+13>>0]|0))>>>a;c=((ve[l+14>>0]|0)<<8|(ve[l+15>>0]|0))>>>a;u=u>>>0>1?(u+3|0)>>>2:1;c=c>>>0>1?(c+3|0)>>>2:1;l=l+18|0;a=de[l>>0]|0;a=ye(a<<24>>24==0|a<<24>>24==9?8:16,u)|0;if(o)if((o&3|0)==0&a>>>0<=o>>>0)a=o;else{e=0;return e|0}if((ye(a,c)|0)>>>0>n>>>0){e=0;return e|0}o=(u+1|0)>>>1;s=(c+1|0)>>>1;if(!r){e=0;return e|0}pe[e+92>>2]=t;pe[e+96>>2]=t;pe[e+104>>2]=r;pe[e+100>>2]=t+r;pe[e+108>>2]=0;pe[e+112>>2]=0;switch(ve[l>>0]|0|0){case 0:{It(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 4:case 6:case 5:case 3:case 2:{Rt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 9:{Dt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}case 8:case 7:{Lt(e,i,n,a,u,c,o,s)|0;e=1;return e|0}default:{e=0;return e|0}}return 0}function wt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+4>>2]|0}function xt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+8>>2]|0}function Tt(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+12>>2]|0}function St(e,t){e=e|0;t=t|0;var r=0,i=0;i=me;me=me+48|0;r=i;pe[r>>2]=40;ct(e,t,r)|0;me=i;return pe[r+32>>2]|0}function Et(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0;u=me;me=me+576|0;a=u+56|0;o=u+40|0;n=u+64|0;c=u;pe[c>>2]=40;ct(e,t,c)|0;i=(((pe[c+4>>2]|0)>>>r)+3|0)>>>2;t=(((pe[c+8>>2]|0)>>>r)+3|0)>>>2;r=c+32|0;e=pe[r+4>>2]|0;do{switch(pe[r>>2]|0){case 0:{if(!e)e=8;else s=13;break}case 1:{if(!e)s=12;else s=13;break}case 2:{if(!e)s=12;else s=13;break}case 3:{if(!e)s=12;else s=13;break}case 4:{if(!e)s=12;else s=13;break}case 5:{if(!e)s=12;else s=13;break}case 6:{if(!e)s=12;else s=13;break}case 7:{if(!e)s=12;else s=13;break}case 8:{if(!e)s=12;else s=13;break}case 9:{if(!e)e=8;else s=13;break}default:s=13}}while(0);if((s|0)==12)e=16;else if((s|0)==13){pe[o>>2]=1154;pe[o+4>>2]=2663;pe[o+8>>2]=1535;_r(n,1100,o)|0;gr(n,a)|0;e=0}c=ye(ye(t,i)|0,e)|0;me=u;return c|0}function Mt(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;p=me;me=me+608|0;h=p+80|0;d=p+64|0;s=p+56|0;a=p+40|0;l=p+88|0;v=p;f=p+84|0;pe[v>>2]=40;ct(e,t,v)|0;u=(((pe[v+4>>2]|0)>>>n)+3|0)>>>2;v=v+32|0;o=pe[v+4>>2]|0;do{switch(pe[v>>2]|0){case 0:{if(!o)o=8;else c=13;break}case 1:{if(!o)c=12;else c=13;break}case 2:{if(!o)c=12;else c=13;break}case 3:{if(!o)c=12;else c=13;break}case 4:{if(!o)c=12;else c=13;break}case 5:{if(!o)c=12;else c=13;break}case 6:{if(!o)c=12;else c=13;break}case 7:{if(!o)c=12;else c=13;break}case 8:{if(!o)c=12;else c=13;break}case 9:{if(!o)o=8;else c=13;break}default:c=13}}while(0);if((c|0)==12)o=16;else if((c|0)==13){pe[a>>2]=1154;pe[a+4>>2]=2663;pe[a+8>>2]=1535;_r(l,1100,a)|0;gr(l,s)|0;o=0}s=ye(o,u)|0;a=yt(e,t)|0;pe[f>>2]=r;o=(a|0)==0;if(!(n>>>0>15|(i>>>0<8|o))?(pe[a>>2]|0)==519686845:0)gt(a,f,i,s,n)|0;if(o){me=p;return}if((pe[a>>2]|0)!=519686845){me=p;return}jt(a);if(!(a&7)){Ri[pe[104>>2]&1](a,0,0,1,pe[27]|0)|0;me=p;return}else{pe[d>>2]=1154;pe[d+4>>2]=2499;pe[d+8>>2]=1516;_r(l,1100,d)|0;gr(l,h)|0;me=p;return}}function Pt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;a=e+92|0;i=pe[e+4>>2]|0;o=e+88|0;n=pe[o>>2]|0;t=(ve[n+68>>0]|0)<<8|(ve[n+67>>0]|0)<<16|(ve[n+69>>0]|0);r=i+t|0;n=(ve[n+65>>0]|0)<<8|(ve[n+66>>0]|0);if(!n){e=0;return e|0}pe[a>>2]=r;pe[e+96>>2]=r;pe[e+104>>2]=n;pe[e+100>>2]=i+(n+t);pe[e+108>>2]=0;pe[e+112>>2]=0;if(!(pt(a,e+116|0)|0)){e=0;return e|0}t=pe[o>>2]|0;do{if(!((ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0))){if(!((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0))){e=0;return e|0}}else{if(!(pt(a,e+140|0)|0)){e=0;return e|0}if(pt(a,e+188|0)|0){t=pe[o>>2]|0;break}else{e=0;return e|0}}}while(0);if((ve[t+55>>0]|0)<<8|(ve[t+56>>0]|0)){if(!(pt(a,e+164|0)|0)){e=0;return e|0}if(!(pt(a,e+212|0)|0)){e=0;return e|0}}e=1;return e|0}function kt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+592|0;u=p+16|0;s=p;a=p+72|0;d=p+24|0;i=e+88|0;t=pe[i>>2]|0;h=(ve[t+39>>0]|0)<<8|(ve[t+40>>0]|0);l=e+236|0;o=e+240|0;r=pe[o>>2]|0;if((r|0)!=(h|0)){if(r>>>0<=h>>>0){do{if((pe[e+244>>2]|0)>>>0>>0){if(nt(l,h,(r+1|0)==(h|0),4,0)|0){t=pe[o>>2]|0;break}de[e+248>>0]=1;d=0;me=p;return d|0}else t=r}while(0);Yr((pe[l>>2]|0)+(t<<2)|0,0,h-t<<2|0)|0;t=pe[i>>2]|0}pe[o>>2]=h}c=e+92|0;r=pe[e+4>>2]|0;i=(ve[t+34>>0]|0)<<8|(ve[t+33>>0]|0)<<16|(ve[t+35>>0]|0);n=r+i|0;t=(ve[t+37>>0]|0)<<8|(ve[t+36>>0]|0)<<16|(ve[t+38>>0]|0);if(!t){d=0;me=p;return d|0}pe[c>>2]=n;pe[e+96>>2]=n;pe[e+104>>2]=t;pe[e+100>>2]=r+(t+i);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[d+20>>2]=0;pe[d>>2]=0;pe[d+4>>2]=0;pe[d+8>>2]=0;pe[d+12>>2]=0;de[d+16>>0]=0;e=d+24|0;pe[d+44>>2]=0;pe[e>>2]=0;pe[e+4>>2]=0;pe[e+8>>2]=0;pe[e+12>>2]=0;de[e+16>>0]=0;if(pt(c,d)|0?(f=d+24|0,pt(c,f)|0):0){if(!(pe[o>>2]|0)){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0}if(!h)t=1;else{i=0;n=0;o=0;t=0;a=0;e=0;s=0;r=pe[l>>2]|0;while(1){i=(bt(c,d)|0)+i&31;n=(bt(c,f)|0)+n&63;o=(bt(c,d)|0)+o&31;t=(bt(c,d)|0)+t|0;a=(bt(c,f)|0)+a&63;e=(bt(c,d)|0)+e&31;pe[r>>2]=n<<5|i<<11|o|t<<27|a<<21|e<<16;s=s+1|0;if((s|0)==(h|0)){t=1;break}else{t=t&31;r=r+4|0}}}}else t=0;ft(d+24|0);ft(d);d=t;me=p;return d|0}function Ct(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+1024|0;s=E+16|0;a=E;o=E+504|0;S=E+480|0;x=E+284|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+47>>0]|0)<<8|(ve[n+48>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+42>>0]|0)<<8|(ve[n+41>>0]|0)<<16|(ve[n+43>>0]|0);i=t+r|0;n=(ve[n+45>>0]|0)<<8|(ve[n+44>>0]|0)<<16|(ve[n+46>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-3;n=-3;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>2;r=r+1|0;if((r|0)==49)break;else{i=t?-3:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+252|0;r=e+256|0;t=pe[r>>2]|0;e:do{if((t|0)==(_|0))u=13;else{if(t>>>0<=_>>>0){do{if((pe[e+260>>2]|0)>>>0<_>>>0)if(nt(y,_,(t+1|0)==(_|0),4,0)|0){t=pe[r>>2]|0;break}else{de[e+264>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<2)|0,0,_-t<<2|0)|0}pe[r>>2]=_;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&3;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&3;t=t+1|0}while((t|0)!=8);pe[r>>2]=(ve[1725+(pe[i>>2]|0)>>0]|0)<<2|(ve[1725+(pe[w>>2]|0)>>0]|0)|(ve[1725+(pe[n>>2]|0)>>0]|0)<<4|(ve[1725+(pe[e>>2]|0)>>0]|0)<<6|(ve[1725+(pe[o>>2]|0)>>0]|0)<<8|(ve[1725+(pe[a>>2]|0)>>0]|0)<<10|(ve[1725+(pe[s>>2]|0)>>0]|0)<<12|(ve[1725+(pe[u>>2]|0)>>0]|0)<<14|(ve[1725+(pe[c>>2]|0)>>0]|0)<<16|(ve[1725+(pe[l>>2]|0)>>0]|0)<<18|(ve[1725+(pe[f>>2]|0)>>0]|0)<<20|(ve[1725+(pe[h>>2]|0)>>0]|0)<<22|(ve[1725+(pe[d>>2]|0)>>0]|0)<<24|(ve[1725+(pe[p>>2]|0)>>0]|0)<<26|(ve[1725+(pe[v>>2]|0)>>0]|0)<<28|(ve[1725+(pe[b>>2]|0)>>0]|0)<<30;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+4|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function At(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+560|0;u=h+16|0;s=h;a=h+48|0;f=h+24|0;n=pe[e+88>>2]|0;l=(ve[n+55>>0]|0)<<8|(ve[n+56>>0]|0);c=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+50>>0]|0)<<8|(ve[n+49>>0]|0)<<16|(ve[n+51>>0]|0);i=t+r|0;n=(ve[n+53>>0]|0)<<8|(ve[n+52>>0]|0)<<16|(ve[n+54>>0]|0);if(!n){f=0;me=h;return f|0}pe[c>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[f+20>>2]=0;pe[f>>2]=0;pe[f+4>>2]=0;pe[f+8>>2]=0;pe[f+12>>2]=0;de[f+16>>0]=0;e:do{if(pt(c,f)|0){o=e+268|0;r=e+272|0;t=pe[r>>2]|0;if((t|0)!=(l|0)){if(t>>>0<=l>>>0){do{if((pe[e+276>>2]|0)>>>0>>0)if(nt(o,l,(t+1|0)==(l|0),2,0)|0){t=pe[r>>2]|0;break}else{de[e+280>>0]=1;t=0;break e}}while(0);Yr((pe[o>>2]|0)+(t<<1)|0,0,l-t<<1|0)|0}pe[r>>2]=l}if(!l){pe[s>>2]=1154;pe[s+4>>2]=903;pe[s+8>>2]=1781;_r(a,1100,s)|0;gr(a,u)|0;t=1;break}r=0;i=0;n=0;t=pe[o>>2]|0;while(1){u=bt(c,f)|0;r=u+r&255;i=(bt(c,f)|0)+i&255;$[t>>1]=i<<8|r;n=n+1|0;if((n|0)==(l|0)){t=1;break}else t=t+2|0}}else t=0}while(0);ft(f);f=t;me=h;return f|0}function Ot(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0;E=me;me=me+2432|0;s=E+16|0;a=E;o=E+1912|0;S=E+1888|0;x=E+988|0;T=E+88|0;w=E+24|0;n=pe[e+88>>2]|0;_=(ve[n+63>>0]|0)<<8|(ve[n+64>>0]|0);g=e+92|0;t=pe[e+4>>2]|0;r=(ve[n+58>>0]|0)<<8|(ve[n+57>>0]|0)<<16|(ve[n+59>>0]|0);i=t+r|0;n=(ve[n+61>>0]|0)<<8|(ve[n+60>>0]|0)<<16|(ve[n+62>>0]|0);if(!n){S=0;me=E;return S|0}pe[g>>2]=i;pe[e+96>>2]=i;pe[e+104>>2]=n;pe[e+100>>2]=t+(n+r);pe[e+108>>2]=0;pe[e+112>>2]=0;pe[S+20>>2]=0;pe[S>>2]=0;pe[S+4>>2]=0;pe[S+8>>2]=0;pe[S+12>>2]=0;de[S+16>>0]=0;if(pt(g,S)|0){r=0;i=-7;n=-7;while(1){pe[x+(r<<2)>>2]=i;pe[T+(r<<2)>>2]=n;t=(i|0)>6;r=r+1|0;if((r|0)==225)break;else{i=t?-7:i+1|0;n=(t&1)+n|0}}t=w;r=t+64|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(r|0));y=e+284|0;r=_*3|0;i=e+288|0;t=pe[i>>2]|0;e:do{if((t|0)==(r|0))u=13;else{if(t>>>0<=r>>>0){do{if((pe[e+292>>2]|0)>>>0>>0)if(nt(y,r,(t+1|0)==(r|0),2,0)|0){t=pe[i>>2]|0;break}else{de[e+296>>0]=1;t=0;break e}}while(0);Yr((pe[y>>2]|0)+(t<<1)|0,0,r-t<<1|0)|0}pe[i>>2]=r;u=13}}while(0);do{if((u|0)==13){if(!_){pe[a>>2]=1154;pe[a+4>>2]=903;pe[a+8>>2]=1781;_r(o,1100,a)|0;gr(o,s)|0;t=1;break}i=w+4|0;n=w+8|0;e=w+12|0;o=w+16|0;a=w+20|0;s=w+24|0;u=w+28|0;c=w+32|0;l=w+36|0;f=w+40|0;h=w+44|0;d=w+48|0;p=w+52|0;v=w+56|0;b=w+60|0;m=0;r=pe[y>>2]|0;while(1){t=0;do{M=bt(g,S)|0;y=t<<1;P=w+(y<<2)|0;pe[P>>2]=(pe[P>>2]|0)+(pe[x+(M<<2)>>2]|0)&7;y=w+((y|1)<<2)|0;pe[y>>2]=(pe[y>>2]|0)+(pe[T+(M<<2)>>2]|0)&7;t=t+1|0}while((t|0)!=8);M=ve[1729+(pe[a>>2]|0)>>0]|0;$[r>>1]=(ve[1729+(pe[i>>2]|0)>>0]|0)<<3|(ve[1729+(pe[w>>2]|0)>>0]|0)|(ve[1729+(pe[n>>2]|0)>>0]|0)<<6|(ve[1729+(pe[e>>2]|0)>>0]|0)<<9|(ve[1729+(pe[o>>2]|0)>>0]|0)<<12|M<<15;P=ve[1729+(pe[f>>2]|0)>>0]|0;$[r+2>>1]=(ve[1729+(pe[s>>2]|0)>>0]|0)<<2|M>>>1|(ve[1729+(pe[u>>2]|0)>>0]|0)<<5|(ve[1729+(pe[c>>2]|0)>>0]|0)<<8|(ve[1729+(pe[l>>2]|0)>>0]|0)<<11|P<<14;$[r+4>>1]=(ve[1729+(pe[h>>2]|0)>>0]|0)<<1|P>>>2|(ve[1729+(pe[d>>2]|0)>>0]|0)<<4|(ve[1729+(pe[p>>2]|0)>>0]|0)<<7|(ve[1729+(pe[v>>2]|0)>>0]|0)<<10|(ve[1729+(pe[b>>2]|0)>>0]|0)<<13;m=m+1|0;if((m|0)==(_|0)){t=1;break}else r=r+6|0}}}while(0)}else t=0;ft(S);P=t;me=E;return P|0}function It(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;le=me;me=me+720|0;ce=le+184|0;se=le+168|0;ae=le+160|0;oe=le+144|0;ne=le+136|0;ie=le+120|0;re=le+112|0;ee=le+96|0;$=le+88|0;Q=le+72|0;Z=le+64|0;K=le+48|0;J=le+40|0;ue=le+24|0;te=le+16|0;Y=le;G=le+208|0;V=le+192|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;q=pe[W>>2]|0;r=de[(pe[e+88>>2]|0)+17>>0]|0;H=i>>>2;if(!(r<<24>>24)){me=le;return 1}z=(s|0)==0;X=s+-1|0;I=(o&1|0)!=0;R=i<<1;D=e+92|0;L=e+116|0;j=e+140|0;F=e+236|0;B=a+-1|0;O=(n&1|0)!=0;A=e+188|0;E=e+252|0;M=H+1|0;P=H+2|0;k=H+3|0;C=B<<4;T=r&255;r=0;o=0;n=1;S=0;do{if(!z){w=pe[t+(S<<2)>>2]|0;x=0;while(1){y=x&1;u=(y|0)==0;m=(y<<5^32)+-16|0;y=(y<<1^2)+-1|0;_=u?a:-1;c=u?0:B;e=(x|0)==(X|0);g=I&e;if((c|0)!=(_|0)){b=I&e^1;v=u?w:w+C|0;while(1){if((n|0)==1)n=bt(D,L)|0|512;p=n&7;n=n>>>3;u=ve[1823+p>>0]|0;e=0;do{h=(bt(D,j)|0)+o|0;d=h-U|0;o=d>>31;o=o&h|d&~o;if((pe[N>>2]|0)>>>0<=o>>>0){pe[Y>>2]=1154;pe[Y+4>>2]=903;pe[Y+8>>2]=1781;_r(G,1100,Y)|0;gr(G,te)|0}pe[V+(e<<2)>>2]=pe[(pe[F>>2]|0)+(o<<2)>>2];e=e+1|0}while(e>>>0>>0);d=O&(c|0)==(B|0);if(g|d){h=0;do{l=ye(h,i)|0;e=v+l|0;u=(h|0)==0|b;f=h<<1;he=(bt(D,A)|0)+r|0;fe=he-q|0;r=fe>>31;r=r&he|fe&~r;do{if(d){if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(G,1100,oe)|0;gr(G,ae)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r}else{if(!u){fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;break}pe[e>>2]=pe[V+((ve[1831+(p<<2)+f>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(G,1100,ie)|0;gr(G,ne)|0}pe[v+(l+4)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;pe[v+(l+8)>>2]=pe[V+((ve[(f|1)+(1831+(p<<2))>>0]|0)<<2)>>2];if((pe[W>>2]|0)>>>0<=r>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(G,1100,se)|0;gr(G,ce)|0}pe[v+(l+12)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}}while(0);h=h+1|0}while((h|0)!=2)}else{pe[v>>2]=pe[V+((ve[1831+(p<<2)>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ue>>2]=1154;pe[ue+4>>2]=903;pe[ue+8>>2]=1781;_r(G,1100,ue)|0;gr(G,J)|0}pe[v+4>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+8>>2]=pe[V+((ve[1831+(p<<2)+1>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(G,1100,K)|0;gr(G,Z)|0}pe[v+12>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(H<<2)>>2]=pe[V+((ve[1831+(p<<2)+2>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(G,1100,Q)|0;gr(G,$)|0}pe[v+(M<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2];pe[v+(P<<2)>>2]=pe[V+((ve[1831+(p<<2)+3>>0]|0)<<2)>>2];fe=(bt(D,A)|0)+r|0;he=fe-q|0;r=he>>31;r=r&fe|he&~r;if((pe[W>>2]|0)>>>0<=r>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(G,1100,ee)|0;gr(G,re)|0}pe[v+(k<<2)>>2]=pe[(pe[E>>2]|0)+(r<<2)>>2]}c=c+y|0;if((c|0)==(_|0))break;else v=v+m|0}}x=x+1|0;if((x|0)==(s|0))break;else w=w+R|0}}S=S+1|0}while((S|0)!=(T|0));me=le;return 1}function Rt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0,se=0,ue=0,ce=0,le=0,fe=0,he=0;fe=me;me=me+640|0;ue=fe+88|0;se=fe+72|0;ae=fe+64|0;oe=fe+48|0;ne=fe+40|0;le=fe+24|0;ce=fe+16|0;ie=fe;te=fe+128|0;re=fe+112|0;ee=fe+96|0;N=e+240|0;U=pe[N>>2]|0;W=e+256|0;Z=pe[W>>2]|0;Q=e+272|0;$=pe[Q>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=fe;return 1}X=(s|0)==0;q=s+-1|0;H=i<<1;G=e+92|0;V=e+116|0;Y=a+-1|0;J=e+212|0;K=e+188|0;B=(n&1|0)==0;F=(o&1|0)==0;O=e+288|0;I=e+284|0;R=e+252|0;D=e+140|0;L=e+236|0;j=e+164|0;C=e+268|0;A=Y<<5;P=r&255;r=0;n=0;o=0;e=0;u=1;k=0;do{if(!X){E=pe[t+(k<<2)>>2]|0;M=0;while(1){T=M&1;c=(T|0)==0;x=(T<<6^64)+-32|0;T=(T<<1^2)+-1|0;S=c?a:-1;l=c?0:Y;if((l|0)!=(S|0)){w=F|(M|0)!=(q|0);_=c?E:E+A|0;while(1){if((u|0)==1)u=bt(G,V)|0|512;g=u&7;u=u>>>3;f=ve[1823+g>>0]|0;c=0;do{m=(bt(G,j)|0)+n|0;y=m-$|0;n=y>>31;n=n&m|y&~n;if((pe[Q>>2]|0)>>>0<=n>>>0){pe[ie>>2]=1154;pe[ie+4>>2]=903;pe[ie+8>>2]=1781;_r(te,1100,ie)|0;gr(te,ce)|0}pe[ee+(c<<2)>>2]=be[(pe[C>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{m=(bt(G,D)|0)+e|0;y=m-U|0;e=y>>31;e=e&m|y&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[le>>2]=1154;pe[le+4>>2]=903;pe[le+8>>2]=1781;_r(te,1100,le)|0;gr(te,ne)|0}pe[re+(c<<2)>>2]=pe[(pe[L>>2]|0)+(e<<2)>>2];c=c+1|0}while(c>>>0>>0);y=B|(l|0)!=(Y|0);b=0;m=_;while(1){v=w|(b|0)==0;p=b<<1;h=0;d=m;while(1){f=(bt(G,J)|0)+r|0;c=f-z|0;r=c>>31;r=r&f|c&~r;c=(bt(G,K)|0)+o|0;f=c-Z|0;o=f>>31;o=o&c|f&~o;if((y|(h|0)==0)&v){c=ve[h+p+(1831+(g<<2))>>0]|0;f=r*3|0;if((pe[O>>2]|0)>>>0<=f>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(te,1100,oe)|0;gr(te,ae)|0}he=pe[I>>2]|0;pe[d>>2]=(be[he+(f<<1)>>1]|0)<<16|pe[ee+(c<<2)>>2];pe[d+4>>2]=(be[he+(f+2<<1)>>1]|0)<<16|(be[he+(f+1<<1)>>1]|0);pe[d+8>>2]=pe[re+(c<<2)>>2];if((pe[W>>2]|0)>>>0<=o>>>0){pe[se>>2]=1154;pe[se+4>>2]=903;pe[se+8>>2]=1781;_r(te,1100,se)|0;gr(te,ue)|0}pe[d+12>>2]=pe[(pe[R>>2]|0)+(o<<2)>>2]}h=h+1|0;if((h|0)==2)break;else d=d+16|0}b=b+1|0;if((b|0)==2)break;else m=m+i|0}l=l+T|0;if((l|0)==(S|0))break;else _=_+x|0}}M=M+1|0;if((M|0)==(s|0))break;else E=E+H|0}}k=k+1|0}while((k|0)!=(P|0));me=fe;return 1}function Dt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0;Z=me;me=me+608|0;Y=Z+64|0;V=Z+48|0;G=Z+40|0;K=Z+24|0;J=Z+16|0;H=Z;q=Z+88|0;W=Z+72|0;R=e+272|0;D=pe[R>>2]|0;r=pe[e+88>>2]|0;L=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=Z;return 1}j=(s|0)==0;F=s+-1|0;B=i<<1;N=e+92|0;U=e+116|0;z=a+-1|0;X=e+212|0;I=(o&1|0)==0;C=e+288|0;A=e+284|0;O=e+164|0;P=e+268|0;k=z<<4;M=r&255;E=(n&1|0)!=0;r=0;o=0;e=1;S=0;do{if(!j){x=pe[t+(S<<2)>>2]|0;T=0;while(1){_=T&1;n=(_|0)==0;g=(_<<5^32)+-16|0;_=(_<<1^2)+-1|0;w=n?a:-1;u=n?0:z;if((u|0)!=(w|0)){y=I|(T|0)!=(F|0);m=n?x:x+k|0;while(1){if((e|0)==1)e=bt(N,U)|0|512;b=e&7;e=e>>>3;c=ve[1823+b>>0]|0;n=0;do{p=(bt(N,O)|0)+o|0;v=p-D|0;o=v>>31;o=o&p|v&~o;if((pe[R>>2]|0)>>>0<=o>>>0){pe[H>>2]=1154;pe[H+4>>2]=903;pe[H+8>>2]=1781;_r(q,1100,H)|0;gr(q,J)|0}pe[W+(n<<2)>>2]=be[(pe[P>>2]|0)+(o<<1)>>1];n=n+1|0}while(n>>>0>>0);v=(u|0)==(z|0)&E;d=0;p=m;while(1){h=y|(d|0)==0;f=d<<1;n=(bt(N,X)|0)+r|0;l=n-L|0;c=l>>31;c=c&n|l&~c;if(h){r=ve[1831+(b<<2)+f>>0]|0;n=c*3|0;if((pe[C>>2]|0)>>>0<=n>>>0){pe[K>>2]=1154;pe[K+4>>2]=903;pe[K+8>>2]=1781;_r(q,1100,K)|0;gr(q,G)|0}l=pe[A>>2]|0;pe[p>>2]=(be[l+(n<<1)>>1]|0)<<16|pe[W+(r<<2)>>2];pe[p+4>>2]=(be[l+(n+2<<1)>>1]|0)<<16|(be[l+(n+1<<1)>>1]|0)}l=p+8|0;n=(bt(N,X)|0)+c|0;c=n-L|0;r=c>>31;r=r&n|c&~r;if(!(v|h^1)){n=ve[(f|1)+(1831+(b<<2))>>0]|0;c=r*3|0;if((pe[C>>2]|0)>>>0<=c>>>0){pe[V>>2]=1154;pe[V+4>>2]=903;pe[V+8>>2]=1781;_r(q,1100,V)|0;gr(q,Y)|0}h=pe[A>>2]|0;pe[l>>2]=(be[h+(c<<1)>>1]|0)<<16|pe[W+(n<<2)>>2];pe[p+12>>2]=(be[h+(c+2<<1)>>1]|0)<<16|(be[h+(c+1<<1)>>1]|0)}d=d+1|0;if((d|0)==2)break;else p=p+i|0}u=u+_|0;if((u|0)==(w|0))break;else m=m+g|0}}T=T+1|0;if((T|0)==(s|0))break;else x=x+B|0}}S=S+1|0}while((S|0)!=(M|0));me=Z;return 1}function Lt(e,t,r,i,n,o,a,s){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;s=s|0;var u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0,$=0,ee=0,te=0,re=0,ie=0,ne=0,oe=0,ae=0;ae=me;me=me+640|0;ie=ae+88|0;re=ae+72|0;te=ae+64|0;ee=ae+48|0;$=ae+40|0;oe=ae+24|0;ne=ae+16|0;Q=ae;Z=ae+128|0;J=ae+112|0;K=ae+96|0;N=e+272|0;U=pe[N>>2]|0;r=pe[e+88>>2]|0;z=(ve[r+63>>0]|0)<<8|(ve[r+64>>0]|0);r=de[r+17>>0]|0;if(!(r<<24>>24)){me=ae;return 1}X=(s|0)==0;W=s+-1|0;q=i<<1;H=e+92|0;G=e+116|0;V=a+-1|0;Y=e+212|0;B=(n&1|0)==0;F=(o&1|0)==0;D=e+288|0;L=e+284|0;j=e+164|0;I=e+268|0;R=V<<5;A=r&255;r=0;n=0;o=0;e=0;u=1;O=0;do{if(!X){k=pe[t+(O<<2)>>2]|0;C=0;while(1){M=C&1;c=(M|0)==0;E=(M<<6^64)+-32|0;M=(M<<1^2)+-1|0;P=c?a:-1;l=c?0:V;if((l|0)!=(P|0)){S=F|(C|0)!=(W|0);T=c?k:k+R|0;while(1){if((u|0)==1)u=bt(H,G)|0|512;x=u&7;u=u>>>3;f=ve[1823+x>>0]|0;c=0;do{_=(bt(H,j)|0)+e|0;w=_-U|0;e=w>>31;e=e&_|w&~e;if((pe[N>>2]|0)>>>0<=e>>>0){pe[Q>>2]=1154;pe[Q+4>>2]=903;pe[Q+8>>2]=1781;_r(Z,1100,Q)|0;gr(Z,ne)|0}pe[J+(c<<2)>>2]=be[(pe[I>>2]|0)+(e<<1)>>1];c=c+1|0}while(c>>>0>>0);c=0;do{_=(bt(H,j)|0)+n|0;w=_-U|0;n=w>>31;n=n&_|w&~n;if((pe[N>>2]|0)>>>0<=n>>>0){pe[oe>>2]=1154;pe[oe+4>>2]=903;pe[oe+8>>2]=1781;_r(Z,1100,oe)|0;gr(Z,$)|0}pe[K+(c<<2)>>2]=be[(pe[I>>2]|0)+(n<<1)>>1];c=c+1|0}while(c>>>0>>0);w=B|(l|0)!=(V|0);g=0;_=T;while(1){y=S|(g|0)==0;m=g<<1;v=0;b=_;while(1){p=(bt(H,Y)|0)+o|0;d=p-z|0;o=d>>31;o=o&p|d&~o;d=(bt(H,Y)|0)+r|0;p=d-z|0;r=p>>31;r=r&d|p&~r;if((w|(v|0)==0)&y){d=ve[v+m+(1831+(x<<2))>>0]|0;p=o*3|0;c=pe[D>>2]|0;if(c>>>0<=p>>>0){pe[ee>>2]=1154;pe[ee+4>>2]=903;pe[ee+8>>2]=1781;_r(Z,1100,ee)|0;gr(Z,te)|0;c=pe[D>>2]|0}f=pe[L>>2]|0;h=r*3|0;if(c>>>0>h>>>0)c=f;else{pe[re>>2]=1154;pe[re+4>>2]=903;pe[re+8>>2]=1781;_r(Z,1100,re)|0;gr(Z,ie)|0;c=pe[L>>2]|0}pe[b>>2]=(be[f+(p<<1)>>1]|0)<<16|pe[J+(d<<2)>>2];pe[b+4>>2]=(be[f+(p+2<<1)>>1]|0)<<16|(be[f+(p+1<<1)>>1]|0);pe[b+8>>2]=(be[c+(h<<1)>>1]|0)<<16|pe[K+(d<<2)>>2];pe[b+12>>2]=(be[c+(h+2<<1)>>1]|0)<<16|(be[c+(h+1<<1)>>1]|0)}v=v+1|0;if((v|0)==2)break;else b=b+16|0}g=g+1|0;if((g|0)==2)break;else _=_+i|0}l=l+M|0;if((l|0)==(P|0))break;else T=T+E|0}}C=C+1|0;if((C|0)==(s|0))break;else k=k+q|0}}O=O+1|0}while((O|0)!=(A|0));me=ae;return 1}function jt(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0;h=me;me=me+608|0;f=h+88|0;l=h+72|0;u=h+64|0;s=h+48|0;o=h+40|0;a=h+24|0;n=h+16|0;i=h;c=h+96|0;pe[e>>2]=0;t=e+284|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[i>>2]=1154;pe[i+4>>2]=2499;pe[i+8>>2]=1516;_r(c,1100,i)|0;gr(c,n)|0}pe[t>>2]=0;pe[e+288>>2]=0;pe[e+292>>2]=0}de[e+296>>0]=0;t=e+268|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[a>>2]=1154;pe[a+4>>2]=2499;pe[a+8>>2]=1516;_r(c,1100,a)|0;gr(c,o)|0}pe[t>>2]=0;pe[e+272>>2]=0;pe[e+276>>2]=0}de[e+280>>0]=0;t=e+252|0;r=pe[t>>2]|0;if(r){if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[s>>2]=1154;pe[s+4>>2]=2499;pe[s+8>>2]=1516;_r(c,1100,s)|0;gr(c,u)|0}pe[t>>2]=0;pe[e+256>>2]=0;pe[e+260>>2]=0}de[e+264>>0]=0;t=e+236|0;r=pe[t>>2]|0;if(!r){f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}if(!(r&7))Ri[pe[104>>2]&1](r,0,0,1,pe[27]|0)|0;else{pe[l>>2]=1154;pe[l+4>>2]=2499;pe[l+8>>2]=1516;_r(c,1100,l)|0;gr(c,f)|0}pe[t>>2]=0;pe[e+240>>2]=0;pe[e+244>>2]=0;f=e+248|0;de[f>>0]=0;f=e+212|0;ft(f);f=e+188|0;ft(f);f=e+164|0;ft(f);f=e+140|0;ft(f);f=e+116|0;ft(f);me=h;return}function Ft(e,t){e=e|0;t=t|0;var r=0;r=me;me=me+16|0;pe[r>>2]=t;t=pe[63]|0;wr(t,e,r)|0;mr(10,t)|0;Xe()}function Bt(){var e=0,t=0;e=me;me=me+16|0;if(!(je(200,2)|0)){t=De(pe[49]|0)|0;me=e;return t|0}else Ft(2090,e);return 0}function Nt(e){e=e|0;zr(e);return}function Ut(e){e=e|0;var t=0;t=me;me=me+16|0;Oi[e&3]();Ft(2139,t)}function zt(){var e=0,t=0;e=Bt()|0;if(((e|0)!=0?(t=pe[e>>2]|0,(t|0)!=0):0)?(e=t+48|0,(pe[e>>2]&-256|0)==1126902528?(pe[e+4>>2]|0)==1129074247:0):0)Ut(pe[t+12>>2]|0);t=pe[28]|0;pe[28]=t+0;Ut(t)}function Xt(e){e=e|0;return}function Wt(e){e=e|0;return}function qt(e){e=e|0;return}function Ht(e){e=e|0;return}function Gt(e){e=e|0;Nt(e);return}function Vt(e){e=e|0;Nt(e);return}function Yt(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;a=me;me=me+64|0;o=a;if((e|0)!=(t|0))if((t|0)!=0?(n=Qt(t,24,40,0)|0,(n|0)!=0):0){t=o;i=t+56|0;do{pe[t>>2]=0;t=t+4|0}while((t|0)<(i|0));pe[o>>2]=n;pe[o+8>>2]=e;pe[o+12>>2]=-1;pe[o+48>>2]=1;Di[pe[(pe[n>>2]|0)+28>>2]&3](n,o,pe[r>>2]|0,1);if((pe[o+24>>2]|0)==1){pe[r>>2]=pe[o+16>>2];t=1}else t=0}else t=0;else t=1;me=a;return t|0}function Jt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0;e=t+16|0;n=pe[e>>2]|0;do{if(n){if((n|0)!=(r|0)){i=t+36|0;pe[i>>2]=(pe[i>>2]|0)+1;pe[t+24>>2]=2;de[t+54>>0]=1;break}e=t+24|0;if((pe[e>>2]|0)==2)pe[e>>2]=i}else{pe[e>>2]=r;pe[t+24>>2]=i;pe[t+36>>2]=1}}while(0);return}function Kt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);return}function Zt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;if((e|0)==(pe[t+8>>2]|0))Jt(0,t,r,i);else{e=pe[e+8>>2]|0;Di[pe[(pe[e>>2]|0)+28>>2]&3](e,t,r,i)}return}function Qt(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0;d=me;me=me+64|0;h=d;f=pe[e>>2]|0;l=e+(pe[f+-8>>2]|0)|0;f=pe[f+-4>>2]|0;pe[h>>2]=r;pe[h+4>>2]=e;pe[h+8>>2]=t;pe[h+12>>2]=i;i=h+16|0;e=h+20|0;t=h+24|0;n=h+28|0;o=h+32|0;a=h+40|0;s=(f|0)==(r|0);u=i;c=u+36|0;do{pe[u>>2]=0;u=u+4|0}while((u|0)<(c|0));$[i+36>>1]=0;de[i+38>>0]=0;e:do{if(s){pe[h+48>>2]=1;Ii[pe[(pe[r>>2]|0)+20>>2]&3](r,h,l,l,1,0);i=(pe[t>>2]|0)==1?l:0}else{Pi[pe[(pe[f>>2]|0)+24>>2]&3](f,h,l,1,0);switch(pe[h+36>>2]|0){case 0:{i=(pe[a>>2]|0)==1&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1?pe[e>>2]|0:0;break e}case 1:break;default:{i=0;break e}}if((pe[t>>2]|0)!=1?!((pe[a>>2]|0)==0&(pe[n>>2]|0)==1&(pe[o>>2]|0)==1):0){i=0;break}i=pe[i>>2]|0}}while(0);me=d;return i|0}function $t(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;de[t+53>>0]=1;do{if((pe[t+4>>2]|0)==(i|0)){de[t+52>>0]=1;i=t+16|0;e=pe[i>>2]|0;if(!e){pe[i>>2]=r;pe[t+24>>2]=n;pe[t+36>>2]=1;if(!((n|0)==1?(pe[t+48>>2]|0)==1:0))break;de[t+54>>0]=1;break}if((e|0)!=(r|0)){n=t+36|0;pe[n>>2]=(pe[n>>2]|0)+1;de[t+54>>0]=1;break}e=t+24|0;i=pe[e>>2]|0;if((i|0)==2){pe[e>>2]=n;i=n}if((i|0)==1?(pe[t+48>>2]|0)==1:0)de[t+54>>0]=1}}while(0);return}function er(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0;e:do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(o=t+28|0,(pe[o>>2]|0)!=1):0)pe[o>>2]=i}else{if((e|0)!=(pe[t>>2]|0)){s=pe[e+8>>2]|0;Pi[pe[(pe[s>>2]|0)+24>>2]&3](s,t,r,i,n);break}if((pe[t+16>>2]|0)!=(r|0)?(a=t+20|0,(pe[a>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;i=t+44|0;if((pe[i>>2]|0)==4)break;o=t+52|0;de[o>>0]=0;u=t+53|0;de[u>>0]=0;e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,r,1,n);if(de[u>>0]|0){if(!(de[o>>0]|0)){o=1;s=13}}else{o=0;s=13}do{if((s|0)==13){pe[a>>2]=r;u=t+40|0;pe[u>>2]=(pe[u>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0){de[t+54>>0]=1;if(o)break}else s=16;if((s|0)==16?o:0)break;pe[i>>2]=4;break e}}while(0);pe[i>>2]=3;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function tr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0;do{if((e|0)==(pe[t+8>>2]|0)){if((pe[t+4>>2]|0)==(r|0)?(a=t+28|0,(pe[a>>2]|0)!=1):0)pe[a>>2]=i}else if((e|0)==(pe[t>>2]|0)){if((pe[t+16>>2]|0)!=(r|0)?(o=t+20|0,(pe[o>>2]|0)!=(r|0)):0){pe[t+32>>2]=i;pe[o>>2]=r;n=t+40|0;pe[n>>2]=(pe[n>>2]|0)+1;if((pe[t+36>>2]|0)==1?(pe[t+24>>2]|0)==2:0)de[t+54>>0]=1;pe[t+44>>2]=4;break}if((i|0)==1)pe[t+32>>2]=1}}while(0);return}function rr(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);else{e=pe[e+8>>2]|0;Ii[pe[(pe[e>>2]|0)+20>>2]&3](e,t,r,i,n,o)}return}function ir(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;if((e|0)==(pe[t+8>>2]|0))$t(0,t,r,i,n);return}function nr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+16|0;i=n;pe[i>>2]=pe[r>>2];e=Mi[pe[(pe[e>>2]|0)+16>>2]&7](e,t,i)|0;if(e)pe[r>>2]=pe[i>>2];me=n;return e&1|0}function or(e){e=e|0;if(!e)e=0;else e=(Qt(e,24,72,0)|0)!=0;return e&1|0}function ar(){var e=0,t=0,r=0,i=0,n=0,o=0,a=0,s=0;n=me;me=me+48|0;a=n+32|0;r=n+24|0;s=n+16|0;o=n;n=n+36|0;e=Bt()|0;if((e|0)!=0?(i=pe[e>>2]|0,(i|0)!=0):0){e=i+48|0;t=pe[e>>2]|0;e=pe[e+4>>2]|0;if(!((t&-256|0)==1126902528&(e|0)==1129074247)){pe[r>>2]=pe[51];Ft(2368,r)}if((t|0)==1126902529&(e|0)==1129074247)e=pe[i+44>>2]|0;else e=i+80|0;pe[n>>2]=e;i=pe[i>>2]|0;e=pe[i+4>>2]|0;if(Mi[pe[(pe[8>>2]|0)+16>>2]&7](8,i,n)|0){s=pe[n>>2]|0;n=pe[51]|0;s=Ci[pe[(pe[s>>2]|0)+8>>2]&1](s)|0;pe[o>>2]=n;pe[o+4>>2]=e;pe[o+8>>2]=s;Ft(2282,o)}else{pe[s>>2]=pe[51];pe[s+4>>2]=e;Ft(2327,s)}}Ft(2406,a)}function sr(){var e=0;e=me;me=me+16|0;if(!(Fe(196,6)|0)){me=e;return}else Ft(2179,e)}function ur(e){e=e|0;var t=0;t=me;me=me+16|0;zr(e);if(!(Ue(pe[49]|0,0)|0)){me=t;return}else Ft(2229,t)}function cr(e){e=e|0;var t=0,r=0;t=0;while(1){if((ve[2427+t>>0]|0)==(e|0)){r=2;break}t=t+1|0;if((t|0)==87){t=87;e=2515;r=5;break}}if((r|0)==2)if(!t)e=2515;else{e=2515;r=5}if((r|0)==5)while(1){r=e;while(1){e=r+1|0;if(!(de[r>>0]|0))break;else r=e}t=t+-1|0;if(!t)break;else r=5}return e|0}function lr(){var e=0;if(!(pe[52]|0))e=264;else{e=(Le()|0)+60|0;e=pe[e>>2]|0}return e|0}function fr(e){e=e|0;var t=0;if(e>>>0>4294963200){t=lr()|0;pe[t>>2]=0-e;e=-1}return e|0}function hr(e,t){e=+e;t=t|0;var r=0,i=0,n=0;ee[te>>3]=e;r=pe[te>>2]|0;i=pe[te+4>>2]|0;n=Jr(r|0,i|0,52)|0;n=n&2047;switch(n|0){case 0:{if(e!=0.0){e=+hr(e*18446744073709552.0e3,t);r=(pe[t>>2]|0)+-64|0}else r=0;pe[t>>2]=r;break}case 2047:break;default:{pe[t>>2]=n+-1022;pe[te>>2]=r;pe[te+4>>2]=i&-2146435073|1071644672;e=+ee[te>>3]}}return+e}function dr(e,t){e=+e;t=t|0;return+ +hr(e,t)}function pr(e,t,r){e=e|0;t=t|0;r=r|0;do{if(e){if(t>>>0<128){de[e>>0]=t;e=1;break}if(t>>>0<2048){de[e>>0]=t>>>6|192;de[e+1>>0]=t&63|128;e=2;break}if(t>>>0<55296|(t&-8192|0)==57344){de[e>>0]=t>>>12|224;de[e+1>>0]=t>>>6&63|128;de[e+2>>0]=t&63|128;e=3;break}if((t+-65536|0)>>>0<1048576){de[e>>0]=t>>>18|240;de[e+1>>0]=t>>>12&63|128;de[e+2>>0]=t>>>6&63|128;de[e+3>>0]=t&63|128;e=4;break}else{e=lr()|0;pe[e>>2]=84;e=-1;break}}else e=1}while(0);return e|0}function vr(e,t){e=e|0;t=t|0;if(!e)e=0;else e=pr(e,t,0)|0;return e|0}function br(e){e=e|0;var t=0,r=0;do{if(e){if((pe[e+76>>2]|0)<=-1){t=Rr(e)|0;break}r=(Sr(e)|0)==0;t=Rr(e)|0;if(!r)Er(e)}else{if(!(pe[65]|0))t=0;else t=br(pe[65]|0)|0;ze(236);e=pe[58]|0;if(e)do{if((pe[e+76>>2]|0)>-1)r=Sr(e)|0;else r=0;if((pe[e+20>>2]|0)>>>0>(pe[e+28>>2]|0)>>>0)t=Rr(e)|0|t;if(r)Er(e);e=pe[e+56>>2]|0}while((e|0)!=0);Be(236)}}while(0);return t|0}function mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0;if((pe[t+76>>2]|0)>=0?(Sr(t)|0)!=0:0){if((de[t+75>>0]|0)!=(e|0)?(i=t+20|0,n=pe[i>>2]|0,n>>>0<(pe[t+16>>2]|0)>>>0):0){pe[i>>2]=n+1;de[n>>0]=e;r=e&255}else r=Mr(t,e)|0;Er(t)}else a=3;do{if((a|0)==3){if((de[t+75>>0]|0)!=(e|0)?(o=t+20|0,r=pe[o>>2]|0,r>>>0<(pe[t+16>>2]|0)>>>0):0){pe[o>>2]=r+1;de[r>>0]=e;r=e&255;break}r=Mr(t,e)|0}}while(0);return r|0}function yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=r+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(r)|0)){n=pe[i>>2]|0;o=4}else i=0;else o=4;e:do{if((o|0)==4){a=r+20|0;o=pe[a>>2]|0;if((n-o|0)>>>0>>0){i=Mi[pe[r+36>>2]&7](r,e,t)|0;break}t:do{if((de[r+75>>0]|0)>-1){i=t;while(1){if(!i){n=o;i=0;break t}n=i+-1|0;if((de[e+n>>0]|0)==10)break;else i=n}if((Mi[pe[r+36>>2]&7](r,e,i)|0)>>>0>>0)break e;t=t-i|0;e=e+i|0;n=pe[a>>2]|0}else{n=o;i=0}}while(0);Qr(n|0,e|0,t|0)|0;pe[a>>2]=(pe[a>>2]|0)+t;i=i+t|0}}while(0);return i|0}function gr(e,t){e=e|0;t=t|0;var r=0,i=0;r=me;me=me+16|0;i=r;pe[i>>2]=t;t=wr(pe[64]|0,e,i)|0;me=r;return t|0}function _r(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=me;me=me+16|0;n=i;pe[n>>2]=r;r=Tr(e,t,n)|0;me=i;return r|0}function wr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0;v=me;me=me+224|0;f=v+120|0;p=v+80|0;d=v;h=v+136|0;i=p;n=i+40|0;do{pe[i>>2]=0;i=i+4|0}while((i|0)<(n|0));pe[f>>2]=pe[r>>2];if((Dr(0,t,f,d,p)|0)<0)r=-1;else{if((pe[e+76>>2]|0)>-1)c=Sr(e)|0;else c=0;r=pe[e>>2]|0;l=r&32;if((de[e+74>>0]|0)<1)pe[e>>2]=r&-33;r=e+48|0;if(!(pe[r>>2]|0)){n=e+44|0;o=pe[n>>2]|0;pe[n>>2]=h;a=e+28|0;pe[a>>2]=h;s=e+20|0;pe[s>>2]=h;pe[r>>2]=80;u=e+16|0;pe[u>>2]=h+80;i=Dr(e,t,f,d,p)|0;if(o){Mi[pe[e+36>>2]&7](e,0,0)|0;i=(pe[s>>2]|0)==0?-1:i;pe[n>>2]=o;pe[r>>2]=0;pe[u>>2]=0;pe[a>>2]=0;pe[s>>2]=0}}else i=Dr(e,t,f,d,p)|0;r=pe[e>>2]|0;pe[e>>2]=r|l;if(c)Er(e);r=(r&32|0)==0?i:-1}me=v;return r|0}function xr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0,l=0;l=me;me=me+128|0;n=l+112|0;c=l;o=c;a=268;s=o+112|0;do{pe[o>>2]=pe[a>>2];o=o+4|0;a=a+4|0}while((o|0)<(s|0));if((t+-1|0)>>>0>2147483646)if(!t){t=1;u=4}else{t=lr()|0;pe[t>>2]=75;t=-1}else{n=e;u=4}if((u|0)==4){u=-2-n|0;u=t>>>0>u>>>0?u:t;pe[c+48>>2]=u;e=c+20|0;pe[e>>2]=n;pe[c+44>>2]=n;t=n+u|0;n=c+16|0;pe[n>>2]=t;pe[c+28>>2]=t;t=wr(c,r,i)|0;if(u){r=pe[e>>2]|0;de[r+(((r|0)==(pe[n>>2]|0))<<31>>31)>>0]=0}}me=l;return t|0}function Tr(e,t,r){e=e|0;t=t|0;r=r|0;return xr(e,2147483647,t,r)|0}function Sr(e){e=e|0;return 0}function Er(e){e=e|0;return}function Mr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0;u=me;me=me+16|0;s=u;a=t&255;de[s>>0]=a;i=e+16|0;n=pe[i>>2]|0;if(!n)if(!(Or(e)|0)){n=pe[i>>2]|0;o=4}else r=-1;else o=4;do{if((o|0)==4){i=e+20|0;o=pe[i>>2]|0;if(o>>>0>>0?(r=t&255,(r|0)!=(de[e+75>>0]|0)):0){pe[i>>2]=o+1;de[o>>0]=a;break}if((Mi[pe[e+36>>2]&7](e,s,1)|0)==1)r=ve[s>>0]|0;else r=-1}}while(0);me=u;return r|0}function Pr(e){e=e|0;var t=0,r=0;t=me;me=me+16|0;r=t;pe[r>>2]=pe[e+60>>2];e=fr(Me(6,r|0)|0)|0;me=t;return e|0}function kr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0;n=me;me=me+32|0;o=n;i=n+20|0;pe[o>>2]=pe[e+60>>2];pe[o+4>>2]=0;pe[o+8>>2]=t;pe[o+12>>2]=i;pe[o+16>>2]=r;if((fr(He(140,o|0)|0)|0)<0){pe[i>>2]=-1;e=-1}else e=pe[i>>2]|0;me=n;return e|0}function Cr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;p=me;me=me+48|0;f=p+16|0;l=p;i=p+32|0;h=e+28|0;n=pe[h>>2]|0;pe[i>>2]=n;d=e+20|0;n=(pe[d>>2]|0)-n|0;pe[i+4>>2]=n;pe[i+8>>2]=t;pe[i+12>>2]=r;u=e+60|0;c=e+44|0;t=2;n=n+r|0;while(1){if(!(pe[52]|0)){pe[f>>2]=pe[u>>2];pe[f+4>>2]=i;pe[f+8>>2]=t;a=fr(Ge(146,f|0)|0)|0}else{We(7,e|0);pe[l>>2]=pe[u>>2];pe[l+4>>2]=i;pe[l+8>>2]=t;a=fr(Ge(146,l|0)|0)|0;Se(0)}if((n|0)==(a|0)){n=6;break}if((a|0)<0){n=8;break}n=n-a|0;o=pe[i+4>>2]|0;if(a>>>0<=o>>>0)if((t|0)==2){pe[h>>2]=(pe[h>>2]|0)+a;s=o;t=2}else s=o;else{s=pe[c>>2]|0;pe[h>>2]=s;pe[d>>2]=s;s=pe[i+12>>2]|0;a=a-o|0;i=i+8|0;t=t+-1|0}pe[i>>2]=(pe[i>>2]|0)+a;pe[i+4>>2]=s-a}if((n|0)==6){f=pe[c>>2]|0;pe[e+16>>2]=f+(pe[e+48>>2]|0);e=f;pe[h>>2]=e;pe[d>>2]=e}else if((n|0)==8){pe[e+16>>2]=0;pe[h>>2]=0;pe[d>>2]=0;pe[e>>2]=pe[e>>2]|32;if((t|0)==2)r=0;else r=r-(pe[i+4>>2]|0)|0}me=p;return r|0}function Ar(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;n=me;me=me+80|0;i=n;pe[e+36>>2]=3;if((pe[e>>2]&64|0)==0?(pe[i>>2]=pe[e+60>>2],pe[i+4>>2]=21505,pe[i+8>>2]=n+12,(Ee(54,i|0)|0)!=0):0)de[e+75>>0]=-1;i=Cr(e,t,r)|0;me=n;return i|0}function Or(e){e=e|0;var t=0,r=0;t=e+74|0;r=de[t>>0]|0;de[t>>0]=r+255|r;t=pe[e>>2]|0;if(!(t&8)){pe[e+8>>2]=0;pe[e+4>>2]=0;t=pe[e+44>>2]|0;pe[e+28>>2]=t;pe[e+20>>2]=t;pe[e+16>>2]=t+(pe[e+48>>2]|0);t=0}else{pe[e>>2]=t|32;t=-1}return t|0}function Ir(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;o=t&255;i=(r|0)!=0;e:do{if(i&(e&3|0)!=0){n=t&255;while(1){if((de[e>>0]|0)==n<<24>>24){a=6;break e}e=e+1|0;r=r+-1|0;i=(r|0)!=0;if(!(i&(e&3|0)!=0)){a=5;break}}}else a=5}while(0);if((a|0)==5)if(i)a=6;else r=0;e:do{if((a|0)==6){n=t&255;if((de[e>>0]|0)!=n<<24>>24){i=ye(o,16843009)|0;t:do{if(r>>>0>3)while(1){o=pe[e>>2]^i;if((o&-2139062144^-2139062144)&o+-16843009)break;e=e+4|0;r=r+-4|0;if(r>>>0<=3){a=11;break t}}else a=11}while(0);if((a|0)==11)if(!r){r=0;break}while(1){if((de[e>>0]|0)==n<<24>>24)break e;e=e+1|0;r=r+-1|0;if(!r){r=0;break}}}}}while(0);return((r|0)!=0?e:0)|0}function Rr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0;t=e+20|0;o=e+28|0;if((pe[t>>2]|0)>>>0>(pe[o>>2]|0)>>>0?(Mi[pe[e+36>>2]&7](e,0,0)|0,(pe[t>>2]|0)==0):0)t=-1;else{a=e+4|0;r=pe[a>>2]|0;i=e+8|0;n=pe[i>>2]|0;if(r>>>0>>0)Mi[pe[e+40>>2]&7](e,r-n|0,1)|0;pe[e+16>>2]=0;pe[o>>2]=0;pe[t>>2]=0;pe[i>>2]=0;pe[a>>2]=0;t=0}return t|0}function Dr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0.0,l=0,f=0,h=0,d=0,p=0.0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0,B=0,N=0,U=0,z=0,X=0,W=0,q=0,H=0,G=0,V=0,Y=0,J=0,K=0,Z=0,Q=0;Q=me;me=me+624|0;V=Q+24|0;J=Q+16|0;Y=Q+588|0;X=Q+576|0;G=Q;N=Q+536|0;Z=Q+8|0;K=Q+528|0;A=(e|0)!=0;O=N+40|0;B=O;N=N+39|0;U=Z+4|0;z=X+12|0;X=X+11|0;W=Y;q=z;H=q-W|0;I=-2-W|0;R=q+2|0;D=V+288|0;L=Y+9|0;j=L;F=Y+8|0;o=0;v=t;a=0;t=0;e:while(1){do{if((o|0)>-1)if((a|0)>(2147483647-o|0)){o=lr()|0;pe[o>>2]=75;o=-1;break}else{o=a+o|0;break}}while(0);a=de[v>>0]|0;if(!(a<<24>>24)){C=245;break}else s=v;t:while(1){switch(a<<24>>24){case 37:{a=s;C=9;break t}case 0:{a=s;break t}default:{}}k=s+1|0;a=de[k>>0]|0;s=k}t:do{if((C|0)==9)while(1){C=0;if((de[a+1>>0]|0)!=37)break t;s=s+1|0;a=a+2|0;if((de[a>>0]|0)==37)C=9;else break}}while(0);m=s-v|0;if(A?(pe[e>>2]&32|0)==0:0)yr(v,m,e)|0;if((s|0)!=(v|0)){v=a;a=m;continue}l=a+1|0;s=de[l>>0]|0;u=(s<<24>>24)+-48|0;if(u>>>0<10){k=(de[a+2>>0]|0)==36;l=k?a+3|0:l;s=de[l>>0]|0;d=k?u:-1;t=k?1:t}else d=-1;a=s<<24>>24;t:do{if((a&-32|0)==32){u=0;while(1){if(!(1<>24)+-32|u;l=l+1|0;s=de[l>>0]|0;a=s<<24>>24;if((a&-32|0)!=32){f=u;a=l;break}}}else{f=0;a=l}}while(0);do{if(s<<24>>24==42){u=a+1|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+2>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;t=1;a=a+3|0;s=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0}else{if(t){o=-1;break e}if(!A){b=f;a=u;t=0;k=0;break}t=(pe[r>>2]|0)+(4-1)&~(4-1);s=pe[t>>2]|0;pe[r>>2]=t+4;t=0;a=u}if((s|0)<0){b=f|8192;k=0-s|0}else{b=f;k=s}}else{u=(s<<24>>24)+-48|0;if(u>>>0<10){s=0;do{s=(s*10|0)+u|0;a=a+1|0;u=(de[a>>0]|0)+-48|0}while(u>>>0<10);if((s|0)<0){o=-1;break e}else{b=f;k=s}}else{b=f;k=0}}}while(0);t:do{if((de[a>>0]|0)==46){u=a+1|0;s=de[u>>0]|0;if(s<<24>>24!=42){l=(s<<24>>24)+-48|0;if(l>>>0<10){a=u;s=0}else{a=u;l=0;break}while(1){s=(s*10|0)+l|0;a=a+1|0;l=(de[a>>0]|0)+-48|0;if(l>>>0>=10){l=s;break t}}}u=a+2|0;s=(de[u>>0]|0)+-48|0;if(s>>>0<10?(de[a+3>>0]|0)==36:0){pe[n+(s<<2)>>2]=10;a=a+4|0;l=pe[i+((de[u>>0]|0)+-48<<3)>>2]|0;break}if(t){o=-1;break e}if(A){a=(pe[r>>2]|0)+(4-1)&~(4-1);l=pe[a>>2]|0;pe[r>>2]=a+4;a=u}else{a=u;l=0}}else l=-1}while(0);h=0;while(1){s=(de[a>>0]|0)+-65|0;if(s>>>0>57){o=-1;break e}u=a+1|0;s=de[5359+(h*58|0)+s>>0]|0;f=s&255;if((f+-1|0)>>>0<8){a=u;h=f}else{P=u;break}}if(!(s<<24>>24)){o=-1;break}u=(d|0)>-1;do{if(s<<24>>24==19)if(u){o=-1;break e}else C=52;else{if(u){pe[n+(d<<2)>>2]=f;E=i+(d<<3)|0;M=pe[E+4>>2]|0;C=G;pe[C>>2]=pe[E>>2];pe[C+4>>2]=M;C=52;break}if(!A){o=0;break e}Fr(G,f,r)}}while(0);if((C|0)==52?(C=0,!A):0){v=P;a=m;continue}d=de[a>>0]|0;d=(h|0)!=0&(d&15|0)==3?d&-33:d;u=b&-65537;M=(b&8192|0)==0?b:u;t:do{switch(d|0){case 110:switch(h|0){case 0:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 1:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 2:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}case 3:{$[pe[G>>2]>>1]=o;v=P;a=m;continue e}case 4:{de[pe[G>>2]>>0]=o;v=P;a=m;continue e}case 6:{pe[pe[G>>2]>>2]=o;v=P;a=m;continue e}case 7:{v=pe[G>>2]|0;pe[v>>2]=o;pe[v+4>>2]=((o|0)<0)<<31>>31;v=P;a=m;continue e}default:{v=P;a=m;continue e}}case 112:{h=M|8;l=l>>>0>8?l:8;d=120;C=64;break}case 88:case 120:{h=M;C=64;break}case 111:{u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;if((s|0)==0&(u|0)==0)a=O;else{a=O;do{a=a+-1|0;de[a>>0]=s&7|48;s=Jr(s|0,u|0,3)|0;u=re}while(!((s|0)==0&(u|0)==0))}if(!(M&8)){s=M;h=0;f=5839;C=77}else{h=B-a+1|0;s=M;l=(l|0)<(h|0)?h:l;h=0;f=5839;C=77}break}case 105:case 100:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;if((s|0)<0){a=Vr(0,0,a|0,s|0)|0;s=re;u=G;pe[u>>2]=a;pe[u+4>>2]=s;u=1;f=5839;C=76;break t}if(!(M&2048)){f=M&1;u=f;f=(f|0)==0?5839:5841;C=76}else{u=1;f=5840;C=76}break}case 117:{s=G;a=pe[s>>2]|0;s=pe[s+4>>2]|0;u=0;f=5839;C=76;break}case 99:{de[N>>0]=pe[G>>2];v=N;s=1;h=0;d=5839;a=O;break}case 109:{a=lr()|0;a=cr(pe[a>>2]|0)|0;C=82;break}case 115:{a=pe[G>>2]|0;a=(a|0)!=0?a:5849;C=82;break}case 67:{pe[Z>>2]=pe[G>>2];pe[U>>2]=0;pe[G>>2]=Z;l=-1;C=86;break}case 83:{if(!l){Nr(e,32,k,0,M);a=0;C=98}else C=86;break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{c=+ee[G>>3];pe[J>>2]=0;ee[te>>3]=c;if((pe[te+4>>2]|0)>=0)if(!(M&2048)){E=M&1;S=E;E=(E|0)==0?5857:5862}else{S=1;E=5859}else{c=-c;S=1;E=5856}ee[te>>3]=c;T=pe[te+4>>2]&2146435072;do{if(T>>>0<2146435072|(T|0)==2146435072&0<0){p=+dr(c,J)*2.0;s=p!=0.0;if(s)pe[J>>2]=(pe[J>>2]|0)+-1;w=d|32;if((w|0)==97){v=d&32;m=(v|0)==0?E:E+9|0;b=S|2;a=12-l|0;do{if(!(l>>>0>11|(a|0)==0)){c=8.0;do{a=a+-1|0;c=c*16.0}while((a|0)!=0);if((de[m>>0]|0)==45){c=-(c+(-p-c));break}else{c=p+c-c;break}}else c=p}while(0);s=pe[J>>2]|0;a=(s|0)<0?0-s|0:s;a=Br(a,((a|0)<0)<<31>>31,z)|0;if((a|0)==(z|0)){de[X>>0]=48;a=X}de[a+-1>>0]=(s>>31&2)+43;h=a+-2|0;de[h>>0]=d+15;f=(l|0)<1;u=(M&8|0)==0;s=Y;while(1){E=~~c;a=s+1|0;de[s>>0]=ve[5823+E>>0]|v;c=(c-+(E|0))*16.0;do{if((a-W|0)==1){if(u&(f&c==0.0))break;de[a>>0]=46;a=s+2|0}}while(0);if(!(c!=0.0))break;else s=a}l=(l|0)!=0&(I+a|0)<(l|0)?R+l-h|0:H-h+a|0;u=l+b|0;Nr(e,32,k,u,M);if(!(pe[e>>2]&32))yr(m,b,e)|0;Nr(e,48,k,u,M^65536);a=a-W|0;if(!(pe[e>>2]&32))yr(Y,a,e)|0;s=q-h|0;Nr(e,48,l-(a+s)|0,0,0);if(!(pe[e>>2]&32))yr(h,s,e)|0;Nr(e,32,k,u,M^8192);a=(u|0)<(k|0)?k:u;break}a=(l|0)<0?6:l;if(s){s=(pe[J>>2]|0)+-28|0;pe[J>>2]=s;c=p*268435456.0}else{c=p;s=pe[J>>2]|0}T=(s|0)<0?V:D;x=T;s=T;do{_=~~c>>>0;pe[s>>2]=_;s=s+4|0;c=(c-+(_>>>0))*1.0e9}while(c!=0.0);u=s;s=pe[J>>2]|0;if((s|0)>0){f=T;while(1){h=(s|0)>29?29:s;l=u+-4|0;do{if(l>>>0>>0)l=f;else{s=0;do{_=Kr(pe[l>>2]|0,0,h|0)|0;_=Zr(_|0,re|0,s|0,0)|0;s=re;g=ai(_|0,s|0,1e9,0)|0;pe[l>>2]=g;s=oi(_|0,s|0,1e9,0)|0;l=l+-4|0}while(l>>>0>=f>>>0);if(!s){l=f;break}l=f+-4|0;pe[l>>2]=s}}while(0);while(1){if(u>>>0<=l>>>0)break;s=u+-4|0;if(!(pe[s>>2]|0))u=s;else break}s=(pe[J>>2]|0)-h|0;pe[J>>2]=s;if((s|0)>0)f=l;else break}}else l=T;if((s|0)<0){m=((a+25|0)/9|0)+1|0;y=(w|0)==102;v=l;while(1){b=0-s|0;b=(b|0)>9?9:b;do{if(v>>>0>>0){s=(1<>>b;l=0;h=v;do{_=pe[h>>2]|0;pe[h>>2]=(_>>>b)+l;l=ye(_&s,f)|0;h=h+4|0}while(h>>>0>>0);s=(pe[v>>2]|0)==0?v+4|0:v;if(!l){l=s;break}pe[u>>2]=l;l=s;u=u+4|0}else l=(pe[v>>2]|0)==0?v+4|0:v}while(0);s=y?T:l;u=(u-s>>2|0)>(m|0)?s+(m<<2)|0:u;s=(pe[J>>2]|0)+b|0;pe[J>>2]=s;if((s|0)>=0){v=l;break}else v=l}}else v=l;do{if(v>>>0>>0){s=(x-v>>2)*9|0;f=pe[v>>2]|0;if(f>>>0<10)break;else l=10;do{l=l*10|0;s=s+1|0}while(f>>>0>=l>>>0)}else s=0}while(0);g=(w|0)==103;_=(a|0)!=0;l=a-((w|0)!=102?s:0)+((_&g)<<31>>31)|0;if((l|0)<(((u-x>>2)*9|0)+-9|0)){h=l+9216|0;y=(h|0)/9|0;l=T+(y+-1023<<2)|0;h=((h|0)%9|0)+1|0;if((h|0)<9){f=10;do{f=f*10|0;h=h+1|0}while((h|0)!=9)}else f=10;b=pe[l>>2]|0;m=(b>>>0)%(f>>>0)|0;if((m|0)==0?(T+(y+-1022<<2)|0)==(u|0):0)f=v;else C=163;do{if((C|0)==163){C=0;p=(((b>>>0)/(f>>>0)|0)&1|0)==0?9007199254740992.0:9007199254740994.0;h=(f|0)/2|0;do{if(m>>>0>>0)c=.5;else{if((m|0)==(h|0)?(T+(y+-1022<<2)|0)==(u|0):0){c=1.0;break}c=1.5}}while(0);do{if(S){if((de[E>>0]|0)!=45)break;p=-p;c=-c}}while(0);h=b-m|0;pe[l>>2]=h;if(!(p+c!=p)){f=v;break}w=h+f|0;pe[l>>2]=w;if(w>>>0>999999999){s=v;while(1){f=l+-4|0;pe[l>>2]=0;if(f>>>0>>0){s=s+-4|0;pe[s>>2]=0}w=(pe[f>>2]|0)+1|0;pe[f>>2]=w;if(w>>>0>999999999)l=f;else{v=s;l=f;break}}}s=(x-v>>2)*9|0;h=pe[v>>2]|0;if(h>>>0<10){f=v;break}else f=10;do{f=f*10|0;s=s+1|0}while(h>>>0>=f>>>0);f=v}}while(0);w=l+4|0;v=f;u=u>>>0>w>>>0?w:u}m=0-s|0;while(1){if(u>>>0<=v>>>0){y=0;w=u;break}l=u+-4|0;if(!(pe[l>>2]|0))u=l;else{y=1;w=u;break}}do{if(g){a=(_&1^1)+a|0;if((a|0)>(s|0)&(s|0)>-5){d=d+-1|0;a=a+-1-s|0}else{d=d+-2|0;a=a+-1|0}u=M&8;if(u)break;do{if(y){u=pe[w+-4>>2]|0;if(!u){l=9;break}if(!((u>>>0)%10|0)){f=10;l=0}else{l=0;break}do{f=f*10|0;l=l+1|0}while(((u>>>0)%(f>>>0)|0|0)==0)}else l=9}while(0);u=((w-x>>2)*9|0)+-9|0;if((d|32|0)==102){u=u-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}else{u=u+s-l|0;u=(u|0)<0?0:u;a=(a|0)<(u|0)?a:u;u=0;break}}else u=M&8}while(0);b=a|u;f=(b|0)!=0&1;h=(d|32|0)==102;if(h){s=(s|0)>0?s:0;d=0}else{l=(s|0)<0?m:s;l=Br(l,((l|0)<0)<<31>>31,z)|0;if((q-l|0)<2)do{l=l+-1|0;de[l>>0]=48}while((q-l|0)<2);de[l+-1>>0]=(s>>31&2)+43;x=l+-2|0;de[x>>0]=d;s=q-x|0;d=x}m=S+1+a+f+s|0;Nr(e,32,k,m,M);if(!(pe[e>>2]&32))yr(E,S,e)|0;Nr(e,48,k,m,M^65536);do{if(h){l=v>>>0>T>>>0?T:v;s=l;do{u=Br(pe[s>>2]|0,0,L)|0;do{if((s|0)==(l|0)){if((u|0)!=(L|0))break;de[F>>0]=48;u=F}else{if(u>>>0<=Y>>>0)break;do{u=u+-1|0;de[u>>0]=48}while(u>>>0>Y>>>0)}}while(0);if(!(pe[e>>2]&32))yr(u,j-u|0,e)|0;s=s+4|0}while(s>>>0<=T>>>0);do{if(b){if(pe[e>>2]&32)break;yr(5891,1,e)|0}}while(0);if((a|0)>0&s>>>0>>0){u=s;while(1){s=Br(pe[u>>2]|0,0,L)|0;if(s>>>0>Y>>>0)do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0);if(!(pe[e>>2]&32))yr(s,(a|0)>9?9:a,e)|0;u=u+4|0;s=a+-9|0;if(!((a|0)>9&u>>>0>>0)){a=s;break}else a=s}}Nr(e,48,a+9|0,9,0)}else{h=y?w:v+4|0;if((a|0)>-1){f=(u|0)==0;l=v;do{s=Br(pe[l>>2]|0,0,L)|0;if((s|0)==(L|0)){de[F>>0]=48;s=F}do{if((l|0)==(v|0)){u=s+1|0;if(!(pe[e>>2]&32))yr(s,1,e)|0;if(f&(a|0)<1){s=u;break}if(pe[e>>2]&32){s=u;break}yr(5891,1,e)|0;s=u}else{if(s>>>0<=Y>>>0)break;do{s=s+-1|0;de[s>>0]=48}while(s>>>0>Y>>>0)}}while(0);u=j-s|0;if(!(pe[e>>2]&32))yr(s,(a|0)>(u|0)?u:a,e)|0;a=a-u|0;l=l+4|0}while(l>>>0>>0&(a|0)>-1)}Nr(e,48,a+18|0,18,0);if(pe[e>>2]&32)break;yr(d,q-d|0,e)|0}}while(0);Nr(e,32,k,m,M^8192);a=(m|0)<(k|0)?k:m}else{h=(d&32|0)!=0;f=c!=c|0.0!=0.0;s=f?0:S;l=s+3|0;Nr(e,32,k,l,u);a=pe[e>>2]|0;if(!(a&32)){yr(E,s,e)|0;a=pe[e>>2]|0}if(!(a&32))yr(f?h?5883:5887:h?5875:5879,3,e)|0;Nr(e,32,k,l,M^8192);a=(l|0)<(k|0)?k:l}}while(0);v=P;continue e}default:{u=M;s=l;h=0;d=5839;a=O}}}while(0);t:do{if((C|0)==64){u=G;s=pe[u>>2]|0;u=pe[u+4>>2]|0;f=d&32;if(!((s|0)==0&(u|0)==0)){a=O;do{a=a+-1|0;de[a>>0]=ve[5823+(s&15)>>0]|f;s=Jr(s|0,u|0,4)|0;u=re}while(!((s|0)==0&(u|0)==0));C=G;if((h&8|0)==0|(pe[C>>2]|0)==0&(pe[C+4>>2]|0)==0){s=h;h=0;f=5839;C=77}else{s=h;h=2;f=5839+(d>>4)|0;C=77}}else{a=O;s=h;h=0;f=5839;C=77}}else if((C|0)==76){a=Br(a,s,O)|0;s=M;h=u;C=77}else if((C|0)==82){C=0;M=Ir(a,0,l)|0;E=(M|0)==0;v=a;s=E?l:M-a|0;h=0;d=5839;a=E?a+l|0:M}else if((C|0)==86){C=0;s=0;a=0;f=pe[G>>2]|0;while(1){u=pe[f>>2]|0;if(!u)break;a=vr(K,u)|0;if((a|0)<0|a>>>0>(l-s|0)>>>0)break;s=a+s|0;if(l>>>0>s>>>0)f=f+4|0;else break}if((a|0)<0){o=-1;break e}Nr(e,32,k,s,M);if(!s){a=0;C=98}else{u=0;l=pe[G>>2]|0;while(1){a=pe[l>>2]|0;if(!a){a=s;C=98;break t}a=vr(K,a)|0;u=a+u|0;if((u|0)>(s|0)){a=s;C=98;break t}if(!(pe[e>>2]&32))yr(K,a,e)|0;if(u>>>0>=s>>>0){a=s;C=98;break}else l=l+4|0}}}}while(0);if((C|0)==98){C=0;Nr(e,32,k,a,M^8192);v=P;a=(k|0)>(a|0)?k:a;continue}if((C|0)==77){C=0;u=(l|0)>-1?s&-65537:s;s=G;s=(pe[s>>2]|0)!=0|(pe[s+4>>2]|0)!=0;if((l|0)!=0|s){s=(s&1^1)+(B-a)|0;v=a;s=(l|0)>(s|0)?l:s;d=f;a=O}else{v=O;s=0;d=f;a=O}}f=a-v|0;s=(s|0)<(f|0)?f:s;l=h+s|0;a=(k|0)<(l|0)?l:k;Nr(e,32,a,l,u);if(!(pe[e>>2]&32))yr(d,h,e)|0;Nr(e,48,a,l,u^65536);Nr(e,48,s,f,0);if(!(pe[e>>2]&32))yr(v,f,e)|0;Nr(e,32,a,l,u^8192);v=P}e:do{if((C|0)==245)if(!e)if(t){o=1;while(1){t=pe[n+(o<<2)>>2]|0;if(!t)break;Fr(i+(o<<3)|0,t,r);o=o+1|0;if((o|0)>=10){o=1;break e}}if((o|0)<10)while(1){if(pe[n+(o<<2)>>2]|0){o=-1;break e}o=o+1|0;if((o|0)>=10){o=1;break}}else o=1}else o=0}while(0);me=Q;return o|0}function Lr(e){e=e|0;if(!(pe[e+68>>2]|0))Er(e);return}function jr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0;i=e+20|0;n=pe[i>>2]|0;e=(pe[e+16>>2]|0)-n|0;e=e>>>0>r>>>0?r:e;Qr(n|0,t|0,e|0)|0;pe[i>>2]=(pe[i>>2]|0)+e;return r|0}function Fr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0.0;e:do{if(t>>>0<=20)do{switch(t|0){case 9:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;pe[e>>2]=t;break e}case 10:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=((t|0)<0)<<31>>31;break e}case 11:{i=(pe[r>>2]|0)+(4-1)&~(4-1);t=pe[i>>2]|0;pe[r>>2]=i+4;i=e;pe[i>>2]=t;pe[i+4>>2]=0;break e}case 12:{i=(pe[r>>2]|0)+(8-1)&~(8-1);t=i;n=pe[t>>2]|0;t=pe[t+4>>2]|0;pe[r>>2]=i+8;i=e;pe[i>>2]=n;pe[i+4>>2]=t;break e}case 13:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&65535)<<16>>16;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 14:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&65535;pe[n+4>>2]=0;break e}case 15:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;i=(i&255)<<24>>24;n=e;pe[n>>2]=i;pe[n+4>>2]=((i|0)<0)<<31>>31;break e}case 16:{n=(pe[r>>2]|0)+(4-1)&~(4-1);i=pe[n>>2]|0;pe[r>>2]=n+4;n=e;pe[n>>2]=i&255;pe[n+4>>2]=0;break e}case 17:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}case 18:{n=(pe[r>>2]|0)+(8-1)&~(8-1);o=+ee[n>>3];pe[r>>2]=n+8;ee[e>>3]=o;break e}default:break e}}while(0)}while(0);return}function Br(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if(t>>>0>0|(t|0)==0&e>>>0>4294967295)while(1){i=ai(e|0,t|0,10,0)|0;r=r+-1|0;de[r>>0]=i|48;i=oi(e|0,t|0,10,0)|0;if(t>>>0>9|(t|0)==9&e>>>0>4294967295){e=i;t=re}else{e=i;break}}if(e)while(1){r=r+-1|0;de[r>>0]=(e>>>0)%10|0|48;if(e>>>0<10)break;else e=(e>>>0)/10|0}return r|0}function Nr(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0;s=me;me=me+256|0;a=s;do{if((r|0)>(i|0)&(n&73728|0)==0){n=r-i|0;Yr(a|0,t|0,(n>>>0>256?256:n)|0)|0;t=pe[e>>2]|0;o=(t&32|0)==0;if(n>>>0>255){i=r-i|0;do{if(o){yr(a,256,e)|0;t=pe[e>>2]|0}n=n+-256|0;o=(t&32|0)==0}while(n>>>0>255);if(o)n=i&255;else break}else if(!o)break;yr(a,n,e)|0}}while(0);me=s;return}function Ur(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0,_=0,w=0,x=0,T=0,S=0,E=0,M=0,P=0,k=0,C=0,A=0,O=0,I=0,R=0,D=0,L=0,j=0,F=0;do{if(e>>>0<245){d=e>>>0<11?16:e+11&-8;e=d>>>3;s=pe[151]|0;r=s>>>e;if(r&3){e=(r&1^1)+e|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;n=pe[i>>2]|0;o=n+8|0;a=pe[o>>2]|0;do{if((r|0)!=(a|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();t=a+12|0;if((pe[t>>2]|0)==(n|0)){pe[t>>2]=r;pe[i>>2]=a;break}else Xe()}else pe[151]=s&~(1<>2]=F|3;F=n+(F|4)|0;pe[F>>2]=pe[F>>2]|1;F=o;return F|0}a=pe[153]|0;if(d>>>0>a>>>0){if(r){i=2<>>12&16;i=i>>>u;n=i>>>5&8;i=i>>>n;o=i>>>2&4;i=i>>>o;r=i>>>1&2;i=i>>>r;e=i>>>1&1;e=(n|u|o|r|e)+(i>>>e)|0;i=e<<1;r=644+(i<<2)|0;i=644+(i+2<<2)|0;o=pe[i>>2]|0;u=o+8|0;n=pe[u>>2]|0;do{if((r|0)!=(n|0)){if(n>>>0<(pe[155]|0)>>>0)Xe();t=n+12|0;if((pe[t>>2]|0)==(o|0)){pe[t>>2]=r;pe[i>>2]=n;c=pe[153]|0;break}else Xe()}else{pe[151]=s&~(1<>2]=d|3;s=o+d|0;pe[o+(d|4)>>2]=a|1;pe[o+F>>2]=a;if(c){n=pe[156]|0;r=c>>>3;t=r<<1;i=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(t>>>0<(pe[155]|0)>>>0)Xe();else{l=e;f=t}}else{pe[151]=e|r;l=644+(t+2<<2)|0;f=i}pe[l>>2]=n;pe[f+12>>2]=n;pe[n+8>>2]=f;pe[n+12>>2]=i}pe[153]=a;pe[156]=s;F=u;return F|0}e=pe[152]|0;if(e){r=(e&0-e)+-1|0;j=r>>>12&16;r=r>>>j;L=r>>>5&8;r=r>>>L;F=r>>>2&4;r=r>>>F;e=r>>>1&2;r=r>>>e;i=r>>>1&1;i=pe[908+((L|j|F|e|i)+(r>>>i)<<2)>>2]|0;r=(pe[i+4>>2]&-8)-d|0;e=i;while(1){t=pe[e+16>>2]|0;if(!t){t=pe[e+20>>2]|0;if(!t){u=r;break}}e=(pe[t+4>>2]&-8)-d|0;F=e>>>0>>0;r=F?e:r;e=t;i=F?t:i}o=pe[155]|0;if(i>>>0>>0)Xe();s=i+d|0;if(i>>>0>=s>>>0)Xe();a=pe[i+24>>2]|0;r=pe[i+12>>2]|0;do{if((r|0)==(i|0)){e=i+20|0;t=pe[e>>2]|0;if(!t){e=i+16|0;t=pe[e>>2]|0;if(!t){h=0;break}}while(1){r=t+20|0;n=pe[r>>2]|0;if(n){t=n;e=r;continue}r=t+16|0;n=pe[r>>2]|0;if(!n)break;else{t=n;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;h=t;break}}else{n=pe[i+8>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(i|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(i|0)){pe[t>>2]=r;pe[e>>2]=n;h=r;break}else Xe()}}while(0);do{if(a){t=pe[i+28>>2]|0;e=908+(t<<2)|0;if((i|0)==(pe[e>>2]|0)){pe[e>>2]=h;if(!h){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(i|0))pe[t>>2]=h;else pe[a+20>>2]=h;if(!h)break}e=pe[155]|0;if(h>>>0>>0)Xe();pe[h+24>>2]=a;t=pe[i+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[h+16>>2]=t;pe[t+24>>2]=h;break}}while(0);t=pe[i+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[h+20>>2]=t;pe[t+24>>2]=h;break}}}while(0);if(u>>>0<16){F=u+d|0;pe[i+4>>2]=F|3;F=i+(F+4)|0;pe[F>>2]=pe[F>>2]|1}else{pe[i+4>>2]=d|3;pe[i+(d|4)>>2]=u|1;pe[i+(u+d)>>2]=u;t=pe[153]|0;if(t){o=pe[156]|0;r=t>>>3;t=r<<1;n=644+(t<<2)|0;e=pe[151]|0;r=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{p=t;v=e}}else{pe[151]=e|r;p=644+(t+2<<2)|0;v=n}pe[p>>2]=o;pe[v+12>>2]=o;pe[o+8>>2]=v;pe[o+12>>2]=n}pe[153]=u;pe[156]=s}F=i+8|0;return F|0}else v=d}else v=d}else if(e>>>0<=4294967231){e=e+11|0;f=e&-8;l=pe[152]|0;if(l){r=0-f|0;e=e>>>8;if(e)if(f>>>0>16777215)c=31;else{v=(e+1048320|0)>>>16&8;_=e<>>16&4;_=_<>>16&2;c=14-(p|v|c)+(_<>>15)|0;c=f>>>(c+7|0)&1|c<<1}else c=0;e=pe[908+(c<<2)>>2]|0;e:do{if(!e){n=0;e=0;_=86}else{a=r;n=0;s=f<<((c|0)==31?0:25-(c>>>1)|0);u=e;e=0;while(1){o=pe[u+4>>2]&-8;r=o-f|0;if(r>>>0>>0)if((o|0)==(f|0)){o=u;e=u;_=90;break e}else e=u;else r=a;_=pe[u+20>>2]|0;u=pe[u+16+(s>>>31<<2)>>2]|0;n=(_|0)==0|(_|0)==(u|0)?n:_;if(!u){_=86;break}else{a=r;s=s<<1}}}}while(0);if((_|0)==86){if((n|0)==0&(e|0)==0){e=2<>>12&16;e=e>>>h;l=e>>>5&8;e=e>>>l;p=e>>>2&4;e=e>>>p;v=e>>>1&2;e=e>>>v;n=e>>>1&1;n=pe[908+((l|h|p|v|n)+(e>>>n)<<2)>>2]|0;e=0}if(!n){s=r;u=e}else{o=n;_=90}}if((_|0)==90)while(1){_=0;v=(pe[o+4>>2]&-8)-f|0;n=v>>>0>>0;r=n?v:r;e=n?o:e;n=pe[o+16>>2]|0;if(n){o=n;_=90;continue}o=pe[o+20>>2]|0;if(!o){s=r;u=e;break}else _=90}if((u|0)!=0?s>>>0<((pe[153]|0)-f|0)>>>0:0){n=pe[155]|0;if(u>>>0>>0)Xe();a=u+f|0;if(u>>>0>=a>>>0)Xe();o=pe[u+24>>2]|0;r=pe[u+12>>2]|0;do{if((r|0)==(u|0)){e=u+20|0;t=pe[e>>2]|0;if(!t){e=u+16|0;t=pe[e>>2]|0;if(!t){d=0;break}}while(1){r=t+20|0;i=pe[r>>2]|0;if(i){t=i;e=r;continue}r=t+16|0;i=pe[r>>2]|0;if(!i)break;else{t=i;e=r}}if(e>>>0>>0)Xe();else{pe[e>>2]=0;d=t;break}}else{i=pe[u+8>>2]|0;if(i>>>0>>0)Xe();t=i+12|0;if((pe[t>>2]|0)!=(u|0))Xe();e=r+8|0;if((pe[e>>2]|0)==(u|0)){pe[t>>2]=r;pe[e>>2]=i;d=r;break}else Xe()}}while(0);do{if(o){t=pe[u+28>>2]|0;e=908+(t<<2)|0;if((u|0)==(pe[e>>2]|0)){pe[e>>2]=d;if(!d){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=o+16|0;if((pe[t>>2]|0)==(u|0))pe[t>>2]=d;else pe[o+20>>2]=d;if(!d)break}e=pe[155]|0;if(d>>>0>>0)Xe();pe[d+24>>2]=o;t=pe[u+16>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[d+16>>2]=t;pe[t+24>>2]=d;break}}while(0);t=pe[u+20>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[d+20>>2]=t;pe[t+24>>2]=d;break}}}while(0);e:do{if(s>>>0>=16){pe[u+4>>2]=f|3;pe[u+(f|4)>>2]=s|1;pe[u+(s+f)>>2]=s;t=s>>>3;if(s>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{m=t;y=e}}else{pe[151]=r|t;m=644+(e+2<<2)|0;y=i}pe[m>>2]=a;pe[y+12>>2]=a;pe[u+(f+8)>>2]=y;pe[u+(f+12)>>2]=i;break}t=s>>>8;if(t)if(s>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=s>>>(i+7|0)&1|i<<1}else i=0;t=908+(i<<2)|0;pe[u+(f+28)>>2]=i;pe[u+(f+20)>>2]=0;pe[u+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break}t=pe[t>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(s|0)){i=s<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(s|0)){T=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[u+(f+24)>>2]=t;pe[u+(f+12)>>2]=a;pe[u+(f+8)>>2]=a;break e}}else T=t}while(0);t=T+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&T>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[u+(f+8)>>2]=e;pe[u+(f+12)>>2]=T;pe[u+(f+24)>>2]=0;break}else Xe()}else{F=s+f|0;pe[u+4>>2]=F|3;F=u+(F+4)|0;pe[F>>2]=pe[F>>2]|1}}while(0);F=u+8|0;return F|0}else v=f}else v=f}else v=-1}while(0);r=pe[153]|0;if(r>>>0>=v>>>0){t=r-v|0;e=pe[156]|0;if(t>>>0>15){pe[156]=e+v;pe[153]=t;pe[e+(v+4)>>2]=t|1;pe[e+r>>2]=t;pe[e+4>>2]=v|3}else{pe[153]=0;pe[156]=0;pe[e+4>>2]=r|3;F=e+(r+4)|0;pe[F>>2]=pe[F>>2]|1}F=e+8|0;return F|0}e=pe[154]|0;if(e>>>0>v>>>0){j=e-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}do{if(!(pe[269]|0)){e=Re(30)|0;if(!(e+-1&e)){pe[271]=e;pe[270]=e;pe[272]=-1;pe[273]=-1;pe[274]=0;pe[262]=0;T=(qe(0)|0)&-16^1431655768;pe[269]=T;break}else Xe()}}while(0);u=v+48|0;s=pe[271]|0;c=v+47|0;a=s+c|0;s=0-s|0;l=a&s;if(l>>>0<=v>>>0){F=0;return F|0}e=pe[261]|0;if((e|0)!=0?(y=pe[259]|0,T=y+l|0,T>>>0<=y>>>0|T>>>0>e>>>0):0){F=0;return F|0}e:do{if(!(pe[262]&4)){e=pe[157]|0;t:do{if(e){n=1052;while(1){r=pe[n>>2]|0;if(r>>>0<=e>>>0?(b=n+4|0,(r+(pe[b>>2]|0)|0)>>>0>e>>>0):0){o=n;e=b;break}n=pe[n+8>>2]|0;if(!n){_=174;break t}}r=a-(pe[154]|0)&s;if(r>>>0<2147483647){n=Ae(r|0)|0;T=(n|0)==((pe[o>>2]|0)+(pe[e>>2]|0)|0);e=T?r:0;if(T){if((n|0)!=(-1|0)){w=n;p=e;_=194;break e}}else _=184}else e=0}else _=174}while(0);do{if((_|0)==174){o=Ae(0)|0;if((o|0)!=(-1|0)){e=o;r=pe[270]|0;n=r+-1|0;if(!(n&e))r=l;else r=l-e+(n+e&0-r)|0;e=pe[259]|0;n=e+r|0;if(r>>>0>v>>>0&r>>>0<2147483647){T=pe[261]|0;if((T|0)!=0?n>>>0<=e>>>0|n>>>0>T>>>0:0){e=0;break}n=Ae(r|0)|0;T=(n|0)==(o|0);e=T?r:0;if(T){w=o;p=e;_=194;break e}else _=184}else e=0}else e=0}}while(0);t:do{if((_|0)==184){o=0-r|0;do{if(u>>>0>r>>>0&(r>>>0<2147483647&(n|0)!=(-1|0))?(g=pe[271]|0,g=c-r+g&0-g,g>>>0<2147483647):0)if((Ae(g|0)|0)==(-1|0)){Ae(o|0)|0;break t}else{r=g+r|0;break}}while(0);if((n|0)!=(-1|0)){w=n;p=r;_=194;break e}}}while(0);pe[262]=pe[262]|4;_=191}else{e=0;_=191}}while(0);if((((_|0)==191?l>>>0<2147483647:0)?(w=Ae(l|0)|0,x=Ae(0)|0,w>>>0>>0&((w|0)!=(-1|0)&(x|0)!=(-1|0))):0)?(S=x-w|0,E=S>>>0>(v+40|0)>>>0,E):0){p=E?S:e;_=194}if((_|0)==194){e=(pe[259]|0)+p|0;pe[259]=e;if(e>>>0>(pe[260]|0)>>>0)pe[260]=e;a=pe[157]|0;e:do{if(a){o=1052;do{e=pe[o>>2]|0;r=o+4|0;n=pe[r>>2]|0;if((w|0)==(e+n|0)){M=e;P=r;k=n;C=o;_=204;break}o=pe[o+8>>2]|0}while((o|0)!=0);if(((_|0)==204?(pe[C+12>>2]&8|0)==0:0)?a>>>0>>0&a>>>0>=M>>>0:0){pe[P>>2]=k+p;F=(pe[154]|0)+p|0;j=a+8|0;j=(j&7|0)==0?0:0-j&7;L=F-j|0;pe[157]=a+j;pe[154]=L;pe[a+(j+4)>>2]=L|1;pe[a+(F+4)>>2]=40;pe[158]=pe[273];break}e=pe[155]|0;if(w>>>0>>0){pe[155]=w;e=w}r=w+p|0;o=1052;while(1){if((pe[o>>2]|0)==(r|0)){n=o;r=o;_=212;break}o=pe[o+8>>2]|0;if(!o){r=1052;break}}if((_|0)==212)if(!(pe[r+12>>2]&8)){pe[n>>2]=w;h=r+4|0;pe[h>>2]=(pe[h>>2]|0)+p;h=w+8|0;h=(h&7|0)==0?0:0-h&7;c=w+(p+8)|0;c=(c&7|0)==0?0:0-c&7;t=w+(c+p)|0;f=h+v|0;d=w+f|0;l=t-(w+h)-v|0;pe[w+(h+4)>>2]=v|3;t:do{if((t|0)!=(a|0)){if((t|0)==(pe[156]|0)){F=(pe[153]|0)+l|0;pe[153]=F;pe[156]=d;pe[w+(f+4)>>2]=F|1;pe[w+(F+f)>>2]=F;break}s=p+4|0;r=pe[w+(s+c)>>2]|0;if((r&3|0)==1){u=r&-8;o=r>>>3;r:do{if(r>>>0>=256){a=pe[w+((c|24)+p)>>2]|0;i=pe[w+(p+12+c)>>2]|0;do{if((i|0)==(t|0)){n=c|16;i=w+(s+n)|0;r=pe[i>>2]|0;if(!r){i=w+(n+p)|0;r=pe[i>>2]|0;if(!r){D=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;D=r;break}}else{n=pe[w+((c|8)+p)>>2]|0;if(n>>>0>>0)Xe();e=n+12|0;if((pe[e>>2]|0)!=(t|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(t|0)){pe[e>>2]=i;pe[r>>2]=n;D=i;break}else Xe()}}while(0);if(!a)break;e=pe[w+(p+28+c)>>2]|0;r=908+(e<<2)|0;do{if((t|0)!=(pe[r>>2]|0)){if(a>>>0<(pe[155]|0)>>>0)Xe();e=a+16|0;if((pe[e>>2]|0)==(t|0))pe[e>>2]=D;else pe[a+20>>2]=D;if(!D)break r}else{pe[r>>2]=D;if(D)break;pe[152]=pe[152]&~(1<>>0>>0)Xe();pe[D+24>>2]=a;t=c|16;e=pe[w+(t+p)>>2]|0;do{if(e)if(e>>>0>>0)Xe();else{pe[D+16>>2]=e;pe[e+24>>2]=D;break}}while(0);t=pe[w+(s+t)>>2]|0;if(!t)break;if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[D+20>>2]=t;pe[t+24>>2]=D;break}}else{i=pe[w+((c|8)+p)>>2]|0;n=pe[w+(p+12+c)>>2]|0;r=644+(o<<1<<2)|0;do{if((i|0)!=(r|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)==(t|0))break;Xe()}}while(0);if((n|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();e=n+8|0;if((pe[e>>2]|0)==(t|0)){A=e;break}Xe()}}while(0);pe[i+12>>2]=n;pe[A>>2]=i}}while(0);t=w+((u|c)+p)|0;n=u+l|0}else n=l;t=t+4|0;pe[t>>2]=pe[t>>2]&-2;pe[w+(f+4)>>2]=n|1;pe[w+(n+f)>>2]=n;t=n>>>3;if(n>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0>=(pe[155]|0)>>>0){L=t;j=e;break}Xe()}}while(0);pe[L>>2]=d;pe[j+12>>2]=d;pe[w+(f+8)>>2]=j;pe[w+(f+12)>>2]=i;break}t=n>>>8;do{if(!t)i=0;else{if(n>>>0>16777215){i=31;break}L=(t+1048320|0)>>>16&8;j=t<>>16&4;j=j<>>16&2;i=14-(D|L|i)+(j<>>15)|0;i=n>>>(i+7|0)&1|i<<1}}while(0);t=908+(i<<2)|0;pe[w+(f+28)>>2]=i;pe[w+(f+20)>>2]=0;pe[w+(f+16)>>2]=0;e=pe[152]|0;r=1<>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break}t=pe[t>>2]|0;r:do{if((pe[t+4>>2]&-8|0)!=(n|0)){i=n<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(n|0)){F=r;break r}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=d;pe[w+(f+24)>>2]=t;pe[w+(f+12)>>2]=d;pe[w+(f+8)>>2]=d;break t}}else F=t}while(0);t=F+8|0;e=pe[t>>2]|0;j=pe[155]|0;if(e>>>0>=j>>>0&F>>>0>=j>>>0){pe[e+12>>2]=d;pe[t>>2]=d;pe[w+(f+8)>>2]=e;pe[w+(f+12)>>2]=F;pe[w+(f+24)>>2]=0;break}else Xe()}else{F=(pe[154]|0)+l|0;pe[154]=F;pe[157]=d;pe[w+(f+4)>>2]=F|1}}while(0);F=w+(h|8)|0;return F|0}else r=1052;while(1){e=pe[r>>2]|0;if(e>>>0<=a>>>0?(t=pe[r+4>>2]|0,i=e+t|0,i>>>0>a>>>0):0)break;r=pe[r+8>>2]|0}n=e+(t+-39)|0;e=e+(t+-47+((n&7|0)==0?0:0-n&7))|0;n=a+16|0;e=e>>>0>>0?a:e;t=e+8|0;r=w+8|0;r=(r&7|0)==0?0:0-r&7;F=p+-40-r|0;pe[157]=w+r;pe[154]=F;pe[w+(r+4)>>2]=F|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273];r=e+4|0;pe[r>>2]=27;pe[t>>2]=pe[263];pe[t+4>>2]=pe[264];pe[t+8>>2]=pe[265];pe[t+12>>2]=pe[266];pe[263]=w;pe[264]=p;pe[266]=0;pe[265]=t;t=e+28|0;pe[t>>2]=7;if((e+32|0)>>>0>>0)do{F=t;t=t+4|0;pe[t>>2]=7}while((F+8|0)>>>0>>0);if((e|0)!=(a|0)){o=e-a|0;pe[r>>2]=pe[r>>2]&-2;pe[a+4>>2]=o|1;pe[e>>2]=o;t=o>>>3;if(o>>>0<256){e=t<<1;i=644+(e<<2)|0;r=pe[151]|0;t=1<>2]|0;if(e>>>0<(pe[155]|0)>>>0)Xe();else{O=t;I=e}}else{pe[151]=r|t;O=644+(e+2<<2)|0;I=i}pe[O>>2]=a;pe[I+12>>2]=a;pe[a+8>>2]=I;pe[a+12>>2]=i;break}t=o>>>8;if(t)if(o>>>0>16777215)i=31;else{j=(t+1048320|0)>>>16&8;F=t<>>16&4;F=F<>>16&2;i=14-(L|j|i)+(F<>>15)|0;i=o>>>(i+7|0)&1|i<<1}else i=0;r=908+(i<<2)|0;pe[a+28>>2]=i;pe[a+20>>2]=0;pe[n>>2]=0;t=pe[152]|0;e=1<>2]=a;pe[a+24>>2]=r;pe[a+12>>2]=a;pe[a+8>>2]=a;break}t=pe[r>>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){i=o<<((i|0)==31?0:25-(i>>>1)|0);while(1){e=t+16+(i>>>31<<2)|0;r=pe[e>>2]|0;if(!r)break;if((pe[r+4>>2]&-8|0)==(o|0)){R=r;break t}else{i=i<<1;t=r}}if(e>>>0<(pe[155]|0)>>>0)Xe();else{pe[e>>2]=a;pe[a+24>>2]=t;pe[a+12>>2]=a;pe[a+8>>2]=a;break e}}else R=t}while(0);t=R+8|0;e=pe[t>>2]|0;F=pe[155]|0;if(e>>>0>=F>>>0&R>>>0>=F>>>0){pe[e+12>>2]=a;pe[t>>2]=a;pe[a+8>>2]=e;pe[a+12>>2]=R;pe[a+24>>2]=0;break}else Xe()}}else{F=pe[155]|0;if((F|0)==0|w>>>0>>0)pe[155]=w;pe[263]=w;pe[264]=p;pe[266]=0;pe[160]=pe[269];pe[159]=-1;t=0;do{F=t<<1;j=644+(F<<2)|0;pe[644+(F+3<<2)>>2]=j;pe[644+(F+2<<2)>>2]=j;t=t+1|0}while((t|0)!=32);F=w+8|0;F=(F&7|0)==0?0:0-F&7;j=p+-40-F|0;pe[157]=w+F;pe[154]=j;pe[w+(F+4)>>2]=j|1;pe[w+(p+-36)>>2]=40;pe[158]=pe[273]}}while(0);t=pe[154]|0;if(t>>>0>v>>>0){j=t-v|0;pe[154]=j;F=pe[157]|0;pe[157]=F+v;pe[F+(v+4)>>2]=j|1;pe[F+4>>2]=v|3;F=F+8|0;return F|0}}F=lr()|0;pe[F>>2]=12;F=0;return F|0}function zr(e){e=e|0;var t=0,r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0,g=0;if(!e)return;t=e+-8|0;s=pe[155]|0;if(t>>>0>>0)Xe();r=pe[e+-4>>2]|0;i=r&3;if((i|0)==1)Xe();d=r&-8;v=e+(d+-8)|0;do{if(!(r&1)){t=pe[t>>2]|0;if(!i)return;u=-8-t|0;l=e+u|0;f=t+d|0;if(l>>>0>>0)Xe();if((l|0)==(pe[156]|0)){t=e+(d+-4)|0;r=pe[t>>2]|0;if((r&3|0)!=3){g=l;o=f;break}pe[153]=f;pe[t>>2]=r&-2;pe[e+(u+4)>>2]=f|1;pe[v>>2]=f;return}n=t>>>3;if(t>>>0<256){i=pe[e+(u+8)>>2]|0;r=pe[e+(u+12)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0>>0)Xe();if((pe[i+12>>2]|0)!=(l|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(l|0))a=t;else Xe()}else a=r+8|0;pe[i+12>>2]=r;pe[a>>2]=i;g=l;o=f;break}a=pe[e+(u+24)>>2]|0;i=pe[e+(u+12)>>2]|0;do{if((i|0)==(l|0)){r=e+(u+20)|0;t=pe[r>>2]|0;if(!t){r=e+(u+16)|0;t=pe[r>>2]|0;if(!t){c=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0>>0)Xe();else{pe[r>>2]=0;c=t;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();t=n+12|0;if((pe[t>>2]|0)!=(l|0))Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0)){pe[t>>2]=i;pe[r>>2]=n;c=i;break}else Xe()}}while(0);if(a){t=pe[e+(u+28)>>2]|0;r=908+(t<<2)|0;if((l|0)==(pe[r>>2]|0)){pe[r>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(l|0))pe[t>>2]=c;else pe[a+20>>2]=c;if(!c){g=l;o=f;break}}r=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;t=pe[e+(u+16)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[c+16>>2]=t;pe[t+24>>2]=c;break}}while(0);t=pe[e+(u+20)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=t;pe[t+24>>2]=c;g=l;o=f;break}else{g=l;o=f}}else{g=l;o=f}}else{g=t;o=d}}while(0);if(g>>>0>=v>>>0)Xe();t=e+(d+-4)|0;r=pe[t>>2]|0;if(!(r&1))Xe();if(!(r&2)){if((v|0)==(pe[157]|0)){y=(pe[154]|0)+o|0;pe[154]=y;pe[157]=g;pe[g+4>>2]=y|1;if((g|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){y=(pe[153]|0)+o|0;pe[153]=y;pe[156]=g;pe[g+4>>2]=y|1;pe[g+y>>2]=y;return}o=(r&-8)+o|0;n=r>>>3;do{if(r>>>0>=256){a=pe[e+(d+16)>>2]|0;t=pe[e+(d|4)>>2]|0;do{if((t|0)==(v|0)){r=e+(d+12)|0;t=pe[r>>2]|0;if(!t){r=e+(d+8)|0;t=pe[r>>2]|0;if(!t){p=0;break}}while(1){i=t+20|0;n=pe[i>>2]|0;if(n){t=n;r=i;continue}i=t+16|0;n=pe[i>>2]|0;if(!n)break;else{t=n;r=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=0;p=t;break}}else{r=pe[e+d>>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();i=r+12|0;if((pe[i>>2]|0)!=(v|0))Xe();n=t+8|0;if((pe[n>>2]|0)==(v|0)){pe[i>>2]=t;pe[n>>2]=r;p=t;break}else Xe()}}while(0);if(a){t=pe[e+(d+20)>>2]|0;r=908+(t<<2)|0;if((v|0)==(pe[r>>2]|0)){pe[r>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=a+16|0;if((pe[t>>2]|0)==(v|0))pe[t>>2]=p;else pe[a+20>>2]=p;if(!p)break}r=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=a;t=pe[e+(d+8)>>2]|0;do{if(t)if(t>>>0>>0)Xe();else{pe[p+16>>2]=t;pe[t+24>>2]=p;break}}while(0);t=pe[e+(d+12)>>2]|0;if(t)if(t>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=t;pe[t+24>>2]=p;break}}}else{i=pe[e+d>>2]|0;r=pe[e+(d|4)>>2]|0;t=644+(n<<1<<2)|0;if((i|0)!=(t|0)){if(i>>>0<(pe[155]|0)>>>0)Xe();if((pe[i+12>>2]|0)!=(v|0))Xe()}if((r|0)==(i|0)){pe[151]=pe[151]&~(1<>>0<(pe[155]|0)>>>0)Xe();t=r+8|0;if((pe[t>>2]|0)==(v|0))h=t;else Xe()}else h=r+8|0;pe[i+12>>2]=r;pe[h>>2]=i}}while(0);pe[g+4>>2]=o|1;pe[g+o>>2]=o;if((g|0)==(pe[156]|0)){pe[153]=o;return}}else{pe[t>>2]=r&-2;pe[g+4>>2]=o|1;pe[g+o>>2]=o}t=o>>>3;if(o>>>0<256){r=t<<1;n=644+(r<<2)|0;i=pe[151]|0;t=1<>2]|0;if(r>>>0<(pe[155]|0)>>>0)Xe();else{b=t;m=r}}else{pe[151]=i|t;b=644+(r+2<<2)|0;m=n}pe[b>>2]=g;pe[m+12>>2]=g;pe[g+8>>2]=m;pe[g+12>>2]=n;return}t=o>>>8;if(t)if(o>>>0>16777215)n=31;else{b=(t+1048320|0)>>>16&8;m=t<>>16&4;m=m<>>16&2;n=14-(v|b|n)+(m<>>15)|0;n=o>>>(n+7|0)&1|n<<1}else n=0;t=908+(n<<2)|0;pe[g+28>>2]=n;pe[g+20>>2]=0;pe[g+16>>2]=0;r=pe[152]|0;i=1<>2]|0;t:do{if((pe[t+4>>2]&-8|0)!=(o|0)){n=o<<((n|0)==31?0:25-(n>>>1)|0);while(1){r=t+16+(n>>>31<<2)|0;i=pe[r>>2]|0;if(!i)break;if((pe[i+4>>2]&-8|0)==(o|0)){y=i;break t}else{n=n<<1;t=i}}if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[r>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g;break e}}else y=t}while(0);t=y+8|0;r=pe[t>>2]|0;m=pe[155]|0;if(r>>>0>=m>>>0&y>>>0>=m>>>0){pe[r+12>>2]=g;pe[t>>2]=g;pe[g+8>>2]=r;pe[g+12>>2]=y;pe[g+24>>2]=0;break}else Xe()}else{pe[152]=r|i;pe[t>>2]=g;pe[g+24>>2]=t;pe[g+12>>2]=g;pe[g+8>>2]=g}}while(0);g=(pe[159]|0)+-1|0;pe[159]=g;if(!g)t=1060;else return;while(1){t=pe[t>>2]|0;if(!t)break;else t=t+8|0}pe[159]=-1;return}function Xr(e,t){e=e|0;t=t|0;var r=0,i=0;if(!e){e=Ur(t)|0;return e|0}if(t>>>0>4294967231){e=lr()|0;pe[e>>2]=12;e=0;return e|0}r=qr(e+-8|0,t>>>0<11?16:t+11&-8)|0;if(r){e=r+8|0;return e|0}r=Ur(t)|0;if(!r){e=0;return e|0}i=pe[e+-4>>2]|0;i=(i&-8)-((i&3|0)==0?8:4)|0;Qr(r|0,e|0,(i>>>0>>0?i:t)|0)|0;zr(e);e=r;return e|0}function Wr(e){e=e|0;var t=0;if(!e){t=0;return t|0}e=pe[e+-4>>2]|0;t=e&3;if((t|0)==1){t=0;return t|0}t=(e&-8)-((t|0)==0?8:4)|0;return t|0}function qr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;d=e+4|0;p=pe[d>>2]|0;u=p&-8;l=e+u|0;s=pe[155]|0;r=p&3;if(!((r|0)!=1&e>>>0>=s>>>0&e>>>0>>0))Xe();i=e+(u|4)|0;n=pe[i>>2]|0;if(!(n&1))Xe();if(!r){if(t>>>0<256){e=0;return e|0}if(u>>>0>=(t+4|0)>>>0?(u-t|0)>>>0<=pe[271]<<1>>>0:0)return e|0;e=0;return e|0}if(u>>>0>=t>>>0){r=u-t|0;if(r>>>0<=15)return e|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|3;pe[i>>2]=pe[i>>2]|1;Hr(e+t|0,r);return e|0}if((l|0)==(pe[157]|0)){r=(pe[154]|0)+u|0;if(r>>>0<=t>>>0){e=0;return e|0}h=r-t|0;pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|1;pe[157]=e+t;pe[154]=h;return e|0}if((l|0)==(pe[156]|0)){i=(pe[153]|0)+u|0;if(i>>>0>>0){e=0;return e|0}r=i-t|0;if(r>>>0>15){pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=r|1;pe[e+i>>2]=r;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]&-2;i=e+t|0}else{pe[d>>2]=p&1|i|2;i=e+(i+4)|0;pe[i>>2]=pe[i>>2]|1;i=0;r=0}pe[153]=r;pe[156]=i;return e|0}if(n&2){e=0;return e|0}f=(n&-8)+u|0;if(f>>>0>>0){e=0;return e|0}h=f-t|0;o=n>>>3;do{if(n>>>0>=256){a=pe[e+(u+24)>>2]|0;o=pe[e+(u+12)>>2]|0;do{if((o|0)==(l|0)){i=e+(u+20)|0;r=pe[i>>2]|0;if(!r){i=e+(u+16)|0;r=pe[i>>2]|0;if(!r){c=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;c=r;break}}else{n=pe[e+(u+8)>>2]|0;if(n>>>0>>0)Xe();r=n+12|0;if((pe[r>>2]|0)!=(l|0))Xe();i=o+8|0;if((pe[i>>2]|0)==(l|0)){pe[r>>2]=o;pe[i>>2]=n;c=o;break}else Xe()}}while(0);if(a){r=pe[e+(u+28)>>2]|0;i=908+(r<<2)|0;if((l|0)==(pe[i>>2]|0)){pe[i>>2]=c;if(!c){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=a+16|0;if((pe[r>>2]|0)==(l|0))pe[r>>2]=c;else pe[a+20>>2]=c;if(!c)break}i=pe[155]|0;if(c>>>0>>0)Xe();pe[c+24>>2]=a;r=pe[e+(u+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[c+16>>2]=r;pe[r+24>>2]=c;break}}while(0);r=pe[e+(u+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[c+20>>2]=r;pe[r+24>>2]=c;break}}}else{n=pe[e+(u+8)>>2]|0;i=pe[e+(u+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(l|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(l|0))a=r;else Xe()}else a=i+8|0;pe[n+12>>2]=i;pe[a>>2]=n}}while(0);if(h>>>0<16){pe[d>>2]=f|p&1|2;t=e+(f|4)|0;pe[t>>2]=pe[t>>2]|1;return e|0}else{pe[d>>2]=p&1|t|2;pe[e+(t+4)>>2]=h|3;p=e+(f|4)|0;pe[p>>2]=pe[p>>2]|1;Hr(e+t|0,h);return e|0}return 0}function Hr(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0,v=0,b=0,m=0,y=0;v=e+t|0;r=pe[e+4>>2]|0;do{if(!(r&1)){c=pe[e>>2]|0;if(!(r&3))return;h=e+(0-c)|0;f=c+t|0;u=pe[155]|0;if(h>>>0>>0)Xe();if((h|0)==(pe[156]|0)){i=e+(t+4)|0;r=pe[i>>2]|0;if((r&3|0)!=3){y=h;a=f;break}pe[153]=f;pe[i>>2]=r&-2;pe[e+(4-c)>>2]=f|1;pe[v>>2]=f;return}o=c>>>3;if(c>>>0<256){n=pe[e+(8-c)>>2]|0;i=pe[e+(12-c)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(h|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(h|0))s=r;else Xe()}else s=i+8|0;pe[n+12>>2]=i;pe[s>>2]=n;y=h;a=f;break}s=pe[e+(24-c)>>2]|0;n=pe[e+(12-c)>>2]|0;do{if((n|0)==(h|0)){n=16-c|0;i=e+(n+4)|0;r=pe[i>>2]|0;if(!r){i=e+n|0;r=pe[i>>2]|0;if(!r){l=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;l=r;break}}else{o=pe[e+(8-c)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(h|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(h|0)){pe[r>>2]=n;pe[i>>2]=o;l=n;break}else Xe()}}while(0);if(s){r=pe[e+(28-c)>>2]|0;i=908+(r<<2)|0;if((h|0)==(pe[i>>2]|0)){pe[i>>2]=l;if(!l){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(h|0))pe[r>>2]=l;else pe[s+20>>2]=l;if(!l){y=h;a=f;break}}n=pe[155]|0;if(l>>>0>>0)Xe();pe[l+24>>2]=s;r=16-c|0;i=pe[e+r>>2]|0;do{if(i)if(i>>>0>>0)Xe();else{pe[l+16>>2]=i;pe[i+24>>2]=l;break}}while(0);r=pe[e+(r+4)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[l+20>>2]=r;pe[r+24>>2]=l;y=h;a=f;break}else{y=h;a=f}}else{y=h;a=f}}else{y=e;a=t}}while(0);u=pe[155]|0;if(v>>>0>>0)Xe();r=e+(t+4)|0;i=pe[r>>2]|0;if(!(i&2)){if((v|0)==(pe[157]|0)){m=(pe[154]|0)+a|0;pe[154]=m;pe[157]=y;pe[y+4>>2]=m|1;if((y|0)!=(pe[156]|0))return;pe[156]=0;pe[153]=0;return}if((v|0)==(pe[156]|0)){m=(pe[153]|0)+a|0;pe[153]=m;pe[156]=y;pe[y+4>>2]=m|1;pe[y+m>>2]=m;return}a=(i&-8)+a|0;o=i>>>3;do{if(i>>>0>=256){s=pe[e+(t+24)>>2]|0;n=pe[e+(t+12)>>2]|0;do{if((n|0)==(v|0)){i=e+(t+20)|0;r=pe[i>>2]|0;if(!r){i=e+(t+16)|0;r=pe[i>>2]|0;if(!r){p=0;break}}while(1){n=r+20|0;o=pe[n>>2]|0;if(o){r=o;i=n;continue}n=r+16|0;o=pe[n>>2]|0;if(!o)break;else{r=o;i=n}}if(i>>>0>>0)Xe();else{pe[i>>2]=0;p=r;break}}else{o=pe[e+(t+8)>>2]|0;if(o>>>0>>0)Xe();r=o+12|0;if((pe[r>>2]|0)!=(v|0))Xe();i=n+8|0;if((pe[i>>2]|0)==(v|0)){pe[r>>2]=n;pe[i>>2]=o;p=n;break}else Xe()}}while(0);if(s){r=pe[e+(t+28)>>2]|0;i=908+(r<<2)|0;if((v|0)==(pe[i>>2]|0)){pe[i>>2]=p;if(!p){pe[152]=pe[152]&~(1<>>0<(pe[155]|0)>>>0)Xe();r=s+16|0;if((pe[r>>2]|0)==(v|0))pe[r>>2]=p;else pe[s+20>>2]=p;if(!p)break}i=pe[155]|0;if(p>>>0>>0)Xe();pe[p+24>>2]=s;r=pe[e+(t+16)>>2]|0;do{if(r)if(r>>>0>>0)Xe();else{pe[p+16>>2]=r;pe[r+24>>2]=p;break}}while(0);r=pe[e+(t+20)>>2]|0;if(r)if(r>>>0<(pe[155]|0)>>>0)Xe();else{pe[p+20>>2]=r;pe[r+24>>2]=p;break}}}else{n=pe[e+(t+8)>>2]|0;i=pe[e+(t+12)>>2]|0;r=644+(o<<1<<2)|0;if((n|0)!=(r|0)){if(n>>>0>>0)Xe();if((pe[n+12>>2]|0)!=(v|0))Xe()}if((i|0)==(n|0)){pe[151]=pe[151]&~(1<>>0>>0)Xe();r=i+8|0;if((pe[r>>2]|0)==(v|0))d=r;else Xe()}else d=i+8|0;pe[n+12>>2]=i;pe[d>>2]=n}}while(0);pe[y+4>>2]=a|1;pe[y+a>>2]=a;if((y|0)==(pe[156]|0)){pe[153]=a;return}}else{pe[r>>2]=i&-2;pe[y+4>>2]=a|1;pe[y+a>>2]=a}r=a>>>3;if(a>>>0<256){i=r<<1;o=644+(i<<2)|0;n=pe[151]|0;r=1<>2]|0;if(i>>>0<(pe[155]|0)>>>0)Xe();else{b=r;m=i}}else{pe[151]=n|r;b=644+(i+2<<2)|0;m=o}pe[b>>2]=y;pe[m+12>>2]=y;pe[y+8>>2]=m;pe[y+12>>2]=o;return}r=a>>>8;if(r)if(a>>>0>16777215)o=31;else{b=(r+1048320|0)>>>16&8;m=r<>>16&4;m=m<>>16&2;o=14-(v|b|o)+(m<>>15)|0;o=a>>>(o+7|0)&1|o<<1}else o=0;r=908+(o<<2)|0;pe[y+28>>2]=o;pe[y+20>>2]=0;pe[y+16>>2]=0;i=pe[152]|0;n=1<>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}r=pe[r>>2]|0;e:do{if((pe[r+4>>2]&-8|0)!=(a|0)){o=a<<((o|0)==31?0:25-(o>>>1)|0);while(1){i=r+16+(o>>>31<<2)|0;n=pe[i>>2]|0;if(!n)break;if((pe[n+4>>2]&-8|0)==(a|0)){r=n;break e}else{o=o<<1;r=n}}if(i>>>0<(pe[155]|0)>>>0)Xe();pe[i>>2]=y;pe[y+24>>2]=r;pe[y+12>>2]=y;pe[y+8>>2]=y;return}}while(0);i=r+8|0;n=pe[i>>2]|0;m=pe[155]|0;if(!(n>>>0>=m>>>0&r>>>0>=m>>>0))Xe();pe[n+12>>2]=y;pe[i>>2]=y;pe[y+8>>2]=n;pe[y+12>>2]=r;pe[y+24>>2]=0;return}function Gr(){}function Vr(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;i=t-i-(r>>>0>e>>>0|0)>>>0;return(re=i,e-r>>>0|0)|0}function Yr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0,n=0,o=0,a=0;i=e+r|0;if((r|0)>=20){t=t&255;o=e&3;a=t|t<<8|t<<16|t<<24;n=i&~3;if(o){o=e+4-o|0;while((e|0)<(o|0)){de[e>>0]=t;e=e+1|0}}while((e|0)<(n|0)){pe[e>>2]=a;e=e+4|0}}while((e|0)<(i|0)){de[e>>0]=t;e=e+1|0}return e-r|0}function Jr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>>r;return e>>>r|(t&(1<>>r-32|0}function Kr(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t<>>32-r;return e<>>0;return(re=t+i+(r>>>0>>0|0)>>>0,r|0)|0}function Qr(e,t,r){e=e|0;t=t|0;r=r|0;var i=0;if((r|0)>=4096)return Ie(e|0,t|0,r|0)|0;i=e|0;if((e&3)==(t&3)){while(e&3){if(!r)return i|0;de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}while((r|0)>=4){pe[e>>2]=pe[t>>2];e=e+4|0;t=t+4|0;r=r-4|0}}while((r|0)>0){de[e>>0]=de[t>>0]|0;e=e+1|0;t=t+1|0;r=r-1|0}return i|0}function $r(e,t,r){e=e|0;t=t|0;r=r|0;if((r|0)<32){re=t>>r;return e>>>r|(t&(1<>r-32|0}function ei(e){e=e|0;var t=0;t=de[b+(e&255)>>0]|0;if((t|0)<8)return t|0;t=de[b+(e>>8&255)>>0]|0;if((t|0)<8)return t+8|0;t=de[b+(e>>16&255)>>0]|0;if((t|0)<8)return t+16|0;return(de[b+(e>>>24)>>0]|0)+24|0}function ti(e,t){e=e|0;t=t|0;var r=0,i=0,n=0,o=0;o=e&65535;n=t&65535;r=ye(n,o)|0;i=e>>>16;e=(r>>>16)+(ye(n,i)|0)|0;n=t>>>16;t=ye(n,o)|0;return(re=(e>>>16)+(ye(n,i)|0)+(((e&65535)+t|0)>>>16)|0,e+t<<16|r&65535|0)|0}function ri(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;c=t>>31|((t|0)<0?-1:0)<<1;u=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;o=i>>31|((i|0)<0?-1:0)<<1;n=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;s=Vr(c^e,u^t,c,u)|0;a=re;e=o^c;t=n^u;return Vr((si(s,a,Vr(o^r,n^i,o,n)|0,re,0)|0)^e,re^t,e,t)|0}function ii(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0,a=0,s=0,u=0,c=0;n=me;me=me+16|0;s=n|0;a=t>>31|((t|0)<0?-1:0)<<1;o=((t|0)<0?-1:0)>>31|((t|0)<0?-1:0)<<1;c=i>>31|((i|0)<0?-1:0)<<1;u=((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1;e=Vr(a^e,o^t,a,o)|0;t=re;si(e,t,Vr(c^r,u^i,c,u)|0,re,s)|0;i=Vr(pe[s>>2]^a,pe[s+4>>2]^o,a,o)|0;r=re;me=n;return(re=r,i)|0}function ni(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;n=e;o=r;r=ti(n,o)|0;e=re;return(re=(ye(t,o)|0)+(ye(i,n)|0)+e|e&0,r|0|0)|0}function oi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return si(e,t,r,i,0)|0}function ai(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;var n=0,o=0;o=me;me=me+16|0;n=o|0;si(e,t,r,i,n)|0;me=o;return(re=pe[n+4>>2]|0,pe[n>>2]|0)|0}function si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;var o=0,a=0,s=0,u=0,c=0,l=0,f=0,h=0,d=0,p=0;l=e;u=t;c=u;a=r;h=i;s=h;if(!c){o=(n|0)!=0;if(!s){if(o){pe[n>>2]=(l>>>0)%(a>>>0);pe[n+4>>2]=0}h=0;n=(l>>>0)/(a>>>0)>>>0;return(re=h,n)|0}else{if(!o){h=0;n=0;return(re=h,n)|0}pe[n>>2]=e|0;pe[n+4>>2]=t&0;h=0;n=0;return(re=h,n)|0}}o=(s|0)==0;do{if(a){if(!o){o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=31){f=o+1|0;s=31-o|0;t=o-31>>31;a=f;e=l>>>(f>>>0)&t|c<>>(f>>>0)&t;o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;h=0;n=0;return(re=h,n)|0}o=a-1|0;if(o&a){s=(ae(a|0)|0)+33-(ae(c|0)|0)|0;p=64-s|0;f=32-s|0;u=f>>31;d=s-32|0;t=d>>31;a=s;e=f-1>>31&c>>>(d>>>0)|(c<>>(s>>>0))&t;t=t&c>>>(s>>>0);o=l<>>(d>>>0))&u|l<>31;break}if(n){pe[n>>2]=o&l;pe[n+4>>2]=0}if((a|0)==1){d=u|t&0;p=e|0|0;return(re=d,p)|0}else{p=ei(a|0)|0;d=c>>>(p>>>0)|0;p=c<<32-p|l>>>(p>>>0)|0;return(re=d,p)|0}}else{if(o){if(n){pe[n>>2]=(c>>>0)%(a>>>0);pe[n+4>>2]=0}d=0;p=(c>>>0)/(a>>>0)>>>0;return(re=d,p)|0}if(!l){if(n){pe[n>>2]=0;pe[n+4>>2]=(c>>>0)%(s>>>0)}d=0;p=(c>>>0)/(s>>>0)>>>0;return(re=d,p)|0}o=s-1|0;if(!(o&s)){if(n){pe[n>>2]=e|0;pe[n+4>>2]=o&c|t&0}d=0;p=c>>>((ei(s|0)|0)>>>0);return(re=d,p)|0}o=(ae(s|0)|0)-(ae(c|0)|0)|0;if(o>>>0<=30){t=o+1|0;s=31-o|0;a=t;e=c<>>(t>>>0);t=c>>>(t>>>0);o=0;s=l<>2]=e|0;pe[n+4>>2]=u|t&0;d=0;p=0;return(re=d,p)|0}}while(0);if(!a){c=s;u=0;s=0}else{f=r|0|0;l=h|i&0;c=Zr(f|0,l|0,-1,-1)|0;r=re;u=s;s=0;do{i=u;u=o>>>31|u<<1;o=s|o<<1;i=e<<1|i>>>31|0;h=e>>>31|t<<1|0;Vr(c,r,i,h)|0;p=re;d=p>>31|((p|0)<0?-1:0)<<1;s=d&1;e=Vr(i,h,d&f,(((p|0)<0?-1:0)>>31|((p|0)<0?-1:0)<<1)&l)|0;t=re;a=a-1|0}while((a|0)!=0);c=u;u=0}a=0;if(n){pe[n>>2]=e;pe[n+4>>2]=t}d=(o|0)>>>31|(c|a)<<1|(a<<1|o>>>31)&0|u;p=(o<<1|0>>>31)&-2|s;return(re=d,p)|0}function ui(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;return Mi[e&7](t|0,r|0,i|0)|0}function ci(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;Pi[e&3](t|0,r|0,i|0,n|0,o|0)}function li(e,t){e=e|0;t=t|0;ki[e&7](t|0)}function fi(e,t){e=e|0;t=t|0;return Ci[e&1](t|0)|0}function hi(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;Ai[e&0](t|0,r|0,i|0)}function di(e){e=e|0;Oi[e&3]()}function pi(e,t,r,i,n,o,a){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;a=a|0;Ii[e&3](t|0,r|0,i|0,n|0,o|0,a|0)}function vi(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;return Ri[e&1](t|0,r|0,i|0,n|0,o|0)|0}function bi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;Di[e&3](t|0,r|0,i|0,n|0)}function mi(e,t,r){e=e|0;t=t|0;r=r|0;se(0);return 0}function yi(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(1)}function gi(e){e=e|0;se(2)}function _i(e){e=e|0;se(3);return 0}function wi(e,t,r){e=e|0;t=t|0;r=r|0;se(4)}function xi(){se(5)}function Ti(e,t,r,i,n,o){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;o=o|0;se(6)}function Si(e,t,r,i,n){e=e|0;t=t|0;r=r|0;i=i|0;n=n|0;se(7);return 0}function Ei(e,t,r,i){e=e|0;t=t|0;r=r|0;i=i|0;se(8)}var Mi=[mi,Yt,jr,Cr,kr,Ar,mi,mi];var Pi=[yi,tr,er,yi];var ki=[gi,Wt,Gt,qt,Ht,Vt,ur,Lr];var Ci=[_i,Pr];var Ai=[wi];var Oi=[xi,ar,sr,xi];var Ii=[Ti,ir,rr,Ti];var Ri=[Si,ut];var Di=[Ei,Kt,Zt,Ei];return{___cxa_can_catch:nr,_crn_get_levels:Tt,_crn_get_uncompressed_size:Et,_crn_decompress:Mt,_i64Add:Zr,_crn_get_width:wt,___cxa_is_pointer_type:or,_i64Subtract:Vr,_memset:Yr,_malloc:Ur,_free:zr,_memcpy:Qr,_bitshift64Lshr:Jr,_fflush:br,_bitshift64Shl:Kr,_crn_get_height:xt,___errno_location:lr,_crn_get_dxt_format:St,runPostSets:Gr,_emscripten_replace_memory:Ye,stackAlloc:Je,stackSave:Ke,stackRestore:Ze,establishStackSpace:Qe,setThrew:$e,setTempRet0:rt,getTempRet0:it,dynCall_iiii:ui,dynCall_viiiii:ci,dynCall_vi:li,dynCall_ii:fi,dynCall_viii:hi,dynCall_v:di,dynCall_viiiiii:pi,dynCall_iiiiii:vi,dynCall_viiii:bi}}(e.Ya,e.Za,buffer);e.___cxa_can_catch=Z.___cxa_can_catch,e._crn_get_levels=Z._crn_get_levels,e.runPostSets=Z.runPostSets,e._crn_get_uncompressed_size=Z._crn_get_uncompressed_size,e._crn_decompress=Z._crn_decompress;var zc=e._i64Add=Z._i64Add;e._crn_get_height=Z._crn_get_height,e.___cxa_is_pointer_type=Z.___cxa_is_pointer_type;var nb=e._i64Subtract=Z._i64Subtract,qb=e._memset=Z._memset,Ea=e._malloc=Z._malloc,Bc=e._memcpy=Z._memcpy,Xa=e._emscripten_replace_memory=Z._emscripten_replace_memory;e._crn_get_dxt_format=Z._crn_get_dxt_format;var rb=e._bitshift64Lshr=Z._bitshift64Lshr,Na=e._free=Z._free;e._fflush=Z._fflush,e._crn_get_width=Z._crn_get_width,e.___errno_location=Z.___errno_location;var sb=e._bitshift64Shl=Z._bitshift64Shl;function ia(e){this.name="ExitStatus",this.message="Program terminated with exit("+e+")",this.status=e}e.dynCall_iiii=Z.dynCall_iiii,e.dynCall_viiiii=Z.dynCall_viiiii,e.dynCall_vi=Z.dynCall_vi,e.dynCall_ii=Z.dynCall_ii,e.dynCall_viii=Z.dynCall_viii,e.dynCall_v=Z.dynCall_v,e.dynCall_viiiiii=Z.dynCall_viiiiii,e.dynCall_iiiiii=Z.dynCall_iiiiii,e.dynCall_viiii=Z.dynCall_viiii,n.aa=Z.stackAlloc,n.ua=Z.stackSave,n.ba=Z.stackRestore,n.Cd=Z.establishStackSpace,n.rb=Z.setTempRet0,n.fb=Z.getTempRet0,ia.prototype=Error(),ia.prototype.constructor=ia;var rd=null,jb=function t(){e.calledRun||td(),e.calledRun||(jb=t)};function td(t){function r(){if(!e.calledRun&&(e.calledRun=!0,!na)){if(Ha||(Ha=!0,ab(cb)),ab(db),e.onRuntimeInitialized&&e.onRuntimeInitialized(),e._main&&vd&&e.callMain(t),e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)gb(e.postRun.shift());ab(eb)}}if(t=t||e.arguments,null===rd&&(rd=Date.now()),!(0>6],n=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function f(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;var n=127&i;if(4>=8)a++;(n=new c(2+a))[0]=o,n[1]=128|a;s=1+a;for(var u=i.length;0>=8)n[s]=255&u;return this._createEncoderBuffer([n,i])},s.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"!==t)return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported");for(var r=new c(2*e.length),i=0;i>=7)n++}var a=new c(n),s=a.length-1;for(i=e.length-1;0<=i;i--){o=e[i];for(a[s--]=127&o;0<(o>>=7);)a[s--]=128|127&o}return this._createEncoderBuffer(a)},s.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=[u(i.getFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[u(i.getFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},s.prototype._encodeNull=function(){return this._createEncoderBuffer("")},s.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!c.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new c(r)}if(c.isBuffer(e)){var i=e.length;0===e.length&&i++;var n=new c(i);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);i=1;for(var o=e;256<=o;o>>=8)i++;for(o=(n=new Array(i)).length-1;0<=o;o--)n[o]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(new c(n))},s.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},s.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},s.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i>16&255,o[s++]=i>>8&255,o[s++]=255&i;2===n?(i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,o[s++]=255&i):1===n&&(i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,o[s++]=i>>8&255,o[s++]=255&i);return o},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,n="",o=[],a=0,s=r-i;a>2],n+=u[t<<4&63],n+="=="):2==i&&(t=(e[r-2]<<8)+e[r-1],n+=u[t>>10],n+=u[t>>4&63],n+=u[t<<2&63],n+="=");return o.push(n),o.join("")};for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n>18&63]+u[n>>12&63]+u[n>>6&63]+u[63&n]);return o.join("")}c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],17:[function(T,e,t){!function(e,t){"use strict";function b(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function m(e,t,r){if(m.isBN(e))return e;this.negative=0,this.words=null,this.length=0,(this.red=null)!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var i;"object"==typeof e?e.exports=m:t.BN=m,(m.BN=m).wordSize=26;try{i=T("buffer").Buffer}catch(e){}function a(e,t,r){for(var i=0,n=Math.min(e.length,r),o=t;o>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);else if("le"===r)for(n=i=0;i>>26-a&67108863,26<=(a+=24)&&(a-=26,n++);return this.strip()},m.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r>>26-o&4194303,26<=(o+=24)&&(o-=26,i++);r+6!==t&&(n=a(e,t,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},m.prototype._parseBase=function(e,t,r){this.words=[0];for(var i=0,n=this.length=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var o=e.length-r,a=o%i,s=Math.min(o,o-a)+r,u=0,c=r;c"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function n(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;i=(r.length=i)-1|0;var n=0|e.words[0],o=0|t.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(n=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}m.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,n=0,o=0;o>>24-i&16777215)||o!==this.length-1?h[6-s.length]+s+r:s+r,26<=(i+=2)&&(i-=26,o--)}for(0!==n&&(r=n.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&2<=e&&e<=36){var u=d[e],c=p[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var f=l.modn(c).toString(e);r=(l=l.idivn(c)).isZero()?f+r:h[u-f.length]+f+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}b(!1,"Base should be between 2 and 36")},m.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:2>>=13),64<=t&&(r+=7,t>>>=7),8<=t&&(r+=4,t>>>=4),2<=t&&(r+=2,t>>>=2),r+t},m.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},m.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},m.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},m.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},m.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},m.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},m.prototype.iuxor=function(e){var t,r;r=this.length>e.length?(t=this,e):(t=e,this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},m.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},m.prototype.inotn=function(e){b("number"==typeof e&&0<=e);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),0>26-r),this.strip()},m.prototype.notn=function(e){return this.clone().inotn(e)},m.prototype.setn=function(e,t){b("number"==typeof e&&0<=e);var r=e/26|0,i=e%26;return this._expand(1+r),this.words[r]=t?this.words[r]|1<e.length?(r=this,e):(r=e,this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},m.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;i=0>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],p=8191&d,v=d>>>13,b=0|a[2],m=8191&b,y=b>>>13,g=0|a[3],_=8191&g,w=g>>>13,x=0|a[4],T=8191&x,S=x>>>13,E=0|a[5],M=8191&E,P=E>>>13,k=0|a[6],C=8191&k,A=k>>>13,O=0|a[7],I=8191&O,R=O>>>13,D=0|a[8],L=8191&D,j=D>>>13,F=0|a[9],B=8191&F,N=F>>>13,U=0|s[0],z=8191&U,X=U>>>13,W=0|s[1],q=8191&W,H=W>>>13,G=0|s[2],V=8191&G,Y=G>>>13,J=0|s[3],K=8191&J,Z=J>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ie=te>>>13,ne=0|s[6],oe=8191&ne,ae=ne>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var be=(c+(i=Math.imul(f,z))|0)+((8191&(n=(n=Math.imul(f,X))+Math.imul(h,z)|0))<<13)|0;c=((o=Math.imul(h,X))+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,X))+Math.imul(v,z)|0,o=Math.imul(v,X);var me=(c+(i=i+Math.imul(f,q)|0)|0)+((8191&(n=(n=n+Math.imul(f,H)|0)+Math.imul(h,q)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,z),n=(n=Math.imul(m,X))+Math.imul(y,z)|0,o=Math.imul(y,X),i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var ye=(c+(i=i+Math.imul(f,V)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(n>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,X))+Math.imul(w,z)|0,o=Math.imul(w,X),i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,H)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(p,V)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,Y)|0;var ge=(c+(i=i+Math.imul(f,K)|0)|0)+((8191&(n=(n=n+Math.imul(f,Z)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,Z)|0)+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(T,z),n=(n=Math.imul(T,X))+Math.imul(S,z)|0,o=Math.imul(S,X),i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,H)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(m,V)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,Y)|0,i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,Z)|0;var _e=(c+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),n=(n=Math.imul(M,X))+Math.imul(P,z)|0,o=Math.imul(P,X),i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,Z)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var we=(c+(i=i+Math.imul(f,re)|0)|0)+((8191&(n=(n=n+Math.imul(f,ie)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(C,z),n=(n=Math.imul(C,X))+Math.imul(A,z)|0,o=Math.imul(A,X),i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,H)|0,i=i+Math.imul(T,V)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Z)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Z)|0,i=i+Math.imul(m,$)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,ee)|0,i=i+Math.imul(p,re)|0,n=(n=n+Math.imul(p,ie)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ie)|0;var xe=(c+(i=i+Math.imul(f,oe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(I,z),n=(n=Math.imul(I,X))+Math.imul(R,z)|0,o=Math.imul(R,X),i=i+Math.imul(C,q)|0,n=(n=n+Math.imul(C,H)|0)+Math.imul(A,q)|0,o=o+Math.imul(A,H)|0,i=i+Math.imul(M,V)|0,n=(n=n+Math.imul(M,Y)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,Y)|0,i=i+Math.imul(T,K)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Z)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ie)|0,i=i+Math.imul(p,oe)|0,n=(n=n+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var Te=(c+(i=i+Math.imul(f,ue)|0)|0)+((8191&(n=(n=n+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(L,z),n=(n=Math.imul(L,X))+Math.imul(j,z)|0,o=Math.imul(j,X),i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,H)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(M,K)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,o=o+Math.imul(w,ie)|0,i=i+Math.imul(m,oe)|0,n=(n=n+Math.imul(m,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,i=i+Math.imul(p,ue)|0,n=(n=n+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(B,z),n=(n=Math.imul(B,X))+Math.imul(N,z)|0,o=Math.imul(N,X),i=i+Math.imul(L,q)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(j,q)|0,o=o+Math.imul(j,H)|0,i=i+Math.imul(I,V)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(R,V)|0,o=o+Math.imul(R,Y)|0,i=i+Math.imul(C,K)|0,n=(n=n+Math.imul(C,Z)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,Z)|0,i=i+Math.imul(M,$)|0,n=(n=n+Math.imul(M,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,i=i+Math.imul(T,re)|0,n=(n=n+Math.imul(T,ie)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ie)|0,i=i+Math.imul(_,oe)|0,n=(n=n+Math.imul(_,ae)|0)+Math.imul(w,oe)|0,o=o+Math.imul(w,ae)|0,i=i+Math.imul(m,ue)|0,n=(n=n+Math.imul(m,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,i=i+Math.imul(p,fe)|0,n=(n=n+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var Ee=(c+(i=i+Math.imul(f,pe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,H))+Math.imul(N,q)|0,o=Math.imul(N,H),i=i+Math.imul(L,V)|0,n=(n=n+Math.imul(L,Y)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,Y)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,i=i+Math.imul(M,re)|0,n=(n=n+Math.imul(M,ie)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ie)|0,i=i+Math.imul(T,oe)|0,n=(n=n+Math.imul(T,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,i=i+Math.imul(_,ue)|0,n=(n=n+Math.imul(_,ce)|0)+Math.imul(w,ue)|0,o=o+Math.imul(w,ce)|0,i=i+Math.imul(m,fe)|0,n=(n=n+Math.imul(m,he)|0)+Math.imul(y,fe)|0,o=o+Math.imul(y,he)|0;var Me=(c+(i=i+Math.imul(p,pe)|0)|0)+((8191&(n=(n=n+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(B,V),n=(n=Math.imul(B,Y))+Math.imul(N,V)|0,o=Math.imul(N,Y),i=i+Math.imul(L,K)|0,n=(n=n+Math.imul(L,Z)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,Z)|0,i=i+Math.imul(I,$)|0,n=(n=n+Math.imul(I,ee)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ie)|0,i=i+Math.imul(M,oe)|0,n=(n=n+Math.imul(M,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,i=i+Math.imul(T,ue)|0,n=(n=n+Math.imul(T,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,i=i+Math.imul(_,fe)|0,n=(n=n+Math.imul(_,he)|0)+Math.imul(w,fe)|0,o=o+Math.imul(w,he)|0;var Pe=(c+(i=i+Math.imul(m,pe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ve)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,ve)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,i=Math.imul(B,K),n=(n=Math.imul(B,Z))+Math.imul(N,K)|0,o=Math.imul(N,Z),i=i+Math.imul(L,$)|0,n=(n=n+Math.imul(L,ee)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,ee)|0,i=i+Math.imul(I,re)|0,n=(n=n+Math.imul(I,ie)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ie)|0,i=i+Math.imul(C,oe)|0,n=(n=n+Math.imul(C,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,i=i+Math.imul(M,ue)|0,n=(n=n+Math.imul(M,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,i=i+Math.imul(T,fe)|0,n=(n=n+Math.imul(T,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var ke=(c+(i=i+Math.imul(_,pe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ve)|0)+Math.imul(w,pe)|0))<<13)|0;c=((o=o+Math.imul(w,ve)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,ee))+Math.imul(N,$)|0,o=Math.imul(N,ee),i=i+Math.imul(L,re)|0,n=(n=n+Math.imul(L,ie)|0)+Math.imul(j,re)|0,o=o+Math.imul(j,ie)|0,i=i+Math.imul(I,oe)|0,n=(n=n+Math.imul(I,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,i=i+Math.imul(C,ue)|0,n=(n=n+Math.imul(C,ce)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,ce)|0,i=i+Math.imul(M,fe)|0,n=(n=n+Math.imul(M,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Ce=(c+(i=i+Math.imul(T,pe)|0)|0)+((8191&(n=(n=n+Math.imul(T,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(B,re),n=(n=Math.imul(B,ie))+Math.imul(N,re)|0,o=Math.imul(N,ie),i=i+Math.imul(L,oe)|0,n=(n=n+Math.imul(L,ae)|0)+Math.imul(j,oe)|0,o=o+Math.imul(j,ae)|0,i=i+Math.imul(I,ue)|0,n=(n=n+Math.imul(I,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,i=i+Math.imul(C,fe)|0,n=(n=n+Math.imul(C,he)|0)+Math.imul(A,fe)|0,o=o+Math.imul(A,he)|0;var Ae=(c+(i=i+Math.imul(M,pe)|0)|0)+((8191&(n=(n=n+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ve)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(B,oe),n=(n=Math.imul(B,ae))+Math.imul(N,oe)|0,o=Math.imul(N,ae),i=i+Math.imul(L,ue)|0,n=(n=n+Math.imul(L,ce)|0)+Math.imul(j,ue)|0,o=o+Math.imul(j,ce)|0,i=i+Math.imul(I,fe)|0,n=(n=n+Math.imul(I,he)|0)+Math.imul(R,fe)|0,o=o+Math.imul(R,he)|0;var Oe=(c+(i=i+Math.imul(C,pe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ve)|0)+Math.imul(A,pe)|0))<<13)|0;c=((o=o+Math.imul(A,ve)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(B,ue),n=(n=Math.imul(B,ce))+Math.imul(N,ue)|0,o=Math.imul(N,ce),i=i+Math.imul(L,fe)|0,n=(n=n+Math.imul(L,he)|0)+Math.imul(j,fe)|0,o=o+Math.imul(j,he)|0;var Ie=(c+(i=i+Math.imul(I,pe)|0)|0)+((8191&(n=(n=n+Math.imul(I,ve)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,ve)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(B,fe),n=(n=Math.imul(B,he))+Math.imul(N,fe)|0,o=Math.imul(N,he);var Re=(c+(i=i+Math.imul(L,pe)|0)|0)+((8191&(n=(n=n+Math.imul(L,ve)|0)+Math.imul(j,pe)|0))<<13)|0;c=((o=o+Math.imul(j,ve)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863;var De=(c+(i=Math.imul(B,pe))|0)+((8191&(n=(n=Math.imul(B,ve))+Math.imul(N,pe)|0))<<13)|0;return c=((o=Math.imul(N,ve))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,u[0]=be,u[1]=me,u[2]=ye,u[3]=ge,u[4]=_e,u[5]=we,u[6]=xe,u[7]=Te,u[8]=Se,u[9]=Ee,u[10]=Me,u[11]=Pe,u[12]=ke,u[13]=Ce,u[14]=Ae,u[15]=Oe,u[16]=Ie,u[17]=Re,u[18]=De,0!==c&&(u[19]=c,r.length++),r};function s(e,t,r){return(new u).mulp(e,t,r)}function u(e,t){this.x=e,this.y=t}Math.imul||(o=n),m.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?o(this,e,t):r<63?n(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,e,t):s(this,e,t)},u.prototype.makeRBT=function(e){for(var t=new Array(e),r=m.prototype._countBits(e)-1,i=0;i>=1;return i},u.prototype.permute=function(e,t,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*o+1]=8191&n,n>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=n>>>26,this.words[r]=67108863&n}return 0!==t&&(this.words[r]=t,this.length++),this},m.prototype.muln=function(e){return this.clone().imuln(e)},m.prototype.sqr=function(){return this.mul(this)},m.prototype.isqr=function(){return this.imul(this.clone())},m.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new m(1);for(var r=this,i=0;i>>26-r<<26-r;if(0!=r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!=i){for(t=this.length-1;0<=t;t--)this.words[t+i]=this.words[t];for(t=0;t>>n<o)for(this.length-=o,u=0;u>>n,c=l&a}return s&&0!==c&&(s.words[s.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},m.prototype.ishrn=function(e,t,r){return b(0===this.negative),this.iushrn(e,t,r)},m.prototype.shln=function(e){return this.clone().ishln(e)},m.prototype.ushln=function(e){return this.clone().iushln(e)},m.prototype.shrn=function(e){return this.clone().ishrn(e)},m.prototype.ushrn=function(e){return this.clone().iushrn(e)},m.prototype.testn=function(e){b("number"==typeof e&&0<=e);var t=e%26,r=(e-t)/26,i=1<>>t<>26)-(s/67108864|0),this.words[i+r]=67108863&n}for(;i>26,this.words[i+r]=67108863&n;if(0===a)return this.strip();for(b(-1===a),i=a=0;i>26,this.words[i]=67108863&n;return this.negative=1,this.strip()},m.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,s=i.length-n.length;if("mod"!==t){(a=new m(null)).length=1+s,a.words=new Array(a.length);for(var u=0;uthis.length||this.cmp(e)<0?{div:new m(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new m(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new m(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,n,o},m.prototype.div=function(e){return this.divmod(e,"div",!1).div},m.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},m.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},m.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},m.prototype.modn=function(e){b(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;0<=i;i--)r=(t*r+(0|this.words[i]))%e;return r},m.prototype.idivn=function(e){b(e<=67108863);for(var t=0,r=this.length-1;0<=r;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},m.prototype.divn=function(e){return this.clone().idivn(e)},m.prototype.egcd=function(e){b(0===e.negative),b(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new m(1),n=new m(0),o=new m(0),a=new m(1),s=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++s;for(var u=r.clone(),c=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(0>>26,a&=67108863,this.words[o]=a}return 0!==n&&(this.words[o]=n,this.length++),this},m.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},m.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),1e.length)return 1;if(this.lengththis.n;);var i=t>>22,n=o}n>>>=22,0===(e.words[i-10]=n)&&10>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},m._prime=function(e){if(c[e])return c[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new y;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return c[e]=t},w.prototype._verify1=function(e){b(0===e.negative,"red works only with positives"),b(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){b(0==(e.negative|t.negative),"red works only with positives"),b(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return 0<=r.cmp(this.m)&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(b(t%2==1),3===t){var r=this.m.add(new m(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),n=0;!i.isZero()&&0===i.andln(1);)n++,i.iushrn(1);b(!i.isZero());var o=new m(1).toRed(this),a=o.redNeg(),s=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new m(2*u*u).toRed(this);0!==this.pow(u,s).cmp(a);)u.redIAdd(a);for(var c=this.pow(u,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),h=n;0!==f.cmp(o);){for(var d=f,p=0;0!==d.cmp(o);p++)d=d.redSqr();b(p>c&1;n!==r[0]&&(n=this.sqr(n)),0!=l||0!==o?(o<<=1,o|=l,(4===++a||0===i&&0===c)&&(n=this.mul(n,r[o]),o=a=0)):a=0}s=26}return n},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},m.mont=function(e){return new x(e)},r(x,w),x.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},x.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},x.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new m(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return 0<=n.cmp(this.m)?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},x.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:19}],18:[function(e,t,r){var i;function n(e){this.rand=e}if(t.exports=function(e){return i||(i=new n(null)),i.generate(e)},(t.exports.Rand=n).prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r>>24]^l[p>>>16&255]^f[v>>>8&255]^h[255&b]^t[m++],a=c[p>>>24]^l[v>>>16&255]^f[b>>>8&255]^h[255&d]^t[m++],s=c[v>>>24]^l[b>>>16&255]^f[d>>>8&255]^h[255&p]^t[m++],u=c[b>>>24]^l[d>>>16&255]^f[p>>>8&255]^h[255&v]^t[m++],d=o,p=a,v=s,b=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[v>>>8&255]<<8|i[255&b])^t[m++],a=(i[p>>>24]<<24|i[v>>>16&255]<<16|i[b>>>8&255]<<8|i[255&d])^t[m++],s=(i[v>>>24]<<24|i[b>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^t[m++],u=(i[b>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&v])^t[m++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var f=[0,1,2,4,8,16,32,64,128,27,54],h=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99;var l=e[i[r[a]=c]=a],f=e[l],h=e[f],d=257*e[c]^16843008*c;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*h^65537*f^257*l^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=l^e[e[e[h^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function s(e){this._key=o(e),this._reset()}s.blockSize=16,s.keySize=32,s.prototype.blockSize=s.blockSize,s.prototype.keySize=s.keySize,s.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,i=4*(r+1),n=[],o=0;o>>24,a=h.SBOX[a>>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a],a^=f[o/t|0]<<24):6>>24]<<24|h.SBOX[a>>>16&255]<<16|h.SBOX[a>>>8&255]<<8|h.SBOX[255&a]),n[o]=n[o-t]^a}for(var s=[],u=0;u>>24]]^h.INV_SUB_MIX[1][h.SBOX[l>>>16&255]]^h.INV_SUB_MIX[2][h.SBOX[l>>>8&255]]^h.INV_SUB_MIX[3][h.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=s},s.prototype.encryptBlockRaw=function(e){return a(e=o(e),this._keySchedule,h.SUB_MIX,h.SBOX,this._nRounds)},s.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},s.prototype.decryptBlock=function(e){var t=(e=o(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,h.INV_SUB_MIX,h.INV_SBOX,this._nRounds),i=n.allocUnsafe(16);return i.writeUInt32BE(r[0],0),i.writeUInt32BE(r[3],4),i.writeUInt32BE(r[2],8),i.writeUInt32BE(r[1],12),i},s.prototype.scrub=function(){i(this._keySchedule),i(this._invKeySchedule),i(this._key)},t.exports.AES=s},{"safe-buffer":143}],21:[function(e,t,r){var a=e("./aes"),c=e("safe-buffer").Buffer,s=e("cipher-base"),i=e("inherits"),l=e("./ghash"),n=e("buffer-xor"),f=e("./incr32");function o(e,t,r,i){s.call(this);var n=c.alloc(4,0);this._cipher=new a.AES(t);var o=this._cipher.encryptBlock(n);this._ghash=new l(o),r=function(e,t,r){if(12===t.length)return e._finID=c.concat([t,c.from([0,0,0,1])]),c.concat([t,c.from([0,0,0,2])]);var i=new l(r),n=t.length,o=n%16;i.update(t),o&&(o=16-o,i.update(c.alloc(o,0))),i.update(c.alloc(8,0));var a=8*n,s=c.alloc(8);s.writeUIntBE(a,0,8),i.update(s),e._finID=i.state;var u=c.from(e._finID);return f(u),u}(this,r,o),this._prev=c.from(r),this._cache=c.allocUnsafe(0),this._secCache=c.allocUnsafe(0),this._decrypt=i,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}i(o,s),o.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=c.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(r),this._len+=e.length,r},o.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=n(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var i=Math.min(e.length,t.length),n=0;n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t>>1|(1&r[e-1])<<31;r[0]=r[0]>>>1,t&&(r[0]=r[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);16<=this.cache.length;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,n],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":143}],26:[function(e,t,r){t.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},{}],27:[function(e,t,r){var n=e("buffer-xor");r.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},r.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},{"buffer-xor":48}],28:[function(e,t,r){var o=e("safe-buffer").Buffer,a=e("buffer-xor");function s(e,t,r){var i=t.length,n=a(t,e._cache);return e._cache=e._cache.slice(i),e._prev=o.concat([e._prev,r?t:n]),n}r.encrypt=function(e,t,r){for(var i,n=o.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=o.allocUnsafe(0)),!(e._cache.length<=t.length)){n=o.concat([n,s(e,t,r)]);break}i=e._cache.length,n=o.concat([n,s(e,t.slice(0,i),r)]),t=t.slice(i)}return n}},{"buffer-xor":48,"safe-buffer":143}],29:[function(e,t,r){var a=e("safe-buffer").Buffer;function s(e,t,r){for(var i,n,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(n=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=u(e._prev,r?i:n);return a}function u(e,t){var r=e.length,i=-1,n=a.allocUnsafe(e.length);for(e=a.concat([e,a.from([t])]);++i>7;return n}r.encrypt=function(e,t,r){for(var i=t.length,n=a.allocUnsafe(i),o=-1;++o=t)throw new Error("invalid sig")}t.exports=function(e,t,r,i,n){var o=v(r);if("ec"===o.type){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=b[r.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var n=new p(i),o=r.data.subjectPrivateKey.data;return n.verify(t,e,o)}(e,t,o)}if("dsa"===o.type){if("dsa"!==i)throw new Error("wrong public key type");return function(e,t,r){var i=r.data.p,n=r.data.q,o=r.data.g,a=r.data.pub_key,s=v.signature.decode(e,"der"),u=s.s,c=s.r;m(u,n),m(c,n);var l=d.mont(i),f=u.invm(n);return 0===o.toRed(l).redPow(new d(t).mul(f).mod(n)).fromRed().mul(a.toRed(l).redPow(c.mul(f).mod(n)).fromRed()).mod(i).mod(n).cmp(c)}(e,t,o)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong public key type");t=h.concat([n,t]);for(var a=o.modulus.byteLength(),s=[1],u=0;t.length+s.length+2=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function d(e,t){if(f.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return L(e).length;default:if(i)return D(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):2147483647=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=f.from(t,i)),f.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){var o,a=1,s=e.length,u=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s/=a=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(n){var l=-1;for(o=r;o>>10&1023|55296),l=56320|1023&l),i.push(l),n+=f}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var r="",i=0;for(;ithis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return _(this,t,r);case"ascii":return x(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return g(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}.apply(this,arguments)},f.prototype.equals=function(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===f.compare(this,e)},f.prototype.inspect=function(){var e="",t=B.INSPECT_MAX_BYTES;return 0t&&(e+=" ... ")),""},f.prototype.compare=function(e,t,r,i,n){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(n<=i&&r<=t)return 0;if(n<=i)return-1;if(r<=t)return 1;if(this===e)return 0;for(var o=(n>>>=0)-(i>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(i,n),c=e.slice(t,r),l=0;lthis.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o,a,s,u,c,l,f,h,d,p=!1;;)switch(i){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return h=t,d=r,j(D(e,(f=this).length-h),f,h,d);case"ascii":return y(this,e,t,r);case"latin1":case"binary":return y(this,e,t,r);case"base64":return u=this,c=t,l=r,j(L(e),u,c,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=r,j(function(e,t){for(var r,i,n,o=[],a=0;a>8,n=r%256,o.push(n),o.push(i);return o}(e,(o=this).length-a),o,a,s);default:if(p)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function x(e,t,r){var i="";r=Math.min(e.length,r);for(var n=t;ne.length)throw new RangeError("Index out of range")}function k(e,t,r,i){t<0&&(t=65535+t+1);for(var n=0,o=Math.min(e.length-r,2);n>>8*(i?n:1-n)}function C(e,t,r,i){t<0&&(t=4294967295+t+1);for(var n=0,o=Math.min(e.length-r,4);n>>8*(i?n:3-n)&255}function A(e,t,r,i,n,o){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function O(e,t,r,i,n){return n||A(e,0,r,4),o.write(e,t,r,i,23,4),r+4}function I(e,t,r,i,n){return n||A(e,0,r,8),o.write(e,t,r,i,52,8),r+8}f.prototype.slice=function(e,t){var r,i=this.length;if((e=~~e)<0?(e+=i)<0&&(e=0):i>>8):k(this,e,t,!0),t+2},f.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},f.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},f.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t|=0,!i){var n=Math.pow(2,8*r-1);P(this,e,t,r,n-1,-n)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},f.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,1,127,-128),f.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},f.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):k(this,e,t,!0),t+2},f.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):k(this,e,t,!1),t+2},f.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},f.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),f.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},f.prototype.writeFloatLE=function(e,t,r){return O(this,e,t,!0,r)},f.prototype.writeFloatBE=function(e,t,r){return O(this,e,t,!1,r)},f.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},f.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},f.prototype.copy=function(e,t,r,i){if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),0=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function L(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(t,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,i){for(var n=0;n=t.length||n>=e.length);++n)t[n+r]=e[n];return n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":16,ieee754:101,isarray:105}],50:[function(e,t,r){var n=e("safe-buffer").Buffer,i=e("stream").Transform,o=e("string_decoder").StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},t.exports=a},{inherits:103,"safe-buffer":143,stream:152,string_decoder:153}],51:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":104}],52:[function(e,s,t){(function(o){var t=e("elliptic"),i=e("bn.js");s.exports=function(e){return new n(e)};var r={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function n(e){this.curveType=r[e],this.curveType||(this.curveType={name:e}),this.curve=new t.ec(this.curveType.name),this.keys=void 0}function a(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new o(e);if(r&&i.length>>2),i=0,n=0;i>5]|=128<>>9<<4)]=t;for(var r=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a>>32-t}(v(v(t,e),v(i,o)),n),r)}function f(e,t,r,i,n,o,a){return s(t&r|~t&i,e,t,n,o,a)}function h(e,t,r,i,n,o,a){return s(t&i|r&~i,e,t,n,o,a)}function d(e,t,r,i,n,o,a){return s(t^r^i,e,t,n,o,a)}function p(e,t,r,i,n,o,a){return s(r^(t|~i),e,t,n,o,a)}function v(e,t){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}t.exports=function(e){return i(e,n)}},{"./make-hash":54}],56:[function(e,t,r){"use strict";var i=e("inherits"),n=e("./legacy"),a=e("cipher-base"),s=e("safe-buffer").Buffer,o=e("create-hash/md5"),u=e("ripemd160"),c=e("sha.js"),l=s.alloc(128);function f(e,t){a.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,(this._key=t).length>r)?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length>>1];r=h.r28shl(r,o),i=h.r28shl(i,o),h.pc2(r,i,e.keys,n)}},u.prototype._update=function(e,t,r,i){var n=this._desState,o=h.readUInt32BE(e,t),a=h.readUInt32BE(e,t+4);h.ip(o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],"encrypt"===this.type?this._encrypt(n,o,a,n.tmp,0):this._decrypt(n,o,a,n.tmp,0),o=n.tmp[0],a=n.tmp[1],h.writeUInt32BE(r,o,i),h.writeUInt32BE(r,a,i+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,i=t;i>>0,o=f}h.rip(a,o,i,n)},u.prototype._decrypt=function(e,t,r,i,n){for(var o=r,a=t,s=e.keys.length-2;0<=s;s-=2){var u=e.keys[s],c=e.keys[s+1];h.expand(o,e.tmp,0),u^=e.tmp[0],c^=e.tmp[1];var l=h.substitute(u,c),f=o;o=(a^h.permute(l))>>>0,a=f}h.rip(o,a,i,n)}},{"../des":59,inherits:103,"minimalistic-assert":109}],63:[function(e,t,r){"use strict";var o=e("minimalistic-assert"),i=e("inherits"),n=e("../des"),a=n.Cipher,s=n.DES;function u(e,t){o.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),n=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:n})]:[s.create({type:"decrypt",key:n}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}function c(e){a.call(this,e);var t=new u(this.type,this.options.key);this._edeState=t}i(c,a),(t.exports=c).create=function(e){return new c(e)},c.prototype._update=function(e,t,r,i){var n=this._edeState;n.ciphers[0]._update(e,t,r,i),n.ciphers[1]._update(r,i,r,i),n.ciphers[2]._update(r,i,r,i)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"../des":59,inherits:103,"minimalistic-assert":109}],64:[function(e,t,r){"use strict";r.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},r.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},r.ip=function(e,t,r,i){for(var n=0,o=0,a=6;0<=a;a-=2){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>>s+a&1}for(a=6;0<=a;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[i+0]=n>>>0,r[i+1]=o>>>0},r.rip=function(e,t,r,i){for(var n=0,o=0,a=0;a<4;a++)for(var s=24;0<=s;s-=8)n<<=1,n|=t>>>s+a&1,n<<=1,n|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;0<=s;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.pc1=function(e,t,r,i){for(var n=0,o=0,a=7;5<=a;a--){for(var s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(s=0;s<=24;s+=8)n<<=1,n|=e>>s+a&1}for(s=0;s<=24;s+=8)n<<=1,n|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.r28shl=function(e,t){return e<>>28-t};var u=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];r.pc2=function(e,t,r,i){for(var n=0,o=0,a=u.length>>>1,s=0;s>>u[s]&1;for(s=a;s>>u[s]&1;r[i+0]=n>>>0,r[i+1]=o>>>0},r.expand=function(e,t,r){var i=0,n=0;i=(1&e)<<5|e>>>27;for(var o=23;15<=o;o-=4)i<<=6,i|=e>>>o&63;for(o=11;3<=o;o-=4)n|=e>>>o&63,n<<=6;n|=(31&e)<<1|e>>>31,t[r+0]=i>>>0,t[r+1]=n>>>0};var n=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];r.substitute=function(e,t){for(var r=0,i=0;i<4;i++){r<<=4,r|=n[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){r<<=4,r|=n[256+64*i+(t>>>18-6*i&63)]}return r>>>0};var i=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];r.permute=function(e){for(var t=0,r=0;r>>i[r]&1;return t>>>0},r.padSplit=function(e,t,r){for(var i=e.toString(2);i.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(u),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;r.mod(f).cmp(h);)r.iadd(p)}else for(;r.mod(a).cmp(d);)r.iadd(p);if(b(i=r.shrn(1))&&b(r)&&m(i)&&m(r)&&s.test(i)&&s.test(r))return r}}},{"bn.js":17,"miller-rabin":108,randombytes:130}],68:[function(e,t,r){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],69:[function(e,t,r){"use strict";var i=r;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":84,"./elliptic/curve":72,"./elliptic/curves":75,"./elliptic/ec":76,"./elliptic/eddsa":79,"./elliptic/utils":83,brorand:18}],70:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils,E=n.getNAF,M=n.getJSF,f=n.assert;function o(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);!r||0>1]):a.mixedAdd(n[-u-1>>1].neg()):0>1]):a.add(n[-u-1>>1].neg())}return"affine"===e.type?a.toP():a},o.prototype._wnafMulAdd=function(e,t,r,i,n){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,u=0,c=0;c>1]:S<0&&(T=a[b][-S-1>>1].neg()),g="affine"===T.type?g.mixedAdd(T):g.add(T))}}for(c=0;c=Math.ceil((e.bitLength()+1)/t.step)},a.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=i.redAdd(t),a=o.redSub(r),s=i.redSub(t),u=n.redMul(a),c=o.redMul(s),l=n.redMul(s),f=a.redMul(o);return this.curve.point(u,c,f,l)},l.prototype._projDbl=function(){var e,t,r,i=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),o=this.y.redSqr();if(this.curve.twisted){var a=(c=this.curve._mulA(n)).redAdd(o);if(this.zOne)e=i.redSub(n).redSub(o).redMul(a.redSub(this.curve.two)),t=a.redMul(c.redSub(o)),r=a.redSqr().redSub(a).redSub(a);else{var s=this.z.redSqr(),u=a.redSub(s).redISub(s);e=i.redSub(n).redISub(o).redMul(u),t=a.redMul(c.redSub(o)),r=a.redMul(u)}}else{var c=n.redAdd(o);s=this.curve._mulC(this.c.redMul(this.z)).redSqr(),u=c.redSub(s).redSub(s);e=this.curve._mulC(i.redISub(c)).redMul(u),t=this.curve._mulC(c).redMul(n.redISub(o)),r=c.redMul(u)}return this.curve.point(e,t,r)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=n.redSub(i),s=n.redAdd(i),u=r.redAdd(t),c=o.redMul(a),l=s.redMul(u),f=o.redMul(u),h=a.redMul(s);return this.curve.point(c,l,h,f)},l.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=n.redSub(s),c=n.redAdd(s),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=i.redMul(u).redMul(l);return r=this.curve.twisted?(t=i.redMul(c).redMul(a.redSub(this.curve._mulA(o))),u.redMul(c)):(t=i.redMul(c).redMul(a.redSub(o)),this.curve._mulC(u).redMul(c)),this.curve.point(f,t,r)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},l.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),0<=r.cmp(this.curve.p))return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}return!1},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],72:[function(e,t,r){"use strict";var i=r;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":70,"./edwards":71,"./mont":73,"./short":74}],73:[function(e,t,r){"use strict";var i=e("../curve"),n=e("bn.js"),o=e("inherits"),a=i.base,s=e("../../elliptic").utils;function u(e){a.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){a.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}o(u,a),(t.exports=u).prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},o(c,a.BasePoint),u.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},u.prototype.point=function(e,t){return new c(this,e,t)},u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=n.redMul(i),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var o=n.length-1;0<=o;o--)0===n[o]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],74:[function(e,t,r){"use strict";var i=e("../curve"),n=e("../../elliptic"),w=e("bn.js"),o=e("inherits"),a=i.base,s=n.utils.assert;function u(e){a.call(this,"short",e),this.a=new w(e.a,16).toRed(this.red),this.b=new w(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new w(t,16),this.y=new w(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,i){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new w(0)):(this.x=new w(t,16),this.y=new w(r,16),this.z=new w(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),(t.exports=u).prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new w(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new w(e.lambda,16);else{var n=this._getEndoRoots(this.n);0===this.g.mul(n[0]).x.cmp(this.g.x.redMul(t))?r=n[0]:(r=n[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new w(e.a,16),b:new w(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:w.mont(e),r=new w(2).toRed(t).redInvm(),i=r.redNeg(),n=new w(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,i,n,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new w(1),p=new w(0),v=new w(0),b=new w(1),m=0;0!==f.cmpn(0);){var y=h.div(f);u=h.sub(y.mul(f)),c=v.sub(y.mul(d));var g=b.sub(y.mul(p));if(!i&&u.cmp(l)<0)t=s.neg(),r=d,i=u.neg(),n=c;else if(i&&2==++m)break;h=f,f=s=u,v=d,d=c,b=p,p=g}o=u.neg(),a=c;var _=i.sqr().add(n.sqr());return 0<=o.sqr().add(a.sqr()).cmp(_)&&(o=t,a=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:n},{a:o,b:a}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=n.mul(r.a),s=o.mul(i.a),u=n.mul(r.b),c=o.mul(i.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new w(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var n=i.fromRed().isOdd();return(t&&!n||!t&&n)&&(i=i.redNeg()),this.point(e,i)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new w(e,16),this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},c.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=i.redSub(n),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=i.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(i),s=n.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(n.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var t=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":69,"../curve":72,"bn.js":17,inherits:103}],75:[function(e,t,r){"use strict";var i,n=r,o=e("hash.js"),a=e("../elliptic"),s=a.utils.assert;function u(e){"short"===e.type?this.curve=new a.curve.short(e):"edwards"===e.type?this.curve=new a.curve.edwards(e):this.curve=new a.curve.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,r){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var e=new u(r);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:e}),e}})}n.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"../elliptic":69,"./precomputed/secp256k1":82,"hash.js":88}],76:[function(e,t,r){"use strict";var b=e("bn.js"),m=e("hmac-drbg"),o=e("../../elliptic"),d=o.utils.assert,i=e("./key"),y=e("./signature");function n(e){if(!(this instanceof n))return new n(e);"string"==typeof e&&(d(o.curves.hasOwnProperty(e),"Unknown curve "+e),e=o.curves[e]),e instanceof o.curves.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}(t.exports=n).prototype.keyPair=function(e){return new i(this,e)},n.prototype.keyFromPrivate=function(e,t){return i.fromPrivate(this,e,t)},n.prototype.keyFromPublic=function(e,t){return i.fromPublic(this,e,t)},n.prototype.genKeyPair=function(e){e||(e={});for(var t=new m({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new b(2));;){var n=new b(t.generate(r));if(!(0>1;if(0<=a.cmp(this.curve.p.umod(this.curve.n))&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(n),f=n.sub(o).mul(l).umod(n),h=s.mul(l).umod(n);return this.g.mulAdd(f,a,h)},n.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new y(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var o;try{o=this.recoverPubKey(e,t,n)}catch(e){continue}if(o.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":69,"./key":77,"./signature":78,"bn.js":17,"hmac-drbg":100}],77:[function(e,t,r){"use strict";var i=e("bn.js"),n=e("../../elliptic").utils.assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}(t.exports=o).fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return""}},{"../../elliptic":69,"bn.js":17}],78:[function(e,t,r){"use strict";var s=e("bn.js"),u=e("../../elliptic").utils,i=u.assert;function n(e,t){if(e instanceof n)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new s(e.r,16),this.s=new s(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function l(e,t){var r=e[t.place++];if(!(128&r))return r;for(var i=15&r,n=0,o=0,a=t.place;o>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}(t.exports=n).prototype._importDER=function(e,t){e=u.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;if(l(e,r)+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=l(e,r),n=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=l(e,r);if(e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);return 0===n[0]&&128&n[1]&&(n=n.slice(1)),0===a[0]&&128&a[1]&&(a=a.slice(1)),this.r=new s(n),this.s=new s(a),!(this.recoveryParam=null)},n.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=a(t),r=a(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];f(i,t.length),(i=i.concat(t)).push(2),f(i,r.length);var n=i.concat(r),o=[48];return f(o,n.length),o=o.concat(n),u.encode(o,e)}},{"../../elliptic":69,"bn.js":17}],79:[function(e,t,r){"use strict";var i=e("hash.js"),n=e("../../elliptic"),o=n.utils,a=o.assert,u=o.parseBytes,s=e("./key"),c=e("./signature");function l(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n.curves[e].curve;this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}(t.exports=l).prototype.sign=function(e,t){e=u(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),o=this.encodePoint(n),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),s=i.add(a).umod(this.curve.n);return this.makeSignature({R:n,S:s,Rencoded:o})},l.prototype.verify=function(e,t,r){e=u(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t>1)-1>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?t+1:1,u=1;ur&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},i.prototype.once=function(e,t){if(!u(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},i.prototype.removeListener=function(e,t){var r,i,n,o;if(!u(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=(r=this._events[e]).length,i=-1,r===t||u(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(c(r)){for(o=n;0=this._blockSize;){for(var n=this._blockOffset;n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;othis.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t>>3},r.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":99}],99:[function(e,t,r){"use strict";var c=e("minimalistic-assert"),i=e("inherits");function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function n(e){return 1===e.length?"0"+e:e}function a(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}r.inherits=i,r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i>8,a=255&n;o?r.push(o,a):r.push(a)}else for(i=0;i>>0}return o},r.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},r.rotr32=function(e,t){return e>>>t|e<<32-t},r.rotl32=function(e,t){return e<>>32-t},r.sum32=function(e,t){return e+t>>>0},r.sum32_3=function(e,t,r){return e+t+r>>>0},r.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},r.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},r.sum64=function(e,t,r,i){var n=e[t],o=i+e[t+1]>>>0,a=(o>>0,e[t+1]=o},r.sum64_hi=function(e,t,r,i){return(t+i>>>0>>0},r.sum64_lo=function(e,t,r,i){return t+i>>>0},r.sum64_4_hi=function(e,t,r,i,n,o,a,s){var u=0,c=t;return u+=(c=c+i>>>0)>>0)>>0)>>0},r.sum64_4_lo=function(e,t,r,i,n,o,a,s){return t+i+o+s>>>0},r.sum64_5_hi=function(e,t,r,i,n,o,a,s,u,c){var l=0,f=t;return l+=(f=f+i>>>0)>>0)>>0)>>0)>>0},r.sum64_5_lo=function(e,t,r,i,n,o,a,s,u,c){return t+i+o+s+c>>>0},r.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},r.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},r.shr64_hi=function(e,t,r){return e>>>r},r.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},{inherits:103,"minimalistic-assert":109}],100:[function(e,t,r){"use strict";var i=e("hash.js"),a=e("minimalistic-crypto-utils"),n=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),i=a.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}(t.exports=o).prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=a.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length>1,l=-7,f=r?n-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-l)-1,d>>=-l,l+=s;0>=-l,l+=i;0>1,h=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,v=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+f?h/u:h*Math.pow(2,1-f))*u&&(a++,u/=2),l<=a+f?(s=0,a=l):1<=a+f?(s=(t*u-1)*Math.pow(2,n),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,n),a=0));8<=n;e[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<>>32-t}function u(e,t,r,i,n,o,a){return s(e+(t&r|~t&i)+n+o|0,a)+t|0}function c(e,t,r,i,n,o,a){return s(e+(t&i|r&~i)+n+o|0,a)+t|0}function l(e,t,r,i,n,o,a){return s(e+(t^r^i)+n+o|0,a)+t|0}function f(e,t,r,i,n,o,a){return s(e+(r^(t|~i))+n+o|0,a)+t|0}e(i,r),i.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d;i=f(i=f(i=f(i=f(i=l(i=l(i=l(i=l(i=c(i=c(i=c(i=c(i=u(i=u(i=u(i=u(i,n=u(n,o=u(o,r=u(r,i,n,o,e[0],3614090360,7),i,n,e[1],3905402710,12),r,i,e[2],606105819,17),o,r,e[3],3250441966,22),n=u(n,o=u(o,r=u(r,i,n,o,e[4],4118548399,7),i,n,e[5],1200080426,12),r,i,e[6],2821735955,17),o,r,e[7],4249261313,22),n=u(n,o=u(o,r=u(r,i,n,o,e[8],1770035416,7),i,n,e[9],2336552879,12),r,i,e[10],4294925233,17),o,r,e[11],2304563134,22),n=u(n,o=u(o,r=u(r,i,n,o,e[12],1804603682,7),i,n,e[13],4254626195,12),r,i,e[14],2792965006,17),o,r,e[15],1236535329,22),n=c(n,o=c(o,r=c(r,i,n,o,e[1],4129170786,5),i,n,e[6],3225465664,9),r,i,e[11],643717713,14),o,r,e[0],3921069994,20),n=c(n,o=c(o,r=c(r,i,n,o,e[5],3593408605,5),i,n,e[10],38016083,9),r,i,e[15],3634488961,14),o,r,e[4],3889429448,20),n=c(n,o=c(o,r=c(r,i,n,o,e[9],568446438,5),i,n,e[14],3275163606,9),r,i,e[3],4107603335,14),o,r,e[8],1163531501,20),n=c(n,o=c(o,r=c(r,i,n,o,e[13],2850285829,5),i,n,e[2],4243563512,9),r,i,e[7],1735328473,14),o,r,e[12],2368359562,20),n=l(n,o=l(o,r=l(r,i,n,o,e[5],4294588738,4),i,n,e[8],2272392833,11),r,i,e[11],1839030562,16),o,r,e[14],4259657740,23),n=l(n,o=l(o,r=l(r,i,n,o,e[1],2763975236,4),i,n,e[4],1272893353,11),r,i,e[7],4139469664,16),o,r,e[10],3200236656,23),n=l(n,o=l(o,r=l(r,i,n,o,e[13],681279174,4),i,n,e[0],3936430074,11),r,i,e[3],3572445317,16),o,r,e[6],76029189,23),n=l(n,o=l(o,r=l(r,i,n,o,e[9],3654602809,4),i,n,e[12],3873151461,11),r,i,e[15],530742520,16),o,r,e[2],3299628645,23),n=f(n,o=f(o,r=f(r,i,n,o,e[0],4096336452,6),i,n,e[7],1126891415,10),r,i,e[14],2878612391,15),o,r,e[5],4237533241,21),n=f(n,o=f(o,r=f(r,i,n,o,e[12],1700485571,6),i,n,e[3],2399980690,10),r,i,e[10],4293915773,15),o,r,e[1],2240044497,21),n=f(n,o=f(o,r=f(r,i,n,o,e[8],1873313359,6),i,n,e[15],4264355552,10),r,i,e[6],2734768916,15),o,r,e[13],1309151649,21),n=f(n,o=f(o,r=f(r,i,n,o,e[4],4149444226,6),i,n,e[11],3174756917,10),r,i,e[2],718787259,15),o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+o|0},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._blockSize;){for(var n=this._blockOffset;n>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(e,t){return"hex"===t?o(e):e}},{}],111:[function(e,t,r){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],112:[function(e,t,r){"use strict";var i=e("asn1.js");r.certificate=e("./certificate");var n=i.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});r.RSAPrivateKey=n;var o=i.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});r.RSAPublicKey=o;var a=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});r.PublicKey=a;var s=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=i.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});r.PrivateKey=u;var c=i.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});r.EncryptedPrivateKey=c;var l=i.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});r.DSAPrivateKey=l,r.DSAparam=i.define("DSAparam",function(){this.int()});var f=i.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});r.ECPrivateKey=f;var h=i.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});r.signature=i.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},{"./certificate":113,"asn1.js":2}],113:[function(e,t,r){"use strict";var i=e("asn1.js"),n=i.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=i.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=i.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())}),s=i.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=i.define("RelativeDistinguishedName",function(){this.setof(o)}),c=i.define("RDNSequence",function(){this.seqof(u)}),l=i.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),f=i.define("Validity",function(){this.seq().obj(this.key("notBefore").use(n),this.key("notAfter").use(n))}),h=i.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),d=i.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(l),this.key("validity").use(f),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=i.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(d),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});t.exports=p},{"asn1.js":2}],114:[function(e,t,r){(function(h){var d=/Proc-Type: 4,ENCRYPTED\n\r?DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)\n\r?\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?/m,p=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n/m,v=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----\n\r?([0-9A-z\n\r\+\/\=]+)\n\r?-----END \1-----$/m,b=e("evp_bytestokey"),m=e("browserify-aes");t.exports=function(e,t){var r,i=e.toString(),n=i.match(d);if(n){var o="aes"+n[1],a=new h(n[2],"hex"),s=new h(n[3].replace(/\r?\n/g,""),"base64"),u=b(t,a.slice(0,8),parseInt(n[1],10)).key,c=[],l=m.createDecipheriv(o,u,a);c.push(l.update(s)),c.push(l.final()),r=h.concat(c)}else{var f=i.match(v);r=new h(f[2].replace(/\r?\n/g,""),"base64")}return{tag:i.match(p)[1],data:r}}}).call(this,e("buffer").Buffer)},{"browserify-aes":22,buffer:49,evp_bytestokey:86}],115:[function(t,r,e){(function(f){var s=t("./asn1"),h=t("./aesid.json"),u=t("./fixProc"),d=t("browserify-aes"),p=t("pbkdf2");function e(e){var t;"object"!=typeof e||f.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=new f(e));var r,i,n=u(e,t),o=n.tag,a=n.data;switch(o){case"CERTIFICATE":i=s.certificate.decode(a,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(i||(i=s.PublicKey.decode(a,"der")),r=i.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(i.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return i.subjectPrivateKey=i.subjectPublicKey,{type:"ec",data:i};case"1.2.840.10040.4.1":return i.algorithm.params.pub_key=s.DSAparam.decode(i.subjectPublicKey.data,"der"),{type:"dsa",data:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":a=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),n=h[e.algorithm.decrypt.cipher.algo.join(".")],o=e.algorithm.decrypt.cipher.iv,a=e.subjectPrivateKey,s=parseInt(n.split("-")[1],10)/8,u=p.pbkdf2Sync(t,r,i,s),c=d.createDecipheriv(n,u,o),l=[];return l.push(c.update(a)),l.push(c.final()),f.concat(l)}(a=s.EncryptedPrivateKey.decode(a,"der"),t);case"PRIVATE KEY":switch(r=(i=s.PrivateKey.decode(a,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(i.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:i.algorithm.curve,privateKey:s.ECPrivateKey.decode(i.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return i.algorithm.params.priv_key=s.DSAparam.decode(i.subjectPrivateKey,"der"),{type:"dsa",params:i.algorithm.params};default:throw new Error("unknown key id "+r)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(a,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(a,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(a,"der")};case"EC PRIVATE KEY":return{curve:(a=s.ECPrivateKey.decode(a,"der")).parameters.value,privateKey:a.privateKey};default:throw new Error("unknown key type "+o)}}(r.exports=e).signature=s.signature}).call(this,t("buffer").Buffer)},{"./aesid.json":111,"./asn1":112,"./fixProc":114,"browserify-aes":22,buffer:49,pbkdf2:117}],116:[function(e,t,c){(function(n){function o(e,t){for(var r=0,i=e.length-1;0<=i;i--){var n=e[i];"."===n?e.splice(i,1):".."===n?(e.splice(i,1),r++):r&&(e.splice(i,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return t.exec(e).slice(1)};function s(e,t){if(e.filter)return e.filter(t);for(var r=[],i=0;in?t=i(t):t.lengtha||0<=new c(t).cmp(o.modulus))throw new Error("decryption error");n=r?v(new c(t),o):d(t,o);var s=new l(a-n.length);if(s.fill(0),n=l.concat([s,n],a),4===i)return function(e,t){e.modulus;var r=e.modulus.byteLength(),i=(t.length,p("sha1").update(new l("")).digest()),n=i.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,n+1),a=t.slice(n+1),s=h(o,f(a,n)),u=h(a,f(s,r-n-1));if(function(e,t){e=new l(e),t=new l(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));var n=-1;for(;++n=t.length){o++;break}var a=t.slice(2,n-1);t.slice(n-1,n);("0002"!==i.toString("hex")&&!r||"0001"!==i.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(n)}(0,n,r);if(3===i)return n;throw new Error("unknown padding")}}).call(this,e("buffer").Buffer)},{"./mgf":125,"./withPublic":128,"./xor":129,"bn.js":17,"browserify-rsa":40,buffer:49,"create-hash":53,"parse-asn1":115}],127:[function(e,t,r){(function(h){var a=e("parse-asn1"),d=e("randombytes"),p=e("create-hash"),v=e("./mgf"),b=e("./xor"),m=e("bn.js"),s=e("./withPublic"),u=e("browserify-rsa");t.exports=function(e,t,r){var i;i=e.padding?e.padding:r?1:4;var n,o=a(e);if(4===i)n=function(e,t){var r=e.modulus.byteLength(),i=t.length,n=p("sha1").update(new h("")).digest(),o=n.length,a=2*o;if(r-a-2t.highWaterMark&&(t.highWaterMark=function(e){return u<=e?e=u:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(g("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?b(f,e):f(e))}function f(e){g("emit readable"),e.emit("readable"),w(e)}function d(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.highWaterMark||t.ended))return g("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):l(this),null;if(0===(e=c(e,t))&&t.ended)return 0===t.length&&T(this),null;var i,n=t.needReadable;return g("need readable",n),(0===t.length||t.length-e>>32-t}function p(e,t,r,i,n,o,a,s){return d(e+(t^r^i)+o+a|0,s)+n|0}function v(e,t,r,i,n,o,a,s){return d(e+(t&r|~t&i)+o+a|0,s)+n|0}function b(e,t,r,i,n,o,a,s){return d(e+((t|~r)^i)+o+a|0,s)+n|0}function m(e,t,r,i,n,o,a,s){return d(e+(t&i|r&~i)+o+a|0,s)+n|0}function y(e,t,r,i,n,o,a,s){return d(e+(t^(r|~i))+o+a|0,s)+n|0}e(i,r),i.prototype._update=function(){for(var e=new Array(16),t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,o=this._d,a=this._e;a=p(a,r=p(r,i,n,o,a,e[0],0,11),i,n=d(n,10),o,e[1],0,14),i=p(i=d(i,10),n=p(n,o=p(o,a,r,i,n,e[2],0,15),a,r=d(r,10),i,e[3],0,12),o,a=d(a,10),r,e[4],0,5),o=p(o=d(o,10),a=p(a,r=p(r,i,n,o,a,e[5],0,8),i,n=d(n,10),o,e[6],0,7),r,i=d(i,10),n,e[7],0,9),r=p(r=d(r,10),i=p(i,n=p(n,o,a,r,i,e[8],0,11),o,a=d(a,10),r,e[9],0,13),n,o=d(o,10),a,e[10],0,14),n=p(n=d(n,10),o=p(o,a=p(a,r,i,n,o,e[11],0,15),r,i=d(i,10),n,e[12],0,6),a,r=d(r,10),i,e[13],0,7),a=v(a=d(a,10),r=p(r,i=p(i,n,o,a,r,e[14],0,9),n,o=d(o,10),a,e[15],0,8),i,n=d(n,10),o,e[7],1518500249,7),i=v(i=d(i,10),n=v(n,o=v(o,a,r,i,n,e[4],1518500249,6),a,r=d(r,10),i,e[13],1518500249,8),o,a=d(a,10),r,e[1],1518500249,13),o=v(o=d(o,10),a=v(a,r=v(r,i,n,o,a,e[10],1518500249,11),i,n=d(n,10),o,e[6],1518500249,9),r,i=d(i,10),n,e[15],1518500249,7),r=v(r=d(r,10),i=v(i,n=v(n,o,a,r,i,e[3],1518500249,15),o,a=d(a,10),r,e[12],1518500249,7),n,o=d(o,10),a,e[0],1518500249,12),n=v(n=d(n,10),o=v(o,a=v(a,r,i,n,o,e[9],1518500249,15),r,i=d(i,10),n,e[5],1518500249,9),a,r=d(r,10),i,e[2],1518500249,11),a=v(a=d(a,10),r=v(r,i=v(i,n,o,a,r,e[14],1518500249,7),n,o=d(o,10),a,e[11],1518500249,13),i,n=d(n,10),o,e[8],1518500249,12),i=b(i=d(i,10),n=b(n,o=b(o,a,r,i,n,e[3],1859775393,11),a,r=d(r,10),i,e[10],1859775393,13),o,a=d(a,10),r,e[14],1859775393,6),o=b(o=d(o,10),a=b(a,r=b(r,i,n,o,a,e[4],1859775393,7),i,n=d(n,10),o,e[9],1859775393,14),r,i=d(i,10),n,e[15],1859775393,9),r=b(r=d(r,10),i=b(i,n=b(n,o,a,r,i,e[8],1859775393,13),o,a=d(a,10),r,e[1],1859775393,15),n,o=d(o,10),a,e[2],1859775393,14),n=b(n=d(n,10),o=b(o,a=b(a,r,i,n,o,e[7],1859775393,8),r,i=d(i,10),n,e[0],1859775393,13),a,r=d(r,10),i,e[6],1859775393,6),a=b(a=d(a,10),r=b(r,i=b(i,n,o,a,r,e[13],1859775393,5),n,o=d(o,10),a,e[11],1859775393,12),i,n=d(n,10),o,e[5],1859775393,7),i=m(i=d(i,10),n=m(n,o=b(o,a,r,i,n,e[12],1859775393,5),a,r=d(r,10),i,e[1],2400959708,11),o,a=d(a,10),r,e[9],2400959708,12),o=m(o=d(o,10),a=m(a,r=m(r,i,n,o,a,e[11],2400959708,14),i,n=d(n,10),o,e[10],2400959708,15),r,i=d(i,10),n,e[0],2400959708,14),r=m(r=d(r,10),i=m(i,n=m(n,o,a,r,i,e[8],2400959708,15),o,a=d(a,10),r,e[12],2400959708,9),n,o=d(o,10),a,e[4],2400959708,8),n=m(n=d(n,10),o=m(o,a=m(a,r,i,n,o,e[13],2400959708,9),r,i=d(i,10),n,e[3],2400959708,14),a,r=d(r,10),i,e[7],2400959708,5),a=m(a=d(a,10),r=m(r,i=m(i,n,o,a,r,e[15],2400959708,6),n,o=d(o,10),a,e[14],2400959708,8),i,n=d(n,10),o,e[5],2400959708,6),i=y(i=d(i,10),n=m(n,o=m(o,a,r,i,n,e[6],2400959708,5),a,r=d(r,10),i,e[2],2400959708,12),o,a=d(a,10),r,e[4],2840853838,9),o=y(o=d(o,10),a=y(a,r=y(r,i,n,o,a,e[0],2840853838,15),i,n=d(n,10),o,e[5],2840853838,5),r,i=d(i,10),n,e[9],2840853838,11),r=y(r=d(r,10),i=y(i,n=y(n,o,a,r,i,e[7],2840853838,6),o,a=d(a,10),r,e[12],2840853838,8),n,o=d(o,10),a,e[2],2840853838,13),n=y(n=d(n,10),o=y(o,a=y(a,r,i,n,o,e[10],2840853838,12),r,i=d(i,10),n,e[14],2840853838,5),a,r=d(r,10),i,e[1],2840853838,12),a=y(a=d(a,10),r=y(r,i=y(i,n,o,a,r,e[3],2840853838,13),n,o=d(o,10),a,e[8],2840853838,14),i,n=d(n,10),o,e[11],2840853838,11),i=y(i=d(i,10),n=y(n,o=y(o,a,r,i,n,e[6],2840853838,8),a,r=d(r,10),i,e[15],2840853838,5),o,a=d(a,10),r,e[13],2840853838,6),o=d(o,10);var s=this._a,u=this._b,c=this._c,l=this._d,f=this._e;f=y(f,s=y(s,u,c,l,f,e[5],1352829926,8),u,c=d(c,10),l,e[14],1352829926,9),u=y(u=d(u,10),c=y(c,l=y(l,f,s,u,c,e[7],1352829926,9),f,s=d(s,10),u,e[0],1352829926,11),l,f=d(f,10),s,e[9],1352829926,13),l=y(l=d(l,10),f=y(f,s=y(s,u,c,l,f,e[2],1352829926,15),u,c=d(c,10),l,e[11],1352829926,15),s,u=d(u,10),c,e[4],1352829926,5),s=y(s=d(s,10),u=y(u,c=y(c,l,f,s,u,e[13],1352829926,7),l,f=d(f,10),s,e[6],1352829926,7),c,l=d(l,10),f,e[15],1352829926,8),c=y(c=d(c,10),l=y(l,f=y(f,s,u,c,l,e[8],1352829926,11),s,u=d(u,10),c,e[1],1352829926,14),f,s=d(s,10),u,e[10],1352829926,14),f=m(f=d(f,10),s=y(s,u=y(u,c,l,f,s,e[3],1352829926,12),c,l=d(l,10),f,e[12],1352829926,6),u,c=d(c,10),l,e[6],1548603684,9),u=m(u=d(u,10),c=m(c,l=m(l,f,s,u,c,e[11],1548603684,13),f,s=d(s,10),u,e[3],1548603684,15),l,f=d(f,10),s,e[7],1548603684,7),l=m(l=d(l,10),f=m(f,s=m(s,u,c,l,f,e[0],1548603684,12),u,c=d(c,10),l,e[13],1548603684,8),s,u=d(u,10),c,e[5],1548603684,9),s=m(s=d(s,10),u=m(u,c=m(c,l,f,s,u,e[10],1548603684,11),l,f=d(f,10),s,e[14],1548603684,7),c,l=d(l,10),f,e[15],1548603684,7),c=m(c=d(c,10),l=m(l,f=m(f,s,u,c,l,e[8],1548603684,12),s,u=d(u,10),c,e[12],1548603684,7),f,s=d(s,10),u,e[4],1548603684,6),f=m(f=d(f,10),s=m(s,u=m(u,c,l,f,s,e[9],1548603684,15),c,l=d(l,10),f,e[1],1548603684,13),u,c=d(c,10),l,e[2],1548603684,11),u=b(u=d(u,10),c=b(c,l=b(l,f,s,u,c,e[15],1836072691,9),f,s=d(s,10),u,e[5],1836072691,7),l,f=d(f,10),s,e[1],1836072691,15),l=b(l=d(l,10),f=b(f,s=b(s,u,c,l,f,e[3],1836072691,11),u,c=d(c,10),l,e[7],1836072691,8),s,u=d(u,10),c,e[14],1836072691,6),s=b(s=d(s,10),u=b(u,c=b(c,l,f,s,u,e[6],1836072691,6),l,f=d(f,10),s,e[9],1836072691,14),c,l=d(l,10),f,e[11],1836072691,12),c=b(c=d(c,10),l=b(l,f=b(f,s,u,c,l,e[8],1836072691,13),s,u=d(u,10),c,e[12],1836072691,5),f,s=d(s,10),u,e[2],1836072691,14),f=b(f=d(f,10),s=b(s,u=b(u,c,l,f,s,e[10],1836072691,13),c,l=d(l,10),f,e[0],1836072691,13),u,c=d(c,10),l,e[4],1836072691,7),u=v(u=d(u,10),c=v(c,l=b(l,f,s,u,c,e[13],1836072691,5),f,s=d(s,10),u,e[8],2053994217,15),l,f=d(f,10),s,e[6],2053994217,5),l=v(l=d(l,10),f=v(f,s=v(s,u,c,l,f,e[4],2053994217,8),u,c=d(c,10),l,e[1],2053994217,11),s,u=d(u,10),c,e[3],2053994217,14),s=v(s=d(s,10),u=v(u,c=v(c,l,f,s,u,e[11],2053994217,14),l,f=d(f,10),s,e[15],2053994217,6),c,l=d(l,10),f,e[0],2053994217,14),c=v(c=d(c,10),l=v(l,f=v(f,s,u,c,l,e[5],2053994217,6),s,u=d(u,10),c,e[12],2053994217,9),f,s=d(s,10),u,e[2],2053994217,12),f=v(f=d(f,10),s=v(s,u=v(u,c,l,f,s,e[13],2053994217,9),c,l=d(l,10),f,e[9],2053994217,12),u,c=d(c,10),l,e[7],2053994217,5),u=p(u=d(u,10),c=v(c,l=v(l,f,s,u,c,e[10],2053994217,15),f,s=d(s,10),u,e[14],2053994217,8),l,f=d(f,10),s,e[12],0,8),l=p(l=d(l,10),f=p(f,s=p(s,u,c,l,f,e[15],0,5),u,c=d(c,10),l,e[10],0,12),s,u=d(u,10),c,e[4],0,9),s=p(s=d(s,10),u=p(u,c=p(c,l,f,s,u,e[1],0,12),l,f=d(f,10),s,e[5],0,5),c,l=d(l,10),f,e[8],0,14),c=p(c=d(c,10),l=p(l,f=p(f,s,u,c,l,e[7],0,6),s,u=d(u,10),c,e[6],0,8),f,s=d(s,10),u,e[2],0,13),f=p(f=d(f,10),s=p(s,u=p(u,c,l,f,s,e[13],0,6),c,l=d(l,10),f,e[14],0,5),u,c=d(c,10),l,e[0],0,15),u=p(u=d(u,10),c=p(c,l=p(l,f,s,u,c,e[3],0,13),f,s=d(s,10),u,e[9],0,11),l,f=d(f,10),s,e[11],0,11),l=d(l,10);var h=this._b+n+l|0;this._b=this._c+o+f|0,this._c=this._d+a+s|0,this._d=this._e+r+u|0,this._e=this._a+i+c|0,this._a=h},i.prototype._digest=function(){this._block[this._blockOffset++]=128,56=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=4294967295&r,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},{"safe-buffer":143}],145:[function(e,t,r){(r=t.exports=function(e){e=e.toLowerCase();var t=r[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),r.sha1=e("./sha1"),r.sha224=e("./sha224"),r.sha256=e("./sha256"),r.sha384=e("./sha384"),r.sha512=e("./sha512")},{"./sha":146,"./sha1":147,"./sha224":148,"./sha256":149,"./sha384":150,"./sha512":151}],146:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,m=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s=this._w,u=0|this._a,c=0|this._b,l=0|this._c,f=0|this._d,h=0|this._e,d=0;d<16;++d)s[d]=e.readInt32BE(4*d);for(;d<80;++d)s[d]=s[d-3]^s[d-8]^s[d-14]^s[d-16];for(var p=0;p<80;++p){var v=~~(p/20),b=0|((a=u)<<5|a>>>27)+(i=c,n=l,o=f,0===(r=v)?i&n|~i&o:2===r?i&n|i&o|n&o:i^n^o)+h+s[p]+m[v];h=f,f=l,l=(t=c)<<30|t>>>2,c=u,u=b}this._a=u+this._a|0,this._b=c+this._b|0,this._c=l+this._c|0,this._d=f+this._d|0,this._e=h+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],147:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,y=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0;p<16;++p)u[p]=e.readInt32BE(4*p);for(;p<80;++p)u[p]=(t=u[p-3]^u[p-8]^u[p-14]^u[p-16])<<1|t>>>31;for(var v=0;v<80;++v){var b=~~(v/20),m=0|((s=c)<<5|s>>>27)+(n=l,o=f,a=h,0===(i=b)?n&o|~n&a:2===i?n&o|n&a|o&a:n^o^a)+d+u[v]+y[b];d=h,h=f,f=(r=l)<<30|r>>>2,l=c,c=m}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0},s.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],148:[function(e,t,r){var i=e("inherits"),n=e("./sha256"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}i(u,n),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=u},{"./hash":144,"./sha256":149,inherits:103,"safe-buffer":143}],149:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,w=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function s(){this.init(),this._w=a,n.call(this,64,56)}i(s,n),s.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u=this._w,c=0|this._a,l=0|this._b,f=0|this._c,h=0|this._d,d=0|this._e,p=0|this._f,v=0|this._g,b=0|this._h,m=0;m<16;++m)u[m]=e.readInt32BE(4*m);for(;m<64;++m)u[m]=0|(((r=u[m-2])>>>17|r<<15)^(r>>>19|r<<13)^r>>>10)+u[m-7]+(((t=u[m-15])>>>7|t<<25)^(t>>>18|t<<14)^t>>>3)+u[m-16];for(var y=0;y<64;++y){var g=b+(((s=d)>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7))+((a=v)^d&(p^a))+w[y]+u[y]|0,_=0|(((o=c)>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+((i=c)&(n=l)|f&(i|n));b=v,v=p,p=d,d=h+g|0,h=f,f=l,l=c,c=g+_|0}this._a=c+this._a|0,this._b=l+this._b|0,this._c=f+this._c|0,this._d=h+this._d|0,this._e=d+this._e|0,this._f=p+this._f|0,this._g=v+this._g|0,this._h=b+this._h|0},s.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],150:[function(e,t,r){var i=e("inherits"),n=e("./sha512"),o=e("./hash"),a=e("safe-buffer").Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}i(u,n),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var i=a.allocUnsafe(48);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),i},t.exports=u},{"./hash":144,"./sha512":151,inherits:103,"safe-buffer":143}],151:[function(e,t,r){var i=e("inherits"),n=e("./hash"),o=e("safe-buffer").Buffer,ee=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function s(){this.init(),this._w=a,n.call(this,128,112)}function te(e,t,r){return r^e&(t^r)}function re(e,t,r){return e&t|r&(e|t)}function ie(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function ne(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function oe(e,t){return e>>>0>>0?1:0}i(s,n),s.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},s.prototype._update=function(e){for(var t,r,i,n,o,a,s,u,c=this._w,l=0|this._ah,f=0|this._bh,h=0|this._ch,d=0|this._dh,p=0|this._eh,v=0|this._fh,b=0|this._gh,m=0|this._hh,y=0|this._al,g=0|this._bl,_=0|this._cl,w=0|this._dl,x=0|this._el,T=0|this._fl,S=0|this._gl,E=0|this._hl,M=0;M<32;M+=2)c[M]=e.readInt32BE(4*M),c[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var P=c[M-30],k=c[M-30+1],C=((s=P)>>>1|(u=k)<<31)^(s>>>8|u<<24)^s>>>7,A=((o=k)>>>1|(a=P)<<31)^(o>>>8|a<<24)^(o>>>7|a<<25);P=c[M-4],k=c[M-4+1];var O=((i=P)>>>19|(n=k)<<13)^(n>>>29|i<<3)^i>>>6,I=((t=k)>>>19|(r=P)<<13)^(r>>>29|t<<3)^(t>>>6|r<<26),R=c[M-14],D=c[M-14+1],L=c[M-32],j=c[M-32+1],F=A+D|0,B=C+R+oe(F,A)|0;B=(B=B+O+oe(F=F+I|0,I)|0)+L+oe(F=F+j|0,j)|0,c[M]=B,c[M+1]=F}for(var N=0;N<160;N+=2){B=c[N],F=c[N+1];var U=re(l,f,h),z=re(y,g,_),X=ie(l,y),W=ie(y,l),q=ne(p,x),H=ne(x,p),G=ee[N],V=ee[N+1],Y=te(p,v,b),J=te(x,T,S),K=E+H|0,Z=m+q+oe(K,E)|0;Z=(Z=(Z=Z+Y+oe(K=K+J|0,J)|0)+G+oe(K=K+V|0,V)|0)+B+oe(K=K+F|0,F)|0;var Q=W+z|0,$=X+U+oe(Q,W)|0;m=b,E=S,b=v,S=T,v=p,T=x,p=d+Z+oe(x=w+K|0,w)|0,d=h,w=_,h=f,_=g,f=l,g=y,l=Z+$+oe(y=K+Q|0,K)|0}this._al=this._al+y|0,this._bl=this._bl+g|0,this._cl=this._cl+_|0,this._dl=this._dl+w|0,this._el=this._el+x|0,this._fl=this._fl+T|0,this._gl=this._gl+S|0,this._hl=this._hl+E|0,this._ah=this._ah+l+oe(this._al,y)|0,this._bh=this._bh+f+oe(this._bl,g)|0,this._ch=this._ch+h+oe(this._cl,_)|0,this._dh=this._dh+d+oe(this._dl,w)|0,this._eh=this._eh+p+oe(this._el,x)|0,this._fh=this._fh+v+oe(this._fl,T)|0,this._gh=this._gh+b+oe(this._gl,S)|0,this._hh=this._hh+m+oe(this._hl,E)|0},s.prototype._hash=function(){var i=o.allocUnsafe(64);function e(e,t,r){i.writeInt32BE(e,r),i.writeInt32BE(t,r+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),i},t.exports=s},{"./hash":144,inherits:103,"safe-buffer":143}],152:[function(e,t,r){t.exports=i;var l=e("events").EventEmitter;function i(){l.call(this)}e("inherits")(i,l),i.Readable=e("readable-stream/readable.js"),i.Writable=e("readable-stream/writable.js"),i.Duplex=e("readable-stream/duplex.js"),i.Transform=e("readable-stream/transform.js"),i.PassThrough=e("readable-stream/passthrough.js"),(i.Stream=i).prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",n),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(c(),0===l.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return r.on("error",u),t.on("error",u),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}},{events:85,inherits:103,"readable-stream/duplex.js":132,"readable-stream/passthrough.js":138,"readable-stream/readable.js":139,"readable-stream/transform.js":140,"readable-stream/writable.js":141}],153:[function(e,t,r){var i=e("buffer").Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var o=r.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},o.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},{buffer:49}],154:[function(e,t,r){(function(r){function i(e){try{if(!r.localStorage)return!1}catch(e){return!1}var t=r.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],155:[function(require,module,exports){var indexOf=require("indexof"),Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r>2)*(r+3>>2)*8;case p:case v:case l:case b:return(t+3>>2)*(r+3>>2)*16;case ne:case ae:return Math.floor((Math.max(t,8)*Math.max(r,8)*4+7)/8);case oe:case se:return Math.floor((Math.max(t,16)*Math.max(r,8)*2+7)/8);case m:case n:return Math.floor((t+3)/4)*Math.floor((r+3)/4)*16;case y:case o:return Math.floor((t+4)/5)*Math.floor((r+3)/4)*16;case g:case a:return Math.floor((t+4)/5)*Math.floor((r+4)/5)*16;case _:case s:return Math.floor((t+5)/6)*Math.floor((r+4)/5)*16;case w:case u:return Math.floor((t+5)/6)*Math.floor((r+5)/6)*16;case x:case O:return Math.floor((t+7)/8)*Math.floor((r+4)/5)*16;case T:case I:return Math.floor((t+7)/8)*Math.floor((r+5)/6)*16;case S:case R:return Math.floor((t+7)/8)*Math.floor((r+7)/8)*16;case E:case D:return Math.floor((t+9)/10)*Math.floor((r+4)/5)*16;case M:case L:return Math.floor((t+9)/10)*Math.floor((r+5)/6)*16;case P:case j:return Math.floor((t+9)/10)*Math.floor((r+7)/8)*16;case k:case F:return Math.floor((t+9)/10)*Math.floor((r+9)/10)*16;case C:case B:return Math.floor((t+11)/12)*Math.floor((r+9)/10)*16;case A:case N:return Math.floor((t+11)/12)*Math.floor((r+11)/12)*16;default:return 0}}(t.exports=f).prototype.init=function(e,t,r,i,n,o,a,s){this.src=e,this.width=i,this.height=n,this.data=t,this.type=r,this.levels=o,this.internalFormat=a,this.isCompressedImage=!0,this.crunch=s,this.preserveSource=!0;var u=this.complete;return this.complete=!!t,!u&&this.complete&&this.onload&&this.onload({target:this}),this},f.prototype.dispose=function(){this.data=null},f.prototype.generateWebGLTexture=function(e){if(null===this.data)throw"Trying to create a second (or more) webgl texture from the same CompressedImage : "+this.src;for(var t=this.width,r=this.height,i=this.levels,n=0,o=0;o>=1)<1&&(t=1),(r>>=1)<1&&(r=1),n+=a}1>8&255,e>>16&255,e>>24&255)}(i)}var n=1;t[G]&z&&(n=Math.max(1,t[J]));var o=t[Y],a=t[V],s=t[H]+4,u=new Uint8Array(e,s);return this.init(this.src,u,"DDS",o,a,n,r)},f.prototype._loadASTC=function(e){var t=new Int8Array(e,0,Ee);if(new Uint32Array(e.slice(0,4))!=Me)throw"Invalid magic number in ASTC header";for(var r=[m,y,g,_,w,x,T,S,E,M,P,k,C,A],i=e.byteLength-Ee,n=new Uint8Array([t[7],t[8],t[9],0]),o=new Uint8Array([t[10],t[11],t[12],0]),a=new Uint32Array(n.buffer)[0],s=new Uint32Array(o.buffer)[0],u=0,c=0;c 0.0) {\n c.rgb /= c.a;\n\n vec3 rgb = pow(c.rgb, vec3(1. / gamma));\n rgb = mix(vec3(.5), mix(vec3(dot(vec3(.2125, .7154, .0721), rgb)), rgb, saturation), contrast);\n rgb.r *= red;\n rgb.g *= green;\n rgb.b *= blue;\n c.rgb = rgb * brightness;\n\n c.rgb *= c.a;\n }\n\n gl_FragColor = c * alpha;\n}\n"),Object.assign(this,{gamma:1,saturation:1,contrast:1,brightness:1,red:1,green:1,blue:1,alpha:1},e)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.gamma=Math.max(this.gamma,1e-4),this.uniforms.saturation=this.saturation,this.uniforms.contrast=this.contrast,this.uniforms.brightness=this.brightness,this.uniforms.red=this.red,this.uniforms.green=this.green,this.uniforms.blue=this.blue,this.uniforms.alpha=this.alpha,e.applyFilter(this,t,r,i)},e}(h.Filter),d=function(i){function e(e,t,r){void 0===e&&(e=4),void 0===t&&(t=3),void 0===r&&(r=!1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}",r?"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\nuniform vec4 filterClamp;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample top right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, clamp(vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y), filterClamp.xy, filterClamp.zw));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}\n":"\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 uOffset;\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n\n // Sample top left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample top right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y + uOffset.y));\n\n // Sample bottom right pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x + uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Sample bottom left pixel\n color += texture2D(uSampler, vec2(vTextureCoord.x - uOffset.x, vTextureCoord.y - uOffset.y));\n\n // Average\n color *= 0.25;\n\n gl_FragColor = color;\n}"),this.uniforms.uOffset=new Float32Array(2),this._pixelSize=new h.Point,this.pixelSize=1,this._clamp=r,this._kernels=null,Array.isArray(e)?this.kernels=e:(this._blur=e,this.quality=t)}i&&(e.__proto__=i);var t={kernels:{configurable:!0},clamp:{configurable:!0},pixelSize:{configurable:!0},quality:{configurable:!0},blur:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n,o=this.pixelSize.x/t.size.width,a=this.pixelSize.y/t.size.height;if(1===this._quality||0===this._blur)n=this._kernels[0]+.5,this.uniforms.uOffset[0]=n*o,this.uniforms.uOffset[1]=n*a,e.applyFilter(this,t,r,i);else{for(var s,u=e.getRenderTarget(!0),c=t,l=u,f=this._quality-1,h=0;h threshold) {\n gl_FragColor = color;\n } else {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n}\n"),this.threshold=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={threshold:{configurable:!0}};return r.threshold.get=function(){return this.uniforms.threshold},r.threshold.set=function(e){this.uniforms.threshold=e},Object.defineProperties(e.prototype,r),e}(h.Filter),i=function(a){function e(e){a.call(this,s,"uniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform sampler2D bloomTexture;\nuniform float bloomScale;\nuniform float brightness;\n\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord);\n color.rgb *= brightness;\n vec4 bloomColor = vec4(texture2D(bloomTexture, vTextureCoord).rgb, 0.0);\n bloomColor.rgb *= bloomScale;\n gl_FragColor = color + bloomColor;\n}\n"),"number"==typeof e&&(e={threshold:e}),e=Object.assign({threshold:.5,bloomScale:1,brightness:1,kernels:null,blur:8,quality:4,pixelSize:1,resolution:h.settings.RESOLUTION},e),this.bloomScale=e.bloomScale,this.brightness=e.brightness;var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._extractFilter=new u(e.threshold),this._extractFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o}a&&(e.__proto__=a);var t={resolution:{configurable:!0},threshold:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r,i,n){var o=e.getRenderTarget(!0);this._extractFilter.apply(e,t,o,!0,n);var a=e.getRenderTarget(!0);this._blurFilter.apply(e,o,a,!0,n),this.uniforms.bloomScale=this.bloomScale,this.uniforms.brightness=this.brightness,this.uniforms.bloomTexture=a,e.applyFilter(this,t,r,i),e.returnRenderTarget(a),e.returnRenderTarget(o)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._extractFilter&&(this._extractFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.threshold.get=function(){return this._extractFilter.threshold},t.threshold.set=function(e){this._extractFilter.threshold=e},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),n=function(t){function e(e){void 0===e&&(e=8),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform float pixelSize;\nuniform sampler2D uSampler;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n return floor( coord / size ) * size;\n}\n\nvec2 getMod(vec2 coord, vec2 size)\n{\n return mod( coord , size) / size;\n}\n\nfloat character(float n, vec2 p)\n{\n p = floor(p*vec2(4.0, -4.0) + 2.5);\n\n if (clamp(p.x, 0.0, 4.0) == p.x)\n {\n if (clamp(p.y, 0.0, 4.0) == p.y)\n {\n if (int(mod(n/exp2(p.x + 5.0*p.y), 2.0)) == 1) return 1.0;\n }\n }\n return 0.0;\n}\n\nvoid main()\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n // get the rounded color..\n vec2 pixCoord = pixelate(coord, vec2(pixelSize));\n pixCoord = unmapCoord(pixCoord);\n\n vec4 color = texture2D(uSampler, pixCoord);\n\n // determine the character to use\n float gray = (color.r + color.g + color.b) / 3.0;\n\n float n = 65536.0; // .\n if (gray > 0.2) n = 65600.0; // :\n if (gray > 0.3) n = 332772.0; // *\n if (gray > 0.4) n = 15255086.0; // o\n if (gray > 0.5) n = 23385164.0; // &\n if (gray > 0.6) n = 15252014.0; // 8\n if (gray > 0.7) n = 13199452.0; // @\n if (gray > 0.8) n = 11512810.0; // #\n\n // get the mod..\n vec2 modd = getMod(coord, vec2(pixelSize));\n\n gl_FragColor = color * character( n, vec2(-1.0) + modd * 2.0);\n\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.pixelSize},r.size.set=function(e){this.uniforms.pixelSize=e},Object.defineProperties(e.prototype,r),e}(h.Filter),o=function(t){function e(e){void 0===e&&(e={}),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float transformX;\nuniform float transformY;\nuniform vec3 lightColor;\nuniform float lightAlpha;\nuniform vec3 shadowColor;\nuniform float shadowAlpha;\n\nvoid main(void) {\n vec2 transform = vec2(1.0 / filterArea) * vec2(transformX, transformY);\n vec4 color = texture2D(uSampler, vTextureCoord);\n float light = texture2D(uSampler, vTextureCoord - transform).a;\n float shadow = texture2D(uSampler, vTextureCoord + transform).a;\n\n color.rgb = mix(color.rgb, lightColor, clamp((color.a - light) * lightAlpha, 0.0, 1.0));\n color.rgb = mix(color.rgb, shadowColor, clamp((color.a - shadow) * shadowAlpha, 0.0, 1.0));\n gl_FragColor = vec4(color.rgb * color.a, color.a);\n}\n"),this.uniforms.lightColor=new Float32Array(3),this.uniforms.shadowColor=new Float32Array(3),e=Object.assign({rotation:45,thickness:2,lightColor:16777215,lightAlpha:.7,shadowColor:0,shadowAlpha:.7},e),this.rotation=e.rotation,this.thickness=e.thickness,this.lightColor=e.lightColor,this.lightAlpha=e.lightAlpha,this.shadowColor=e.shadowColor,this.shadowAlpha=e.shadowAlpha}t&&(e.__proto__=t);var r={rotation:{configurable:!0},thickness:{configurable:!0},lightColor:{configurable:!0},lightAlpha:{configurable:!0},shadowColor:{configurable:!0},shadowAlpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype._updateTransform=function(){this.uniforms.transformX=this._thickness*Math.cos(this._angle),this.uniforms.transformY=this._thickness*Math.sin(this._angle)},r.rotation.get=function(){return this._angle/h.DEG_TO_RAD},r.rotation.set=function(e){this._angle=e*h.DEG_TO_RAD,this._updateTransform()},r.thickness.get=function(){return this._thickness},r.thickness.set=function(e){this._thickness=e,this._updateTransform()},r.lightColor.get=function(){return h.utils.rgb2hex(this.uniforms.lightColor)},r.lightColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.lightColor)},r.lightAlpha.get=function(){return this.uniforms.lightAlpha},r.lightAlpha.set=function(e){this.uniforms.lightAlpha=e},r.shadowColor.get=function(){return h.utils.rgb2hex(this.uniforms.shadowColor)},r.shadowColor.set=function(e){h.utils.hex2rgb(e,this.uniforms.shadowColor)},r.shadowAlpha.get=function(){return this.uniforms.shadowAlpha},r.shadowAlpha.set=function(e){this.uniforms.shadowAlpha=e},Object.defineProperties(e.prototype,r),e}(h.Filter),a=h.filters,c=a.BlurXFilter,l=a.BlurYFilter,f=a.AlphaFilter,p=function(a){function e(e,t,r,i){var n,o;void 0===e&&(e=2),void 0===t&&(t=4),void 0===r&&(r=h.settings.RESOLUTION),void 0===i&&(i=5),a.call(this),"number"==typeof e?o=n=e:e instanceof h.Point?(n=e.x,o=e.y):Array.isArray(e)&&(n=e[0],o=e[1]),this.blurXFilter=new c(n,t,r,i),this.blurYFilter=new l(o,t,r,i),this.blurYFilter.blendMode=h.BLEND_MODES.SCREEN,this.defaultFilter=new f}a&&(e.__proto__=a);var t={blur:{configurable:!0},blurX:{configurable:!0},blurY:{configurable:!0}};return((e.prototype=Object.create(a&&a.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.defaultFilter.apply(e,t,r),this.blurXFilter.apply(e,t,i),this.blurYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.blurXFilter.blur},t.blur.set=function(e){this.blurXFilter.blur=this.blurYFilter.blur=e},t.blurX.get=function(){return this.blurXFilter.blur},t.blurX.set=function(e){this.blurXFilter.blur=e},t.blurY.get=function(){return this.blurYFilter.blur},t.blurY.set=function(e){this.blurYFilter.blur=e},Object.defineProperties(e.prototype,t),e}(h.Filter),v=function(i){function e(e,t,r){i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","uniform float radius;\nuniform float strength;\nuniform vec2 center;\nuniform sampler2D uSampler;\nvarying vec2 vTextureCoord;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nvoid main()\n{\n vec2 coord = vTextureCoord * filterArea.xy;\n coord -= center * dimensions.xy;\n float distance = length(coord);\n if (distance < radius) {\n float percent = distance / radius;\n if (strength > 0.0) {\n coord *= mix(1.0, smoothstep(0.0, radius / distance, percent), strength * 0.75);\n } else {\n coord *= mix(1.0, pow(percent, 1.0 + strength * 0.75) * radius / distance, 1.0 - percent);\n }\n }\n coord += center * dimensions.xy;\n coord /= filterArea.xy;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n gl_FragColor = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.center=e||[.5,.5],this.radius="number"==typeof t?t:100,this.strength="number"==typeof r?r:1}i&&(e.__proto__=i);var t={radius:{configurable:!0},strength:{configurable:!0},center:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.strength.get=function(){return this.uniforms.strength},t.strength.set=function(e){this.uniforms.strength=e},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},Object.defineProperties(e.prototype,t),e}(h.Filter),b=function(i){function e(e,t,r){void 0===t&&(t=!1),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D colorMap;\nuniform float _mix;\nuniform float _size;\nuniform float _sliceSize;\nuniform float _slicePixelSize;\nuniform float _sliceInnerSize;\nvoid main() {\n vec4 color = texture2D(uSampler, vTextureCoord.xy);\n\n vec4 adjusted;\n if (color.a > 0.0) {\n color.rgb /= color.a;\n float innerWidth = _size - 1.0;\n float zSlice0 = min(floor(color.b * innerWidth), innerWidth);\n float zSlice1 = min(zSlice0 + 1.0, innerWidth);\n float xOffset = _slicePixelSize * 0.5 + color.r * _sliceInnerSize;\n float s0 = xOffset + (zSlice0 * _sliceSize);\n float s1 = xOffset + (zSlice1 * _sliceSize);\n float yOffset = _sliceSize * 0.5 + color.g * (1.0 - _sliceSize);\n vec4 slice0Color = texture2D(colorMap, vec2(s0,yOffset));\n vec4 slice1Color = texture2D(colorMap, vec2(s1,yOffset));\n float zOffset = fract(color.b * innerWidth);\n adjusted = mix(slice0Color, slice1Color, zOffset);\n\n color.rgb *= color.a;\n }\n gl_FragColor = vec4(mix(color, adjusted, _mix).rgb, color.a);\n\n}"),this._size=0,this._sliceSize=0,this._slicePixelSize=0,this._sliceInnerSize=0,this._scaleMode=null,this._nearest=!1,this.nearest=t,this.mix=r,this.colorMap=e}i&&(e.__proto__=i);var t={colorSize:{configurable:!0},colorMap:{configurable:!0},nearest:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms._mix=this.mix,e.applyFilter(this,t,r,i)},t.colorSize.get=function(){return this._size},t.colorMap.get=function(){return this._colorMap},t.colorMap.set=function(e){e instanceof h.Texture||(e=h.Texture.from(e)),e&&e.baseTexture&&(e.baseTexture.scaleMode=this._scaleMode,e.baseTexture.mipmap=!1,this._size=e.height,this._sliceSize=1/this._size,this._slicePixelSize=this._sliceSize/this._size,this._sliceInnerSize=this._slicePixelSize*(this._size-1),this.uniforms._size=this._size,this.uniforms._sliceSize=this._sliceSize,this.uniforms._slicePixelSize=this._slicePixelSize,this.uniforms._sliceInnerSize=this._sliceInnerSize,this.uniforms.colorMap=e),this._colorMap=e},t.nearest.get=function(){return this._nearest},t.nearest.set=function(e){this._nearest=e,this._scaleMode=e?h.SCALE_MODES.NEAREST:h.SCALE_MODES.LINEAR;var t=this._colorMap;t&&t.baseTexture&&(t.baseTexture._glTextures={},t.baseTexture.scaleMode=this._scaleMode,t.baseTexture.mipmap=!1,t._updateID++,t.baseTexture.emit("update",t.baseTexture))},e.prototype.updateColorMap=function(){var e=this._colorMap;e&&e.baseTexture&&(e._updateID++,e.baseTexture.emit("update",e.baseTexture),this.colorMap=e)},e.prototype.destroy=function(e){this._colorMap&&this._colorMap.destroy(e),i.prototype.destroy.call(this)},Object.defineProperties(e.prototype,t),e}(h.Filter),m=function(i){function e(e,t,r){void 0===e&&(e=16711680),void 0===t&&(t=0),void 0===r&&(r=.4),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec3 originalColor;\nuniform vec3 newColor;\nuniform float epsilon;\nvoid main(void) {\n vec4 currentColor = texture2D(uSampler, vTextureCoord);\n vec3 colorDiff = originalColor - (currentColor.rgb / max(currentColor.a, 0.0000000001));\n float colorDistance = length(colorDiff);\n float doReplace = step(colorDistance, epsilon);\n gl_FragColor = vec4(mix(currentColor.rgb, (newColor + colorDiff) * currentColor.a, doReplace), currentColor.a);\n}\n"),this.uniforms.originalColor=new Float32Array(3),this.uniforms.newColor=new Float32Array(3),this.originalColor=e,this.newColor=t,this.epsilon=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={originalColor:{configurable:!0},newColor:{configurable:!0},epsilon:{configurable:!0}};return t.originalColor.set=function(e){var t=this.uniforms.originalColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._originalColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._originalColor=h.utils.rgb2hex(t))},t.originalColor.get=function(){return this._originalColor},t.newColor.set=function(e){var t=this.uniforms.newColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._newColor=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],this._newColor=h.utils.rgb2hex(t))},t.newColor.get=function(){return this._newColor},t.epsilon.set=function(e){this.uniforms.epsilon=e},t.epsilon.get=function(){return this.uniforms.epsilon},Object.defineProperties(e.prototype,t),e}(h.Filter),y=function(i){function e(e,t,r){void 0===t&&(t=200),void 0===r&&(r=200),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying mediump vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec2 texelSize;\nuniform float matrix[9];\n\nvoid main(void)\n{\n vec4 c11 = texture2D(uSampler, vTextureCoord - texelSize); // top left\n vec4 c12 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y - texelSize.y)); // top center\n vec4 c13 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y - texelSize.y)); // top right\n\n vec4 c21 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y)); // mid left\n vec4 c22 = texture2D(uSampler, vTextureCoord); // mid center\n vec4 c23 = texture2D(uSampler, vec2(vTextureCoord.x + texelSize.x, vTextureCoord.y)); // mid right\n\n vec4 c31 = texture2D(uSampler, vec2(vTextureCoord.x - texelSize.x, vTextureCoord.y + texelSize.y)); // bottom left\n vec4 c32 = texture2D(uSampler, vec2(vTextureCoord.x, vTextureCoord.y + texelSize.y)); // bottom center\n vec4 c33 = texture2D(uSampler, vTextureCoord + texelSize); // bottom right\n\n gl_FragColor =\n c11 * matrix[0] + c12 * matrix[1] + c13 * matrix[2] +\n c21 * matrix[3] + c22 * matrix[4] + c23 * matrix[5] +\n c31 * matrix[6] + c32 * matrix[7] + c33 * matrix[8];\n\n gl_FragColor.a = c22.a;\n}\n"),this.uniforms.texelSize=new Float32Array(2),this.uniforms.matrix=new Float32Array(9),void 0!==e&&(this.matrix=e),this.width=t,this.height=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={matrix:{configurable:!0},width:{configurable:!0},height:{configurable:!0}};return t.matrix.get=function(){return this.uniforms.matrix},t.matrix.set=function(e){var r=this;e.forEach(function(e,t){return r.uniforms.matrix[t]=e})},t.width.get=function(){return 1/this.uniforms.texelSize[0]},t.width.set=function(e){this.uniforms.texelSize[0]=1/e},t.height.get=function(){return 1/this.uniforms.texelSize[1]},t.height.set=function(e){this.uniforms.texelSize[1]=1/e},Object.defineProperties(e.prototype,t),e}(h.Filter),g=function(e){function t(){e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\n\nvoid main(void)\n{\n float lum = length(texture2D(uSampler, vTextureCoord.xy).rgb);\n\n gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);\n\n if (lum < 1.00)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.75)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.50)\n {\n if (mod(gl_FragCoord.x + gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n\n if (lum < 0.3)\n {\n if (mod(gl_FragCoord.x - gl_FragCoord.y - 5.0, 10.0) == 0.0)\n {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n }\n }\n}\n")}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t}(h.Filter),_=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec2 dimensions;\n\nconst float SQRT_2 = 1.414213;\n\nconst float light = 1.0;\n\nuniform float curvature;\nuniform float lineWidth;\nuniform float lineContrast;\nuniform bool verticalLine;\nuniform float noise;\nuniform float noiseSize;\n\nuniform float vignetting;\nuniform float vignettingAlpha;\nuniform float vignettingBlur;\n\nuniform float seed;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n vec2 dir = vec2(coord - vec2(0.5, 0.5));\n\n float _c = curvature > 0. ? curvature : 1.;\n float k = curvature > 0. ?(length(dir * dir) * 0.25 * _c * _c + 0.935 * _c) : 1.;\n vec2 uv = dir * k;\n\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 rgb = gl_FragColor.rgb;\n\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n rgb += _noise * noise;\n }\n\n if (lineWidth > 0.0) {\n float v = (verticalLine ? uv.x * dimensions.x : uv.y * dimensions.y) * min(1.0, 2.0 / lineWidth ) / _c;\n float j = 1. + cos(v * 1.2 - time) * 0.5 * lineContrast;\n rgb *= j;\n float segment = verticalLine ? mod((dir.x + .5) * dimensions.x, 4.) : mod((dir.y + .5) * dimensions.y, 4.);\n rgb *= 0.99 + ceil(segment) * 0.015;\n }\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n gl_FragColor.rgb = rgb;\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.time=0,this.seed=0,Object.assign(this,{curvature:1,lineWidth:1,lineContrast:.25,verticalLine:!1,noise:0,noiseSize:1,seed:0,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3,time:0},e)}t&&(e.__proto__=t);var r={curvature:{configurable:!0},lineWidth:{configurable:!0},lineContrast:{configurable:!0},verticalLine:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.curvature.set=function(e){this.uniforms.curvature=e},r.curvature.get=function(){return this.uniforms.curvature},r.lineWidth.set=function(e){this.uniforms.lineWidth=e},r.lineWidth.get=function(){return this.uniforms.lineWidth},r.lineContrast.set=function(e){this.uniforms.lineContrast=e},r.lineContrast.get=function(){return this.uniforms.lineContrast},r.verticalLine.set=function(e){this.uniforms.verticalLine=e},r.verticalLine.get=function(){return this.uniforms.verticalLine},r.noise.set=function(e){this.uniforms.noise=e},r.noise.get=function(){return this.uniforms.noise},r.noiseSize.set=function(e){this.uniforms.noiseSize=e},r.noiseSize.get=function(){return this.uniforms.noiseSize},r.vignetting.set=function(e){this.uniforms.vignetting=e},r.vignetting.get=function(){return this.uniforms.vignetting},r.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},r.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},r.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},r.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,r),e}(h.Filter),w=function(r){function e(e,t){void 0===e&&(e=1),void 0===t&&(t=5),r.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform vec4 filterArea;\nuniform sampler2D uSampler;\n\nuniform float angle;\nuniform float scale;\n\nfloat pattern()\n{\n float s = sin(angle), c = cos(angle);\n vec2 tex = vTextureCoord * filterArea.xy;\n vec2 point = vec2(\n c * tex.x - s * tex.y,\n s * tex.x + c * tex.y\n ) * scale;\n return (sin(point.x) * sin(point.y)) * 4.0;\n}\n\nvoid main()\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n float average = (color.r + color.g + color.b) / 3.0;\n gl_FragColor = vec4(vec3(average * 10.0 - 5.0 + pattern()), color.a);\n}\n"),this.scale=e,this.angle=t}r&&(e.__proto__=r),(e.prototype=Object.create(r&&r.prototype)).constructor=e;var t={scale:{configurable:!0},angle:{configurable:!0}};return t.scale.get=function(){return this.uniforms.scale},t.scale.set=function(e){this.uniforms.scale=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),x=function(f){function e(e){e&&e.constructor!==Object&&(console.warn("DropShadowFilter now uses options instead of (rotation, distance, blur, color, alpha)"),e={rotation:e},void 0!==arguments[1]&&(e.distance=arguments[1]),void 0!==arguments[2]&&(e.blur=arguments[2]),void 0!==arguments[3]&&(e.color=arguments[3]),void 0!==arguments[4]&&(e.alpha=arguments[4])),e=Object.assign({rotation:45,distance:5,color:0,alpha:.5,shadowOnly:!1,kernels:null,blur:2,quality:3,pixelSize:1,resolution:h.settings.RESOLUTION},e),f.call(this);var t=e.kernels,r=e.blur,i=e.quality,n=e.pixelSize,o=e.resolution;this._tintFilter=new h.Filter("attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform vec3 color;\nvoid main(void){\n vec4 sample = texture2D(uSampler, vTextureCoord);\n\n // Un-premultiply alpha before applying the color\n if (sample.a > 0.0) {\n sample.rgb /= sample.a;\n }\n\n // Premultiply alpha again\n sample.rgb = color.rgb * sample.a;\n\n // alpha user alpha\n sample *= alpha;\n\n gl_FragColor = sample;\n}"),this._tintFilter.uniforms.color=new Float32Array(4),this._tintFilter.resolution=o,this._blurFilter=t?new d(t):new d(r,i),this.pixelSize=n,this.resolution=o,this.targetTransform=new h.Matrix;var a=e.shadowOnly,s=e.rotation,u=e.distance,c=e.alpha,l=e.color;this.shadowOnly=a,this.rotation=s,this.distance=u,this.alpha=c,this.color=l,this._updatePadding()}f&&(e.__proto__=f);var t={resolution:{configurable:!0},distance:{configurable:!0},rotation:{configurable:!0},alpha:{configurable:!0},color:{configurable:!0},kernels:{configurable:!0},blur:{configurable:!0},quality:{configurable:!0},pixelSize:{configurable:!0}};return((e.prototype=Object.create(f&&f.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=e.getRenderTarget();n.transform=this.targetTransform,this._tintFilter.apply(e,t,n,!0),n.transform=null,this._blurFilter.apply(e,n,r,i),!0!==this.shadowOnly&&e.applyFilter(this,t,r,!1),e.returnRenderTarget(n)},e.prototype._updatePadding=function(){this.padding=this.distance+2*this.blur},e.prototype._updateTargetTransform=function(){this.targetTransform.tx=this.distance*Math.cos(this.angle),this.targetTransform.ty=this.distance*Math.sin(this.angle)},t.resolution.get=function(){return this._resolution},t.resolution.set=function(e){this._resolution=e,this._tintFilter&&(this._tintFilter.resolution=e),this._blurFilter&&(this._blurFilter.resolution=e)},t.distance.get=function(){return this._distance},t.distance.set=function(e){this._distance=e,this._updatePadding(),this._updateTargetTransform()},t.rotation.get=function(){return this.angle/h.DEG_TO_RAD},t.rotation.set=function(e){this.angle=e*h.DEG_TO_RAD,this._updateTargetTransform()},t.alpha.get=function(){return this._tintFilter.uniforms.alpha},t.alpha.set=function(e){this._tintFilter.uniforms.alpha=e},t.color.get=function(){return h.utils.rgb2hex(this._tintFilter.uniforms.color)},t.color.set=function(e){h.utils.hex2rgb(e,this._tintFilter.uniforms.color)},t.kernels.get=function(){return this._blurFilter.kernels},t.kernels.set=function(e){this._blurFilter.kernels=e},t.blur.get=function(){return this._blurFilter.blur},t.blur.set=function(e){this._blurFilter.blur=e,this._updatePadding()},t.quality.get=function(){return this._blurFilter.quality},t.quality.set=function(e){this._blurFilter.quality=e},t.pixelSize.get=function(){return this._blurFilter.pixelSize},t.pixelSize.set=function(e){this._blurFilter.pixelSize=e},Object.defineProperties(e.prototype,t),e}(h.Filter),T=function(t){function e(e){void 0===e&&(e=5),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float strength;\nuniform vec4 filterArea;\n\n\nvoid main(void)\n{\n\tvec2 onePixel = vec2(1.0 / filterArea);\n\n\tvec4 color;\n\n\tcolor.rgb = vec3(0.5);\n\n\tcolor -= texture2D(uSampler, vTextureCoord - onePixel) * strength;\n\tcolor += texture2D(uSampler, vTextureCoord + onePixel) * strength;\n\n\tcolor.rgb = vec3((color.r + color.g + color.b) / 3.0);\n\n\tfloat alpha = texture2D(uSampler, vTextureCoord).a;\n\n\tgl_FragColor = vec4(color.rgb * alpha, alpha);\n}\n"),this.strength=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={strength:{configurable:!0}};return r.strength.get=function(){return this.uniforms.strength},r.strength.set=function(e){this.uniforms.strength=e},Object.defineProperties(e.prototype,r),e}(h.Filter),S=function(t){function e(e){void 0===e&&(e={}),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","// precision highp float;\n\nvarying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\nuniform float aspect;\n\nuniform sampler2D displacementMap;\nuniform float offset;\nuniform float sinDir;\nuniform float cosDir;\nuniform int fillMode;\n\nuniform float seed;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nconst int TRANSPARENT = 0;\nconst int ORIGINAL = 1;\nconst int LOOP = 2;\nconst int CLAMP = 3;\nconst int MIRROR = 4;\n\nvoid main(void)\n{\n vec2 coord = (vTextureCoord * filterArea.xy) / dimensions;\n\n if (coord.x > 1.0 || coord.y > 1.0) {\n return;\n }\n\n float cx = coord.x - 0.5;\n float cy = (coord.y - 0.5) * aspect;\n float ny = (-sinDir * cx + cosDir * cy) / aspect + 0.5;\n\n // displacementMap: repeat\n // ny = ny > 1.0 ? ny - 1.0 : (ny < 0.0 ? 1.0 + ny : ny);\n\n // displacementMap: mirror\n ny = ny > 1.0 ? 2.0 - ny : (ny < 0.0 ? -ny : ny);\n\n vec4 dc = texture2D(displacementMap, vec2(0.5, ny));\n\n float displacement = (dc.r - dc.g) * (offset / filterArea.x);\n\n coord = vTextureCoord + vec2(cosDir * displacement, sinDir * displacement * aspect);\n\n if (fillMode == CLAMP) {\n coord = clamp(coord, filterClamp.xy, filterClamp.zw);\n } else {\n if( coord.x > filterClamp.z ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x -= filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x = filterClamp.z * 2.0 - coord.x;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.x < filterClamp.x ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.x += filterClamp.z;\n } else if (fillMode == MIRROR) {\n coord.x *= -filterClamp.z;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n\n if( coord.y > filterClamp.w ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y -= filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y = filterClamp.w * 2.0 - coord.y;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n } else if( coord.y < filterClamp.y ) {\n if (fillMode == ORIGINAL) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n } else if (fillMode == LOOP) {\n coord.y += filterClamp.w;\n } else if (fillMode == MIRROR) {\n coord.y *= -filterClamp.w;\n } else {\n gl_FragColor = vec4(0., 0., 0., 0.);\n return;\n }\n }\n }\n\n gl_FragColor.r = texture2D(uSampler, coord + red * (1.0 - seed * 0.4) / filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, coord + green * (1.0 - seed * 0.3) / filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, coord + blue * (1.0 - seed * 0.2) / filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, coord).a;\n}\n"),this.uniforms.dimensions=new Float32Array(2),e=Object.assign({slices:5,offset:100,direction:0,fillMode:0,average:!1,seed:0,red:[0,0],green:[0,0],blue:[0,0],minSize:8,sampleSize:512},e),this.direction=e.direction,this.red=e.red,this.green=e.green,this.blue=e.blue,this.offset=e.offset,this.fillMode=e.fillMode,this.average=e.average,this.seed=e.seed,this.minSize=e.minSize,this.sampleSize=e.sampleSize,this._canvas=document.createElement("canvas"),this._canvas.width=4,this._canvas.height=this.sampleSize,this.texture=h.Texture.fromCanvas(this._canvas,h.SCALE_MODES.NEAREST),this._slices=0,this.slices=e.slices}t&&(e.__proto__=t);var r={sizes:{configurable:!0},offsets:{configurable:!0},slices:{configurable:!0},direction:{configurable:!0},red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){var n=t.sourceFrame.width,o=t.sourceFrame.height;this.uniforms.dimensions[0]=n,this.uniforms.dimensions[1]=o,this.uniforms.aspect=o/n,this.uniforms.seed=this.seed,this.uniforms.offset=this.offset,this.uniforms.fillMode=this.fillMode,e.applyFilter(this,t,r,i)},e.prototype._randomizeSizes=function(){var e=this._sizes,t=this._slices-1,r=this.sampleSize,i=Math.min(this.minSize/r,.9/this._slices);if(this.average){for(var n=this._slices,o=1,a=0;a>0,i=e[t];e[t]=e[r],e[r]=i}},e.prototype._randomizeOffsets=function(){for(var e=0;e>0,t,1+a>>0),n+=a}r.baseTexture.update(),this.uniforms.displacementMap=r},r.sizes.set=function(e){for(var t=Math.min(this._slices,e.length),r=0;rthis._maxColors)throw"Length of replacements ("+i+") exceeds the maximum colors length ("+this._maxColors+")";t[3*i]=-1;for(var n=0;n 0.5) then: 1 - 2 * (1 - dst) * (1 - src)\n return vec3((dst.x <= 0.5) ? (2.0 * src.x * dst.x) : (1.0 - 2.0 * (1.0 - dst.x) * (1.0 - src.x)),\n (dst.y <= 0.5) ? (2.0 * src.y * dst.y) : (1.0 - 2.0 * (1.0 - dst.y) * (1.0 - src.y)),\n (dst.z <= 0.5) ? (2.0 * src.z * dst.z) : (1.0 - 2.0 * (1.0 - dst.z) * (1.0 - src.z)));\n}\n\n\nvoid main()\n{\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n vec3 color = gl_FragColor.rgb;\n\n if (sepia > 0.0)\n {\n float gray = (color.x + color.y + color.z) / 3.0;\n vec3 grayscale = vec3(gray);\n\n color = Overlay(SEPIA_RGB, grayscale);\n\n color = grayscale + sepia * (color - grayscale);\n }\n\n vec2 coord = vTextureCoord * filterArea.xy / dimensions.xy;\n\n if (vignetting > 0.0)\n {\n float outter = SQRT_2 - vignetting * SQRT_2;\n vec2 dir = vec2(vec2(0.5, 0.5) - coord);\n dir.y *= dimensions.y / dimensions.x;\n float darker = clamp((outter - length(dir) * SQRT_2) / ( 0.00001 + vignettingBlur * SQRT_2), 0.0, 1.0);\n color.rgb *= darker + (1.0 - darker) * (1.0 - vignettingAlpha);\n }\n\n if (scratchDensity > seed && scratch != 0.0)\n {\n float phase = seed * 256.0;\n float s = mod(floor(phase), 2.0);\n float dist = 1.0 / scratchDensity;\n float d = distance(coord, vec2(seed * dist, abs(s - seed * dist)));\n if (d < seed * 0.6 + 0.4)\n {\n highp float period = scratchDensity * 10.0;\n\n float xx = coord.x * period + phase;\n float aa = abs(mod(xx, 0.5) * 4.0);\n float bb = mod(floor(xx / 0.5), 2.0);\n float yy = (1.0 - bb) * aa + bb * (2.0 - aa);\n\n float kk = 2.0 * period;\n float dw = scratchWidth / dimensions.x * (0.75 + seed);\n float dh = dw * kk;\n\n float tine = (yy - (2.0 - dh));\n\n if (tine > 0.0) {\n float _sign = sign(scratch);\n\n tine = s * tine / period + scratch + 0.1;\n tine = clamp(tine + 1.0, 0.5 + _sign * 0.5, 1.5 + _sign * 0.5);\n\n color.rgb *= tine;\n }\n }\n }\n\n if (noise > 0.0 && noiseSize > 0.0)\n {\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n pixelCoord.x = floor(pixelCoord.x / noiseSize);\n pixelCoord.y = floor(pixelCoord.y / noiseSize);\n // vec2 d = pixelCoord * noiseSize * vec2(1024.0 + seed * 512.0, 1024.0 - seed * 512.0);\n // float _noise = snoise(d) * 0.5;\n float _noise = rand(pixelCoord * noiseSize * seed) - 0.5;\n color += _noise * noise;\n }\n\n gl_FragColor.rgb = color;\n}\n"),this.uniforms.dimensions=new Float32Array(2),"number"==typeof e?(this.seed=e,e=null):this.seed=t,Object.assign(this,{sepia:.3,noise:.3,noiseSize:1,scratch:.5,scratchDensity:.3,scratchWidth:1,vignetting:.3,vignettingAlpha:1,vignettingBlur:.3},e)}r&&(e.__proto__=r);var t={sepia:{configurable:!0},noise:{configurable:!0},noiseSize:{configurable:!0},scratch:{configurable:!0},scratchDensity:{configurable:!0},scratchWidth:{configurable:!0},vignetting:{configurable:!0},vignettingAlpha:{configurable:!0},vignettingBlur:{configurable:!0}};return((e.prototype=Object.create(r&&r.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.seed=this.seed,e.applyFilter(this,t,r,i)},t.sepia.set=function(e){this.uniforms.sepia=e},t.sepia.get=function(){return this.uniforms.sepia},t.noise.set=function(e){this.uniforms.noise=e},t.noise.get=function(){return this.uniforms.noise},t.noiseSize.set=function(e){this.uniforms.noiseSize=e},t.noiseSize.get=function(){return this.uniforms.noiseSize},t.scratch.set=function(e){this.uniforms.scratch=e},t.scratch.get=function(){return this.uniforms.scratch},t.scratchDensity.set=function(e){this.uniforms.scratchDensity=e},t.scratchDensity.get=function(){return this.uniforms.scratchDensity},t.scratchWidth.set=function(e){this.uniforms.scratchWidth=e},t.scratchWidth.get=function(){return this.uniforms.scratchWidth},t.vignetting.set=function(e){this.uniforms.vignetting=e},t.vignetting.get=function(){return this.uniforms.vignetting},t.vignettingAlpha.set=function(e){this.uniforms.vignettingAlpha=e},t.vignettingAlpha.get=function(){return this.uniforms.vignettingAlpha},t.vignettingBlur.set=function(e){this.uniforms.vignettingBlur=e},t.vignettingBlur.get=function(){return this.uniforms.vignettingBlur},Object.defineProperties(e.prototype,t),e}(h.Filter),A=function(o){function a(e,t,r){void 0===e&&(e=1),void 0===t&&(t=0),void 0===r&&(r=.1);var i=Math.max(r*a.MAX_SAMPLES,a.MIN_SAMPLES),n=(2*Math.PI/i).toFixed(7);o.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec2 thickness;\nuniform vec4 outlineColor;\nuniform vec4 filterClamp;\n\nconst float DOUBLE_PI = 3.14159265358979323846264 * 2.;\n\nvoid main(void) {\n vec4 ownColor = texture2D(uSampler, vTextureCoord);\n vec4 curColor;\n float maxAlpha = 0.;\n vec2 displaced;\n for (float angle = 0.; angle <= DOUBLE_PI; angle += ${angleStep}) {\n displaced.x = vTextureCoord.x + thickness.x * cos(angle);\n displaced.y = vTextureCoord.y + thickness.y * sin(angle);\n curColor = texture2D(uSampler, clamp(displaced, filterClamp.xy, filterClamp.zw));\n maxAlpha = max(maxAlpha, curColor.a);\n }\n float resultAlpha = max(maxAlpha, ownColor.a);\n gl_FragColor = vec4((ownColor.rgb + outlineColor.rgb * (1. - ownColor.a)) * resultAlpha, resultAlpha);\n}\n".replace(/\$\{angleStep\}/,n)),this.uniforms.thickness=new Float32Array([0,0]),this.thickness=e,this.uniforms.outlineColor=new Float32Array([0,0,0,1]),this.color=t,this.quality=r}o&&(a.__proto__=o);var e={color:{configurable:!0}};return((a.prototype=Object.create(o&&o.prototype)).constructor=a).prototype.apply=function(e,t,r,i){this.uniforms.thickness[0]=this.thickness/t.size.width,this.uniforms.thickness[1]=this.thickness/t.size.height,e.applyFilter(this,t,r,i)},e.color.get=function(){return h.utils.rgb2hex(this.uniforms.outlineColor)},e.color.set=function(e){h.utils.hex2rgb(e,this.uniforms.outlineColor)},Object.defineProperties(a.prototype,e),a}(h.Filter);A.MIN_SAMPLES=1,A.MAX_SAMPLES=100;var O=function(t){function e(e){void 0===e&&(e=10),t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform vec2 size;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 pixelate(vec2 coord, vec2 size)\n{\n\treturn floor( coord / size ) * size;\n}\n\nvoid main(void)\n{\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = pixelate(coord, size);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord);\n}\n"),this.size=e}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var r={size:{configurable:!0}};return r.size.get=function(){return this.uniforms.size},r.size.set=function(e){"number"==typeof e&&(e=[e,e]),this.uniforms.size=e},Object.defineProperties(e.prototype,r),e}(h.Filter),I=function(n){function e(e,t,r,i){void 0===e&&(e=0),void 0===t&&(t=[0,0]),void 0===r&&(r=5),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform float uRadian;\nuniform vec2 uCenter;\nuniform float uRadius;\nuniform int uKernelSize;\n\nconst int MAX_KERNEL_SIZE = 2048;\n\nvoid main(void)\n{\n vec4 color = texture2D(uSampler, vTextureCoord);\n\n if (uKernelSize == 0)\n {\n gl_FragColor = color;\n return;\n }\n\n float aspect = filterArea.y / filterArea.x;\n vec2 center = uCenter.xy / filterArea.xy;\n float gradient = uRadius / filterArea.x * 0.3;\n float radius = uRadius / filterArea.x - gradient * 0.5;\n int k = uKernelSize - 1;\n\n vec2 coord = vTextureCoord;\n vec2 dir = vec2(center - coord);\n float dist = length(vec2(dir.x, dir.y * aspect));\n\n float radianStep = uRadian;\n if (radius >= 0.0 && dist > radius) {\n float delta = dist - radius;\n float gap = gradient;\n float scale = 1.0 - abs(delta / gap);\n if (scale <= 0.0) {\n gl_FragColor = color;\n return;\n }\n radianStep *= scale;\n }\n radianStep /= float(k);\n\n float s = sin(radianStep);\n float c = cos(radianStep);\n mat2 rotationMatrix = mat2(vec2(c, -s), vec2(s, c));\n\n for(int i = 0; i < MAX_KERNEL_SIZE - 1; i++) {\n if (i == k) {\n break;\n }\n\n coord -= center;\n coord.y *= aspect;\n coord = rotationMatrix * coord;\n coord.y /= aspect;\n coord += center;\n\n vec4 sample = texture2D(uSampler, coord);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample;\n }\n\n gl_FragColor = color / float(uKernelSize);\n}\n"),this._angle=0,this.angle=e,this.center=t,this.kernelSize=r,this.radius=i}n&&(e.__proto__=n);var t={angle:{configurable:!0},center:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.uKernelSize=0!==this._angle?this.kernelSize:0,e.applyFilter(this,t,r,i)},t.angle.set=function(e){this._angle=e,this.uniforms.uRadian=e*Math.PI/180},t.angle.get=function(){return this._angle},t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),R=function(t){function e(e){t.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\n\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\nuniform vec2 dimensions;\n\nuniform bool mirror;\nuniform float boundary;\nuniform vec2 amplitude;\nuniform vec2 waveLength;\nuniform vec2 alpha;\nuniform float time;\n\nfloat rand(vec2 co) {\n return fract(sin(dot(co.xy, vec2(12.9898, 78.233))) * 43758.5453);\n}\n\nvoid main(void)\n{\n vec2 pixelCoord = vTextureCoord.xy * filterArea.xy;\n vec2 coord = pixelCoord / dimensions;\n\n if (coord.y < boundary) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n float k = (coord.y - boundary) / (1. - boundary + 0.0001);\n float areaY = boundary * dimensions.y / filterArea.y;\n float v = areaY + areaY - vTextureCoord.y;\n float y = mirror ? v : vTextureCoord.y;\n\n float _amplitude = ((amplitude.y - amplitude.x) * k + amplitude.x ) / filterArea.x;\n float _waveLength = ((waveLength.y - waveLength.x) * k + waveLength.x) / filterArea.y;\n float _alpha = (alpha.y - alpha.x) * k + alpha.x;\n\n float x = vTextureCoord.x + cos(v * 6.28 / _waveLength - time) * _amplitude;\n x = clamp(x, filterClamp.x, filterClamp.z);\n\n vec4 color = texture2D(uSampler, vec2(x, y));\n\n gl_FragColor = color * _alpha;\n}\n"),this.uniforms.amplitude=new Float32Array(2),this.uniforms.waveLength=new Float32Array(2),this.uniforms.alpha=new Float32Array(2),this.uniforms.dimensions=new Float32Array(2),Object.assign(this,{mirror:!0,boundary:.5,amplitude:[0,20],waveLength:[30,100],alpha:[1,1],time:0},e)}t&&(e.__proto__=t);var r={mirror:{configurable:!0},boundary:{configurable:!0},amplitude:{configurable:!0},waveLength:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},r.mirror.set=function(e){this.uniforms.mirror=e},r.mirror.get=function(){return this.uniforms.mirror},r.boundary.set=function(e){this.uniforms.boundary=e},r.boundary.get=function(){return this.uniforms.boundary},r.amplitude.set=function(e){this.uniforms.amplitude[0]=e[0],this.uniforms.amplitude[1]=e[1]},r.amplitude.get=function(){return this.uniforms.amplitude},r.waveLength.set=function(e){this.uniforms.waveLength[0]=e[0],this.uniforms.waveLength[1]=e[1]},r.waveLength.get=function(){return this.uniforms.waveLength},r.alpha.set=function(e){this.uniforms.alpha[0]=e[0],this.uniforms.alpha[1]=e[1]},r.alpha.get=function(){return this.uniforms.alpha},Object.defineProperties(e.prototype,r),e}(h.Filter),D=function(i){function e(e,t,r){void 0===e&&(e=[-10,0]),void 0===t&&(t=[0,10]),void 0===r&&(r=[0,0]),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","precision mediump float;\n\nvarying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec2 red;\nuniform vec2 green;\nuniform vec2 blue;\n\nvoid main(void)\n{\n gl_FragColor.r = texture2D(uSampler, vTextureCoord + red/filterArea.xy).r;\n gl_FragColor.g = texture2D(uSampler, vTextureCoord + green/filterArea.xy).g;\n gl_FragColor.b = texture2D(uSampler, vTextureCoord + blue/filterArea.xy).b;\n gl_FragColor.a = texture2D(uSampler, vTextureCoord).a;\n}\n"),this.red=e,this.green=t,this.blue=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={red:{configurable:!0},green:{configurable:!0},blue:{configurable:!0}};return t.red.get=function(){return this.uniforms.red},t.red.set=function(e){this.uniforms.red=e},t.green.get=function(){return this.uniforms.green},t.green.set=function(e){this.uniforms.green=e},t.blue.get=function(){return this.uniforms.blue},t.blue.set=function(e){this.uniforms.blue=e},Object.defineProperties(e.prototype,t),e}(h.Filter),L=function(i){function e(e,t,r){void 0===e&&(e=[0,0]),void 0===t&&(t={}),void 0===r&&(r=0),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\nuniform vec4 filterClamp;\n\nuniform vec2 center;\n\nuniform float amplitude;\nuniform float wavelength;\n// uniform float power;\nuniform float brightness;\nuniform float speed;\nuniform float radius;\n\nuniform float time;\n\nconst float PI = 3.14159;\n\nvoid main()\n{\n float halfWavelength = wavelength * 0.5 / filterArea.x;\n float maxRadius = radius / filterArea.x;\n float currentRadius = time * speed / filterArea.x;\n\n float fade = 1.0;\n\n if (maxRadius > 0.0) {\n if (currentRadius > maxRadius) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n fade = 1.0 - pow(currentRadius / maxRadius, 2.0);\n }\n\n vec2 dir = vec2(vTextureCoord - center / filterArea.xy);\n dir.y *= filterArea.y / filterArea.x;\n float dist = length(dir);\n\n if (dist <= 0.0 || dist < currentRadius - halfWavelength || dist > currentRadius + halfWavelength) {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n\n vec2 diffUV = normalize(dir);\n\n float diff = (dist - currentRadius) / halfWavelength;\n\n float p = 1.0 - pow(abs(diff), 2.0);\n\n // float powDiff = diff * pow(p, 2.0) * ( amplitude * fade );\n float powDiff = 1.25 * sin(diff * PI) * p * ( amplitude * fade );\n\n vec2 offset = diffUV * powDiff / filterArea.xy;\n\n // Do clamp :\n vec2 coord = vTextureCoord + offset;\n vec2 clampedCoord = clamp(coord, filterClamp.xy, filterClamp.zw);\n vec4 color = texture2D(uSampler, clampedCoord);\n if (coord != clampedCoord) {\n color *= max(0.0, 1.0 - length(coord - clampedCoord));\n }\n\n // No clamp :\n // gl_FragColor = texture2D(uSampler, vTextureCoord + offset);\n\n color.rgb *= 1.0 + (brightness - 1.0) * p * fade;\n\n gl_FragColor = color;\n}\n"),this.center=e,Array.isArray(t)&&(console.warn("Deprecated Warning: ShockwaveFilter params Array has been changed to options Object."),t={}),t=Object.assign({amplitude:30,wavelength:160,brightness:1,speed:500,radius:-1},t),this.amplitude=t.amplitude,this.wavelength=t.wavelength,this.brightness=t.brightness,this.speed=t.speed,this.radius=t.radius,this.time=r}i&&(e.__proto__=i);var t={center:{configurable:!0},amplitude:{configurable:!0},wavelength:{configurable:!0},brightness:{configurable:!0},speed:{configurable:!0},radius:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.time=this.time,e.applyFilter(this,t,r,i)},t.center.get=function(){return this.uniforms.center},t.center.set=function(e){this.uniforms.center=e},t.amplitude.get=function(){return this.uniforms.amplitude},t.amplitude.set=function(e){this.uniforms.amplitude=e},t.wavelength.get=function(){return this.uniforms.wavelength},t.wavelength.set=function(e){this.uniforms.wavelength=e},t.brightness.get=function(){return this.uniforms.brightness},t.brightness.set=function(e){this.uniforms.brightness=e},t.speed.get=function(){return this.uniforms.speed},t.speed.set=function(e){this.uniforms.speed=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},Object.defineProperties(e.prototype,t),e}(h.Filter),j=function(i){function e(e,t,r){void 0===t&&(t=0),void 0===r&&(r=1),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform sampler2D uLightmap;\nuniform vec4 filterArea;\nuniform vec2 dimensions;\nuniform vec4 ambientColor;\nvoid main() {\n vec4 diffuseColor = texture2D(uSampler, vTextureCoord);\n vec2 lightCoord = (vTextureCoord * filterArea.xy) / dimensions;\n vec4 light = texture2D(uLightmap, lightCoord);\n vec3 ambient = ambientColor.rgb * ambientColor.a;\n vec3 intensity = ambient + light.rgb;\n vec3 finalColor = diffuseColor.rgb * intensity;\n gl_FragColor = vec4(finalColor, diffuseColor.a);\n}\n"),this.uniforms.dimensions=new Float32Array(2),this.uniforms.ambientColor=new Float32Array([0,0,0,r]),this.texture=e,this.color=t}i&&(e.__proto__=i);var t={texture:{configurable:!0},color:{configurable:!0},alpha:{configurable:!0}};return((e.prototype=Object.create(i&&i.prototype)).constructor=e).prototype.apply=function(e,t,r,i){this.uniforms.dimensions[0]=t.sourceFrame.width,this.uniforms.dimensions[1]=t.sourceFrame.height,e.applyFilter(this,t,r,i)},t.texture.get=function(){return this.uniforms.uLightmap},t.texture.set=function(e){this.uniforms.uLightmap=e},t.color.set=function(e){var t=this.uniforms.ambientColor;"number"==typeof e?(h.utils.hex2rgb(e,t),this._color=e):(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],this._color=h.utils.rgb2hex(t))},t.color.get=function(){return this._color},t.alpha.get=function(){return this.uniforms.ambientColor[3]},t.alpha.set=function(e){this.uniforms.ambientColor[3]=e},Object.defineProperties(e.prototype,t),e}(h.Filter),F=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float blur;\nuniform float gradientBlur;\nuniform vec2 start;\nuniform vec2 end;\nuniform vec2 delta;\nuniform vec2 texSize;\n\nfloat random(vec3 scale, float seed)\n{\n return fract(sin(dot(gl_FragCoord.xyz + seed, scale)) * 43758.5453 + seed);\n}\n\nvoid main(void)\n{\n vec4 color = vec4(0.0);\n float total = 0.0;\n\n float offset = random(vec3(12.9898, 78.233, 151.7182), 0.0);\n vec2 normal = normalize(vec2(start.y - end.y, end.x - start.x));\n float radius = smoothstep(0.0, 1.0, abs(dot(vTextureCoord * texSize - start, normal)) / gradientBlur) * blur;\n\n for (float t = -30.0; t <= 30.0; t++)\n {\n float percent = (t + offset - 0.5) / 30.0;\n float weight = 1.0 - abs(percent);\n vec4 sample = texture2D(uSampler, vTextureCoord + delta / texSize * percent * radius);\n sample.rgb *= sample.a;\n color += sample * weight;\n total += weight;\n }\n\n color /= total;\n color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.uniforms.blur=e,this.uniforms.gradientBlur=t,this.uniforms.start=r||new h.Point(0,window.innerHeight/2),this.uniforms.end=i||new h.Point(600,window.innerHeight/2),this.uniforms.delta=new h.Point(30,30),this.uniforms.texSize=new h.Point(window.innerWidth,window.innerHeight),this.updateDelta()}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.updateDelta=function(){this.uniforms.delta.x=0,this.uniforms.delta.y=0},t.blur.get=function(){return this.uniforms.blur},t.blur.set=function(e){this.uniforms.blur=e},t.gradientBlur.get=function(){return this.uniforms.gradientBlur},t.gradientBlur.set=function(e){this.uniforms.gradientBlur=e},t.start.get=function(){return this.uniforms.start},t.start.set=function(e){this.uniforms.start=e,this.updateDelta()},t.end.get=function(){return this.uniforms.end},t.end.set=function(e){this.uniforms.end=e,this.updateDelta()},Object.defineProperties(e.prototype,t),e}(h.Filter),B=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=e/r,this.uniforms.delta.y=t/r},t}(F),N=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),((t.prototype=Object.create(e&&e.prototype)).constructor=t).prototype.updateDelta=function(){var e=this.uniforms.end.x-this.uniforms.start.x,t=this.uniforms.end.y-this.uniforms.start.y,r=Math.sqrt(e*e+t*t);this.uniforms.delta.x=-t/r,this.uniforms.delta.y=e/r},t}(F),U=function(n){function e(e,t,r,i){void 0===e&&(e=100),void 0===t&&(t=600),void 0===r&&(r=null),void 0===i&&(i=null),n.call(this),this.tiltShiftXFilter=new B(e,t,r,i),this.tiltShiftYFilter=new N(e,t,r,i)}n&&(e.__proto__=n);var t={blur:{configurable:!0},gradientBlur:{configurable:!0},start:{configurable:!0},end:{configurable:!0}};return((e.prototype=Object.create(n&&n.prototype)).constructor=e).prototype.apply=function(e,t,r){var i=e.getRenderTarget(!0);this.tiltShiftXFilter.apply(e,t,i),this.tiltShiftYFilter.apply(e,i,r),e.returnRenderTarget(i)},t.blur.get=function(){return this.tiltShiftXFilter.blur},t.blur.set=function(e){this.tiltShiftXFilter.blur=this.tiltShiftYFilter.blur=e},t.gradientBlur.get=function(){return this.tiltShiftXFilter.gradientBlur},t.gradientBlur.set=function(e){this.tiltShiftXFilter.gradientBlur=this.tiltShiftYFilter.gradientBlur=e},t.start.get=function(){return this.tiltShiftXFilter.start},t.start.set=function(e){this.tiltShiftXFilter.start=this.tiltShiftYFilter.start=e},t.end.get=function(){return this.tiltShiftXFilter.end},t.end.set=function(e){this.tiltShiftXFilter.end=this.tiltShiftYFilter.end=e},Object.defineProperties(e.prototype,t),e}(h.Filter),z=function(i){function e(e,t,r){void 0===e&&(e=200),void 0===t&&(t=4),void 0===r&&(r=20),i.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\n\nuniform sampler2D uSampler;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform vec4 filterArea;\n\nvec2 mapCoord( vec2 coord )\n{\n coord *= filterArea.xy;\n coord += filterArea.zw;\n\n return coord;\n}\n\nvec2 unmapCoord( vec2 coord )\n{\n coord -= filterArea.zw;\n coord /= filterArea.xy;\n\n return coord;\n}\n\nvec2 twist(vec2 coord)\n{\n coord -= offset;\n\n float dist = length(coord);\n\n if (dist < radius)\n {\n float ratioDist = (radius - dist) / radius;\n float angleMod = ratioDist * ratioDist * angle;\n float s = sin(angleMod);\n float c = cos(angleMod);\n coord = vec2(coord.x * c - coord.y * s, coord.x * s + coord.y * c);\n }\n\n coord += offset;\n\n return coord;\n}\n\nvoid main(void)\n{\n\n vec2 coord = mapCoord(vTextureCoord);\n\n coord = twist(coord);\n\n coord = unmapCoord(coord);\n\n gl_FragColor = texture2D(uSampler, coord );\n\n}\n"),this.radius=e,this.angle=t,this.padding=r}i&&(e.__proto__=i),(e.prototype=Object.create(i&&i.prototype)).constructor=e;var t={offset:{configurable:!0},radius:{configurable:!0},angle:{configurable:!0}};return t.offset.get=function(){return this.uniforms.offset},t.offset.set=function(e){this.uniforms.offset=e},t.radius.get=function(){return this.uniforms.radius},t.radius.set=function(e){this.uniforms.radius=e},t.angle.get=function(){return this.uniforms.angle},t.angle.set=function(e){this.uniforms.angle=e},Object.defineProperties(e.prototype,t),e}(h.Filter),X=function(n){function e(e,t,r,i){void 0===e&&(e=.1),void 0===t&&(t=[0,0]),void 0===r&&(r=0),void 0===i&&(i=-1),n.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec4 filterArea;\n\nuniform vec2 uCenter;\nuniform float uStrength;\nuniform float uInnerRadius;\nuniform float uRadius;\n\nconst float MAX_KERNEL_SIZE = 32.0;\n\n// author: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/\nhighp float rand(vec2 co, float seed) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(co + seed, vec2(a, b)), sn = mod(dt, 3.14159);\n return fract(sin(sn) * c + seed);\n}\n\nvoid main() {\n\n float minGradient = uInnerRadius * 0.3;\n float innerRadius = (uInnerRadius + minGradient * 0.5) / filterArea.x;\n\n float gradient = uRadius * 0.3;\n float radius = (uRadius - gradient * 0.5) / filterArea.x;\n\n float countLimit = MAX_KERNEL_SIZE;\n\n vec2 dir = vec2(uCenter.xy / filterArea.xy - vTextureCoord);\n float dist = length(vec2(dir.x, dir.y * filterArea.y / filterArea.x));\n\n float strength = uStrength;\n\n float delta = 0.0;\n float gap;\n if (dist < innerRadius) {\n delta = innerRadius - dist;\n gap = minGradient;\n } else if (radius >= 0.0 && dist > radius) { // radius < 0 means it's infinity\n delta = dist - radius;\n gap = gradient;\n }\n\n if (delta > 0.0) {\n float normalCount = gap / filterArea.x;\n delta = (normalCount - delta) / normalCount;\n countLimit *= delta;\n strength *= delta;\n if (countLimit < 1.0)\n {\n gl_FragColor = texture2D(uSampler, vTextureCoord);\n return;\n }\n }\n\n // randomize the lookup values to hide the fixed number of samples\n float offset = rand(vTextureCoord, 0.0);\n\n float total = 0.0;\n vec4 color = vec4(0.0);\n\n dir *= strength;\n\n for (float t = 0.0; t < MAX_KERNEL_SIZE; t++) {\n float percent = (t + offset) / MAX_KERNEL_SIZE;\n float weight = 4.0 * (percent - percent * percent);\n vec2 p = vTextureCoord + dir * percent;\n vec4 sample = texture2D(uSampler, p);\n\n // switch to pre-multiplied alpha to correctly blur transparent images\n // sample.rgb *= sample.a;\n\n color += sample * weight;\n total += weight;\n\n if (t > countLimit){\n break;\n }\n }\n\n color /= total;\n // switch back from pre-multiplied alpha\n // color.rgb /= color.a + 0.00001;\n\n gl_FragColor = color;\n}\n"),this.center=t,this.strength=e,this.innerRadius=r,this.radius=i}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={center:{configurable:!0},strength:{configurable:!0},innerRadius:{configurable:!0},radius:{configurable:!0}};return t.center.get=function(){return this.uniforms.uCenter},t.center.set=function(e){this.uniforms.uCenter=e},t.strength.get=function(){return this.uniforms.uStrength},t.strength.set=function(e){this.uniforms.uStrength=e},t.innerRadius.get=function(){return this.uniforms.uInnerRadius},t.innerRadius.set=function(e){this.uniforms.uInnerRadius=e},t.radius.get=function(){return this.uniforms.uRadius},t.radius.set=function(e){(e<0||e===1/0)&&(e=-1),this.uniforms.uRadius=e},Object.defineProperties(e.prototype,t),e}(h.Filter);return e.AdjustmentFilter=t,e.AdvancedBloomFilter=i,e.AsciiFilter=n,e.BevelFilter=o,e.BloomFilter=p,e.BulgePinchFilter=v,e.ColorMapFilter=b,e.ColorReplaceFilter=m,e.ConvolutionFilter=y,e.CrossHatchFilter=g,e.CRTFilter=_,e.DotFilter=w,e.DropShadowFilter=x,e.EmbossFilter=T,e.GlitchFilter=S,e.GlowFilter=E,e.GodrayFilter=M,e.KawaseBlurFilter=d,e.MotionBlurFilter=P,e.MultiColorReplaceFilter=k,e.OldFilmFilter=C,e.OutlineFilter=A,e.PixelateFilter=O,e.RadialBlurFilter=I,e.ReflectionFilter=R,e.RGBSplitFilter=D,e.ShockwaveFilter=L,e.SimpleLightmapFilter=j,e.TiltShiftFilter=U,e.TiltShiftAxisFilter=F,e.TiltShiftXFilter=B,e.TiltShiftYFilter=N,e.TwistFilter=z,e.ZoomBlurFilter=X,e}({},PIXI),pixi_projection,pixi_projection;Object.assign(PIXI.filters,this?this.__filters:__filters),this.PIXI=this.PIXI||{},function(d,b){"use strict";var h,p=function(){function h(e,t,r){this.value=e,this.time=t,this.next=null,this.isStepped=!1,this.ease=r?"function"==typeof r?r:d.ParticleUtils.generateEase(r):null}return h.createList=function(e){if("list"in e){var t=e.list,r=void 0,i=void 0,n=t[0],o=n.value,a=n.time;if(i=r=new h("string"==typeof o?d.ParticleUtils.hexToRGB(o):o,a,e.ease),2a.time;)n=a,a=e[++o];u=(u-n.time)/(a.time-n.time);var c=h.hexToRGB(n.value),l=h.hexToRGB(a.value),f={r:(l.r-c.r)*u+c.r,g:(l.g-c.g)*u+c.g,b:(l.b-c.b)*u+c.b};i.next=new p(f,s/t),i=i.next}return r};var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var n=function(){function e(e){void 0===e&&(e=!1),this.current=null,this.next=null,this.isColor=!!e,this.interpolate=null,this.ease=null}return e.prototype.reset=function(e){this.current=e,this.next=e.next,this.next&&1<=this.next.time?this.interpolate=this.isColor?o:r:e.isStepped?this.interpolate=this.isColor?c:u:this.interpolate=this.isColor?s:a,this.ease=this.current.ease},e}();function r(e){return this.ease&&(e=this.ease(e)),(this.next.value-this.current.value)*e+this.current.value}function o(e){this.ease&&(e=this.ease(e));var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function a(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;return e=(e-this.current.time)/(this.next.time-this.current.time),(this.next.value-this.current.value)*e+this.current.value}function s(e){for(this.ease&&(e=this.ease(e));e>this.next.time;)this.current=this.next,this.next=this.next.next;e=(e-this.current.time)/(this.next.time-this.current.time);var t=this.current.value,r=this.next.value,i=(r.r-t.r)*e+t.r,n=(r.g-t.g)*e+t.g,o=(r.b-t.b)*e+t.b;return d.ParticleUtils.combineRGBComponents(i,n,o)}function u(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;return this.current.value}function c(e){for(this.ease&&(e=this.ease(e));this.next&&e>this.next.time;)this.current=this.next,this.next=this.next.next;var t=this.current.value;return d.ParticleUtils.combineRGBComponents(t.r,t.g,t.b)}var l,f=function(r){function i(e){var t=r.call(this)||this;return t.emitter=e,t.anchor.x=t.anchor.y=.5,t.velocity=new b.Point,t.rotationSpeed=0,t.rotationAcceleration=0,t.maxLife=0,t.age=0,t.ease=null,t.extraData=null,t.alphaList=new n,t.speedList=new n,t.speedMultiplier=1,t.acceleration=new b.Point,t.maxSpeed=NaN,t.scaleList=new n,t.scaleMultiplier=1,t.colorList=new n(!0),t._doAlpha=!1,t._doScale=!1,t._doSpeed=!1,t._doAcceleration=!1,t._doColor=!1,t._doNormalMovement=!1,t._oneOverLife=0,t.next=null,t.prev=null,t.init=t.init,t.Particle_init=i.prototype.init,t.update=t.update,t.Particle_update=i.prototype.update,t.Sprite_destroy=r.prototype.destroy,t.Particle_destroy=i.prototype.destroy,t.applyArt=t.applyArt,t.kill=t.kill,t}return t(i,r),i.prototype.init=function(){this.age=0,this.velocity.x=this.speedList.current.value*this.speedMultiplier,this.velocity.y=0,d.ParticleUtils.rotatePoint(this.rotation,this.velocity),this.noRotation?this.rotation=0:this.rotation*=d.ParticleUtils.DEG_TO_RADS,this.rotationSpeed*=d.ParticleUtils.DEG_TO_RADS,this.rotationAcceleration*=d.ParticleUtils.DEG_TO_RADS,this.alpha=this.alphaList.current.value,this.scale.x=this.scale.y=this.scaleList.current.value,this._doAlpha=!!this.alphaList.current.next,this._doSpeed=!!this.speedList.current.next,this._doScale=!!this.scaleList.current.next,this._doColor=!!this.colorList.current.next,this._doAcceleration=0!==this.acceleration.x||0!==this.acceleration.y,this._doNormalMovement=this._doSpeed||0!==this.speedList.current.value||this._doAcceleration,this._oneOverLife=1/this.maxLife;var e=this.colorList.current.value;this.tint=d.ParticleUtils.combineRGBComponents(e.r,e.g,e.b),this.visible=!0},i.prototype.applyArt=function(e){this.texture=e||b.Texture.EMPTY},i.prototype.update=function(e){if(this.age+=e,this.age>=this.maxLife||this.age<0)return this.kill(),-1;var t=this.age*this._oneOverLife;if(this.ease&&(t=4==this.ease.length?this.ease(t,0,1,1):this.ease(t)),this._doAlpha&&(this.alpha=this.alphaList.interpolate(t)),this._doScale){var r=this.scaleList.interpolate(t)*this.scaleMultiplier;this.scale.x=this.scale.y=r}if(this._doNormalMovement){var i=void 0,n=void 0;if(this._doSpeed){var o=this.speedList.interpolate(t)*this.speedMultiplier;d.ParticleUtils.normalize(this.velocity),d.ParticleUtils.scaleBy(this.velocity,o),i=this.velocity.x*e,n=this.velocity.y*e}else if(this._doAcceleration){var a=this.velocity.x,s=this.velocity.y;if(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.maxSpeed){var u=d.ParticleUtils.length(this.velocity);u>this.maxSpeed&&d.ParticleUtils.scaleBy(this.velocity,this.maxSpeed/u)}i=(a+this.velocity.x)/2*e,n=(s+this.velocity.y)/2*e}else i=this.velocity.x*e,n=this.velocity.y*e;this.position.x+=i,this.position.y+=n}if(this._doColor&&(this.tint=this.colorList.interpolate(t)),0!==this.rotationAcceleration){var c=this.rotationSpeed+this.rotationAcceleration*e;this.rotation+=(this.rotationSpeed+c)/2*e,this.rotationSpeed=c}else 0!==this.rotationSpeed?this.rotation+=this.rotationSpeed*e:this.acceleration&&!this.noRotation&&(this.rotation=Math.atan2(this.velocity.y,this.velocity.x));return t},i.prototype.kill=function(){this.emitter.recycle(this)},i.prototype.destroy=function(){this.parent&&this.parent.removeChild(this),this.Sprite_destroy(),this.emitter=this.velocity=this.colorList=this.scaleList=this.alphaList=this.speedList=this.ease=this.next=this.prev=null},i.parseArt=function(e){var t;for(t=e.length;0<=t;--t)"string"==typeof e[t]&&(e[t]=b.Texture.fromImage(e[t]));if(d.ParticleUtils.verbose)for(t=e.length-1;0=this.maxParticles)this._spawnTimer+=this._frequency;else{var u=void 0;if(u=this.minLifetime==this.maxLifetime?this.minLifetime:Math.random()*(this.maxLifetime-this.minLifetime)+this.minLifetime,-this._spawnTimer=this.spawnChance)){var d=void 0;if(this._poolFirst?(d=this._poolFirst,this._poolFirst=this._poolFirst.next,d.next=null):d=new this.particleConstructor(this),1this.duration&&(this.loop?this.elapsed=this.elapsed%this.duration:this.elapsed=this.duration-1e-6);var r=this.elapsed*this.framerate+1e-7|0;this.texture=this.textures[r]||b.Texture.EMPTY}return t},e.prototype.destroy=function(){this.Particle_destroy(),this.textures=null},e.parseArt=function(e){for(var t,r,i,n,o,a=[],s=0;s>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,1+(e|=e>>>16)},t.log2=function(e){var t,r;return t=+(65535>>=t))<<3,t|=r=+(15<(e>>>=r))<<2,(t|=r=+(3<(e>>>=r))<<1)|(e>>>=r)>>1},t.getIntersectionFactor=function(e,t,r,i,n){var o=t.x-e.x,a=r.x-i.x,s=r.x-e.x,u=t.y-e.y,c=r.y-i.y,l=r.y-e.y,f=o*c-u*a;if(Math.abs(f)<1e-7)return n.x=o,n.y=u,0;var h=(s*c-l*a)/f,d=(o*l-u*s)/f;return d<1e-6||-1e-6=this.size&&this.flush(),e._texture._uvs&&e._texture.baseTexture&&(this.sprites[this.currentIndex++]=e)},e.prototype.flush=function(){if(0!==this.currentIndex){var e,t,r,i=this.renderer.gl,n=this.MAX_TEXTURES,o=R.utils.nextPow2(this.currentIndex),a=R.utils.log2(o),s=this.buffers[a],u=this.sprites,c=this.groups,l=s.float32View,f=s.uint32View,h=0,d=null,p=1,v=0,b=c[0],m=O[u[0]._texture.baseTexture.premultipliedAlpha?1:0][u[0].blendMode];for(b.textureCount=0,b.start=0,b.blend=m,I++,r=0;rt[s]&&(i=t[s]),ot[s+1]&&(n=t[s+1]),ah[c]){u=f[s];f[s]=f[c],f[c]=u;var l=h[s];h[s]=h[c],h[c]=l}if(t[0]=f[0].x,t[1]=f[0].y,t[2]=f[1].x,t[3]=f[1].y,t[4]=f[2].x,t[5]=f[2].y,t[6]=f[3].x,t[7]=f[3].y,(f[3].x-f[2].x)*(f[1].y-f[2].y)-(f[1].x-f[2].x)*(f[3].y-f[2].y)<0)return t[4]=f[3].x,void(t[5]=f[3].y)}},e}();e.Surface=t}(pixi_projection||(pixi_projection={})),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.distortion=new PIXI.Point,e}return __extends(e,t),e.prototype.clear=function(){this.distortion.set(0,0)},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.distortion,i=e.x*e.y;return t.x=e.x+r.x*i,t.y=e.y+r.y*i,t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=e.x,i=e.y,n=this.distortion.x,o=this.distortion.y;if(0==n)t.x=r,t.y=i/(1+o*r);else if(0==o)t.y=i,t.x=r/(1+n*i);else{var a=.5*(i*n-r*o+1)/o,s=a*a+r/o;if(s<=1e-5)return void t.set(NaN,NaN);t.x=0 vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n uv.x = vTrans1.x * surface2.x + vTrans1.y * surface2.y + vTrans1.z;\n uv.y = vTrans2.x * surface2.x + vTrans2.y * surface2.y + vTrans2.z;\n pixels = uv * samplerSize[0];\n \n if (pixels.x < vFrame.x || pixels.x > vFrame.z ||\n pixels.y < vFrame.y || pixels.y > vFrame.w) {\n discard;\n }\n}\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = 1.0; //edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_bilinear",t)}(),function(e){var t=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.size=100,e.MAX_TEXTURES_LOCAL=1,e.shaderVert="precision highp float;\nattribute vec2 aVertexPosition;\nattribute vec3 aTrans1;\nattribute vec3 aTrans2;\nattribute vec4 aFrame;\nattribute vec4 aColor;\nattribute float aTextureId;\n\nuniform mat3 projectionMatrix;\nuniform mat3 worldTransform;\n\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nvoid main(void){\n gl_Position.xyw = projectionMatrix * worldTransform * vec3(aVertexPosition, 1.0);\n gl_Position.z = 0.0;\n \n vTextureCoord = aVertexPosition;\n vTrans1 = aTrans1;\n vTrans2 = aTrans2;\n vTextureId = aTextureId;\n vColor = aColor;\n vFrame = aFrame;\n}\n",e.shaderFrag="precision highp float;\nvarying vec2 vTextureCoord;\nvarying vec3 vTrans1;\nvarying vec3 vTrans2;\nvarying vec4 vFrame;\nvarying vec4 vColor;\nvarying float vTextureId;\n\nuniform sampler2D uSamplers[%count%];\nuniform vec2 samplerSize[%count%]; \nuniform vec4 params;\n\nvoid main(void){\nvec2 surface;\n\nfloat vx = vTextureCoord.x;\nfloat vy = vTextureCoord.y;\nfloat aleph = params.x;\nfloat bet = params.y;\nfloat A = params.z;\nfloat B = params.w;\n\nif (aleph == 0.0) {\n\tsurface.y = vy / (1.0 + vx * bet);\n\tsurface.x = vx;\n}\nelse if (bet == 0.0) {\n\tsurface.x = vx / (1.0 + vy * aleph);\n\tsurface.y = vy;\n} else {\n\tsurface.x = vx * (bet + 1.0) / (bet + 1.0 + vy * aleph);\n\tsurface.y = vy * (aleph + 1.0) / (aleph + 1.0 + vx * bet);\n}\n\nvec2 uv;\nuv.x = vTrans1.x * surface.x + vTrans1.y * surface.y + vTrans1.z;\nuv.y = vTrans2.x * surface.x + vTrans2.y * surface.y + vTrans2.z;\n\nvec2 pixels = uv * samplerSize[0];\n\nvec4 edge;\nedge.xy = clamp(pixels - vFrame.xy + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\nedge.zw = clamp(vFrame.zw - pixels + 0.5, vec2(0.0, 0.0), vec2(1.0, 1.0));\n\nfloat alpha = edge.x * edge.y * edge.z * edge.w;\nvec4 rColor = vColor * alpha;\n\nfloat textureId = floor(vTextureId+0.5);\nvec4 color;\nvec2 textureCoord = uv;\n%forloop%\ngl_FragColor = color * rColor;\n}",e.defUniforms={worldTransform:new Float32Array([1,0,0,0,1,0,0,0,1]),distortion:new Float32Array([0,0])},e}return __extends(e,t),e.prototype.getUniforms=function(e){var t=e.proj;this.shader;return null!==t.surface?t.uniforms:null!==t._activeProjection?t._activeProjection.uniforms:this.defUniforms},e.prototype.createVao=function(e){var t=this.shader.attributes;this.vertSize=14,this.vertByteSize=4*this.vertSize;var r=this.renderer.gl,i=this.renderer.createVao().addIndex(this.indexBuffer).addAttribute(e,t.aVertexPosition,r.FLOAT,!1,this.vertByteSize,0).addAttribute(e,t.aTrans1,r.FLOAT,!1,this.vertByteSize,8).addAttribute(e,t.aTrans2,r.FLOAT,!1,this.vertByteSize,20).addAttribute(e,t.aFrame,r.FLOAT,!1,this.vertByteSize,32).addAttribute(e,t.aColor,r.UNSIGNED_BYTE,!0,this.vertByteSize,48);return t.aTextureId&&i.addAttribute(e,t.aTextureId,r.FLOAT,!1,this.vertByteSize,52),i},e.prototype.fillVertices=function(e,t,r,i,n,o){for(var a=i.vertexData,s=i._texture,u=(s.orig.width,s.orig.height,i._anchor._x,i._anchor._y,s._frame),c=i.aTrans,l=0;l<4;l++)e[r]=a[2*l],e[r+1]=a[2*l+1],e[r+2]=c.a,e[r+3]=c.c,e[r+4]=c.tx,e[r+5]=c.b,e[r+6]=c.d,e[r+7]=c.ty,e[r+8]=u.x,e[r+9]=u.y,e[r+10]=u.x+u.width,e[r+11]=u.y+u.height,t[r+12]=n,e[r+13]=o,r+=14},e}((pixi_projection||(pixi_projection={})).webgl.MultiTextureSpriteRenderer);PIXI.WebGLRenderer.registerPlugin("sprite_strange",t)}(),function(e){var S=new PIXI.Matrix,n=new PIXI.Rectangle,E=new PIXI.Point,t=function(t){function e(){var e=t.call(this)||this;return e.params=[0,0,NaN,NaN],e}return __extends(e,t),e.prototype.clear=function(){var e=this.params;e[0]=0,e[1]=0,e[2]=NaN,e[3]=NaN},e.prototype.setAxisX=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.y=Math.atan2(n,i);var s=this.params;s[2]=0!==t?-o*t:NaN,this._calc01()},e.prototype.setAxisY=function(e,t,r){var i=e.x,n=e.y,o=Math.sqrt(i*i+n*n),a=r.rotation;0!==a&&(r.skew._x-=a,r.skew._y+=a,r.rotation=0),r.skew.x=-Math.atan2(n,i)+Math.PI/2;var s=this.params;s[3]=0!==t?-o*t:NaN,this._calc01()},e.prototype._calc01=function(){var e=this.params;if(isNaN(e[2]))e[1]=0,isNaN(e[3])?e[0]=0:e[0]=1/e[3];else if(isNaN(e[3]))e[0]=0,e[1]=1/e[2];else{var t=1-e[2]*e[3];e[0]=(1-e[2])/t,e[1]=(1-e[3])/t}},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=this.params[2],o=this.params[3],a=e.x,s=e.y;if(0===r)t.y=s*(1+a*i),t.x=a;else if(0===i)t.x=a*(1+s*r),t.y=s;else{var u=n*o-s*a;t.x=n*a*(o+s)/u,t.y=o*s*(n+a)/u}return t},e.prototype.applyInverse=function(e,t){t=t||new PIXI.Point;var r=this.params[0],i=this.params[1],n=(this.params[2],this.params[3],e.x),o=e.y;return 0===r?(t.y=o/(1+n*i),t.x=n):0===i?(t.x=n*(1+o*r),t.y=o):(t.x=n*(i+1)/(i+1+o*r),t.y=o*(r+1)/(r+1+n*i)),t},e.prototype.mapSprite=function(e,t,r){var i=e.texture;return n.x=-e.anchor.x*i.orig.width,n.y=-e.anchor.y*i.orig.height,n.width=i.orig.width,n.height=i.orig.height,this.mapQuad(n,t,r||e.transform)},e.prototype.mapQuad=function(e,t,r){var i=-e.x/e.width,n=-e.y/e.height,o=(1-e.x)/e.width,a=(1-e.y)/e.height,s=t[0].x*(1-i)+t[1].x*i,u=t[0].y*(1-i)+t[1].y*i,c=t[0].x*(1-o)+t[1].x*o,l=t[0].y*(1-o)+t[1].y*o,f=t[3].x*(1-i)+t[2].x*i,h=t[3].y*(1-i)+t[2].y*i,d=t[3].x*(1-o)+t[2].x*o,p=t[3].y*(1-o)+t[2].y*o,v=s*(1-n)+f*n,b=u*(1-n)+h*n,m=c*(1-n)+d*n,y=l*(1-n)+p*n,g=s*(1-a)+f*a,_=u*(1-a)+h*a,w=c*(1-a)+d*a,x=l*(1-a)+p*a,T=S;return T.tx=v,T.ty=b,T.a=m-v,T.b=y-b,T.c=g-v,T.d=_-b,E.set(w,x),T.applyInverse(E,E),r.setFromMatrix(T),this},e.prototype.fillUniforms=function(e){var t=this.params,r=e.params||new Float32Array([0,0,0,0]);(e.params=r)[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3]},e}(e.Surface);e.StrangeSurface=t}(pixi_projection||(pixi_projection={})),function(e){PIXI.Sprite.prototype.convertTo2s=function(){this.proj||(this.pluginName="sprite_bilinear",this.aTrans=new PIXI.Matrix,this.calculateVertices=e.Sprite2s.prototype.calculateVertices,this.calculateTrimmedVertices=e.Sprite2s.prototype.calculateTrimmedVertices,this._calculateBounds=e.Sprite2s.prototype._calculateBounds,PIXI.Container.prototype.convertTo2s.call(this))},PIXI.Container.prototype.convertTo2s=function(){this.proj||(this.proj=new e.Projection2d(this.transform),Object.defineProperty(this,"worldTransform",{get:function(){return this.proj},enumerable:!0,configurable:!0}))},PIXI.Container.prototype.convertSubtreeTo2s=function(){this.convertTo2s();for(var e=0;e=o.TRANSFORM_STEP.PROJ?(i||this.displayObjectUpdateTransform(),this.proj.affine?this.transform.worldTransform.applyInverse(e,r):this.proj.world.applyInverse(e,r)):(this.parent?r=this.parent.worldTransform.applyInverse(e,r):r.copy(e),n===o.TRANSFORM_STEP.NONE?r:this.transform.localTransform.applyInverse(r,r))},Object.defineProperty(e.prototype,"worldTransform",{get:function(){return this.proj.affine?this.transform.worldTransform:this.proj.world},enumerable:!0,configurable:!0}),e}(PIXI.Container);o.Container2d=e,o.container2dToLocal=e.prototype.toLocal}(pixi_projection||(pixi_projection={})),function(e){var u,t,m=PIXI.Point,r=[1,0,0,0,1,0,0,0,1];(t=u=e.AFFINE||(e.AFFINE={}))[t.NONE=0]="NONE",t[t.FREE=1]="FREE",t[t.AXIS_X=2]="AXIS_X",t[t.AXIS_Y=3]="AXIS_Y",t[t.POINT=4]="POINT",t[t.AXIS_XR=5]="AXIS_XR";var i=function(){function e(e){this.floatArray=null,this.mat3=new Float64Array(e||r)}return Object.defineProperty(e.prototype,"a",{get:function(){return this.mat3[0]/this.mat3[8]},set:function(e){this.mat3[0]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"b",{get:function(){return this.mat3[1]/this.mat3[8]},set:function(e){this.mat3[1]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"c",{get:function(){return this.mat3[3]/this.mat3[8]},set:function(e){this.mat3[3]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"d",{get:function(){return this.mat3[4]/this.mat3[8]},set:function(e){this.mat3[4]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tx",{get:function(){return this.mat3[6]/this.mat3[8]},set:function(e){this.mat3[6]=e*this.mat3[8]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ty",{get:function(){return this.mat3[7]/this.mat3[8]},set:function(e){this.mat3[7]=e*this.mat3[8]},enumerable:!0,configurable:!0}),e.prototype.set=function(e,t,r,i,n,o){var a=this.mat3;return a[0]=e,a[1]=t,a[2]=0,a[3]=r,a[4]=i,a[5]=0,a[6]=n,a[7]=o,a[8]=1,this},e.prototype.toArray=function(e,t){this.floatArray||(this.floatArray=new Float32Array(9));var r=t||this.floatArray,i=this.mat3;return e?(r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7]):(r[0]=i[0],r[1]=i[3],r[2]=i[6],r[3]=i[1],r[4]=i[4],r[5]=i[7],r[6]=i[2],r[7]=i[5]),r[8]=i[8],r},e.prototype.apply=function(e,t){t=t||new PIXI.Point;var r=this.mat3,i=e.x,n=e.y,o=1/(r[2]*i+r[5]*n+r[8]);return t.x=o*(r[0]*i+r[3]*n+r[6]),t.y=o*(r[1]*i+r[4]*n+r[7]),t},e.prototype.translate=function(e,t){var r=this.mat3;return r[0]+=e*r[2],r[1]+=t*r[2],r[3]+=e*r[5],r[4]+=t*r[5],r[6]+=e*r[8],r[7]+=t*r[8],this},e.prototype.scale=function(e,t){var r=this.mat3;return r[0]*=e,r[1]*=t,r[3]*=e,r[4]*=t,r[6]*=e,r[7]*=t,this},e.prototype.scaleAndTranslate=function(e,t,r,i){var n=this.mat3;n[0]=e*n[0]+r*n[2],n[1]=t*n[1]+i*n[2],n[3]=e*n[3]+r*n[5],n[4]=t*n[4]+i*n[5],n[6]=e*n[6]+r*n[8],n[7]=t*n[7]+i*n[8]},e.prototype.applyInverse=function(e,t){t=t||new m;var r=this.mat3,i=e.x,n=e.y,o=r[0],a=r[3],s=r[6],u=r[1],c=r[4],l=r[7],f=r[2],h=r[5],d=r[8],p=(d*c-l*h)*i+(-d*a+s*h)*n+(l*a-s*c),v=(-d*u+l*f)*i+(d*o-s*f)*n+(-l*o+s*u),b=(h*u-c*f)*i+(-h*o+a*f)*n+(c*o-a*u);return t.x=p/b,t.y=v/b,t},e.prototype.invert=function(){var e=this.mat3,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=c*o-a*u,f=-c*n+a*s,h=u*n-o*s,d=t*l+r*f+i*h;return d&&(d=1/d,e[0]=l*d,e[1]=(-c*r+i*u)*d,e[2]=(a*r-i*o)*d,e[3]=f*d,e[4]=(c*t-i*s)*d,e[5]=(-a*t+i*n)*d,e[6]=h*d,e[7]=(-u*t+r*s)*d,e[8]=(o*t-r*n)*d),this},e.prototype.identity=function(){var e=this.mat3;return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,this},e.prototype.clone=function(){return new e(this.mat3)},e.prototype.copyTo=function(e){var t=this.mat3,r=e.mat3;return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],e},e.prototype.copyTo2dOr3d=function(e){return this.copyTo(e)},e.prototype.copy=function(e,t,r){var i=this.mat3,n=1/i[8],o=i[6]*n,a=i[7]*n;if(e.a=(i[0]-i[2]*o)*n,e.b=(i[1]-i[2]*a)*n,e.c=(i[3]-i[5]*o)*n,e.d=(i[4]-i[5]*a)*n,e.tx=o,e.ty=a,2<=t){var s=e.a*e.d-e.b*e.c;r||(s=Math.abs(s)),t===u.POINT?(s=0=r&&ethis._duration?this._duration:e,t)):this._time},n.totalTime=function(e,t,r){if(m||b.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!r&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var i=this._totalDuration,n=this._timeline;if(io;)n=n._prev;return n?(e._next=n._next,n._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=n,this._recent=e,this._timeline&&this._uncache(!0),this},n._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},n.render=function(e,t,r){var i,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;n;)i=n._next,(n._active||e>=n._startTime&&!n._paused&&!n._gc)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(e-n._startTime)*n._timeScale,t,r):n.render((e-n._startTime)*n._timeScale,t,r)),n=i},n.rawTime=function(){return m||b.wake(),this._totalTime};var L=S("TweenLite",function(e,t,r){if(I.call(this,t,r),this.render=L.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:L.selector(e)||e;var i,n,o,a=e.jquery||e.length&&e!==h&&e[0]&&(e[0]===h||e[0].nodeType&&e[0].style&&!e.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?K[L.defaultOverwrite]:"number"==typeof s?s>>0:K[s],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=o=u(e),this._propLookup=[],this._siblings=[],i=0;i=$){for(r in $=b.frame+(parseInt(L.autoSleep,10)||120),V){for(e=(t=V[r].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete V[r]}if((!(r=Q._first)||r._paused)&&L.autoSleep&&!Z._first&&1===b._listeners.tick.length){for(;r&&r._paused;)r=r._next;r||b.sleep()}}},b.addEventListener("tick",I._updateRoot);var te=function(e,t,r){var i,n,o=e._gsTweenID;if(V[o||(e._gsTweenID=o="t"+Y++)]||(V[o]={target:e,tweens:[]}),t&&((i=V[o].tweens)[n=i.length]=t,r))for(;-1<--n;)i[n]===t&&i.splice(n,1);return V[o].tweens},re=function(e,t,r,i){var n,o,a=e.vars.onOverwrite;return a&&(n=a(e,t,r,i)),(a=L.onOverwrite)&&(o=a(e,t,r,i)),!1!==n&&!1!==o},ie=function(e,t,r,i,n){var o,a,s,u;if(1===i||4<=i){for(u=n.length,o=0;ol&&((d||!s._initted)&&l-s._startTime<=2e-8||(f[h++]=s)));for(o=h;-1<--o;)if(u=(s=f[o])._firstPT,2===i&&s._kill(r,e,t)&&(a=!0),2!==i||!s._firstPT&&s._initted&&u){if(2!==i&&!re(s,t))continue;s._enabled(!1,!1)&&(a=!0)}return a},ne=function(e,t,r){for(var i=e._timeline,n=i._timeScale,o=e._startTime;i._timeline;){if(o+=i._startTime,n*=i._timeScale,i._paused)return-100;i=i._timeline}return t<(o/=n)?o-t:r&&o===t||!e._initted&&o-t<2e-8?g:(o+=e.totalDuration()/e._timeScale/n)>t+g?0:o-t-g};n._init=function(){var e,t,r,i,n,o,a=this.vars,s=this._overwrittenProps,u=this._duration,c=!!a.immediateRender,l=a.ease,f=this._startAt;if(a.startAt){for(i in f&&(f.render(-1,!0),f.kill()),n={},a.startAt)n[i]=a.startAt[i];if(n.data="isStart",n.overwrite=!1,n.immediateRender=!0,n.lazy=c&&!1!==a.lazy,n.startAt=n.delay=null,n.onUpdate=a.onUpdate,n.onUpdateParams=a.onUpdateParams,n.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=L.to(this.target||{},0,n),c)if(0s.pr;)i=i._next;(s._prev=i?i._prev:o)?s._prev._next=s:n=s,(s._next=i)?i._prev=s:o=s,s=a}s=t._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[e]&&s.t[e]()&&(r=!0),s=s._next;return r},oe.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===oe.API&&(G[(new e[t])._propName]=e[t]);return!0},s.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,r=e.propName,i=e.priority||0,n=e.overwriteProps,o={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+r.charAt(0).toUpperCase()+r.substr(1)+"Plugin",function(){oe.call(this,r,i),this._overwriteProps=n||[]},!0===e.global),s=a.prototype=new oe(r);for(t in(s.constructor=a).API=e.API,o)"function"==typeof e[t]&&(s[o[t]]=e[t]);return a.version=e.version,oe.activate([a]),a},t=h._gsQueue){for(r=0;r>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(" "),t.s1=r(" "),t.s2=r(" "),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1),r=null}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function i(e,t){var r=new o(e),i=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],16:[function(e,t,r){!function(e,t,r){function o(e){var n=this,t="";n.next=function(){var e=n.b,t=n.c,r=n.d,i=n.a;return e=e<<25^e>>>7^t,t=t-r|0,r=r<<24^r>>>8^i,i=i-e|0,n.b=e=e<<20^e>>>12^t,n.c=t=t-r|0,n.d=r<<16^t>>>16^i,n.a=i-e|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,e===Math.floor(e)?(n.a=e/4294967296|0,n.b=0|e):t+=e;for(var r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],17:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var i=0;i>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],18:[function(e,t,r){!function(e,t,r){function o(e){var o=this;o.next=function(){var e,t,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,t=i[n+34&127],e=i[n=n+1&127],t^=t<<13,e^=e<<17,t^=t>>>15,e^=e>>>12,t=i[n]=t^e,o.i=n,t+(r^r>>>16)|0},function(e,t){var r,i,n,o,a,s=[],u=128;for(t===(0|t)?(i=t,t=null):(t+="\0",i=0,u=Math.max(u,t.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(a=a+1640531527|0,n=0==(r=s[127&o]^=i+a)?n+1:0);for(128<=n&&(s[127&(t&&t.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,s[n]=i^r;e.w=a,e.X=s,e.i=n}(o,e)}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function i(e,t){null==e&&(e=+new Date);var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.X&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],19:[function(e,t,r){!function(e,t,r){function o(e){var n=this;n.next=function(){var e,t,r=n.x,i=n.i;return e=r[i],t=(e^=e>>>7)^e<<24,t^=(e=r[i+1&7])^e>>>10,t^=(e=r[i+3&7])^e>>>3,t^=(e=r[i+4&7])^e<<7,e=r[i+7&7],t^=(e^=e<<13)^e<<9,r[i]=t,n.i=i+1&7,t},function(e,t){var r,i=[];if(t===(0|t))i[0]=t;else for(t=""+t,r=0;r>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&(i.x&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],20:[function(e,t,r){!function(e,t,r){function o(e){var t=this,r="";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var i=0;i>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function i(e,t){var r=new o(e),i=t&&t.state,n=function(){return(r.next()>>>0)/4294967296};return n.double=function(){do{var e=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},n.int32=r.next,n.quick=n,i&&("object"==typeof i&&a(i,r),n.state=function(){return a(r,{})}),n}t&&t.exports?t.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof t&&t,"function"==typeof define&&define)},{}],21:[function(t,r,e){!function(s,u){var c,l=this,f=256,h=6,d="random",p=u.pow(f,h),v=u.pow(2,52),b=2*v,m=f-1;function e(e,t,r){var i=[],n=_(function e(t,r){var i,n=[],o=typeof t;if(r&&"object"==o)for(i in t)try{n.push(e(t[i],r-1))}catch(e){}return n.length?n:"string"==o?t:t+"\0"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,w(s)]:null==e?function(){try{var e;return c&&(e=c.randomBytes)?e=e(f):(e=new Uint8Array(f),(l.crypto||l.msCrypto).getRandomValues(e)),w(e)}catch(e){var t=l.navigator,r=t&&t.plugins;return[+new Date,l,r,l.screen,w(s)]}}():e,3),i),o=new y(i),a=function(){for(var e=o.g(h),t=p,r=0;e>>=1;return(e+r)/t};return a.int32=function(){return 0|o.g(4)},a.quick=function(){return o.g(4)/4294967296},a.double=a,_(w(o.S),s),(t.pass||r||function(e,t,r,i){return i&&(i.S&&g(i,o),e.state=function(){return g(o,{})}),r?(u[d]=e,t):e})(a,n,"global"in t?t.global:this==u,t.state)}function y(e){var t,r=e.length,a=this,i=0,n=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);iMath.PI?f-r:r}function b(e){return e-f*Math.floor(e/f)}t.exports={UP:o,DOWN:a,LEFT:s,RIGHT:0,NORTH:u,SOUTH:c,WEST:l,EAST:0,PI_2:f,PI_QUARTER:h,PI_HALF:d,toDegrees:function(e){return e*i},toRadians:function(e){return e*n},isAngleBetween:function(e,t,r){if(((r-t)%f+f)%f>=Math.PI){var i=t;t=r,r=i}return t<=r?t<=e&&e<=r:t<=e||e<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(e,t){return v(t,e)*p(t,e)+e},normalize:b,angleTwoPoints:function(){return 4===arguments.length?Math.atan2(arguments[3]-arguments[1],arguments[2]-arguments[0]):Math.atan2(arguments[1].y-arguments[0].y,arguments[1].x-arguments[0].x)},distanceTwoPoints:function(){return 2===arguments.length?Math.sqrt(Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2)):Math.sqrt(Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2))},distanceTwoPointsSquared:function(){return 2===arguments.length?Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2):Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2)},closestAngle:function(e){var t=v(e,s),r=v(e,0),i=v(e,o),n=v(e,a);return t<=r&&t<=i&&t<=n?s:r<=i&&r<=n?0:i<=n?o:a},equals:function(e,t,r){return r?v(e,t)>16)+e*(r>>16)<<16|i*(t>>8&255)+e*(r>>8&255)<<8|i*(255&t)+e*(255&r)},random:function(e,t){function r(){return s.range(e,t)}var i=s.pick([{r:1,g:1,b:1},{r:1,g:1,b:0},{r:1,g:0,b:1},{r:0,g:1,b:1},{r:1,g:0,b:0},{r:0,g:1,b:0},{r:0,g:0,b:1}]);return e=e||0,t=t||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(e,t,r,i,n,o){var a={h:s.range(e,t),s:s.range(r,i,!0),l:s.range(n,o,!0)};return this.hslToHex(a)},randomGoldenRatioHSL:function(e,t,r){for(var i=s.get(1,!0),n=[],o=0;o=this.time?(this.parent.x=t.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(t.time,t.start,t.delta,this.time),this.parent.dirty=!0}if(this.toY){var r=this.toY;r.time+=e,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time),this.parent.dirty=!0}}}},{key:"calcUnderflowX",value:function(){var e=void 0;switch(this.underflowX){case-1:e=0;break;case 1:e=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:e=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return e}},{key:"calcUnderflowY",value:function(){var e=void 0;switch(this.underflowY){case-1:e=0;break;case 1:e=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:e=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return e}},{key:"bounce",value:function(){if(!this.paused){var e=void 0,t=this.parent.plugins.decelerate;t&&(t.x||t.y)&&(t.x&&t.percentChangeX===t.friction||t.y&&t.percentChangeY===t.friction)&&(((e=this.parent.OOB()).left&&this.left||e.right&&this.right)&&(t.percentChangeX=this.friction),(e.top&&this.top||e.bottom&&this.bottom)&&(t.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(t=t||{},!(r.active||i.active||this.toX&&this.toY||t.x&&t.y)){var n=(e=e||this.parent.OOB()).cornerPoint;if(!this.toX&&!t.x){var o=null;e.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth&&(this.parent.fitWidth(this.maxWidth),e=this.parent.worldScreenWidth,t=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})),this.minHeight&&tthis.maxHeight&&(this.parent.fitHeight(this.maxHeight),this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"}))}}}]),i}()},{"./plugin":9}],3:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,t=!(e.x=0));t&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var r=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,r=!(e.y=0));r&&this.parent.emit("moved",{viewport:this.parent,type:"clamp-y"})}}}}]),i}()},{"./plugin":9,"./utils":12}],4:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=e-100){var s=e-a.time;this.x=(this.parent.x-a.x)/s,this.y=(this.parent.y-a.y)/s,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(e){void 0!==(e=e||{}).x&&(this.x=e.x,this.percentChangeX=this.friction),void 0!==e.y&&(this.y=e.y,this.percentChangeY=this.friction)}},{key:"update",value:function(e){if(!this.paused){var t=void 0;this.x&&(this.parent.x+=this.x*e,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,e.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,e.y=0)}},{key:"active",get:function(){return this.moved}}]),i}()},{"./plugin":9,"./utils":12}],6:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.radius))return;var i=Math.atan2(this.target.y-e.y,this.target.x-e.x);t=this.target.x-Math.cos(i)*this.radius,r=this.target.y-Math.sin(i)*this.radius}if(this.speed){var n=t-e.x,o=r-e.y;if(n||o){var a=Math.atan2(r-e.y,t-e.x),s=Math.cos(a)*this.speed,u=Math.sin(a)*this.speed,c=Math.abs(s)>Math.abs(n)?t:e.x+s,l=Math.abs(u)>Math.abs(o)?r:e.y+u;this.parent.moveCenter(c,l),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else this.parent.moveCenter(t,r),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),n}()},{"./plugin":9}],7:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-t);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&tthis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var e=this.parent.plugins.decelerate;this.horizontal&&e&&!this.noDecelerate&&e.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var e=this.parent.plugins.decelerate;this.vertical&&e&&!this.noDecelerate&&e.activate({y:this.vertical*this.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var e=this.parent.center;this.horizontal&&(e.x+=this.horizontal*this.speed),this.vertical&&(e.y+=this.vertical*this.speed),this.parent.moveCenter(e),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),i}()},{"./plugin":9,"./utils":12}],8:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(t))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function e(t,r,i){null===t&&(t=Function.prototype);var n=Object.getOwnPropertyDescriptor(t,r);if(void 0===n){var o=Object.getPrototypeOf(t);return null===o?void 0:e(o,r,i)}if("value"in n)return n.value;var a=n.get;return void 0!==a?a.call(i):void 0}(i.prototype.__proto__||Object.getPrototypeOf(i.prototype),"resume",this).call(this)}}]),i}()},{"./plugin":9,"./utils":12}],11:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(t.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var a=this.topLeft?this.parent.corner:this.parent.center;a.x===this.x&&a.y===this.y||this.snapStart()}}}]),o}()},{"./plugin":9,"./utils":12}],12:[function(e,t,r){"use strict";var i=e("penner");function n(e){return null!=e}t.exports={exists:n,defaults:function(e,t){return null!=e?e:t},ease:function(e,t){return n(e)?"function"==typeof e?e:"string"==typeof e?i[e]:void 0:i[t]}}},{penner:15}],13:[function(e,t,r){"use strict";var i=function(){function i(e,t){for(var r=0;r=this.threshold}},{key:"move",value:function(e){if(!this.pause){var t=!0,r=!1,i=void 0;try{for(var n,o=this.pluginsList[Symbol.iterator]();!(t=(n=o.next()).done);t=!0){n.value.move(e)}}catch(e){r=!0,i=e}finally{try{!t&&o.return&&o.return()}finally{if(r)throw i}}if(this.clickedAvailable){var a=e.data.global.x-this.last.x,s=e.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(s))&&(this.clickedAvailable=!1)}}}},{key:"up",value:function(e){if(!this.pause){if(e.data.originalEvent instanceof MouseEvent&&0==e.data.originalEvent.button&&(this.leftDown=!1),"mouse"!==e.data.pointerType)for(var t=0;tthis._worldWidth,e.top=this.top<0,e.bottom=this.bottom>this._worldHeight,e.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},e}},{key:"countDownPointers",value:function(){return(this.leftDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t){var i=t[r];-1!==this.touches.indexOf(i.pointerId)&&e.push(i)}return e}},{key:"getPointers",value:function(){var e=[],t=this.trackedPointers;for(var r in t)e.push(t[r]);return e}},{key:"_reset",value:function(){this.plugins.bounce&&(this.plugins.bounce.reset(),this.plugins.bounce.bounce()),this.plugins.decelerate&&this.plugins.decelerate.reset(),this.plugins.snap&&this.plugins.snap.reset(),this.plugins.clamp&&this.plugins.clamp.update(),this.plugins["clamp-zoom"]&&this.plugins["clamp-zoom"].clamp(),this.dirty=!0}},{key:"removePlugin",value:function(e){this.plugins[e]&&(this.plugins[e]=null,this.emit(e+"-remove"),this.pluginsSort())}},{key:"pausePlugin",value:function(e){this.plugins[e]&&this.plugins[e].pause()}},{key:"resumePlugin",value:function(e){this.plugins[e]&&this.plugins[e].resume()}},{key:"pluginsSort",value:function(){var e=!0,t=!(this.pluginsList=[]),r=void 0;try{for(var i,n=b[Symbol.iterator]();!(e=(i=n.next()).done);e=!0){var o=i.value;this.plugins[o]&&this.pluginsList.push(this.plugins[o])}}catch(e){t=!0,r=e}finally{try{!e&&n.return&&n.return()}finally{if(t)throw r}}}},{key:"drag",value:function(e){return this.plugins.drag=new o(this,e),this.pluginsSort(),this}},{key:"clamp",value:function(e){return this.plugins.clamp=new s(this,e),this.pluginsSort(),this}},{key:"decelerate",value:function(e){return this.plugins.decelerate=new c(this,e),this.pluginsSort(),this}},{key:"bounce",value:function(e){return this.plugins.bounce=new l(this,e),this.pluginsSort(),this}},{key:"pinch",value:function(e){return this.plugins.pinch=new a(this,e),this.pluginsSort(),this}},{key:"snap",value:function(e,t,r){return this.plugins.snap=new f(this,e,t,r),this.pluginsSort(),this}},{key:"follow",value:function(e,t){return this.plugins.follow=new d(this,e,t),this.pluginsSort(),this}},{key:"wheel",value:function(e){return this.plugins.wheel=new p(this,e),this.pluginsSort(),this}},{key:"clampZoom",value:function(e){return this.plugins["clamp-zoom"]=new u(this,e),this.pluginsSort(),this}},{key:"mouseEdges",value:function(e){return this.plugins["mouse-edges"]=new v(this,e),this.pluginsSort(),this}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(e){this._screenWidth=e}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(e){this._screenHeight=e}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(e){this._worldWidth=e,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(e){this._worldHeight=e,this.resizePlugins()}},{key:"worldScreenWidth",get:function(){return this._screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this._screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this._worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this._worldHeight*this.scale.y}},{key:"center",get:function(){return{x:this.worldScreenWidth/2-this.x/this.scale.x,y:this.worldScreenHeight/2-this.y/this.scale.y}},set:function(e){this.moveCenter(e)}},{key:"corner",get:function(){return{x:-this.x/this.scale.x,y:-this.y/this.scale.y}},set:function(e){this.moveCorner(e)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(e){this.x=-e*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(e){this.x=-e*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(e){this.y=-e*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(e){this.y=-e*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(e){this._dirty=e}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(e){e?(this._forceHitArea=e,this.hitArea=e):(this._forceHitArea=!1,this.hitArea=new PIXI.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(e){(this._pause=e)&&(this.touches=[],this.leftDown=!1)}}]),r}();PIXI.extras.Viewport=m,t.exports=m},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(e,t,r){"use strict";var n=function(){function i(e,t){for(var r=0;r]+>|\t|)+|(?:\n)))/gm; - - // The object will be assigned by the build tool. It used to synchronize API - // of external language files with minified version of the highlight.js library. - var API_REPLACES; - - var spanEndTag = ''; - - // Global options used when within external APIs. This is modified when - // calling the `hljs.configure` function. - var options = { - classPrefix: 'hljs-', - tabReplace: null, - useBR: false, - languages: undefined - }; - - - /* Utility functions */ - - function escape(value) { - return value.replace(/&/g, '&').replace(//g, '>'); - } - - function tag(node) { - return node.nodeName.toLowerCase(); - } - - function testRe(re, lexeme) { - var match = re && re.exec(lexeme); - return match && match.index === 0; - } - - function isNotHighlighted(language) { - return noHighlightRe.test(language); - } - - function blockLanguage(block) { - var i, match, length, _class; - var classes = block.className + ' '; - - classes += block.parentNode ? block.parentNode.className : ''; - - // language-* takes precedence over non-prefixed class names. - match = languagePrefixRe.exec(classes); - if (match) { - return getLanguage(match[1]) ? match[1] : 'no-highlight'; - } - - classes = classes.split(/\s+/); - - for (i = 0, length = classes.length; i < length; i++) { - _class = classes[i]; - - if (isNotHighlighted(_class) || getLanguage(_class)) { - return _class; - } - } - } - - function inherit(parent) { // inherit(parent, override_obj, override_obj, ...) - var key; - var result = {}; - var objects = Array.prototype.slice.call(arguments, 1); - - for (key in parent) - result[key] = parent[key]; - objects.forEach(function(obj) { - for (key in obj) - result[key] = obj[key]; - }); - return result; - } - - /* Stream merging */ - - function nodeStream(node) { - var result = []; - (function _nodeStream(node, offset) { - for (var child = node.firstChild; child; child = child.nextSibling) { - if (child.nodeType === 3) - offset += child.nodeValue.length; - else if (child.nodeType === 1) { - result.push({ - event: 'start', - offset: offset, - node: child - }); - offset = _nodeStream(child, offset); - // Prevent void elements from having an end tag that would actually - // double them in the output. There are more void elements in HTML - // but we list only those realistically expected in code display. - if (!tag(child).match(/br|hr|img|input/)) { - result.push({ - event: 'stop', - offset: offset, - node: child - }); - } - } - } - return offset; - })(node, 0); - return result; - } - - function mergeStreams(original, highlighted, value) { - var processed = 0; - var result = ''; - var nodeStack = []; - - function selectStream() { - if (!original.length || !highlighted.length) { - return original.length ? original : highlighted; - } - if (original[0].offset !== highlighted[0].offset) { - return (original[0].offset < highlighted[0].offset) ? original : highlighted; - } - - /* - To avoid starting the stream just before it should stop the order is - ensured that original always starts first and closes last: - - if (event1 == 'start' && event2 == 'start') - return original; - if (event1 == 'start' && event2 == 'stop') - return highlighted; - if (event1 == 'stop' && event2 == 'start') - return original; - if (event1 == 'stop' && event2 == 'stop') - return highlighted; - - ... which is collapsed to: - */ - return highlighted[0].event === 'start' ? original : highlighted; - } - - function open(node) { - function attr_str(a) {return ' ' + a.nodeName + '="' + escape(a.value).replace('"', '"') + '"';} - result += '<' + tag(node) + ArrayProto.map.call(node.attributes, attr_str).join('') + '>'; - } - - function close(node) { - result += ''; - } - - function render(event) { - (event.event === 'start' ? open : close)(event.node); - } - - while (original.length || highlighted.length) { - var stream = selectStream(); - result += escape(value.substring(processed, stream[0].offset)); - processed = stream[0].offset; - if (stream === original) { - /* - On any opening or closing tag of the original markup we first close - the entire highlighted node stack, then render the original tag along - with all the following original tags at the same offset and then - reopen all the tags on the highlighted stack. - */ - nodeStack.reverse().forEach(close); - do { - render(stream.splice(0, 1)[0]); - stream = selectStream(); - } while (stream === original && stream.length && stream[0].offset === processed); - nodeStack.reverse().forEach(open); - } else { - if (stream[0].event === 'start') { - nodeStack.push(stream[0].node); - } else { - nodeStack.pop(); - } - render(stream.splice(0, 1)[0]); - } - } - return result + escape(value.substr(processed)); - } - - /* Initialization */ - - function expand_mode(mode) { - if (mode.variants && !mode.cached_variants) { - mode.cached_variants = mode.variants.map(function(variant) { - return inherit(mode, {variants: null}, variant); - }); - } - return mode.cached_variants || (mode.endsWithParent && [inherit(mode)]) || [mode]; - } - - function restoreLanguageApi(obj) { - if(API_REPLACES && !obj.langApiRestored) { - obj.langApiRestored = true; - for(var key in API_REPLACES) - obj[key] && (obj[API_REPLACES[key]] = obj[key]); - (obj.contains || []).concat(obj.variants || []).forEach(restoreLanguageApi); - } - } - - function compileLanguage(language) { - - function reStr(re) { - return (re && re.source) || re; - } - - function langRe(value, global) { - return new RegExp( - reStr(value), - 'm' + (language.case_insensitive ? 'i' : '') + (global ? 'g' : '') - ); - } - - // joinRe logically computes regexps.join(separator), but fixes the - // backreferences so they continue to match. - function joinRe(regexps, separator) { - // backreferenceRe matches an open parenthesis or backreference. To avoid - // an incorrect parse, it additionally matches the following: - // - [...] elements, where the meaning of parentheses and escapes change - // - other escape sequences, so we do not misparse escape sequences as - // interesting elements - // - non-matching or lookahead parentheses, which do not capture. These - // follow the '(' with a '?'. - var backreferenceRe = /\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./; - var numCaptures = 0; - var ret = ''; - for (var i = 0; i < regexps.length; i++) { - var offset = numCaptures; - var re = reStr(regexps[i]); - if (i > 0) { - ret += separator; - } - while (re.length > 0) { - var match = backreferenceRe.exec(re); - if (match == null) { - ret += re; - break; - } - ret += re.substring(0, match.index); - re = re.substring(match.index + match[0].length); - if (match[0][0] == '\\' && match[1]) { - // Adjust the backreference. - ret += '\\' + String(Number(match[1]) + offset); - } else { - ret += match[0]; - if (match[0] == '(') { - numCaptures++; - } - } - } - } - return ret; - } - - function compileMode(mode, parent) { - if (mode.compiled) - return; - mode.compiled = true; - - mode.keywords = mode.keywords || mode.beginKeywords; - if (mode.keywords) { - var compiled_keywords = {}; - - var flatten = function(className, str) { - if (language.case_insensitive) { - str = str.toLowerCase(); - } - str.split(' ').forEach(function(kw) { - var pair = kw.split('|'); - compiled_keywords[pair[0]] = [className, pair[1] ? Number(pair[1]) : 1]; - }); - }; - - if (typeof mode.keywords === 'string') { // string - flatten('keyword', mode.keywords); - } else { - objectKeys(mode.keywords).forEach(function (className) { - flatten(className, mode.keywords[className]); - }); - } - mode.keywords = compiled_keywords; - } - mode.lexemesRe = langRe(mode.lexemes || /\w+/, true); - - if (parent) { - if (mode.beginKeywords) { - mode.begin = '\\b(' + mode.beginKeywords.split(' ').join('|') + ')\\b'; - } - if (!mode.begin) - mode.begin = /\B|\b/; - mode.beginRe = langRe(mode.begin); - if (mode.endSameAsBegin) - mode.end = mode.begin; - if (!mode.end && !mode.endsWithParent) - mode.end = /\B|\b/; - if (mode.end) - mode.endRe = langRe(mode.end); - mode.terminator_end = reStr(mode.end) || ''; - if (mode.endsWithParent && parent.terminator_end) - mode.terminator_end += (mode.end ? '|' : '') + parent.terminator_end; - } - if (mode.illegal) - mode.illegalRe = langRe(mode.illegal); - if (mode.relevance == null) - mode.relevance = 1; - if (!mode.contains) { - mode.contains = []; - } - mode.contains = Array.prototype.concat.apply([], mode.contains.map(function(c) { - return expand_mode(c === 'self' ? mode : c); - })); - mode.contains.forEach(function(c) {compileMode(c, mode);}); - - if (mode.starts) { - compileMode(mode.starts, parent); - } - - var terminators = - mode.contains.map(function(c) { - return c.beginKeywords ? '\\.?(?:' + c.begin + ')\\.?' : c.begin; - }) - .concat([mode.terminator_end, mode.illegal]) - .map(reStr) - .filter(Boolean); - mode.terminators = terminators.length ? langRe(joinRe(terminators, '|'), true) : {exec: function(/*s*/) {return null;}}; - } - - compileMode(language); - } - - /* - Core highlighting function. Accepts a language name, or an alias, and a - string with the code to highlight. Returns an object with the following - properties: - - - relevance (int) - - value (an HTML string with highlighting markup) - - */ - function highlight(name, value, ignore_illegals, continuation) { - - function escapeRe(value) { - return new RegExp(value.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'm'); - } - - function subMode(lexeme, mode) { - var i, length; - - for (i = 0, length = mode.contains.length; i < length; i++) { - if (testRe(mode.contains[i].beginRe, lexeme)) { - if (mode.contains[i].endSameAsBegin) { - mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] ); - } - return mode.contains[i]; - } - } - } - - function endOfMode(mode, lexeme) { - if (testRe(mode.endRe, lexeme)) { - while (mode.endsParent && mode.parent) { - mode = mode.parent; - } - return mode; - } - if (mode.endsWithParent) { - return endOfMode(mode.parent, lexeme); - } - } - - function isIllegal(lexeme, mode) { - return !ignore_illegals && testRe(mode.illegalRe, lexeme); - } - - function keywordMatch(mode, match) { - var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0]; - return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str]; - } - - function buildSpan(classname, insideSpan, leaveOpen, noPrefix) { - var classPrefix = noPrefix ? '' : options.classPrefix, - openSpan = ''; - - return openSpan + insideSpan + closeSpan; - } - - function processKeywords() { - var keyword_match, last_index, match, result; - - if (!top.keywords) - return escape(mode_buffer); - - result = ''; - last_index = 0; - top.lexemesRe.lastIndex = 0; - match = top.lexemesRe.exec(mode_buffer); - - while (match) { - result += escape(mode_buffer.substring(last_index, match.index)); - keyword_match = keywordMatch(top, match); - if (keyword_match) { - relevance += keyword_match[1]; - result += buildSpan(keyword_match[0], escape(match[0])); - } else { - result += escape(match[0]); - } - last_index = top.lexemesRe.lastIndex; - match = top.lexemesRe.exec(mode_buffer); - } - return result + escape(mode_buffer.substr(last_index)); - } - - function processSubLanguage() { - var explicit = typeof top.subLanguage === 'string'; - if (explicit && !languages[top.subLanguage]) { - return escape(mode_buffer); - } - - var result = explicit ? - highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : - highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); - - // Counting embedded language score towards the host language may be disabled - // with zeroing the containing mode relevance. Usecase in point is Markdown that - // allows XML everywhere and makes every XML snippet to have a much larger Markdown - // score. - if (top.relevance > 0) { - relevance += result.relevance; - } - if (explicit) { - continuations[top.subLanguage] = result.top; - } - return buildSpan(result.language, result.value, false, true); - } - - function processBuffer() { - result += (top.subLanguage != null ? processSubLanguage() : processKeywords()); - mode_buffer = ''; - } - - function startNewMode(mode) { - result += mode.className? buildSpan(mode.className, '', true): ''; - top = Object.create(mode, {parent: {value: top}}); - } - - function processLexeme(buffer, lexeme) { - - mode_buffer += buffer; - - if (lexeme == null) { - processBuffer(); - return 0; - } - - var new_mode = subMode(lexeme, top); - if (new_mode) { - if (new_mode.skip) { - mode_buffer += lexeme; - } else { - if (new_mode.excludeBegin) { - mode_buffer += lexeme; - } - processBuffer(); - if (!new_mode.returnBegin && !new_mode.excludeBegin) { - mode_buffer = lexeme; - } - } - startNewMode(new_mode, lexeme); - return new_mode.returnBegin ? 0 : lexeme.length; - } - - var end_mode = endOfMode(top, lexeme); - if (end_mode) { - var origin = top; - if (origin.skip) { - mode_buffer += lexeme; - } else { - if (!(origin.returnEnd || origin.excludeEnd)) { - mode_buffer += lexeme; - } - processBuffer(); - if (origin.excludeEnd) { - mode_buffer = lexeme; - } - } - do { - if (top.className) { - result += spanEndTag; - } - if (!top.skip && !top.subLanguage) { - relevance += top.relevance; - } - top = top.parent; - } while (top !== end_mode.parent); - if (end_mode.starts) { - if (end_mode.endSameAsBegin) { - end_mode.starts.endRe = end_mode.endRe; - } - startNewMode(end_mode.starts, ''); - } - return origin.returnEnd ? 0 : lexeme.length; - } - - if (isIllegal(lexeme, top)) - throw new Error('Illegal lexeme "' + lexeme + '" for mode "' + (top.className || '') + '"'); - - /* - Parser should not reach this point as all types of lexemes should be caught - earlier, but if it does due to some bug make sure it advances at least one - character forward to prevent infinite looping. - */ - mode_buffer += lexeme; - return lexeme.length || 1; - } - - var language = getLanguage(name); - if (!language) { - throw new Error('Unknown language: "' + name + '"'); - } - - compileLanguage(language); - var top = continuation || language; - var continuations = {}; // keep continuations for sub-languages - var result = '', current; - for(current = top; current !== language; current = current.parent) { - if (current.className) { - result = buildSpan(current.className, '', true) + result; - } - } - var mode_buffer = ''; - var relevance = 0; - try { - var match, count, index = 0; - while (true) { - top.terminators.lastIndex = index; - match = top.terminators.exec(value); - if (!match) - break; - count = processLexeme(value.substring(index, match.index), match[0]); - index = match.index + count; - } - processLexeme(value.substr(index)); - for(current = top; current.parent; current = current.parent) { // close dangling modes - if (current.className) { - result += spanEndTag; - } - } - return { - relevance: relevance, - value: result, - language: name, - top: top - }; - } catch (e) { - if (e.message && e.message.indexOf('Illegal') !== -1) { - return { - relevance: 0, - value: escape(value) - }; - } else { - throw e; - } - } - } - - /* - Highlighting with language detection. Accepts a string with the code to - highlight. Returns an object with the following properties: - - - language (detected language) - - relevance (int) - - value (an HTML string with highlighting markup) - - second_best (object with the same structure for second-best heuristically - detected language, may be absent) - - */ - function highlightAuto(text, languageSubset) { - languageSubset = languageSubset || options.languages || objectKeys(languages); - var result = { - relevance: 0, - value: escape(text) - }; - var second_best = result; - languageSubset.filter(getLanguage).filter(autoDetection).forEach(function(name) { - var current = highlight(name, text, false); - current.language = name; - if (current.relevance > second_best.relevance) { - second_best = current; - } - if (current.relevance > result.relevance) { - second_best = result; - result = current; - } - }); - if (second_best.language) { - result.second_best = second_best; - } - return result; - } - - /* - Post-processing of the highlighted markup: - - - replace TABs with something more useful - - replace real line-breaks with '
' for non-pre containers - - */ - function fixMarkup(value) { - return !(options.tabReplace || options.useBR) - ? value - : value.replace(fixMarkupRe, function(match, p1) { - if (options.useBR && match === '\n') { - return '
'; - } else if (options.tabReplace) { - return p1.replace(/\t/g, options.tabReplace); - } - return ''; - }); - } - - function buildClassName(prevClassName, currentLang, resultLang) { - var language = currentLang ? aliases[currentLang] : resultLang, - result = [prevClassName.trim()]; - - if (!prevClassName.match(/\bhljs\b/)) { - result.push('hljs'); - } - - if (prevClassName.indexOf(language) === -1) { - result.push(language); - } - - return result.join(' ').trim(); - } - - /* - Applies highlighting to a DOM node containing code. Accepts a DOM node and - two optional parameters for fixMarkup. - */ - function highlightBlock(block) { - var node, originalStream, result, resultNode, text; - var language = blockLanguage(block); - - if (isNotHighlighted(language)) - return; - - if (options.useBR) { - node = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); - node.innerHTML = block.innerHTML.replace(/\n/g, '').replace(//g, '\n'); - } else { - node = block; - } - text = node.textContent; - result = language ? highlight(language, text, true) : highlightAuto(text); - - originalStream = nodeStream(node); - if (originalStream.length) { - resultNode = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); - resultNode.innerHTML = result.value; - result.value = mergeStreams(originalStream, nodeStream(resultNode), text); - } - result.value = fixMarkup(result.value); - - block.innerHTML = result.value; - block.className = buildClassName(block.className, language, result.language); - block.result = { - language: result.language, - re: result.relevance - }; - if (result.second_best) { - block.second_best = { - language: result.second_best.language, - re: result.second_best.relevance - }; - } - } - - /* - Updates highlight.js global options with values passed in the form of an object. - */ - function configure(user_options) { - options = inherit(options, user_options); - } - - /* - Applies highlighting to all
..
blocks on a page. - */ - function initHighlighting() { - if (initHighlighting.called) - return; - initHighlighting.called = true; - - var blocks = document.querySelectorAll('pre code'); - ArrayProto.forEach.call(blocks, highlightBlock); - } - - /* - Attaches highlighting to the page load event. - */ - function initHighlightingOnLoad() { - addEventListener('DOMContentLoaded', initHighlighting, false); - addEventListener('load', initHighlighting, false); - } - - function registerLanguage(name, language) { - var lang = languages[name] = language(hljs); - restoreLanguageApi(lang); - if (lang.aliases) { - lang.aliases.forEach(function(alias) {aliases[alias] = name;}); - } - } - - function listLanguages() { - return objectKeys(languages); - } - - function getLanguage(name) { - name = (name || '').toLowerCase(); - return languages[name] || languages[aliases[name]]; - } - - function autoDetection(name) { - var lang = getLanguage(name); - return lang && !lang.disableAutodetect; - } - - /* Interface definition */ - - hljs.highlight = highlight; - hljs.highlightAuto = highlightAuto; - hljs.fixMarkup = fixMarkup; - hljs.highlightBlock = highlightBlock; - hljs.configure = configure; - hljs.initHighlighting = initHighlighting; - hljs.initHighlightingOnLoad = initHighlightingOnLoad; - hljs.registerLanguage = registerLanguage; - hljs.listLanguages = listLanguages; - hljs.getLanguage = getLanguage; - hljs.autoDetection = autoDetection; - hljs.inherit = inherit; - - // Common regexps - hljs.IDENT_RE = '[a-zA-Z]\\w*'; - hljs.UNDERSCORE_IDENT_RE = '[a-zA-Z_]\\w*'; - hljs.NUMBER_RE = '\\b\\d+(\\.\\d+)?'; - hljs.C_NUMBER_RE = '(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)'; // 0x..., 0..., decimal, float - hljs.BINARY_NUMBER_RE = '\\b(0b[01]+)'; // 0b... - hljs.RE_STARTERS_RE = '!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~'; - - // Common modes - hljs.BACKSLASH_ESCAPE = { - begin: '\\\\[\\s\\S]', relevance: 0 - }; - hljs.APOS_STRING_MODE = { - className: 'string', - begin: '\'', end: '\'', - illegal: '\\n', - contains: [hljs.BACKSLASH_ESCAPE] - }; - hljs.QUOTE_STRING_MODE = { - className: 'string', - begin: '"', end: '"', - illegal: '\\n', - contains: [hljs.BACKSLASH_ESCAPE] - }; - hljs.PHRASAL_WORDS_MODE = { - begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ - }; - hljs.COMMENT = function (begin, end, inherits) { - var mode = hljs.inherit( - { - className: 'comment', - begin: begin, end: end, - contains: [] - }, - inherits || {} - ); - mode.contains.push(hljs.PHRASAL_WORDS_MODE); - mode.contains.push({ - className: 'doctag', - begin: '(?:TODO|FIXME|NOTE|BUG|XXX):', - relevance: 0 - }); - return mode; - }; - hljs.C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$'); - hljs.C_BLOCK_COMMENT_MODE = hljs.COMMENT('/\\*', '\\*/'); - hljs.HASH_COMMENT_MODE = hljs.COMMENT('#', '$'); - hljs.NUMBER_MODE = { - className: 'number', - begin: hljs.NUMBER_RE, - relevance: 0 - }; - hljs.C_NUMBER_MODE = { - className: 'number', - begin: hljs.C_NUMBER_RE, - relevance: 0 - }; - hljs.BINARY_NUMBER_MODE = { - className: 'number', - begin: hljs.BINARY_NUMBER_RE, - relevance: 0 - }; - hljs.CSS_NUMBER_MODE = { - className: 'number', - begin: hljs.NUMBER_RE + '(' + - '%|em|ex|ch|rem' + - '|vw|vh|vmin|vmax' + - '|cm|mm|in|pt|pc|px' + - '|deg|grad|rad|turn' + - '|s|ms' + - '|Hz|kHz' + - '|dpi|dpcm|dppx' + - ')?', - relevance: 0 - }; - hljs.REGEXP_MODE = { - className: 'regexp', - begin: /\//, end: /\/[gimuy]*/, - illegal: /\n/, - contains: [ - hljs.BACKSLASH_ESCAPE, - { - begin: /\[/, end: /\]/, - relevance: 0, - contains: [hljs.BACKSLASH_ESCAPE] - } - ] - }; - hljs.TITLE_MODE = { - className: 'title', - begin: hljs.IDENT_RE, - relevance: 0 - }; - hljs.UNDERSCORE_TITLE_MODE = { - className: 'title', - begin: hljs.UNDERSCORE_IDENT_RE, - relevance: 0 - }; - hljs.METHOD_GUARD = { - // excludes method names from keyword processing - begin: '\\.\\s*' + hljs.UNDERSCORE_IDENT_RE, - relevance: 0 - }; - - return hljs; -})); - /*! * VERSION: 2.1.2 * DATE: 2019-03-01 diff --git a/dist/iwmlib.3rdparty.preload.min.js b/dist/iwmlib.3rdparty.preload.min.js index 45a8733..9fa7ab3 100644 --- a/dist/iwmlib.3rdparty.preload.min.js +++ b/dist/iwmlib.3rdparty.preload.min.js @@ -1 +1 @@ -!function(e){var t="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):t&&(t.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return t.hljs}))}(function(r){var i,h=[],l=Object.keys,v={},o={},t=/^(no-?highlight|plain|text)$/i,u=/\blang(?:uage)?-([\w-]+)\b/i,n=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,y="
",T={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function w(e){return e.replace(/&/g,"&").replace(//g,">")}function c(e){return e.nodeName.toLowerCase()}function b(e,t){var i=e&&e.exec(t);return i&&0===i.index}function _(e){return t.test(e)}function f(e){var t,i={},n=Array.prototype.slice.call(arguments,1);for(t in e)i[t]=e[t];return n.forEach(function(e){for(t in e)i[t]=e[t]}),i}function p(e){var r=[];return function e(t,i){for(var n=t.firstChild;n;n=n.nextSibling)3===n.nodeType?i+=n.nodeValue.length:1===n.nodeType&&(r.push({event:"start",offset:i,node:n}),i=e(n,i),c(n).match(/br|hr|img|input/)||r.push({event:"stop",offset:i,node:n}));return i}(e,0),r}function s(e){if(i&&!e.langApiRestored){for(var t in e.langApiRestored=!0,i)e[t]&&(e[i[t]]=e[t]);(e.contains||[]).concat(e.variants||[]).forEach(s)}}function P(a){function u(e){return e&&e.source||e}function o(e,t){return new RegExp(u(e),"m"+(a.case_insensitive?"i":"")+(t?"g":""))}!function t(i,e){if(!i.compiled){if(i.compiled=!0,i.keywords=i.keywords||i.beginKeywords,i.keywords){var n={},r=function(i,e){a.case_insensitive&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var t=e.split("|");n[t[0]]=[i,t[1]?Number(t[1]):1]})};"string"==typeof i.keywords?r("keyword",i.keywords):l(i.keywords).forEach(function(e){r(e,i.keywords[e])}),i.keywords=n}i.lexemesRe=o(i.lexemes||/\w+/,!0),e&&(i.beginKeywords&&(i.begin="\\b("+i.beginKeywords.split(" ").join("|")+")\\b"),i.begin||(i.begin=/\B|\b/),i.beginRe=o(i.begin),i.endSameAsBegin&&(i.end=i.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(i.endRe=o(i.end)),i.terminator_end=u(i.end)||"",i.endsWithParent&&e.terminator_end&&(i.terminator_end+=(i.end?"|":"")+e.terminator_end)),i.illegal&&(i.illegalRe=o(i.illegal)),null==i.relevance&&(i.relevance=1),i.contains||(i.contains=[]),i.contains=Array.prototype.concat.apply([],i.contains.map(function(e){return function(t){return t.variants&&!t.cached_variants&&(t.cached_variants=t.variants.map(function(e){return f(t,{variants:null},e)})),t.cached_variants||t.endsWithParent&&[f(t)]||[t]}("self"===e?i:e)})),i.contains.forEach(function(e){t(e,i)}),i.starts&&t(i.starts,e);var s=i.contains.map(function(e){return e.beginKeywords?"\\.?(?:"+e.begin+")\\.?":e.begin}).concat([i.terminator_end,i.illegal]).map(u).filter(Boolean);i.terminators=s.length?o(function(e,t){for(var i=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,n=0,r="",s=0;s')+t+(i?"":y)}function a(){c+=null!=_.subLanguage?function(){var e="string"==typeof _.subLanguage;if(e&&!v[_.subLanguage])return w(f);var t=e?E(_.subLanguage,f,!0,h[_.subLanguage]):S(f,_.subLanguage.length?_.subLanguage:void 0);return 0<_.relevance&&(p+=t.relevance),e&&(h[_.subLanguage]=t.top),o(t.language,t.value,!1,!0)}():function(){var e,t,i,n,r,s,a;if(!_.keywords)return w(f);for(n="",t=0,_.lexemesRe.lastIndex=0,i=_.lexemesRe.exec(f);i;)n+=w(f.substring(t,i.index)),r=_,s=i,a=u.case_insensitive?s[0].toLowerCase():s[0],(e=r.keywords.hasOwnProperty(a)&&r.keywords[a])?(p+=e[1],n+=o(e[0],w(i[0]))):n+=w(i[0]),t=_.lexemesRe.lastIndex,i=_.lexemesRe.exec(f);return n+w(f.substr(t))}(),f=""}function l(e){c+=e.className?o(e.className,"",!0):"",_=Object.create(e,{parent:{value:_}})}function n(e,t){if(f+=e,null==t)return a(),0;var i=function(e,t){var i,n,r;for(i=0,n=t.contains.length;i")+'"');return f+=t,t.length||1}var u=R(e);if(!u)throw new Error('Unknown language: "'+e+'"');P(u);var r,_=i||u,h={},c="";for(r=_;r!==u;r=r.parent)r.className&&(c=o(r.className,"",!0)+c);var f="",p=0;try{for(var m,d,g=0;_.terminators.lastIndex=g,m=_.terminators.exec(t);)d=n(t.substring(g,m.index),m[0]),g=m.index+d;for(n(t.substr(g)),r=_;r.parent;r=r.parent)r.className&&(c+=y);return{relevance:p,value:c,language:e,top:_}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{relevance:0,value:w(t)};throw e}}function S(i,e){e=e||T.languages||l(v);var n={relevance:0,value:w(i)},r=n;return e.filter(R).filter(g).forEach(function(e){var t=E(e,i,!1);t.language=e,t.relevance>r.relevance&&(r=t),t.relevance>n.relevance&&(r=n,n=t)}),r.language&&(n.second_best=r),n}function m(e){return T.tabReplace||T.useBR?e.replace(n,function(e,t){return T.useBR&&"\n"===e?"
":T.tabReplace?t.replace(/\t/g,T.tabReplace):""}):e}function a(e){var t,i,n,r,s,a=function(e){var t,i,n,r,s=e.className+" ";if(s+=e.parentNode?e.parentNode.className:"",i=u.exec(s))return R(i[1])?i[1]:"no-highlight";for(t=0,n=(s=s.split(/\s+/)).length;t/g,"\n"):t=e,s=t.textContent,n=a?E(a,s,!0):S(s),(i=p(t)).length&&((r=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=n.value,n.value=function(e,t,i){var n=0,r="",s=[];function a(){return e.length&&t.length?e[0].offset!==t[0].offset?e[0].offset"}function l(e){r+=""}function u(e){("start"===e.event?o:l)(e.node)}for(;e.length||t.length;){var _=a();if(r+=w(i.substring(n,_[0].offset)),n=_[0].offset,_===e){for(s.reverse().forEach(l);u(_.splice(0,1)[0]),(_=a())===e&&_.length&&_[0].offset===n;);s.reverse().forEach(o)}else"start"===_[0].event?s.push(_[0].node):s.pop(),u(_.splice(0,1)[0])}return r+w(i.substr(n))}(i,p(r),s)),n.value=m(n.value),e.innerHTML=n.value,e.className=function(e,t,i){var n=t?o[t]:i,r=[e.trim()];return e.match(/\bhljs\b/)||r.push("hljs"),-1===e.indexOf(n)&&r.push(n),r.join(" ").trim()}(e.className,a,n.language),e.result={language:n.language,re:n.relevance},n.second_best&&(e.second_best={language:n.second_best.language,re:n.second_best.relevance}))}function d(){if(!d.called){d.called=!0;var e=document.querySelectorAll("pre code");h.forEach.call(e,a)}}function R(e){return e=(e||"").toLowerCase(),v[e]||v[o[e]]}function g(e){var t=R(e);return t&&!t.disableAutodetect}return r.highlight=E,r.highlightAuto=S,r.fixMarkup=m,r.highlightBlock=a,r.configure=function(e){T=f(T,e)},r.initHighlighting=d,r.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",d,!1),addEventListener("load",d,!1)},r.registerLanguage=function(t,e){var i=v[t]=e(r);s(i),i.aliases&&i.aliases.forEach(function(e){o[e]=t})},r.listLanguages=function(){return l(v)},r.getLanguage=R,r.autoDetection=g,r.inherit=f,r.IDENT_RE="[a-zA-Z]\\w*",r.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",r.NUMBER_RE="\\b\\d+(\\.\\d+)?",r.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",r.BINARY_NUMBER_RE="\\b(0b[01]+)",r.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",r.BACKSLASH_ESCAPE={begin:"\\\\[\\s\\S]",relevance:0},r.APOS_STRING_MODE={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},r.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[r.BACKSLASH_ESCAPE]},r.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},r.COMMENT=function(e,t,i){var n=r.inherit({className:"comment",begin:e,end:t,contains:[]},i||{});return n.contains.push(r.PHRASAL_WORDS_MODE),n.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|XXX):",relevance:0}),n},r.C_LINE_COMMENT_MODE=r.COMMENT("//","$"),r.C_BLOCK_COMMENT_MODE=r.COMMENT("/\\*","\\*/"),r.HASH_COMMENT_MODE=r.COMMENT("#","$"),r.NUMBER_MODE={className:"number",begin:r.NUMBER_RE,relevance:0},r.C_NUMBER_MODE={className:"number",begin:r.C_NUMBER_RE,relevance:0},r.BINARY_NUMBER_MODE={className:"number",begin:r.BINARY_NUMBER_RE,relevance:0},r.CSS_NUMBER_MODE={className:"number",begin:r.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},r.REGEXP_MODE={className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[r.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[r.BACKSLASH_ESCAPE]}]},r.TITLE_MODE={className:"title",begin:r.IDENT_RE,relevance:0},r.UNDERSCORE_TITLE_MODE={className:"title",begin:r.UNDERSCORE_IDENT_RE,relevance:0},r.METHOD_GUARD={begin:"\\.\\s*"+r.UNDERSCORE_IDENT_RE,relevance:0},r}),function(c,f){"use strict";var p={},n=c.document,m=c.GreenSockGlobals=c.GreenSockGlobals||c,e=m[f];if(e)return"undefined"!=typeof module&&module.exports&&(module.exports=e);var t,i,r,d,g,s,a,v=function(e){var t,i=e.split("."),n=m;for(t=0;t=i&&ethis._duration?this._duration:e,t)):this._time},r.totalTime=function(e,t,i){if(g||d.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(e<0&&!i&&(e+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var n=this._totalDuration,r=this._timeline;if(ns;)r=r._prev;return r?(e._next=r._next,r._next=e):(e._next=this._first,this._first=e),e._next?e._next._prev=e:this._last=e,e._prev=r,this._recent=e,this._timeline&&this._uncache(!0),this},r._remove=function(e,t){return e.timeline===this&&(t||e._enabled(!1,!0),e._prev?e._prev._next=e._next:this._first===e&&(this._first=e._next),e._next?e._next._prev=e._prev:this._last===e&&(this._last=e._prev),e._next=e._prev=e.timeline=null,e===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},r.render=function(e,t,i){var n,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=e;r;)n=r._next,(r._active||e>=r._startTime&&!r._paused&&!r._gc)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(e-r._startTime)*r._timeScale,t,i):r.render((e-r._startTime)*r._timeScale,t,i)),r=n},r.rawTime=function(){return g||d.wake(),this._totalTime};var I=E("TweenLite",function(e,t,i){if(O.call(this,t,i),this.render=I.prototype.render,null==e)throw"Cannot tween a null target.";this.target=e="string"!=typeof e?e:I.selector(e)||e;var n,r,s,a=e.jquery||e.length&&e!==c&&e[0]&&(e[0]===c||e[0].nodeType&&e[0].style&&!e.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?Y[I.defaultOverwrite]:"number"==typeof o?o>>0:Y[o],(a||e instanceof Array||e.push&&w(e))&&"number"!=typeof e[0])for(this._targets=s=l(e),this._propLookup=[],this._siblings=[],n=0;n=J){for(i in J=d.frame+(parseInt(I.autoSleep,10)||120),Q){for(e=(t=Q[i].tweens).length;-1<--e;)t[e]._gc&&t.splice(e,1);0===t.length&&delete Q[i]}if((!(i=V._first)||i._paused)&&I.autoSleep&&!Z._first&&1===d._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||d.sleep()}}},d.addEventListener("tick",O._updateRoot);var te=function(e,t,i){var n,r,s=e._gsTweenID;if(Q[s||(e._gsTweenID=s="t"+X++)]||(Q[s]={target:e,tweens:[]}),t&&((n=Q[s].tweens)[r=n.length]=t,i))for(;-1<--r;)n[r]===t&&n.splice(r,1);return Q[s].tweens},ie=function(e,t,i,n){var r,s,a=e.vars.onOverwrite;return a&&(r=a(e,t,i,n)),(a=I.onOverwrite)&&(s=a(e,t,i,n)),!1!==r&&!1!==s},ne=function(e,t,i,n,r){var s,a,o,l;if(1===n||4<=n){for(l=r.length,s=0;s_&&((f||!o._initted)&&_-o._startTime<=2e-8||(h[c++]=o)));for(s=c;-1<--s;)if(l=(o=h[s])._firstPT,2===n&&o._kill(i,e,t)&&(a=!0),2!==n||!o._firstPT&&o._initted&&l){if(2!==n&&!ie(o,t))continue;o._enabled(!1,!1)&&(a=!0)}return a},re=function(e,t,i){for(var n=e._timeline,r=n._timeScale,s=e._startTime;n._timeline;){if(s+=n._startTime,r*=n._timeScale,n._paused)return-100;n=n._timeline}return t<(s/=r)?s-t:i&&s===t||!e._initted&&s-t<2e-8?y:(s+=e.totalDuration()/e._timeScale/r)>t+y?0:s-t-y};r._init=function(){var e,t,i,n,r,s,a=this.vars,o=this._overwrittenProps,l=this._duration,u=!!a.immediateRender,_=a.ease,h=this._startAt;if(a.startAt){for(n in h&&(h.render(-1,!0),h.kill()),r={},a.startAt)r[n]=a.startAt[n];if(r.data="isStart",r.overwrite=!1,r.immediateRender=!0,r.lazy=u&&!1!==a.lazy,r.startAt=r.delay=null,r.onUpdate=a.onUpdate,r.onUpdateParams=a.onUpdateParams,r.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=I.to(this.target||{},0,r),u)if(0o.pr;)n=n._next;(o._prev=n?n._prev:s)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:s=o,o=a}o=t._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[e]&&o.t[e]()&&(i=!0),o=o._next;return i},se.activate=function(e){for(var t=e.length;-1<--t;)e[t].API===se.API&&(q[(new e[t])._propName]=e[t]);return!0},o.plugin=function(e){if(!(e&&e.propName&&e.init&&e.API))throw"illegal plugin definition.";var t,i=e.propName,n=e.priority||0,r=e.overwriteProps,s={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=E("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){se.call(this,i,n),this._overwriteProps=r||[]},!0===e.global),o=a.prototype=new se(i);for(t in(o.constructor=a).API=e.API,s)"function"==typeof e[t]&&(o[s[t]]=e[t]);return a.version=e.version,se.activate([a]),a},t=c._gsQueue){for(i=0;i=i&&tthis._duration?this._duration:t,e)):this._time},r.totalTime=function(t,e,i){if(v||d.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var n=this._totalDuration,r=this._timeline;if(ns;)r=r._prev;return r?(t._next=r._next,r._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=r,this._recent=t,this._timeline&&this._uncache(!0),this},r._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},r.render=function(t,e,i){var n,r=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;r;)n=r._next,(r._active||t>=r._startTime&&!r._paused&&!r._gc)&&(r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=n},r.rawTime=function(){return v||d.wake(),this._totalTime};var F=S("TweenLite",function(t,e,i){if(I.call(this,e,i),this.render=F.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:F.selector(t)||t;var n,r,s,a=t.jquery||t.length&&t!==f&&t[0]&&(t[0]===f||t[0].nodeType&&t[0].style&&!t.nodeType),o=this.vars.overwrite;if(this._overwrite=o=null==o?Y[F.defaultOverwrite]:"number"==typeof o?o>>0:Y[o],(a||t instanceof Array||t.push&&w(t))&&"number"!=typeof t[0])for(this._targets=s=l(t),this._propLookup=[],this._siblings=[],n=0;n=Z){for(i in Z=d.frame+(parseInt(F.autoSleep,10)||120),$){for(t=(e=$[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete $[i]}if((!(i=V._first)||i._paused)&&F.autoSleep&&!J._first&&1===d._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||d.sleep()}}},d.addEventListener("tick",I._updateRoot);var et=function(t,e,i){var n,r,s=t._gsTweenID;if($[s||(t._gsTweenID=s="t"+H++)]||($[s]={target:t,tweens:[]}),e&&((n=$[s].tweens)[r=n.length]=e,i))for(;-1<--r;)n[r]===e&&n.splice(r,1);return $[s].tweens},it=function(t,e,i,n){var r,s,a=t.vars.onOverwrite;return a&&(r=a(t,e,i,n)),(a=F.onOverwrite)&&(s=a(t,e,i,n)),!1!==r&&!1!==s},nt=function(t,e,i,n,r){var s,a,o,l;if(1===n||4<=n){for(l=r.length,s=0;sh&&((c||!o._initted)&&h-o._startTime<=2*T||(u[f++]=o)));for(s=f;-1<--s;)if(l=(o=u[s])._firstPT,2===n&&o._kill(i,t,e)&&(a=!0),2!==n||!o._firstPT&&o._initted&&l){if(2!==n&&!it(o,e))continue;o._enabled(!1,!1)&&(a=!0)}return a},rt=function(t,e,i){for(var n=t._timeline,r=n._timeScale,s=t._startTime;n._timeline;){if(s+=n._startTime,r*=n._timeScale,n._paused)return-100;n=n._timeline}return e<(s/=r)?s-e:i&&s===e||!t._initted&&s-e<2*T?T:(s+=t.totalDuration()/t._timeScale/r)>e+T?0:s-e-T};r._init=function(){var t,e,i,n,r,s,a=this.vars,o=this._overwrittenProps,l=this._duration,_=!!a.immediateRender,h=a.ease,u=this._startAt;if(a.startAt){for(n in u&&(u.render(-1,!0),u.kill()),r={},a.startAt)r[n]=a.startAt[n];if(r.data="isStart",r.overwrite=!1,r.immediateRender=!0,r.lazy=_&&!1!==a.lazy,r.startAt=r.delay=null,r.onUpdate=a.onUpdate,r.onUpdateParams=a.onUpdateParams,r.onUpdateScope=a.onUpdateScope||a.callbackScope||this,this._startAt=F.to(this.target||{},0,r),_)if(0o.pr;)n=n._next;(o._prev=n?n._prev:s)?o._prev._next=o:r=o,(o._next=n)?n._prev=o:s=o,o=a}o=e._firstPT=r}for(;o;)o.pg&&"function"==typeof o.t[t]&&o.t[t]()&&(i=!0),o=o._next;return i},st.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===st.API&&(W[(new t[e])._propName]=t[e]);return!0},o.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,n=t.priority||0,r=t.overwriteProps,s={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_mod",mod:"_mod",initAll:"_onInitAllProps"},a=S("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){st.call(this,i,n),this._overwriteProps=r||[]},!0===t.global),o=a.prototype=new st(i);for(e in(o.constructor=a).API=t.API,s)"function"==typeof t[e]&&(o[s[e]]=t[e]);return a.version=t.version,st.activate([a]),a},e=f._gsQueue){for(i=0;i 1 && this.autoScroll) { setTimeout(() => this.keepInBounds(delta, anchor), 1000 / 100); @@ -12410,6 +12411,691 @@ } } + /** + * pixi.js scrollbox: a masked content box that can scroll vertically or horizontally with scrollbars + */ + class Scrollbox extends PIXI.Container { + /** + * create a scrollbox + * @param {object} options + * @param {boolean} [options.dragScroll=true] user may drag the content area to scroll content + * @param {string} [options.overflowX=auto] (none, scroll, hidden, auto) this changes whether the scrollbar is shown + * @param {string} [options.overflowY=auto] (none, scroll, hidden, auto) this changes whether the scrollbar is shown + * @param {string} [options.overflow] (none, scroll, hidden, auto) sets overflowX and overflowY to this value + * @param {number} [options.boxWidth=100] width of scrollbox including scrollbar (in pixels) + * @param {number} [options.boxHeight=100] height of scrollbox including scrollbar (in pixels) + * @param {number} [options.scrollbarSize=10] size of scrollbar (in pixels) + * @param {number} [options.scrollbarOffsetHorizontal=0] offset of horizontal scrollbar (in pixels) + * @param {number} [options.scrollbarOffsetVertical=0] offset of vertical scrollbar (in pixels) + * @param {boolean} [options.stopPropagation=true] call stopPropagation on any events that impact scrollbox + * @param {number} [options.scrollbarBackground=0xdddddd] background color of scrollbar + * @param {number} [options.scrollbarBackgroundAlpha=1] alpha of background of scrollbar + * @param {number} [options.scrollbarForeground=0x888888] foreground color of scrollbar + * @param {number} [options.scrollbarForegroundAlpha=1] alpha of foreground of scrollbar + * @param {string} [options.underflow=top-left] what to do when content underflows the scrollbox size: none: do nothing; (left/right/center AND top/bottom/center); OR center (e.g., 'top-left', 'center', 'none', 'bottomright') + * @param {(boolean|number)} [options.fade] fade the scrollbar when not in use (true = 1000ms) + * @param {number} [options.fadeWait=3000] time to wait before fading the scrollbar if options.fade is set + * @param {(string|function)} [options.fadeEase=easeInOutSine] easing function to use for fading + */ + constructor(options) + { + super(); + this.options = Object.assign({}, { + "boxWidth": 100, + "boxHeight": 100, + "scrollbarSize": 10, + "scrollbarBackground": 14540253, + "scrollbarBackgroundAlpha": 1, + "scrollbarForeground": 8947848, + "scrollbarForegroundAlpha": 1, + "dragScroll": true, + "stopPropagation": true, + "scrollbarOffsetHorizontal": 0, + "scrollbarOffsetVertical": 0, + "underflow": "top-left", + "fadeScrollbar": false, + "fadeWait": 3000, + "fadeEase": "easeInOutSine" + }, options); + this.ease = new PIXI.extras.Ease.list(); + + /** + * content in placed in here + * you can use any function from pixi-viewport on content to manually move the content (see https://davidfig.github.io/pixi-viewport/jsdoc/) + * @type {PIXI.extras.Viewport} + */ + this.content = this.addChild(new PIXI.extras.Viewport({ passiveWheel: this.options.stopPropagation, stopPropagation: this.options.stopPropagation, screenWidth: this.options.boxWidth, screenHeight: this.options.boxHeight })); + this.content + .decelerate() + .on('moved', () => this._drawScrollbars()); + + /** + * graphics element for drawing the scrollbars + * @type {PIXI.Graphics} + */ + this.scrollbar = this.addChild(new PIXI.Graphics()); + this.scrollbar.interactive = true; + this.scrollbar.on('pointerdown', this.scrollbarDown, this); + this.interactive = true; + this.on('pointermove', this.scrollbarMove, this); + this.on('pointerup', this.scrollbarUp, this); + this.on('pointercancel', this.scrollbarUp, this); + this.on('pointerupoutside', this.scrollbarUp, this); + this._maskContent = this.addChild(new PIXI.Graphics()); + this.update(); + } + + /** + * offset of horizontal scrollbar (in pixels) + * @type {number} + */ + get scrollbarOffsetHorizontal() + { + return this.options.scrollbarOffsetHorizontal + } + set scrollbarOffsetHorizontal(value) + { + this.options.scrollbarOffsetHorizontal = value; + } + + /** + * offset of vertical scrollbar (in pixels) + * @type {number} + */ + get scrollbarOffsetVertical() + { + return this.options.scrollbarOffsetVertical + } + set scrollbarOffsetVertical(value) + { + this.options.scrollbarOffsetVertical = value; + } + + /** + * disable the scrollbox (if set to true this will also remove the mask) + * @type {boolean} + */ + get disable() + { + return this._disabled + } + set disable(value) + { + if (this._disabled !== value) + { + this._disabled = value; + this.update(); + } + } + + /** + * call stopPropagation on any events that impact scrollbox + * @type {boolean} + */ + get stopPropagation() + { + return this.options.stopPropagation + } + set stopPropagation(value) + { + this.options.stopPropagation = value; + } + + /** + * user may drag the content area to scroll content + * @type {boolean} + */ + get dragScroll() + { + return this.options.dragScroll + } + set dragScroll(value) + { + this.options.dragScroll = value; + if (value) + { + this.content.drag(); + } + else + { + this.content.removePlugin('drag'); + } + this.update(); + } + + /** + * width of scrollbox including the scrollbar (if visible)- this changes the size and not the scale of the box + * @type {number} + */ + get boxWidth() + { + return this.options.boxWidth + } + set boxWidth(value) + { + this.options.boxWidth = value; + this.content.screenWidth = value; + this.update(); + } + + /** + * sets overflowX and overflowY to (scroll, hidden, auto) changing whether the scrollbar is shown + * scroll = always show scrollbar + * hidden = hide overflow and do not show scrollbar + * auto = if content is larger than box size, then show scrollbar + * @type {string} + */ + get overflow() + { + return this.options.overflow + } + set overflow(value) + { + this.options.overflow = value; + this.options.overflowX = value; + this.options.overflowY = value; + this.update(); + } + + /** + * sets overflowX to (scroll, hidden, auto) changing whether the scrollbar is shown + * scroll = always show scrollbar + * hidden = hide overflow and do not show scrollbar + * auto = if content is larger than box size, then show scrollbar + * @type {string} + */ + get overflowX() + { + return this.options.overflowX + } + set overflowX(value) + { + this.options.overflowX = value; + this.update(); + } + + /** + * sets overflowY to (scroll, hidden, auto) changing whether the scrollbar is shown + * scroll = always show scrollbar + * hidden = hide overflow and do not show scrollbar + * auto = if content is larger than box size, then show scrollbar + * @type {string} + */ + get overflowY() + { + return this.options.overflowY + } + set overflowY(value) + { + this.options.overflowY = value; + this.update(); + } + + /** + * height of scrollbox including the scrollbar (if visible) - this changes the size and not the scale of the box + * @type {number} + */ + get boxHeight() + { + return this.options.boxHeight + } + set boxHeight(value) + { + this.options.boxHeight = value; + this.content.screenHeight = value; + this.update(); + } + + /** + * scrollbar size in pixels + * @type {number} + */ + get scrollbarSize() + { + return this.options.scrollbarSize + } + set scrollbarSize(value) + { + this.options.scrollbarSize = value; + } + + /** + * width of scrollbox less the scrollbar (if visible) + * @type {number} + * @readonly + */ + get contentWidth() + { + return this.options.boxWidth - (this.isScrollbarVertical ? this.options.scrollbarSize : 0) + } + + /** + * height of scrollbox less the scrollbar (if visible) + * @type {number} + * @readonly + */ + get contentHeight() + { + return this.options.boxHeight - (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0) + } + + /** + * is the vertical scrollbar visible + * @type {boolean} + * @readonly + */ + get isScrollbarVertical() + { + return this._isScrollbarVertical + } + + /** + * is the horizontal scrollbar visible + * @type {boolean} + * @readonly + */ + get isScrollbarHorizontal() + { + return this._isScrollbarHorizontal + } + + /** + * top coordinate of scrollbar + */ + get scrollTop() + { + return this.content.top + } + + /** + * left coordinate of scrollbar + */ + get scrollLeft() + { + return this.content.left + } + + /** + * width of content area + * if not set then it uses content.width to calculate width + */ + get scrollWidth() + { + return this._scrollWidth || this.content.width + } + set scrollWidth(value) + { + this._scrollWidth = value; + } + + /** + * height of content area + * if not set then it uses content.height to calculate height + */ + get scrollHeight() + { + return this._scrollHeight || this.content.height + } + set scrollHeight(value) + { + this._scrollHeight = value; + } + + /** + * draws scrollbars + * @private + */ + _drawScrollbars() + { + this._isScrollbarHorizontal = this.overflowX === 'scroll' ? true : ['hidden', 'none'].indexOf(this.overflowX) !== -1 ? false : this.scrollWidth > this.options.boxWidth; + this._isScrollbarVertical = this.overflowY === 'scroll' ? true : ['hidden', 'none'].indexOf(this.overflowY) !== -1 ? false : this.scrollHeight > this.options.boxHeight; + this.scrollbar.clear(); + let options = {}; + options.left = 0; + options.right = this.scrollWidth + (this._isScrollbarVertical ? this.options.scrollbarSize : 0); + options.top = 0; + options.bottom = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0); + const width = this.scrollWidth + (this.isScrollbarVertical ? this.options.scrollbarSize : 0); + const height = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0); + this.scrollbarTop = (this.content.top / height) * this.boxHeight; + this.scrollbarTop = this.scrollbarTop < 0 ? 0 : this.scrollbarTop; + this.scrollbarHeight = (this.boxHeight / height) * this.boxHeight; + this.scrollbarHeight = this.scrollbarTop + this.scrollbarHeight > this.boxHeight ? this.boxHeight - this.scrollbarTop : this.scrollbarHeight; + this.scrollbarLeft = (this.content.left / width) * this.boxWidth; + this.scrollbarLeft = this.scrollbarLeft < 0 ? 0 : this.scrollbarLeft; + this.scrollbarWidth = (this.boxWidth / width) * this.boxWidth; + this.scrollbarWidth = this.scrollbarWidth + this.scrollbarLeft > this.boxWidth ? this.boxWidth - this.scrollbarLeft : this.scrollbarWidth; + if (this.isScrollbarVertical) + { + this.scrollbar + .beginFill(this.options.scrollbarBackground, this.options.scrollbarBackgroundAlpha) + .drawRect(this.boxWidth - this.scrollbarSize + this.options.scrollbarOffsetVertical, 0, this.scrollbarSize, this.boxHeight) + .endFill(); + } + if (this.isScrollbarHorizontal) + { + this.scrollbar + .beginFill(this.options.scrollbarBackground, this.options.scrollbarBackgroundAlpha) + .drawRect(0, this.boxHeight - this.scrollbarSize + this.options.scrollbarOffsetHorizontal, this.boxWidth, this.scrollbarSize) + .endFill(); + } + if (this.isScrollbarVertical) + { + this.scrollbar + .beginFill(this.options.scrollbarForeground, this.options.scrollbarForegroundAlpha) + .drawRect(this.boxWidth - this.scrollbarSize + this.options.scrollbarOffsetVertical, this.scrollbarTop, this.scrollbarSize, this.scrollbarHeight) + .endFill(); + } + if (this.isScrollbarHorizontal) + { + this.scrollbar + .beginFill(this.options.scrollbarForeground, this.options.scrollbarForegroundAlpha) + .drawRect(this.scrollbarLeft, this.boxHeight - this.scrollbarSize + this.options.scrollbarOffsetHorizontal, this.scrollbarWidth, this.scrollbarSize) + .endFill(); + } + // this.content.forceHitArea = new PIXI.Rectangle(0, 0 , this.boxWidth, this.boxHeight) + this.activateFade(); + } + + /** + * draws mask layer + * @private + */ + _drawMask() + { + this._maskContent + .beginFill(0) + .drawRect(0, 0, this.boxWidth, this.boxHeight) + .endFill(); + this.content.mask = this._maskContent; + } + + /** + * call when scrollbox content changes + */ + update() + { + this.content.mask = null; + this._maskContent.clear(); + if (!this._disabled) + { + this._drawScrollbars(); + this._drawMask(); + if (this.options.dragScroll) + { + const direction = this.isScrollbarHorizontal && this.isScrollbarVertical ? 'all' : this.isScrollbarHorizontal ? 'x' : 'y'; + if (direction !== null) + { + this.content + .drag({ clampWheel: true, direction }) + .clamp({ direction, underflow: this.options.underflow }); + } + } + } + } + + /** + * show the scrollbar and restart the timer for fade if options.fade is set + */ + activateFade() + { + if (this.options.fade) + { + if (this.fade) + { + this.ease.remove(this.fade); + } + this.scrollbar.alpha = 1; + const time = this.options.fade === true ? 1000 : this.options.fade; + this.fade = this.ease.to(this.scrollbar, { alpha: 0 }, time, { wait: this.options.fadeWait, ease: this.options.fadeEase }); + this.fade.on('each', () => this.content.dirty = true); + } + } + + /** + * handle pointer down on scrollbar + * @param {PIXI.interaction.InteractionEvent} e + * @private + */ + scrollbarDown(e) + { + const local = this.toLocal(e.data.global); + if (this.isScrollbarHorizontal) + { + if (local.y > this.boxHeight - this.scrollbarSize) + { + if (local.x >= this.scrollbarLeft && local.x <= this.scrollbarLeft + this.scrollbarWidth) + { + this.pointerDown = { type: 'horizontal', last: local }; + } + else + { + if (local.x > this.scrollbarLeft) + { + this.content.left += this.content.worldScreenWidth; + this.update(); + } + else + { + this.content.left -= this.content.worldScreenWidth; + this.update(); + } + } + if (this.options.stopPropagation) + { + e.stopPropagation(); + } + return + } + } + if (this.isScrollbarVertical) + { + if (local.x > this.boxWidth - this.scrollbarSize) + { + if (local.y >= this.scrollbarTop && local.y <= this.scrollbarTop + this.scrollbarWidth) + { + this.pointerDown = { type: 'vertical', last: local }; + } + else + { + if (local.y > this.scrollbarTop) + { + this.content.top += this.content.worldScreenHeight; + this.update(); + } + else + { + this.content.top -= this.content.worldScreenHeight; + this.update(); + } + } + if (this.options.stopPropagation) + { + e.stopPropagation(); + } + return + } + } + } + + /** + * handle pointer move on scrollbar + * @param {PIXI.interaction.InteractionEvent} e + * @private + */ + scrollbarMove(e) + { + if (this.pointerDown) + { + if (this.pointerDown.type === 'horizontal') + { + const local = this.toLocal(e.data.global); + this.content.left += local.x - this.pointerDown.last.x; + this.pointerDown.last = local; + this.update(); + } + else if (this.pointerDown.type === 'vertical') + { + const local = this.toLocal(e.data.global); + this.content.top += local.y - this.pointerDown.last.y; + this.pointerDown.last = local; + this.update(); + } + if (this.options.stopPropagation) + { + e.stopPropagation(); + } + } + } + + /** + * handle pointer down on scrollbar + * @private + */ + scrollbarUp() + { + this.pointerDown = null; + } + + /** + * resize the mask for the container + * @param {object} options + * @param {number} [options.boxWidth] width of scrollbox including scrollbar (in pixels) + * @param {number} [options.boxHeight] height of scrollbox including scrollbar (in pixels) + * @param {number} [options.scrollWidth] set the width of the inside of the scrollbox (leave null to use content.width) + * @param {number} [options.scrollHeight] set the height of the inside of the scrollbox (leave null to use content.height) + */ + resize(options) + { + this.options.boxWidth = typeof options.boxWidth !== 'undefined' ? options.boxWidth : this.options.boxWidth; + this.options.boxHeight = typeof options.boxHeight !== 'undefined' ? options.boxHeight : this.options.boxHeight; + if (options.scrollWidth) + { + this.scrollWidth = options.scrollWidth; + } + if (options.scrollHeight) + { + this.scrollHeight = options.scrollHeight; + } + this.content.resize(this.options.boxWidth, this.options.boxHeight, this.scrollWidth, this.scrollHeight); + this.update(); + } + + /** + * ensure that the bounding box is visible + * @param {number} x - relative to content's coordinate system + * @param {number} y + * @param {number} width + * @param {number} height + */ + ensureVisible(x, y, width, height) + { + this.content.ensureVisible(x, y, width, height); + this._drawScrollbars(); + } + } + + /** + * Callback for the switch action. + * + * @callback actionCallback + * @param {object} event - The event object. + * @param {Switch} switch - A reference to the switch (also this refers to the switch). + */ + + /** + * Callback for the switch action. + * + * @callback actionActiveCallback + * @param {object} event - The event object. + * @param {Switch} switch - A reference to the switch (also this refers to the switch). + */ + + /** + * Callback for the switch beforeAction. + * + * @callback beforeActionCallback + * @param {object} event - The event object. + * @param {Switch} switch - A reference to the switch (also this refers to the switch). + */ + + /** + * Callback for the switch afterAction. + * + * @callback afterActionCallback + * @param {object} event - The event object. + * @param {Switch} switch - A reference to the switch (also this refers to the switch). + */ + + /** + * Class that represents a PixiJS Switch. + * + * @example + * // Create the app + * const app = new PIXIApp({ + * view: canvas, + * width: 900, + * height: 250 + * }).setup().run() + * + * // Create the switch + * const switch1 = new Switch({ + * x: 10, + * y: 20 + * }) + * + * // Add the switch to a DisplayObject + * app.scene.addChild(switch1) + * + * @class + * @extends PIXI.extras.Scrollbox + * @see {@link https://davidfig.github.io/pixi-scrollbox/jsdoc/Scrollbox.html|Scrollbox} + * @see {@link https://davidfig.github.io/pixi-viewport/jsdoc/Viewport.html|Viewport} + */ + class Scrollview extends Scrollbox { + + /** + * Creates an instance of a Switch. + * + * @constructor + */ + constructor(opts = {}) { + + super(opts); + + this.opts = opts; + + // setup + //----------------- + this.setup(); + + // layout + //----------------- + this.layout(); + } + + /** + * Creates children and instantiates everything. + * + * @private + * @return {Scrollview} A reference to the Scrollview for chaining. + */ + setup() { + + return this + } + + /** + * Should be called to refresh the layout of the Scrollview. Can be used after resizing. + * + * @return {Scrollview} A reference to the Scrollview for chaining. + */ + layout() { + + return this + } + } + /** * Callback for the slider action onStart. * @@ -14055,6 +14741,7 @@ window.Theme = Theme; window.Button = Button; window.ButtonGroup = ButtonGroup; + window.Scrollview = Scrollview; window.Slider = Slider; window.Switch = Switch; window.Popup = Popup; diff --git a/gulpfile.js b/gulpfile.js index 57823f9..0f8abeb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,6 @@ function vendors() { './node_modules/optimal-select/dist/optimal-select.js', './node_modules/hammerjs/hammer.js', './node_modules/propagating-hammerjs/propagating.js', - './node_modules/highlight.js/lib/highlight.js', './node_modules/pixi.js/dist/pixi.js', './node_modules/pixi-compressed-textures/lib/crn_decomp.js', './node_modules/pixi-compressed-textures/bin/pixi-compressed-textures.js', @@ -17,7 +16,9 @@ function vendors() { './node_modules/pixi-particles/dist/pixi-particles.js', './node_modules/pixi-projection/dist/pixi-projection.js', './node_modules/gsap/src/uncompressed/TweenLite.js', - './lib/3rdparty/convertPointFromPageToNode.js', + './lib/3rdparty/pixi-ease.js', + './lib/3rdparty/pixi-viewport.js', + './lib/3rdparty/convertPointFromPageToNode.js' ], {sourcemaps: false}) .pipe(concat('iwmlib.3rdparty.js')) .pipe(replace(/^\/\/# sourceMappingURL=.*$/gmi, '')) @@ -29,7 +30,6 @@ function vendors() { function preload() { return src([ - './node_modules/highlight.js/lib/highlight.js', './node_modules/gsap/src/uncompressed/TweenLite.js', './lib/3rdparty/convertPointFromPageToNode.js', ], {sourcemaps: false}) diff --git a/lib/3rdparty/highlight/CHANGES.md b/lib/3rdparty/highlight/CHANGES.md index f4caccb..ca4b82b 100644 --- a/lib/3rdparty/highlight/CHANGES.md +++ b/lib/3rdparty/highlight/CHANGES.md @@ -1,3 +1,317 @@ +## Master + +New languages: + +New styles: + +Improvements: + +## Version 9.15.6 +New languages: + none. +New styles: + none. +Improvements: + - Move dependencies to be devDependencies. + - Fixed security issues in dev dependencies. + +## Version 9.15.5 +New languages: + none. +New styles: + none. +Improvements: + 🔥 Hot fix: updated build tool. + +## Version 9.15.4 +New languages: + none. +New styles: + none. +Improvements: + 🔥 Hot fix: reverted hljs cli build tool, as it was causing issues with install. + +## Version 9.15.3 +New languages: + none. +New styles: + none. +Improvements: + 🔥 Hot fix: reverted hljs cli build tool, as it was causing issues with install. + +## Version 9.15.2 +New languages: + none. +New styles: + none. +Improvements: + 🔥 Hot fix that was preventing highlight.js from installing. + +## Version 9.15.1 + +New languages: + none. + +New styles: + none. + +Improvements: + +- Pony: Fixed keywords without spaces at line ends, highlighting of `iso` in class definitions, and function heads without bodies in traits and interfaces. Removed FUNCTION and CLASS modes until they are found to be needed and to provide some of the fixes. + - Support external language files in minified version of highlight.js (#1888) + +## Version 9.15 + +New languages: + none. + +New styles: + none. + +Improvements: + - new cli tool `hljs` - allows easier [building from command line](docs/building-testing.rst#building-a-bundle-from-the-command-line). + - cpp: Fully support C++11 raw strings. (#1897) + - Python: Treat False None and True as literals (#1920) + +## Version 9.14.2 + +New languages: + none. +New styles: + none. +Improvements: +- *Gauss* fixed to stop global namespace pollution [Scott Hyndman][]. +- fix(Tcl): removed apostrophe string delimiters (don't exist) + +[Scott Hyndman]: https://github.com/shyndman + +## Version 9.14.1 + +New languages: + none. +New styles: + none. +Improvements: +- Pony: language improvements (#1958) + +## Version 9.14.0 + +New languages: + none. +New styles: + none. +Improvements: +- Pony: add missing "object" highlighting (#1932) +- Added *XQuery* built-in functions, prolog declarations, as well as parsing of function bodies, computed and direct constructors, by [Duncan Paterson][] +- fix(dart): Corrects highlighting with string interpolation. (#1946) +- fix(swift): be eager on optional-using types (!/?) (#1919) +- fix(tex): Changed cyrillic to unicode (IE11 throw SCRIPT5021) (#1601) +- fix(JavaScript): Recognize get/set accessor keywords (#1940) +- Fixed Dockerfile definition when using highlight continuation parameter, by [Laurent Voullemier][] +- Added tests & new `annotation` and `verbatim` keywords to *Crystal*, by [Benoit de Chezelles][] +- Added missing dockerfile markup tests, by [Laurent Voullemier][] + Allow empty prompt text in clojure-repl, by [Egor Rogov][] +- Fixed several issues with *Crystal* language definition, by [Johannes Müller][] +- Added `C#` as an alias for *CSharp* language, by [Ahmed Atito][] +- Added generic user-defined proc support, new compiler define, refactor to re-use rules, and add tests to *GAUSS*, by [Matthew Evans][] +- Improve *Crystal* language to highlight regexes after some keywords, by [Tsuyusato Kitsune][] +- Fix filterByQualifiers: fileInfo can be null +- Fixed String interpolation in Dart, by [Scott Hyndman][]. + +[Laurent Voullemier]: https://github.com/l-vo +[Benoit de Chezelles]: https://github.com/bew +[Johannes Müller]: https://github.com/straight-shoota +[Ahmed Atito]: https://github.com/atitoa93 +[Matthew Evans]: https://github.com/matthewevans +[Tsuyusato Kitsune]: https://github.com/MakeNowJust +[Scott Hyndman]: https://github.com/shyndman +[Duncan Paterson]: https://github.com/duncdrum + +## Version 9.13.1 + +Improvements: + +- *C#* function declarations no longer include trailing whitespace, by [JeremyTCD][] +- Added new and missing keywords to *AngelScript*, by [Melissa Geels][] +- *TypeScript* decorator factories highlighting fix, by [Antoine Boisier-Michaud][] +- Added support for multiline strings to *Swift*, by [Alejandro Isaza][] +- Fixed issue that was causing some minifiers to fail. +- Fixed `autoDetection` to accept language aliases. + +[JeremyTCD]: https://github.com/JeremyTCD +[Melissa Geels]: https://github.com/codecat +[Antoine Boisier-Michaud]: https://github.com/Aboisier +[Alejandro Isaza]: https://github.com/alejandro-isaza + +## Version 9.13.0 + +New languages: + +- *ArcGIS Arcade* by [John Foster][] +- *AngelScript* by [Melissa Geels][] +- *GML* by [meseta][] +- *isbl* built-in language DIRECTUM and Conterra by [Dmitriy Tarasov][]. +- *PostgreSQL* SQL dialect and PL/pgSQL language by [Egor Rogov][]. +- *ReasonML* by [Gidi Meir Morris][] +- *SAS* by [Mauricio Caceres Bravo][] +- *Plaintext* by [Egor Rogov][] +- *.properties* by [bostko][] and [Egor Rogov][] + +New styles: + +- *a11y-dark theme* by [Eric Bailey][] +- *a11y-light theme* by [Eric Bailey][] +- *An Old Hope* by [Gustavo Costa][] +- *Atom One Dark Reasonable* by [Gidi Meir Morris][] +- *isbl editor dark* by [Dmitriy Tarasov][] +- *isbl editor light* by [Dmitriy Tarasov][] +- *Lightfair* by [Tristian Kelly][] +- [*Nord*][nord-highlightjs] by [Arctic Ice Studio][] +- *[🦄 Shades of Purple](https://github.com/ahmadawais/Shades-of-Purple-HighlightJS)* by [Ahmad Awais][] + +Improvements: + +- New attribute `endSameAsBegin` for nested constructs with variable names + by [Egor Rogov][]. +- *Python* highlighting of escaped quotes fixed by [Harmon][] +- *PHP*: Added alias for php7, by [Vijaya Chandran Mani][] +- *C++* string handling, by [David Benjamin][] +- *Swift* Add `@objcMembers` to `@attributes`, by [Berk Çebi][] +- Infrastructural changes by [Marcos Cáceres][] +- Fixed metachars highighting for *NSIS* by [Jan T. Sott][] +- *Yaml* highlight local tags as types by [Léo Lam][] +- Improved highlighting for *Elixir* by [Piotr Kaminski][] +- New attribute `disableAutodetect` for preventing autodetection by [Egor Rogov][] +- *Matlab*: transpose operators and double quote strings, by [JohnC32][] and [Egor Rogov][] +- Various documentation typos and improvemets by [Jimmy Wärting][], [Lutz Büch][], [bcleland][] +- *Cmake* updated with new keywords and commands by [Deniz Bahadir][] + +[Ahmad Awais]: https://github.com/ahmadawais +[Arctic Ice Studio]: https://github.com/arcticicestudio +[Dmitriy Tarasov]: https://github.com/MedvedTMN +[Egor Rogov]: https://github.com/egor-rogov +[Eric Bailey]: https://github.com/ericwbailey +[Gidi Meir Morris]: https://github.com/gmmorris +[Gustavo Costa]: https://github.com/gusbemacbe +[Harmon]: https://github.com/Harmon758 +[Melissa Geels]: https://github.com/codecat +[meseta]: https://github.com/meseta +[nord-highlightjs]: https://github.com/arcticicestudio/nord-highlightjs +[Tristian Kelly]: https://github.com/TristianK3604 +[Vijaya Chandran Mani]: https://github.com/vijaycs85 +[John Foster]: https://github.com/jf990 +[David Benjamin]: https://github.com/davidben +[Berk Çebi]: https://github.com/berkcebi +[Mauricio Caceres Bravo]: https://github.com/mcaceresb +[bostko]: https://github.com/bostko +[Deniz Bahadir]: https://github.com/Bagira80 +[bcleland]: https://github.com/bcleland +[JohnC32]: https://github.com/JohnC32 +[Lutz Büch]: https://github.com/lutz-100worte +[Piotr Kaminski]: https://github.com/pkaminski +[Léo Lam]: https://github.com/leoetlino +[Jan T. Sott]: https://github.com/idleberg +[Jimmy Wärting]: https://github.com/jimmywarting +[Marcos Cáceres]: https://github.com/marcoscaceres + +## Version 9.12.0 + +New language: + +- *MikroTik* RouterOS Scripting language by [Ivan Dementev][]. + +New style: + +- *VisualStudio 2015 Dark* by [Nicolas LLOBERA][] + +Improvements: +- *Crystal* updated with new keywords and syntaxes by [Tsuyusato Kitsune][]. +- *Julia* updated to the modern definitions by [Alex Arslan][]. +- *julia-repl* added by [Morten Piibeleht][]. +- [Stanislav Belov][] wrote a new definition for *1C*, replacing the one that + has not been updated for more than 8 years. The new version supports syntax + for versions 7.7 and 8. +- [Nicolas LLOBERA][] improved C# definition fixing edge cases with function + titles detection and added highlighting of `[Attributes]`. +- [nnnik][] provided a few correctness fixes for *Autohotkey*. +- [Martin Clausen][] made annotation collections in *Clojure* to look + consistently with other kinds. +- [Alejandro Alonso][] updated *Swift* keywords. + +[Tsuyusato Kitsune]: https://github.com/MakeNowJust +[Alex Arslan]: https://github.com/ararslan +[Morten Piibeleht]: https://github.com/mortenpi +[Stanislav Belov]: https://github.com/4ppl +[Ivan Dementev]: https://github.com/DiVAN1x +[Nicolas LLOBERA]: https://github.com/Nicolas01 +[nnnik]: https://github.com/nnnik +[Martin Clausen]: https://github.com/maacl +[Alejandro Alonso]: https://github.com/Azoy + +## Version 9.11.0 + +New languages: + +- *Shell* by [Tsuyusato Kitsune][] +- *jboss-cli* by [Raphaël Parrëe][] + +Improvements: + +- [Joël Porquet] has [greatly improved the definition of *makefile*][5b3e0e6]. +- *C++* class titles are now highlighted as in other languages with classes. +- [Jordi Petit][] added rarely used `or`, `and` and `not` keywords to *C++*. +- [Pieter Vantorre][] fixed highlighting of negative floating point values. + + +[Tsuyusato Kitsune]: https://github.com/MakeNowJust +[Jordi Petit]: https://github.com/jordi-petit +[Raphaël Parrëe]: https://github.com/rparree +[Pieter Vantorre]: https://github.com/NuclearCookie +[5b3e0e6]: https://github.com/isagalaev/highlight.js/commit/5b3e0e68bfaae282faff6697d6a490567fa9d44b + + +## Version 9.10.0 + +Apologies for missing the previous release cycle. Some thing just can't be +automated… Anyway, we're back! + +New languages: + +- *Hy* by [Sergey Sobko][] +- *Leaf* by [Hale Chan][] +- *N1QL* by [Andres Täht][] and [Rene Saarsoo][] + +Improvements: + +- *Rust* got updated with new keywords by [Kasper Andersen][] and then + significantly modernized even more by [Eduard-Mihai Burtescu][] (yes, @eddyb, + Rust core team member!) +- *Python* updated with f-literals by [Philipp A][]. +- *YAML* updated with unquoted strings support. +- *Gauss* updated with new keywords by [Matt Evans][]. +- *Lua* updated with new keywords by [Joe Blow][]. +- *Kotlin* updated with new keywords by [Philipp Hauer][]. +- *TypeScript* got highlighting of function params and updated keywords by + [Ike Ku][]. +- *Scheme* now correctly handles \`-quoted lists thanks to [Guannan Wei]. +- [Sam Wu][] fixed handling of `<<` in *C++* defines. + +[Philipp A]: https://github.com/flying-sheep +[Philipp Hauer]: https://github.com/phauer +[Sergey Sobko]: https://github.com/profitware +[Hale Chan]: https://github.com/halechan +[Matt Evans]: https://github.com/matthewevans +[Joe Blow]: https://github.com/mossarelli +[Kasper Andersen]: https://github.com/kasma1990 +[Eduard-Mihai Burtescu]: https://github.com/eddyb +[Andres Täht]: https://github.com/andrestaht +[Rene Saarsoo]: https://github.com/nene +[Philipp Hauer]: https://github.com/phauer +[Ike Ku]: https://github.com/dempfi +[Guannan Wei]: https://github.com/Kraks +[Sam Wu]: https://github.com/samsam2310 + + ## Version 9.9.0 New languages diff --git a/lib/3rdparty/highlight/README.md b/lib/3rdparty/highlight/README.md index 9f76e6b..4c287ae 100644 --- a/lib/3rdparty/highlight/README.md +++ b/lib/3rdparty/highlight/README.md @@ -1,10 +1,10 @@ # Highlight.js -[![Build Status](https://travis-ci.org/isagalaev/highlight.js.svg?branch=master)](https://travis-ci.org/isagalaev/highlight.js) +[![Build Status](https://travis-ci.org/highlightjs/highlight.js.svg?branch=master)](https://travis-ci.org/highlightjs/highlight.js) [![Greenkeeper badge](https://badges.greenkeeper.io/highlightjs/highlight.js.svg)](https://greenkeeper.io/) Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It works with pretty much any -markup, doesn’t depend on any framework and has automatic language +markup, doesn’t depend on any framework, and has automatic language detection. ## Getting Started @@ -31,6 +31,13 @@ The list of supported language classes is available in the [class reference][2]. Classes can also be prefixed with either `language-` or `lang-`. +To make arbitrary text look like code, but without highlighting, use the +`plaintext` class: + +```html +
...
+``` + To disable highlighting altogether use the `nohighlight` class: ```html @@ -44,24 +51,24 @@ highlight.js, you can use the [`highlightBlock`][3] and [`configure`][4] functions. This allows you to control *what* to highlight and *when*. Here’s an equivalent way to calling [`initHighlightingOnLoad`][1] using -jQuery: +vanilla JS: -```javascript -$(document).ready(function() { - $('pre code').each(function(i, block) { +```js +document.addEventListener('DOMContentLoaded', (event) => { + document.querySelectorAll('pre code').forEach((block) => { hljs.highlightBlock(block); }); }); ``` You can use any tags instead of `
` to mark up your code. If
-you don't use a container that preserve line breaks you will need to
+you don't use a container that preserves line breaks you will need to
 configure highlight.js to use the `
` tag: -```javascript +```js hljs.configure({useBR: true}); -$('div.code').each(function(i, block) { +document.querySelectorAll('div.code').forEach((block) => { hljs.highlightBlock(block); }); ``` @@ -76,23 +83,23 @@ window while dealing with very big chunks of code. In your main script: -```javascript -addEventListener('load', function() { - var code = document.querySelector('#code'); - var worker = new Worker('worker.js'); - worker.onmessage = function(event) { code.innerHTML = event.data; } +```js +addEventListener('load', () => { + const code = document.querySelector('#code'); + const worker = new Worker('worker.js'); + worker.onmessage = (event) => { code.innerHTML = event.data; } worker.postMessage(code.textContent); -}) +}); ``` In worker.js: -```javascript -onmessage = function(event) { +```js +onmessage = (event) => { importScripts('/highlight.pack.js'); - var result = self.hljs.highlightAuto(event.data); + const result = self.hljs.highlightAuto(event.data); postMessage(result.value); -} +}; ``` @@ -115,17 +122,48 @@ too big. If you don't see the language you need in the ["Common" section][5], it can be added manually: ```html - + ``` **On Almond.** You need to use the optimizer to give the module a name. For example: -``` +```bash r.js -o name=hljs paths.hljs=/path/to/highlight out=highlight.js ``` +### CommonJS + +You can import Highlight.js as a CommonJS-module: + +```bash +npm install highlight.js --save +``` + +In your application: + +```js +import hljs from 'highlight.js'; +``` + +The default import imports all languages! Therefore it is likely to be more efficient to import only the library and the languages you need: + +```js +import hljs from 'highlight.js/lib/highlight'; +import javascript from 'highlight.js/lib/languages/javascript'; +hljs.registerLanguage('javascript', javascript); +``` + +To set the syntax highlighting style, if your build tool processes CSS from your JavaScript entry point, you can import the stylesheet directly into your CommonJS-module: + +```js +import hljs from 'highlight.js/lib/highlight'; +import 'highlight.js/styles/github.css'; +``` + ## License Highlight.js is released under the BSD License. See [LICENSE][7] file @@ -146,5 +184,5 @@ Authors and contributors are listed in the [AUTHORS.en.txt][8] file. [4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options [5]: https://highlightjs.org/download/ [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html -[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE -[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.en.txt +[7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.en.txt diff --git a/lib/3rdparty/highlight/README.ru.md b/lib/3rdparty/highlight/README.ru.md index ac481d0..198ee96 100644 --- a/lib/3rdparty/highlight/README.ru.md +++ b/lib/3rdparty/highlight/README.ru.md @@ -40,11 +40,11 @@ Highlight.js — это инструмент для подсветки синт можно управлять тем, *что* и *когда* подсвечивать. Вот пример инициализации, эквивалентной вызову [`initHighlightingOnLoad`][1], но -с использованием jQuery: +с использованием `document.addEventListener`: -```javascript -$(document).ready(function() { - $('pre code').each(function(i, block) { +```js +document.addEventListener('DOMContentLoaded', (event) => { + document.querySelectorAll('pre code').forEach((block) => { hljs.highlightBlock(block); }); }); @@ -54,10 +54,10 @@ $(document).ready(function() { используете контейнер, не сохраняющий переводы строк, вам нужно сказать highlight.js использовать для них тег `
`: -```javascript +```js hljs.configure({useBR: true}); -$('div.code').each(function(i, block) { +document.querySelectorAll('div.code').forEach((block) => { hljs.highlightBlock(block); }); ``` @@ -72,23 +72,23 @@ $('div.code').each(function(i, block) { В основном скрипте: -```javascript -addEventListener('load', function() { - var code = document.querySelector('#code'); - var worker = new Worker('worker.js'); - worker.onmessage = function(event) { code.innerHTML = event.data; } +```js +addEventListener('load', () => { + const code = document.querySelector('#code'); + const worker = new Worker('worker.js'); + worker.onmessage = (event) => { code.innerHTML = event.data; } worker.postMessage(code.textContent); -}) +}); ``` В worker.js: -```javascript -onmessage = function(event) { +```js +onmessage = (event) => { importScripts('/highlight.pack.js'); - var result = self.hljs.highlightAuto(event.data); + const result = self.hljs.highlightAuto(event.data); postMessage(result.value); -} +}; ``` @@ -138,5 +138,5 @@ Highlight.js распространяется под лицензией BSD. П [4]: http://highlightjs.readthedocs.io/en/latest/api.html#configure-options [5]: https://highlightjs.org/download/ [6]: http://highlightjs.readthedocs.io/en/latest/building-testing.html -[7]: https://github.com/isagalaev/highlight.js/blob/master/LICENSE -[8]: https://github.com/isagalaev/highlight.js/blob/master/AUTHORS.ru.txt +[7]: https://github.com/highlightjs/highlight.js/blob/master/LICENSE +[8]: https://github.com/highlightjs/highlight.js/blob/master/AUTHORS.ru.txt diff --git a/lib/3rdparty/highlight/highlight.pack.js b/lib/3rdparty/highlight/highlight.pack.js index 2fc4ef7..901b7f5 100644 --- a/lib/3rdparty/highlight/highlight.pack.js +++ b/lib/3rdparty/highlight/highlight.pack.js @@ -1,2 +1,2 @@ -/*! highlight.js v9.9.0 | BSD3 License | git.io/hljslicense */ -!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(e){function n(e){return e.replace(/[&<>]/gm,function(e){return I[e]})}function t(e){return e.nodeName.toLowerCase()}function r(e,n){var t=e&&e.exec(n);return t&&0===t.index}function i(e){return k.test(e)}function a(e){var n,t,r,a,o=e.className+" ";if(o+=e.parentNode?e.parentNode.className:"",t=B.exec(o))return R(t[1])?t[1]:"no-highlight";for(o=o.split(/\s+/),n=0,r=o.length;r>n;n++)if(a=o[n],i(a)||R(a))return a}function o(e,n){var t,r={};for(t in e)r[t]=e[t];if(n)for(t in n)r[t]=n[t];return r}function u(e){var n=[];return function r(e,i){for(var a=e.firstChild;a;a=a.nextSibling)3===a.nodeType?i+=a.nodeValue.length:1===a.nodeType&&(n.push({event:"start",offset:i,node:a}),i=r(a,i),t(a).match(/br|hr|img|input/)||n.push({event:"stop",offset:i,node:a}));return i}(e,0),n}function c(e,r,i){function a(){return e.length&&r.length?e[0].offset!==r[0].offset?e[0].offset"}function u(e){l+=""}function c(e){("start"===e.event?o:u)(e.node)}for(var s=0,l="",f=[];e.length||r.length;){var g=a();if(l+=n(i.substring(s,g[0].offset)),s=g[0].offset,g===e){f.reverse().forEach(u);do c(g.splice(0,1)[0]),g=a();while(g===e&&g.length&&g[0].offset===s);f.reverse().forEach(o)}else"start"===g[0].event?f.push(g[0].node):f.pop(),c(g.splice(0,1)[0])}return l+n(i.substr(s))}function s(e){function n(e){return e&&e.source||e}function t(t,r){return new RegExp(n(t),"m"+(e.cI?"i":"")+(r?"g":""))}function r(i,a){if(!i.compiled){if(i.compiled=!0,i.k=i.k||i.bK,i.k){var u={},c=function(n,t){e.cI&&(t=t.toLowerCase()),t.split(" ").forEach(function(e){var t=e.split("|");u[t[0]]=[n,t[1]?Number(t[1]):1]})};"string"==typeof i.k?c("keyword",i.k):E(i.k).forEach(function(e){c(e,i.k[e])}),i.k=u}i.lR=t(i.l||/\w+/,!0),a&&(i.bK&&(i.b="\\b("+i.bK.split(" ").join("|")+")\\b"),i.b||(i.b=/\B|\b/),i.bR=t(i.b),i.e||i.eW||(i.e=/\B|\b/),i.e&&(i.eR=t(i.e)),i.tE=n(i.e)||"",i.eW&&a.tE&&(i.tE+=(i.e?"|":"")+a.tE)),i.i&&(i.iR=t(i.i)),null==i.r&&(i.r=1),i.c||(i.c=[]);var s=[];i.c.forEach(function(e){e.v?e.v.forEach(function(n){s.push(o(e,n))}):s.push("self"===e?i:e)}),i.c=s,i.c.forEach(function(e){r(e,i)}),i.starts&&r(i.starts,a);var l=i.c.map(function(e){return e.bK?"\\.?("+e.b+")\\.?":e.b}).concat([i.tE,i.i]).map(n).filter(Boolean);i.t=l.length?t(l.join("|"),!0):{exec:function(){return null}}}}r(e)}function l(e,t,i,a){function o(e,n){var t,i;for(t=0,i=n.c.length;i>t;t++)if(r(n.c[t].bR,e))return n.c[t]}function u(e,n){if(r(e.eR,n)){for(;e.endsParent&&e.parent;)e=e.parent;return e}return e.eW?u(e.parent,n):void 0}function c(e,n){return!i&&r(n.iR,e)}function g(e,n){var t=N.cI?n[0].toLowerCase():n[0];return e.k.hasOwnProperty(t)&&e.k[t]}function h(e,n,t,r){var i=r?"":y.classPrefix,a='',a+n+o}function p(){var e,t,r,i;if(!E.k)return n(B);for(i="",t=0,E.lR.lastIndex=0,r=E.lR.exec(B);r;)i+=n(B.substring(t,r.index)),e=g(E,r),e?(M+=e[1],i+=h(e[0],n(r[0]))):i+=n(r[0]),t=E.lR.lastIndex,r=E.lR.exec(B);return i+n(B.substr(t))}function d(){var e="string"==typeof E.sL;if(e&&!x[E.sL])return n(B);var t=e?l(E.sL,B,!0,L[E.sL]):f(B,E.sL.length?E.sL:void 0);return E.r>0&&(M+=t.r),e&&(L[E.sL]=t.top),h(t.language,t.value,!1,!0)}function b(){k+=null!=E.sL?d():p(),B=""}function v(e){k+=e.cN?h(e.cN,"",!0):"",E=Object.create(e,{parent:{value:E}})}function m(e,n){if(B+=e,null==n)return b(),0;var t=o(n,E);if(t)return t.skip?B+=n:(t.eB&&(B+=n),b(),t.rB||t.eB||(B=n)),v(t,n),t.rB?0:n.length;var r=u(E,n);if(r){var i=E;i.skip?B+=n:(i.rE||i.eE||(B+=n),b(),i.eE&&(B=n));do E.cN&&(k+=C),E.skip||(M+=E.r),E=E.parent;while(E!==r.parent);return r.starts&&v(r.starts,""),i.rE?0:n.length}if(c(n,E))throw new Error('Illegal lexeme "'+n+'" for mode "'+(E.cN||"")+'"');return B+=n,n.length||1}var N=R(e);if(!N)throw new Error('Unknown language: "'+e+'"');s(N);var w,E=a||N,L={},k="";for(w=E;w!==N;w=w.parent)w.cN&&(k=h(w.cN,"",!0)+k);var B="",M=0;try{for(var I,j,O=0;;){if(E.t.lastIndex=O,I=E.t.exec(t),!I)break;j=m(t.substring(O,I.index),I[0]),O=I.index+j}for(m(t.substr(O)),w=E;w.parent;w=w.parent)w.cN&&(k+=C);return{r:M,value:k,language:e,top:E}}catch(T){if(T.message&&-1!==T.message.indexOf("Illegal"))return{r:0,value:n(t)};throw T}}function f(e,t){t=t||y.languages||E(x);var r={r:0,value:n(e)},i=r;return t.filter(R).forEach(function(n){var t=l(n,e,!1);t.language=n,t.r>i.r&&(i=t),t.r>r.r&&(i=r,r=t)}),i.language&&(r.second_best=i),r}function g(e){return y.tabReplace||y.useBR?e.replace(M,function(e,n){return y.useBR&&"\n"===e?"
":y.tabReplace?n.replace(/\t/g,y.tabReplace):void 0}):e}function h(e,n,t){var r=n?L[n]:t,i=[e.trim()];return e.match(/\bhljs\b/)||i.push("hljs"),-1===e.indexOf(r)&&i.push(r),i.join(" ").trim()}function p(e){var n,t,r,o,s,p=a(e);i(p)||(y.useBR?(n=document.createElementNS("http://www.w3.org/1999/xhtml","div"),n.innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n")):n=e,s=n.textContent,r=p?l(p,s,!0):f(s),t=u(n),t.length&&(o=document.createElementNS("http://www.w3.org/1999/xhtml","div"),o.innerHTML=r.value,r.value=c(t,u(o),s)),r.value=g(r.value),e.innerHTML=r.value,e.className=h(e.className,p,r.language),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function d(e){y=o(y,e)}function b(){if(!b.called){b.called=!0;var e=document.querySelectorAll("pre code");w.forEach.call(e,p)}}function v(){addEventListener("DOMContentLoaded",b,!1),addEventListener("load",b,!1)}function m(n,t){var r=x[n]=t(e);r.aliases&&r.aliases.forEach(function(e){L[e]=n})}function N(){return E(x)}function R(e){return e=(e||"").toLowerCase(),x[e]||x[L[e]]}var w=[],E=Object.keys,x={},L={},k=/^(no-?highlight|plain|text)$/i,B=/\blang(?:uage)?-([\w-]+)\b/i,M=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,C="
",y={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0},I={"&":"&","<":"<",">":">"};return e.highlight=l,e.highlightAuto=f,e.fixMarkup=g,e.highlightBlock=p,e.configure=d,e.initHighlighting=b,e.initHighlightingOnLoad=v,e.registerLanguage=m,e.listLanguages=N,e.getLanguage=R,e.inherit=o,e.IR="[a-zA-Z]\\w*",e.UIR="[a-zA-Z_]\\w*",e.NR="\\b\\d+(\\.\\d+)?",e.CNR="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",e.BNR="\\b(0b[01]+)",e.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",e.BE={b:"\\\\[\\s\\S]",r:0},e.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[e.BE]},e.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[e.BE]},e.PWM={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|like)\b/},e.C=function(n,t,r){var i=e.inherit({cN:"comment",b:n,e:t,c:[]},r||{});return i.c.push(e.PWM),i.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),i},e.CLCM=e.C("//","$"),e.CBCM=e.C("/\\*","\\*/"),e.HCM=e.C("#","$"),e.NM={cN:"number",b:e.NR,r:0},e.CNM={cN:"number",b:e.CNR,r:0},e.BNM={cN:"number",b:e.BNR,r:0},e.CSSNM={cN:"number",b:e.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},e.RM={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[e.BE,{b:/\[/,e:/\]/,r:0,c:[e.BE]}]},e.TM={cN:"title",b:e.IR,r:0},e.UTM={cN:"title",b:e.UIR,r:0},e.METHOD_GUARD={b:"\\.\\s*"+e.UIR,r:0},e});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={cN:"subst",b:/#\{/,e:/}/,k:c},i=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,r]},{b:/"/,e:/"/,c:[e.BE,r]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[r,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+n},{sL:"javascript",eB:!0,eE:!0,v:[{b:"```",e:"```"},{b:"`",e:"`"}]}];r.c=i;var s=e.inherit(e.TM,{b:n}),t="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(i)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:i.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+t,e:"[-=]>",rB:!0,c:[s,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:t,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[s]},s]},{b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double else enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while nameof add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},r={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},t=e.inherit(r,{i:/\n/}),a={cN:"subst",b:"{",e:"}",k:i},n=e.inherit(a,{i:/\n/}),c={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,n]},s={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},a]},o=e.inherit(s,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},n]});a.c=[s,c,r,e.ASM,e.QSM,e.CNM,e.CBCM],n.c=[o,c,t,e.ASM,e.QSM,e.CNM,e.inherit(e.CBCM,{i:/\n/})];var l={v:[s,c,r,e.ASM,e.QSM]},b=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:""},{b:""}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},l,e.CNM,{bK:"class interface",e:/[{;=]/,i:/[^\s:]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{bK:"new return throw await",r:0},{cN:"function",b:"("+b+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[l,e.CNM,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*#]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias allocate allow alter always analyze ancillary and any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second section securefile security seed segment select self sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null",built_in:"array bigint binary bit blob boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t]},e.CBCM,t]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b://,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("objectivec",function(e){var t={cN:"built_in",b:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},_={keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},i=/[a-zA-Z@][a-zA-Z0-9_]*/,n="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:_,l:i,i:""}]}]},{cN:"class",b:"("+n.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:n,l:i,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("php",function(e){var c={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"meta",b:/<\?(php)?|\?>/},t={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php3","php4","php5","php6"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[i]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},i,{cN:"keyword",b:/\$this\b/},c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,t,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},t,a]}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U)?L?"',e:'"',i:"\\n",c:[t.BE]},{b:'(u8?|U)?R"',e:'"',c:[t.BE]},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:"<",e:">",i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const struct for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using class asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e]},t.CLCM,t.CBCM,i]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("python",function(e){var r={cN:"meta",b:/^(>>>|\.\.\.) /},b={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[r],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[r],r:10},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},e.ASM,e.QSM]},a={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},l={cN:"params",b:/\(/,e:/\)/,c:["self",r,a,b]};return{aliases:["py","gyp"],k:{keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10 None True False",built_in:"Ellipsis NotImplemented"},i:/(<\/|->|\?)|=>/,c:[r,a,b,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,l,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("makefile",function(e){var a={cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]};return{aliases:["mk","mak"],c:[e.HCM,{b:/^\w+\s*\W*=/,rB:!0,r:0,starts:{e:/\s*\W*=/,eE:!0,starts:{e:/$/,r:0,c:[a]}}},{cN:"section",b:/^[\w]+:\s*$/},{cN:"meta",b:/^\.PHONY:/,e:/$/,k:{"meta-keyword":".PHONY"},l:/[\.\w]+/},{b:/^\t+/,e:/$/,r:0,c:[e.QSM,a]}]}});hljs.registerLanguage("xml",function(s){var e="[A-Za-z0-9\\._:-]+",t={eW:!0,i:/`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0}]},{cN:"tag",b:"|$)",e:">",k:{name:"style"},c:[t],starts:{e:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"|$)",e:">",k:{name:"script"},c:[t],starts:{e:"",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"meta",v:[{b:/<\?xml/,e:/\?>/,r:10},{b:/<\?\w+/,e:/\?>/}]},{cN:"tag",b:"",c:[{cN:"name",b:/[^\/><\s]+/,r:0},t]}]}});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}});hljs.registerLanguage("java",function(e){var a="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",t=a+"(<"+a+"(\\s*,\\s*"+a+")*>)?",r="false synchronized int abstract float private char boolean static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",s="\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",c={cN:"number",b:s,r:0};return{aliases:["jsp"],k:r,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"("+t+"\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:r,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:r,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},c,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}| )",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("apache",function(e){var r={cN:"number",b:"[\\$%]\\d+"};return{aliases:["apacheconf"],cI:!0,c:[e.HCM,{cN:"section",b:""},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("css",function(e){var c="[a-zA-Z-][a-zA-Z0-9_-]*",t={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:c,r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,t]}]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d,i.c=d;var l="[>?]>",o="[\\w#]+\\(\\w+\\):\\d+:\\d+>",u="(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>",w=[{b:/^\s*=>/,starts:{e:"$",c:d}},{cN:"meta",b:"^("+l+"|"+o+"|"+u+")",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(w).concat(d)}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=o,s.c=o,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:o}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]},a={cN:"string",b:/'/,e:/'/};return{aliases:["sh","zsh"],l:/-?[a-z\._]+/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,a,t]}}); \ No newline at end of file +/*! highlight.js v9.15.6 | BSD3 License | git.io/hljslicense */ +!function(e){var n="object"==typeof window&&window||"object"==typeof self&&self;"undefined"!=typeof exports?e(exports):n&&(n.hljs=e({}),"function"==typeof define&&define.amd&&define([],function(){return n.hljs}))}(function(a){var E=[],u=Object.keys,N={},g={},n=/^(no-?highlight|plain|text)$/i,R=/\blang(?:uage)?-([\w-]+)\b/i,t=/((^(<[^>]+>|\t|)+|(?:\n)))/gm,r={case_insensitive:"cI",lexemes:"l",contains:"c",keywords:"k",subLanguage:"sL",className:"cN",begin:"b",beginKeywords:"bK",end:"e",endsWithParent:"eW",illegal:"i",excludeBegin:"eB",excludeEnd:"eE",returnBegin:"rB",returnEnd:"rE",relevance:"r",variants:"v",IDENT_RE:"IR",UNDERSCORE_IDENT_RE:"UIR",NUMBER_RE:"NR",C_NUMBER_RE:"CNR",BINARY_NUMBER_RE:"BNR",RE_STARTERS_RE:"RSR",BACKSLASH_ESCAPE:"BE",APOS_STRING_MODE:"ASM",QUOTE_STRING_MODE:"QSM",PHRASAL_WORDS_MODE:"PWM",C_LINE_COMMENT_MODE:"CLCM",C_BLOCK_COMMENT_MODE:"CBCM",HASH_COMMENT_MODE:"HCM",NUMBER_MODE:"NM",C_NUMBER_MODE:"CNM",BINARY_NUMBER_MODE:"BNM",CSS_NUMBER_MODE:"CSSNM",REGEXP_MODE:"RM",TITLE_MODE:"TM",UNDERSCORE_TITLE_MODE:"UTM",COMMENT:"C",beginRe:"bR",endRe:"eR",illegalRe:"iR",lexemesRe:"lR",terminators:"t",terminator_end:"tE"},b="",h={classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:void 0};function _(e){return e.replace(/&/g,"&").replace(//g,">")}function d(e){return e.nodeName.toLowerCase()}function v(e,n){var t=e&&e.exec(n);return t&&0===t.index}function p(e){return n.test(e)}function l(e){var n,t={},r=Array.prototype.slice.call(arguments,1);for(n in e)t[n]=e[n];return r.forEach(function(e){for(n in e)t[n]=e[n]}),t}function M(e){var a=[];return function e(n,t){for(var r=n.firstChild;r;r=r.nextSibling)3===r.nodeType?t+=r.nodeValue.length:1===r.nodeType&&(a.push({event:"start",offset:t,node:r}),t=e(r,t),d(r).match(/br|hr|img|input/)||a.push({event:"stop",offset:t,node:r}));return t}(e,0),a}function i(e){if(r&&!e.langApiRestored){for(var n in e.langApiRestored=!0,r)e[n]&&(e[r[n]]=e[n]);(e.c||[]).concat(e.v||[]).forEach(i)}}function m(c){function s(e){return e&&e.source||e}function o(e,n){return new RegExp(s(e),"m"+(c.cI?"i":"")+(n?"g":""))}!function n(t,e){if(!t.compiled){if(t.compiled=!0,t.k=t.k||t.bK,t.k){var r={},a=function(t,e){c.cI&&(e=e.toLowerCase()),e.split(" ").forEach(function(e){var n=e.split("|");r[n[0]]=[t,n[1]?Number(n[1]):1]})};"string"==typeof t.k?a("keyword",t.k):u(t.k).forEach(function(e){a(e,t.k[e])}),t.k=r}t.lR=o(t.l||/\w+/,!0),e&&(t.bK&&(t.b="\\b("+t.bK.split(" ").join("|")+")\\b"),t.b||(t.b=/\B|\b/),t.bR=o(t.b),t.endSameAsBegin&&(t.e=t.b),t.e||t.eW||(t.e=/\B|\b/),t.e&&(t.eR=o(t.e)),t.tE=s(t.e)||"",t.eW&&e.tE&&(t.tE+=(t.e?"|":"")+e.tE)),t.i&&(t.iR=o(t.i)),null==t.r&&(t.r=1),t.c||(t.c=[]),t.c=Array.prototype.concat.apply([],t.c.map(function(e){return(n="self"===e?t:e).v&&!n.cached_variants&&(n.cached_variants=n.v.map(function(e){return l(n,{v:null},e)})),n.cached_variants||n.eW&&[l(n)]||[n];var n})),t.c.forEach(function(e){n(e,t)}),t.starts&&n(t.starts,e);var i=t.c.map(function(e){return e.bK?"\\.?(?:"+e.b+")\\.?":e.b}).concat([t.tE,t.i]).map(s).filter(Boolean);t.t=i.length?o(function(e,n){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i')+n+(t?"":b)}function s(){g+=null!=E.sL?function(){var e="string"==typeof E.sL;if(e&&!N[E.sL])return _(R);var n=e?C(E.sL,R,!0,i[E.sL]):O(R,E.sL.length?E.sL:void 0);return 0")+'"');return R+=n,n.length||1}var f=S(e);if(!f)throw new Error('Unknown language: "'+e+'"');m(f);var a,E=t||f,i={},g="";for(a=E;a!==f;a=a.parent)a.cN&&(g=u(a.cN,"",!0)+g);var R="",d=0;try{for(var c,p,M=0;E.t.lastIndex=M,c=E.t.exec(n);)p=r(n.substring(M,c.index),c[0]),M=c.index+p;for(r(n.substr(M)),a=E;a.parent;a=a.parent)a.cN&&(g+=b);return{r:d,value:g,language:e,top:E}}catch(e){if(e.message&&-1!==e.message.indexOf("Illegal"))return{r:0,value:_(n)};throw e}}function O(t,e){e=e||h.languages||u(N);var r={r:0,value:_(t)},a=r;return e.filter(S).filter(s).forEach(function(e){var n=C(e,t,!1);n.language=e,n.r>a.r&&(a=n),n.r>r.r&&(a=r,r=n)}),a.language&&(r.second_best=a),r}function B(e){return h.tabReplace||h.useBR?e.replace(t,function(e,n){return h.useBR&&"\n"===e?"
":h.tabReplace?n.replace(/\t/g,h.tabReplace):""}):e}function c(e){var n,t,r,a,i,c,o,u,s,l,f=function(e){var n,t,r,a,i=e.className+" ";if(i+=e.parentNode?e.parentNode.className:"",t=R.exec(i))return S(t[1])?t[1]:"no-highlight";for(n=0,r=(i=i.split(/\s+/)).length;n/g,"\n"):n=e,i=n.textContent,r=f?C(f,i,!0):O(i),(t=M(n)).length&&((a=document.createElementNS("http://www.w3.org/1999/xhtml","div")).innerHTML=r.value,r.value=function(e,n,t){var r=0,a="",i=[];function c(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){a+=""}function s(e){("start"===e.event?o:u)(e.node)}for(;e.length||n.length;){var l=c();if(a+=_(t.substring(r,l[0].offset)),r=l[0].offset,l===e){for(i.reverse().forEach(u);s(l.splice(0,1)[0]),(l=c())===e&&l.length&&l[0].offset===r;);i.reverse().forEach(o)}else"start"===l[0].event?i.push(l[0].node):i.pop(),s(l.splice(0,1)[0])}return a+_(t.substr(r))}(t,M(a),i)),r.value=B(r.value),e.innerHTML=r.value,e.className=(c=e.className,o=f,u=r.language,s=o?g[o]:u,l=[c.trim()],c.match(/\bhljs\b/)||l.push("hljs"),-1===c.indexOf(s)&&l.push(s),l.join(" ").trim()),e.result={language:r.language,re:r.r},r.second_best&&(e.second_best={language:r.second_best.language,re:r.second_best.r}))}function o(){if(!o.called){o.called=!0;var e=document.querySelectorAll("pre code");E.forEach.call(e,c)}}function S(e){return e=(e||"").toLowerCase(),N[e]||N[g[e]]}function s(e){var n=S(e);return n&&!n.disableAutodetect}return a.highlight=C,a.highlightAuto=O,a.fixMarkup=B,a.highlightBlock=c,a.configure=function(e){h=l(h,e)},a.initHighlighting=o,a.initHighlightingOnLoad=function(){addEventListener("DOMContentLoaded",o,!1),addEventListener("load",o,!1)},a.registerLanguage=function(n,e){var t=N[n]=e(a);i(t),t.aliases&&t.aliases.forEach(function(e){g[e]=n})},a.listLanguages=function(){return u(N)},a.getLanguage=S,a.autoDetection=s,a.inherit=l,a.IR=a.IDENT_RE="[a-zA-Z]\\w*",a.UIR=a.UNDERSCORE_IDENT_RE="[a-zA-Z_]\\w*",a.NR=a.NUMBER_RE="\\b\\d+(\\.\\d+)?",a.CNR=a.C_NUMBER_RE="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",a.BNR=a.BINARY_NUMBER_RE="\\b(0b[01]+)",a.RSR=a.RE_STARTERS_RE="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",a.BE=a.BACKSLASH_ESCAPE={b:"\\\\[\\s\\S]",r:0},a.ASM=a.APOS_STRING_MODE={cN:"string",b:"'",e:"'",i:"\\n",c:[a.BE]},a.QSM=a.QUOTE_STRING_MODE={cN:"string",b:'"',e:'"',i:"\\n",c:[a.BE]},a.PWM=a.PHRASAL_WORDS_MODE={b:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},a.C=a.COMMENT=function(e,n,t){var r=a.inherit({cN:"comment",b:e,e:n,c:[]},t||{});return r.c.push(a.PWM),r.c.push({cN:"doctag",b:"(?:TODO|FIXME|NOTE|BUG|XXX):",r:0}),r},a.CLCM=a.C_LINE_COMMENT_MODE=a.C("//","$"),a.CBCM=a.C_BLOCK_COMMENT_MODE=a.C("/\\*","\\*/"),a.HCM=a.HASH_COMMENT_MODE=a.C("#","$"),a.NM=a.NUMBER_MODE={cN:"number",b:a.NR,r:0},a.CNM=a.C_NUMBER_MODE={cN:"number",b:a.CNR,r:0},a.BNM=a.BINARY_NUMBER_MODE={cN:"number",b:a.BNR,r:0},a.CSSNM=a.CSS_NUMBER_MODE={cN:"number",b:a.NR+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",r:0},a.RM=a.REGEXP_MODE={cN:"regexp",b:/\//,e:/\/[gimuy]*/,i:/\n/,c:[a.BE,{b:/\[/,e:/\]/,r:0,c:[a.BE]}]},a.TM=a.TITLE_MODE={cN:"title",b:a.IR,r:0},a.UTM=a.UNDERSCORE_TITLE_MODE={cN:"title",b:a.UIR,r:0},a.METHOD_GUARD={b:"\\.\\s*"+a.UIR,r:0},a});hljs.registerLanguage("coffeescript",function(e){var c={keyword:"in if for while finally new do return else break catch instanceof throw try this switch continue typeof delete debugger super yield import export from as default await then unless until loop of by when and or is isnt not",literal:"true false null undefined yes no on off",built_in:"npm require console print module global window document"},n="[A-Za-z$_][0-9A-Za-z$_]*",r={cN:"subst",b:/#\{/,e:/}/,k:c},i=[e.BNM,e.inherit(e.CNM,{starts:{e:"(\\s*/)?",r:0}}),{cN:"string",v:[{b:/'''/,e:/'''/,c:[e.BE]},{b:/'/,e:/'/,c:[e.BE]},{b:/"""/,e:/"""/,c:[e.BE,r]},{b:/"/,e:/"/,c:[e.BE,r]}]},{cN:"regexp",v:[{b:"///",e:"///",c:[r,e.HCM]},{b:"//[gim]*",r:0},{b:/\/(?![ *])(\\\/|.)*?\/[gim]*(?=\W|$)/}]},{b:"@"+n},{sL:"javascript",eB:!0,eE:!0,v:[{b:"```",e:"```"},{b:"`",e:"`"}]}];r.c=i;var s=e.inherit(e.TM,{b:n}),t="(\\(.*\\))?\\s*\\B[-=]>",o={cN:"params",b:"\\([^\\(]",rB:!0,c:[{b:/\(/,e:/\)/,k:c,c:["self"].concat(i)}]};return{aliases:["coffee","cson","iced"],k:c,i:/\/\*/,c:i.concat([e.C("###","###"),e.HCM,{cN:"function",b:"^\\s*"+n+"\\s*=\\s*"+t,e:"[-=]>",rB:!0,c:[s,o]},{b:/[:\(,=]\s*/,r:0,c:[{cN:"function",b:t,e:"[-=]>",rB:!0,c:[o]}]},{cN:"class",bK:"class",e:"$",i:/[:="\[\]]/,c:[{bK:"extends",eW:!0,i:/[:="\[\]]/,c:[s]},s]},{b:n+":",e:":",rB:!0,rE:!0,r:0}])}});hljs.registerLanguage("objectivec",function(e){var t=/[a-zA-Z@][a-zA-Z0-9_]*/,_="@interface @class @protocol @implementation";return{aliases:["mm","objc","obj-c"],k:{keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},l:t,i:""}]}]},{cN:"class",b:"("+_.split(" ").join("|")+")\\b",e:"({|$)",eE:!0,k:_,l:t,c:[e.UTM]},{b:"\\."+e.UIR,r:0}]}});hljs.registerLanguage("cs",function(e){var i={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in int interface internal is lock long nameof object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let on orderby partial remove select set value var where yield",literal:"null false true"},r={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},t={cN:"string",b:'@"',e:'"',c:[{b:'""'}]},a=e.inherit(t,{i:/\n/}),c={cN:"subst",b:"{",e:"}",k:i},n=e.inherit(c,{i:/\n/}),s={cN:"string",b:/\$"/,e:'"',i:/\n/,c:[{b:"{{"},{b:"}}"},e.BE,n]},b={cN:"string",b:/\$@"/,e:'"',c:[{b:"{{"},{b:"}}"},{b:'""'},c]},l=e.inherit(b,{i:/\n/,c:[{b:"{{"},{b:"}}"},{b:'""'},n]});c.c=[b,s,t,e.ASM,e.QSM,r,e.CBCM],n.c=[l,s,a,e.ASM,e.QSM,r,e.inherit(e.CBCM,{i:/\n/})];var o={v:[b,s,t,e.ASM,e.QSM]},d=e.IR+"(<"+e.IR+"(\\s*,\\s*"+e.IR+")*>)?(\\[\\])?";return{aliases:["csharp","c#"],k:i,i:/::/,c:[e.C("///","$",{rB:!0,c:[{cN:"doctag",v:[{b:"///",r:0},{b:"\x3c!--|--\x3e"},{b:""}]}]}),e.CLCM,e.CBCM,{cN:"meta",b:"#",e:"$",k:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},o,r,{bK:"class interface",e:/[{;=]/,i:/[^\s:,]/,c:[e.TM,e.CLCM,e.CBCM]},{bK:"namespace",e:/[{;=]/,i:/[^\s:]/,c:[e.inherit(e.TM,{b:"[a-zA-Z](\\.?\\w)*"}),e.CLCM,e.CBCM]},{cN:"meta",b:"^\\s*\\[",eB:!0,e:"\\]",eE:!0,c:[{cN:"meta-string",b:/"/,e:/"/}]},{bK:"new return throw await else",r:0},{cN:"function",b:"("+d+"\\s+)+"+e.IR+"\\s*\\(",rB:!0,e:/\s*[{;=]/,eE:!0,k:i,c:[{b:e.IR+"\\s*\\(",rB:!0,c:[e.TM],r:0},{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,k:i,r:0,c:[o,r,e.CBCM]},e.CLCM,e.CBCM]}]}});hljs.registerLanguage("json",function(e){var i={literal:"true false null"},n=[e.QSM,e.CNM],r={e:",",eW:!0,eE:!0,c:n,k:i},t={b:"{",e:"}",c:[{cN:"attr",b:/"/,e:/"/,c:[e.BE],i:"\\n"},e.inherit(r,{b:/:/})],i:"\\S"},c={b:"\\[",e:"\\]",c:[e.inherit(r)],i:"\\S"};return n.splice(n.length,0,t,c),{c:n,k:i,i:"\\S"}});hljs.registerLanguage("bash",function(e){var t={cN:"variable",v:[{b:/\$[\w\d#@][\w\d_]*/},{b:/\$\{(.*?)}/}]},s={cN:"string",b:/"/,e:/"/,c:[e.BE,t,{cN:"variable",b:/\$\(/,e:/\)/,c:[e.BE]}]};return{aliases:["sh","zsh"],l:/\b-?[a-z\._]+\b/,k:{keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},c:[{cN:"meta",b:/^#![^\n]+sh\s*$/,r:10},{cN:"function",b:/\w[\w\d_]*\s*\(\s*\)\s*\{/,rB:!0,c:[e.inherit(e.TM,{b:/\w[\w\d_]*/})],r:0},e.HCM,s,{cN:"string",b:/'/,e:/'/},t]}});hljs.registerLanguage("makefile",function(e){var i={cN:"variable",v:[{b:"\\$\\("+e.UIR+"\\)",c:[e.BE]},{b:/\$[@%"},{cN:"attribute",b:/\w+/,r:0,k:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{e:/$/,r:0,k:{literal:"on off all"},c:[{cN:"meta",b:"\\s\\[",e:"\\]$"},{cN:"variable",b:"[\\$%]\\{",e:"\\}",c:["self",r]},r,e.QSM]}}],i:/\S/}});hljs.registerLanguage("perl",function(e){var t="getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qqfileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmgetsub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedirioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when",r={cN:"subst",b:"[$@]\\{",e:"\\}",k:t},s={b:"->{",e:"}"},n={v:[{b:/\$\d/},{b:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{b:/[\$%@][^\s\w{]/,r:0}]},i=[e.BE,r,n],o=[n,e.HCM,e.C("^\\=\\w","\\=cut",{eW:!0}),s,{cN:"string",c:i,v:[{b:"q[qwxr]?\\s*\\(",e:"\\)",r:5},{b:"q[qwxr]?\\s*\\[",e:"\\]",r:5},{b:"q[qwxr]?\\s*\\{",e:"\\}",r:5},{b:"q[qwxr]?\\s*\\|",e:"\\|",r:5},{b:"q[qwxr]?\\s*\\<",e:"\\>",r:5},{b:"qw\\s+q",e:"q",r:5},{b:"'",e:"'",c:[e.BE]},{b:'"',e:'"'},{b:"`",e:"`",c:[e.BE]},{b:"{\\w+}",c:[],r:0},{b:"-?\\w+\\s*\\=\\>",c:[],r:0}]},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\/\\/|"+e.RSR+"|\\b(split|return|print|reverse|grep)\\b)\\s*",k:"split return print reverse grep",r:0,c:[e.HCM,{cN:"regexp",b:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",r:10},{cN:"regexp",b:"(m|qr)?/",e:"/[a-z]*",c:[e.BE],r:0}]},{cN:"function",bK:"sub",e:"(\\s*\\(.*?\\))?[;{]",eE:!0,r:5,c:[e.TM]},{b:"-\\w\\b",r:0},{b:"^__DATA__$",e:"^__END__$",sL:"mojolicious",c:[{b:"^@@.*",e:"$",cN:"comment"}]}];return r.c=o,{aliases:["pl","pm"],l:/[\w\.]+/,k:t,c:s.c=o}});hljs.registerLanguage("python",function(e){var r={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10",built_in:"Ellipsis NotImplemented",literal:"False None True"},b={cN:"meta",b:/^(>>>|\.\.\.) /},c={cN:"subst",b:/\{/,e:/\}/,k:r,i:/#/},a={cN:"string",c:[e.BE],v:[{b:/(u|b)?r?'''/,e:/'''/,c:[e.BE,b],r:10},{b:/(u|b)?r?"""/,e:/"""/,c:[e.BE,b],r:10},{b:/(fr|rf|f)'''/,e:/'''/,c:[e.BE,b,c]},{b:/(fr|rf|f)"""/,e:/"""/,c:[e.BE,b,c]},{b:/(u|r|ur)'/,e:/'/,r:10},{b:/(u|r|ur)"/,e:/"/,r:10},{b:/(b|br)'/,e:/'/},{b:/(b|br)"/,e:/"/},{b:/(fr|rf|f)'/,e:/'/,c:[e.BE,c]},{b:/(fr|rf|f)"/,e:/"/,c:[e.BE,c]},e.ASM,e.QSM]},i={cN:"number",r:0,v:[{b:e.BNR+"[lLjJ]?"},{b:"\\b(0o[0-7]+)[lLjJ]?"},{b:e.CNR+"[lLjJ]?"}]},l={cN:"params",b:/\(/,e:/\)/,c:["self",b,i,a]};return c.c=[a,i,b],{aliases:["py","gyp","ipython"],k:r,i:/(<\/|->|\?)|=>/,c:[b,i,a,e.HCM,{v:[{cN:"function",bK:"def"},{cN:"class",bK:"class"}],e:/:/,i:/[${=;\n,]/,c:[e.UTM,l,{b:/->/,eW:!0,k:"None"}]},{cN:"meta",b:/^[\t ]*@/,e:/$/},{b:/\b(print|exec)\(/}]}});hljs.registerLanguage("xml",function(s){var e={eW:!0,i:/`]+/}]}]}]};return{aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist"],cI:!0,c:[{cN:"meta",b:"",r:10,c:[{b:"\\[",e:"\\]"}]},s.C("\x3c!--","--\x3e",{r:10}),{b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"meta",b:/<\?xml/,e:/\?>/,r:10},{b:/<\?(php)?/,e:/\?>/,sL:"php",c:[{b:"/\\*",e:"\\*/",skip:!0},{b:'b"',e:'"',skip:!0},{b:"b'",e:"'",skip:!0},s.inherit(s.ASM,{i:null,cN:null,c:null,skip:!0}),s.inherit(s.QSM,{i:null,cN:null,c:null,skip:!0})]},{cN:"tag",b:"|$)",e:">",k:{name:"style"},c:[e],starts:{e:"",rE:!0,sL:["css","xml"]}},{cN:"tag",b:"|$)",e:">",k:{name:"script"},c:[e],starts:{e:"<\/script>",rE:!0,sL:["actionscript","javascript","handlebars","xml"]}},{cN:"tag",b:"",c:[{cN:"name",b:/[^\/><\s]+/,r:0},e]}]}});hljs.registerLanguage("markdown",function(e){return{aliases:["md","mkdown","mkd"],c:[{cN:"section",v:[{b:"^#{1,6}",e:"$"},{b:"^.+?\\n[=-]{2,}$"}]},{b:"<",e:">",sL:"xml",r:0},{cN:"bullet",b:"^([*+-]|(\\d+\\.))\\s+"},{cN:"strong",b:"[*_]{2}.+?[*_]{2}"},{cN:"emphasis",v:[{b:"\\*.+?\\*"},{b:"_.+?_",r:0}]},{cN:"quote",b:"^>\\s+",e:"$"},{cN:"code",v:[{b:"^```w*s*$",e:"^```s*$"},{b:"`.+?`"},{b:"^( {4}|\t)",e:"$",r:0}]},{b:"^[-\\*]{3,}",e:"$"},{b:"\\[.+?\\][\\(\\[].*?[\\)\\]]",rB:!0,c:[{cN:"string",b:"\\[",e:"\\]",eB:!0,rE:!0,r:0},{cN:"link",b:"\\]\\(",e:"\\)",eB:!0,eE:!0},{cN:"symbol",b:"\\]\\[",e:"\\]",eB:!0,eE:!0}],r:10},{b:/^\[[^\n]+\]:/,rB:!0,c:[{cN:"symbol",b:/\[/,e:/\]/,eB:!0,eE:!0},{cN:"link",b:/:\s*/,e:/$/,eB:!0}]}]}});hljs.registerLanguage("cpp",function(t){var e={cN:"keyword",b:"\\b[a-z\\d_]*_t\\b"},r={cN:"string",v:[{b:'(u8?|U|L)?"',e:'"',i:"\\n",c:[t.BE]},{b:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\((?:.|\n)*?\)\1"/},{b:"'\\\\?.",e:"'",i:"."}]},s={cN:"number",v:[{b:"\\b(0b[01']+)"},{b:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{b:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],r:0},i={cN:"meta",b:/#\s*[a-z]+\b/,e:/$/,k:{"meta-keyword":"if else elif endif define undef warning error line pragma ifdef ifndef include"},c:[{b:/\\\n/,r:0},t.inherit(r,{cN:"meta-string"}),{cN:"meta-string",b:/<[^\n>]*>/,e:/$/,i:"\\n"},t.CLCM,t.CBCM]},a=t.IR+"\\s*\\(",c={keyword:"int float while private char catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignof constexpr decltype noexcept static_assert thread_local restrict _Bool complex _Complex _Imaginary atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and or not",built_in:"std string cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap array shared_ptr abort abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr",literal:"true false nullptr NULL"},n=[e,t.CLCM,t.CBCM,s,r];return{aliases:["c","cc","h","c++","h++","hpp"],k:c,i:"",k:c,c:["self",e]},{b:t.IR+"::",k:c},{v:[{b:/=/,e:/;/},{b:/\(/,e:/\)/},{bK:"new throw return else",e:/;/}],k:c,c:n.concat([{b:/\(/,e:/\)/,k:c,c:n.concat(["self"]),r:0}]),r:0},{cN:"function",b:"("+t.IR+"[\\*&\\s]+)+"+a,rB:!0,e:/[{;=]/,eE:!0,k:c,i:/[^\w\s\*&]/,c:[{b:a,rB:!0,c:[t.TM],r:0},{cN:"params",b:/\(/,e:/\)/,k:c,r:0,c:[t.CLCM,t.CBCM,r,s,e,{b:/\(/,e:/\)/,k:c,r:0,c:["self",t.CLCM,t.CBCM,r,s,e]}]},t.CLCM,t.CBCM,i]},{cN:"class",bK:"class struct",e:/[{;:]/,c:[{b://,c:["self"]},t.TM]}]),exports:{preprocessor:i,strings:r,k:c}}});hljs.registerLanguage("css",function(e){var c={b:/[A-Z\_\.\-]+\s*:/,rB:!0,e:";",eW:!0,c:[{cN:"attribute",b:/\S/,e:":",eE:!0,starts:{eW:!0,eE:!0,c:[{b:/[\w-]+\(/,rB:!0,c:[{cN:"built_in",b:/[\w-]+/},{b:/\(/,e:/\)/,c:[e.ASM,e.QSM]}]},e.CSSNM,e.QSM,e.ASM,e.CBCM,{cN:"number",b:"#[0-9A-Fa-f]+"},{cN:"meta",b:"!important"}]}}]};return{cI:!0,i:/[=\/|'\$]/,c:[e.CBCM,{cN:"selector-id",b:/#[A-Za-z0-9_-]+/},{cN:"selector-class",b:/\.[A-Za-z0-9_-]+/},{cN:"selector-attr",b:/\[/,e:/\]/,i:"$"},{cN:"selector-pseudo",b:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{b:"@(font-face|page)",l:"[a-z-]+",k:"font-face page"},{b:"@",e:"[{;]",i:/:/,c:[{cN:"keyword",b:/\w+/},{b:/\s/,eW:!0,eE:!0,r:0,c:[e.ASM,e.QSM,e.CSSNM]}]},{cN:"selector-tag",b:"[a-zA-Z-][a-zA-Z0-9_-]*",r:0},{b:"{",e:"}",i:/\S/,c:[e.CBCM,c]}]}});hljs.registerLanguage("javascript",function(e){var r="[A-Za-z$_][0-9A-Za-z$_]*",t={keyword:"in of if for while finally var new function do return void else break catch instanceof with throw case default try this switch continue typeof delete let yield const export super debugger as async await static import from as",literal:"true false null undefined NaN Infinity",built_in:"eval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Error EvalError InternalError RangeError ReferenceError StopIteration SyntaxError TypeError URIError Number Math Date String RegExp Array Float32Array Float64Array Int16Array Int32Array Int8Array Uint16Array Uint32Array Uint8Array Uint8ClampedArray ArrayBuffer DataView JSON Intl arguments require module console window document Symbol Set Map WeakSet WeakMap Proxy Reflect Promise"},a={cN:"number",v:[{b:"\\b(0[bB][01]+)"},{b:"\\b(0[oO][0-7]+)"},{b:e.CNR}],r:0},n={cN:"subst",b:"\\$\\{",e:"\\}",k:t,c:[]},c={cN:"string",b:"`",e:"`",c:[e.BE,n]};n.c=[e.ASM,e.QSM,c,a,e.RM];var s=n.c.concat([e.CBCM,e.CLCM]);return{aliases:["js","jsx"],k:t,c:[{cN:"meta",r:10,b:/^\s*['"]use (strict|asm)['"]/},{cN:"meta",b:/^#!/,e:/$/},e.ASM,e.QSM,c,e.CLCM,e.CBCM,a,{b:/[{,]\s*/,r:0,c:[{b:r+"\\s*:",rB:!0,r:0,c:[{cN:"attr",b:r,r:0}]}]},{b:"("+e.RSR+"|\\b(case|return|throw)\\b)\\s*",k:"return throw case",c:[e.CLCM,e.CBCM,e.RM,{cN:"function",b:"(\\(.*?\\)|"+r+")\\s*=>",rB:!0,e:"\\s*=>",c:[{cN:"params",v:[{b:r},{b:/\(\s*\)/},{b:/\(/,e:/\)/,eB:!0,eE:!0,k:t,c:s}]}]},{b://,sL:"xml",c:[{b:/<\w+\s*\/>/,skip:!0},{b:/<\w+/,e:/(\/\w+|\w+\/)>/,skip:!0,c:[{b:/<\w+\s*\/>/,skip:!0},"self"]}]}],r:0},{cN:"function",bK:"function",e:/\{/,eE:!0,c:[e.inherit(e.TM,{b:r}),{cN:"params",b:/\(/,e:/\)/,eB:!0,eE:!0,c:s}],i:/\[|%/},{b:/\$[(.]/},e.METHOD_GUARD,{cN:"class",bK:"class",e:/[{;=]/,eE:!0,i:/[:"\[\]]/,c:[{bK:"extends"},e.UTM]},{bK:"constructor get set",e:/\{/,eE:!0}],i:/#(?!!)/}});hljs.registerLanguage("php",function(e){var c={b:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},i={cN:"meta",b:/<\?(php)?|\?>/},t={cN:"string",c:[e.BE,i],v:[{b:'b"',e:'"'},{b:"b'",e:"'"},e.inherit(e.ASM,{i:null}),e.inherit(e.QSM,{i:null})]},a={v:[e.BNM,e.CNM]};return{aliases:["php","php3","php4","php5","php6","php7"],cI:!0,k:"and include_once list abstract global private echo interface as static endswitch array null if endwhile or const for endforeach self var while isset public protected exit foreach throw elseif include __FILE__ empty require_once do xor return parent clone use __CLASS__ __LINE__ else break print eval new catch __METHOD__ case exception default die require __FUNCTION__ enddeclare final try switch continue endfor endif declare unset true false trait goto instanceof insteadof __DIR__ __NAMESPACE__ yield finally",c:[e.HCM,e.C("//","$",{c:[i]}),e.C("/\\*","\\*/",{c:[{cN:"doctag",b:"@[A-Za-z]+"}]}),e.C("__halt_compiler.+?;",!1,{eW:!0,k:"__halt_compiler",l:e.UIR}),{cN:"string",b:/<<<['"]?\w+['"]?$/,e:/^\w+;?$/,c:[e.BE,{cN:"subst",v:[{b:/\$\w+/},{b:/\{\$/,e:/\}/}]}]},i,{cN:"keyword",b:/\$this\b/},c,{b:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{cN:"function",bK:"function",e:/[;{]/,eE:!0,i:"\\$|\\[|%",c:[e.UTM,{cN:"params",b:"\\(",e:"\\)",c:["self",c,e.CBCM,t,a]}]},{cN:"class",bK:"class interface",e:"{",eE:!0,i:/[:\(\$"]/,c:[{bK:"extends implements"},e.UTM]},{bK:"namespace",e:";",i:/[\.']/,c:[e.UTM]},{bK:"use",e:";",c:[e.UTM]},{b:"=>"},t,a]}});hljs.registerLanguage("ruby",function(e){var b="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",r={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},c={cN:"doctag",b:"@[A-Za-z]+"},a={b:"#<",e:">"},s=[e.C("#","$",{c:[c]}),e.C("^\\=begin","^\\=end",{c:[c],r:10}),e.C("^__END__","\\n$")],n={cN:"subst",b:"#\\{",e:"}",k:r},t={cN:"string",c:[e.BE,n],v:[{b:/'/,e:/'/},{b:/"/,e:/"/},{b:/`/,e:/`/},{b:"%[qQwWx]?\\(",e:"\\)"},{b:"%[qQwWx]?\\[",e:"\\]"},{b:"%[qQwWx]?{",e:"}"},{b:"%[qQwWx]?<",e:">"},{b:"%[qQwWx]?/",e:"/"},{b:"%[qQwWx]?%",e:"%"},{b:"%[qQwWx]?-",e:"-"},{b:"%[qQwWx]?\\|",e:"\\|"},{b:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{b:/<<(-?)\w+$/,e:/^\s*\w+$/}]},i={cN:"params",b:"\\(",e:"\\)",endsParent:!0,k:r},d=[t,a,{cN:"class",bK:"class module",e:"$|;",i:/=/,c:[e.inherit(e.TM,{b:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{b:"<\\s*",c:[{b:"("+e.IR+"::)?"+e.IR}]}].concat(s)},{cN:"function",bK:"def",e:"$|;",c:[e.inherit(e.TM,{b:b}),i].concat(s)},{b:e.IR+"::"},{cN:"symbol",b:e.UIR+"(\\!|\\?)?:",r:0},{cN:"symbol",b:":(?!\\s)",c:[t,{b:b}],r:0},{cN:"number",b:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",r:0},{b:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{cN:"params",b:/\|/,e:/\|/,k:r},{b:"("+e.RSR+"|unless)\\s*",k:"unless",c:[a,{cN:"regexp",c:[e.BE,n],i:/\n/,v:[{b:"/",e:"/[a-z]*"},{b:"%r{",e:"}[a-z]*"},{b:"%r\\(",e:"\\)[a-z]*"},{b:"%r!",e:"![a-z]*"},{b:"%r\\[",e:"\\][a-z]*"}]}].concat(s),r:0}].concat(s);n.c=d;var l=[{b:/^\s*=>/,starts:{e:"$",c:i.c=d}},{cN:"meta",b:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{e:"$",c:d}}];return{aliases:["rb","gemspec","podspec","thor","irb"],k:r,i:/\/\*/,c:s.concat(l).concat(d)}});hljs.registerLanguage("sql",function(e){var t=e.C("--","$");return{cI:!0,i:/[<>{}*]/,c:[{bK:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with",e:/;/,eW:!0,l:/[\w\.]+/,k:{keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varying void"},c:[{cN:"string",b:"'",e:"'",c:[e.BE,{b:"''"}]},{cN:"string",b:'"',e:'"',c:[e.BE,{b:'""'}]},{cN:"string",b:"`",e:"`",c:[e.BE]},e.CNM,e.CBCM,t,e.HCM]},e.CBCM,t,e.HCM]}});hljs.registerLanguage("nginx",function(e){var r={cN:"variable",v:[{b:/\$\d+/},{b:/\$\{/,e:/}/},{b:"[\\$\\@]"+e.UIR}]},b={eW:!0,l:"[a-z/_]+",k:{literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},r:0,i:"=>",c:[e.HCM,{cN:"string",c:[e.BE,r],v:[{b:/"/,e:/"/},{b:/'/,e:/'/}]},{b:"([a-z]+):/",e:"\\s",eW:!0,eE:!0,c:[r]},{cN:"regexp",c:[e.BE,r],v:[{b:"\\s\\^",e:"\\s|{|;",rE:!0},{b:"~\\*?\\s+",e:"\\s|{|;",rE:!0},{b:"\\*(\\.[a-z\\-]+)+"},{b:"([a-z\\-]+\\.)+\\*"}]},{cN:"number",b:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{cN:"number",b:"\\b\\d+[kKmMgGdshdwy]*\\b",r:0},r]};return{aliases:["nginxconf"],c:[e.HCM,{b:e.UIR+"\\s+{",rB:!0,e:"{",c:[{cN:"section",b:e.UIR}],r:0},{b:e.UIR+"\\s",e:";|{",rB:!0,c:[{cN:"attribute",b:e.UIR,starts:b}],r:0}],i:"[^\\s\\}]"}});hljs.registerLanguage("ini",function(e){var b={cN:"string",c:[e.BE],v:[{b:"'''",e:"'''",r:10},{b:'"""',e:'"""',r:10},{b:'"',e:'"'},{b:"'",e:"'"}]};return{aliases:["toml"],cI:!0,i:/\S/,c:[e.C(";","$"),e.HCM,{cN:"section",b:/^\s*\[+/,e:/\]+/},{b:/^[a-z0-9\[\]_\.-]+\s*=\s*/,e:"$",rB:!0,c:[{cN:"attr",b:/[a-z0-9\[\]_\.-]+/},{b:/=/,eW:!0,r:0,c:[{cN:"literal",b:/\bon|off|true|false|yes|no\b/},{cN:"variable",v:[{b:/\$[\w\d"][\w\d_]*/},{b:/\$\{(.*?)}/}]},b,{cN:"number",b:/([\+\-]+)?[\d]+_[\d_]+/},e.NM]}]}]}});hljs.registerLanguage("java",function(e){var a="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",t={cN:"number",b:"\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",r:0};return{aliases:["jsp"],k:a,i:/<\/|#/,c:[e.C("/\\*\\*","\\*/",{r:0,c:[{b:/\w+@/,r:0},{cN:"doctag",b:"@[A-Za-z]+"}]}),e.CLCM,e.CBCM,e.ASM,e.QSM,{cN:"class",bK:"class interface",e:/[{;=]/,eE:!0,k:"class interface",i:/[:"\[\]]/,c:[{bK:"extends implements"},e.UTM]},{bK:"new throw return else",r:0},{cN:"function",b:"([À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*)*>)?\\s+)+"+e.UIR+"\\s*\\(",rB:!0,e:/[{;=]/,eE:!0,k:a,c:[{b:e.UIR+"\\s*\\(",rB:!0,r:0,c:[e.UTM]},{cN:"params",b:/\(/,e:/\)/,k:a,r:0,c:[e.ASM,e.QSM,e.CNM,e.CBCM]},e.CLCM,e.CBCM]},t,{cN:"meta",b:"@[A-Za-z]+"}]}});hljs.registerLanguage("diff",function(e){return{aliases:["patch"],c:[{cN:"meta",r:10,v:[{b:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{b:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{b:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{cN:"comment",v:[{b:/Index: /,e:/$/},{b:/={3,}/,e:/$/},{b:/^\-{3}/,e:/$/},{b:/^\*{3} /,e:/$/},{b:/^\+{3}/,e:/$/},{b:/\*{5}/,e:/\*{5}$/}]},{cN:"addition",b:"^\\+",e:"$"},{cN:"deletion",b:"^\\-",e:"$"},{cN:"addition",b:"^\\!",e:"$"}]}});hljs.registerLanguage("shell",function(s){return{aliases:["console"],c:[{cN:"meta",b:"^\\s{0,3}[\\w\\d\\[\\]()@-]*[>%$#]",starts:{e:"$",sL:"bash"}}]}});hljs.registerLanguage("http",function(e){var t="HTTP/[0-9\\.]+";return{aliases:["https"],i:"\\S",c:[{b:"^"+t,e:"$",c:[{cN:"number",b:"\\b\\d{3}\\b"}]},{b:"^[A-Z]+ (.*?) "+t+"$",rB:!0,e:"$",c:[{cN:"string",b:" ",e:" ",eB:!0,eE:!0},{b:t},{cN:"keyword",b:"[A-Z]+"}]},{cN:"attribute",b:"^\\w",e:": ",eE:!0,i:"\\n|\\s|=",starts:{e:"$",r:0}},{b:"\\n\\n",starts:{sL:[],eW:!0}}]}}); \ No newline at end of file diff --git a/lib/3rdparty/highlight/styles/a11y-dark.css b/lib/3rdparty/highlight/styles/a11y-dark.css new file mode 100644 index 0000000..b93b742 --- /dev/null +++ b/lib/3rdparty/highlight/styles/a11y-dark.css @@ -0,0 +1,99 @@ +/* a11y-dark theme */ +/* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css */ +/* @author: ericwbailey */ + +/* Comment */ +.hljs-comment, +.hljs-quote { + color: #d4d0ab; +} + +/* Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #ffa07a; +} + +/* Orange */ +.hljs-number, +.hljs-built_in, +.hljs-builtin-name, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-meta, +.hljs-link { + color: #f5ab35; +} + +/* Yellow */ +.hljs-attribute { + color: #ffd700; +} + +/* Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #abe338; +} + +/* Blue */ +.hljs-title, +.hljs-section { + color: #00e0e0; +} + +/* Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #dcc6e0; +} + +.hljs { + display: block; + overflow-x: auto; + background: #2b2b2b; + color: #f8f8f2; + padding: 0.5em; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +@media screen and (-ms-high-contrast: active) { + .hljs-addition, + .hljs-attribute, + .hljs-built_in, + .hljs-builtin-name, + .hljs-bullet, + .hljs-comment, + .hljs-link, + .hljs-literal, + .hljs-meta, + .hljs-number, + .hljs-params, + .hljs-string, + .hljs-symbol, + .hljs-type, + .hljs-quote { + color: highlight; + } + + .hljs-keyword, + .hljs-selector-tag { + font-weight: bold; + } +} diff --git a/lib/3rdparty/highlight/styles/a11y-light.css b/lib/3rdparty/highlight/styles/a11y-light.css new file mode 100644 index 0000000..f1bf8f3 --- /dev/null +++ b/lib/3rdparty/highlight/styles/a11y-light.css @@ -0,0 +1,99 @@ +/* a11y-light theme */ +/* Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css */ +/* @author: ericwbailey */ + +/* Comment */ +.hljs-comment, +.hljs-quote { + color: #696969; +} + +/* Red */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion { + color: #d91e18; +} + +/* Orange */ +.hljs-number, +.hljs-built_in, +.hljs-builtin-name, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-meta, +.hljs-link { + color: #aa5d00; +} + +/* Yellow */ +.hljs-attribute { + color: #aa5d00; +} + +/* Green */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition { + color: #008000; +} + +/* Blue */ +.hljs-title, +.hljs-section { + color: #007faa; +} + +/* Purple */ +.hljs-keyword, +.hljs-selector-tag { + color: #7928a1; +} + +.hljs { + display: block; + overflow-x: auto; + background: #fefefe; + color: #545454; + padding: 0.5em; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +@media screen and (-ms-high-contrast: active) { + .hljs-addition, + .hljs-attribute, + .hljs-built_in, + .hljs-builtin-name, + .hljs-bullet, + .hljs-comment, + .hljs-link, + .hljs-literal, + .hljs-meta, + .hljs-number, + .hljs-params, + .hljs-string, + .hljs-symbol, + .hljs-type, + .hljs-quote { + color: highlight; + } + + .hljs-keyword, + .hljs-selector-tag { + font-weight: bold; + } +} diff --git a/lib/3rdparty/highlight/styles/an-old-hope.css b/lib/3rdparty/highlight/styles/an-old-hope.css new file mode 100644 index 0000000..a6d56f4 --- /dev/null +++ b/lib/3rdparty/highlight/styles/an-old-hope.css @@ -0,0 +1,89 @@ +/* + +An Old Hope – Star Wars Syntax (c) Gustavo Costa +Original theme - Ocean Dark Theme – by https://github.com/gavsiu +Based on Jesse Leite's Atom syntax theme 'An Old Hope' – https://github.com/JesseLeite/an-old-hope-syntax-atom + +*/ + +/* Death Star Comment */ +.hljs-comment, +.hljs-quote +{ + color: #B6B18B; +} + +/* Darth Vader */ +.hljs-variable, +.hljs-template-variable, +.hljs-tag, +.hljs-name, +.hljs-selector-id, +.hljs-selector-class, +.hljs-regexp, +.hljs-deletion +{ + color: #EB3C54; +} + +/* Threepio */ +.hljs-number, +.hljs-built_in, +.hljs-builtin-name, +.hljs-literal, +.hljs-type, +.hljs-params, +.hljs-meta, +.hljs-link +{ + color: #E7CE56; +} + +/* Luke Skywalker */ +.hljs-attribute +{ + color: #EE7C2B; +} + +/* Obi Wan Kenobi */ +.hljs-string, +.hljs-symbol, +.hljs-bullet, +.hljs-addition +{ + color: #4FB4D7; +} + +/* Yoda */ +.hljs-title, +.hljs-section +{ + color: #78BB65; +} + +/* Mace Windu */ +.hljs-keyword, +.hljs-selector-tag +{ + color: #B45EA4; +} + +/* Millenium Falcon */ +.hljs +{ + display: block; + overflow-x: auto; + background: #1C1D21; + color: #c0c5ce; + padding: 0.5em; +} + +.hljs-emphasis +{ + font-style: italic; +} + +.hljs-strong +{ + font-weight: bold; +} diff --git a/lib/3rdparty/highlight/styles/atom-one-dark-reasonable.css b/lib/3rdparty/highlight/styles/atom-one-dark-reasonable.css new file mode 100644 index 0000000..fd41c99 --- /dev/null +++ b/lib/3rdparty/highlight/styles/atom-one-dark-reasonable.css @@ -0,0 +1,77 @@ +/* + +Atom One Dark With support for ReasonML by Gidi Morris, based off work by Daniel Gamage + +Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax + +*/ +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + line-height: 1.3em; + color: #abb2bf; + background: #282c34; + border-radius: 5px; +} +.hljs-keyword, .hljs-operator { + color: #F92672; +} +.hljs-pattern-match { + color: #F92672; +} +.hljs-pattern-match .hljs-constructor { + color: #61aeee; +} +.hljs-function { + color: #61aeee; +} +.hljs-function .hljs-params { + color: #A6E22E; +} +.hljs-function .hljs-params .hljs-typing { + color: #FD971F; +} +.hljs-module-access .hljs-module { + color: #7e57c2; +} +.hljs-constructor { + color: #e2b93d; +} +.hljs-constructor .hljs-string { + color: #9CCC65; +} +.hljs-comment, .hljs-quote { + color: #b18eb1; + font-style: italic; +} +.hljs-doctag, .hljs-formula { + color: #c678dd; +} +.hljs-section, .hljs-name, .hljs-selector-tag, .hljs-deletion, .hljs-subst { + color: #e06c75; +} +.hljs-literal { + color: #56b6c2; +} +.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { + color: #98c379; +} +.hljs-built_in, .hljs-class .hljs-title { + color: #e6c07b; +} +.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { + color: #d19a66; +} +.hljs-symbol, .hljs-bullet, .hljs-link, .hljs-meta, .hljs-selector-id, .hljs-title { + color: #61aeee; +} +.hljs-emphasis { + font-style: italic; +} +.hljs-strong { + font-weight: bold; +} +.hljs-link { + text-decoration: underline; +} diff --git a/lib/3rdparty/highlight/styles/gml.css b/lib/3rdparty/highlight/styles/gml.css new file mode 100644 index 0000000..ffb5e47 --- /dev/null +++ b/lib/3rdparty/highlight/styles/gml.css @@ -0,0 +1,78 @@ +/* + +GML Theme - Meseta + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #222222; + color: #C0C0C0; +} + +.hljs-keywords { + color: #FFB871; + font-weight: bold; +} + +.hljs-built_in { + color: #FFB871; +} + +.hljs-literal { + color: #FF8080; +} + +.hljs-symbol { + color: #58E55A; +} + +.hljs-comment { + color: #5B995B; +} + +.hljs-string { + color: #FFFF00; +} + +.hljs-number { + color: #FF8080; +} + +.hljs-attribute, +.hljs-selector-tag, +.hljs-doctag, +.hljs-name, +.hljs-bullet, +.hljs-code, +.hljs-addition, +.hljs-regexp, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-type, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion, +.hljs-title, +.hljs-section, +.hljs-function, +.hljs-meta-keyword, +.hljs-meta, +.hljs-subst { + color: #C0C0C0; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/lib/3rdparty/highlight/styles/isbl-editor-dark.css b/lib/3rdparty/highlight/styles/isbl-editor-dark.css new file mode 100644 index 0000000..2f1d95d --- /dev/null +++ b/lib/3rdparty/highlight/styles/isbl-editor-dark.css @@ -0,0 +1,112 @@ +/* + +ISBL Editor style dark color scheme (c) Dmitriy Tarasov + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #404040; + color: #f0f0f0; +} + +/* Base color: saturation 0; */ + +.hljs, +.hljs-subst { + color: #f0f0f0; +} + +.hljs-comment { + color: #b5b5b5; + font-style: italic; +} + +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta-keyword, +.hljs-doctag, +.hljs-name { + color: #f0f0f0; + font-weight: bold; +} + + +/* User color: hue: 0 */ + +.hljs-string { + color: #97bf0d; +} + +.hljs-type, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #f0f0f0; +} + +.hljs-title, +.hljs-section { + color: #df471e; +} + +.hljs-title>.hljs-built_in { + color: #81bce9; + font-weight: normal; +} + +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #e2c696; +} + +/* Language color: hue: 90; */ + +.hljs-built_in, +.hljs-literal { + color: #97bf0d; + font-weight: bold; +} + +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #397300; +} + +.hljs-class { + color: #ce9d4d; + font-weight: bold; +} + +/* Meta color: hue: 200 */ + +.hljs-meta { + color: #1f7199; +} + +.hljs-meta-string { + color: #4d99bf; +} + + +/* Misc effects */ + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/lib/3rdparty/highlight/styles/isbl-editor-light.css b/lib/3rdparty/highlight/styles/isbl-editor-light.css new file mode 100644 index 0000000..633070d --- /dev/null +++ b/lib/3rdparty/highlight/styles/isbl-editor-light.css @@ -0,0 +1,112 @@ +/* + +ISBL Editor style light color schemec (c) Dmitriy Tarasov + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: white; + color: black; +} + +/* Base color: saturation 0; */ + +.hljs, +.hljs-subst { + color: #000000; +} + +.hljs-comment { + color: #555555; + font-style: italic; +} + +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta-keyword, +.hljs-doctag, +.hljs-name { + color: #000000; + font-weight: bold; +} + + +/* User color: hue: 0 */ + +.hljs-string { + color: #000080; +} + +.hljs-type, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #000000; +} + +.hljs-title, +.hljs-section { + color: #fb2c00; +} + +.hljs-title>.hljs-built_in { + color: #008080; + font-weight: normal; +} + +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #5e1700; +} + +/* Language color: hue: 90; */ + +.hljs-built_in, +.hljs-literal { + color: #000080; + font-weight: bold; +} + +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #397300; +} + +.hljs-class { + color: #6f1C00; + font-weight: bold; +} + +/* Meta color: hue: 200 */ + +.hljs-meta { + color: #1f7199; +} + +.hljs-meta-string { + color: #4d99bf; +} + + +/* Misc effects */ + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/lib/3rdparty/highlight/styles/lightfair.css b/lib/3rdparty/highlight/styles/lightfair.css new file mode 100644 index 0000000..a247c8e --- /dev/null +++ b/lib/3rdparty/highlight/styles/lightfair.css @@ -0,0 +1,87 @@ +/* + +Lightfair style (c) Tristian Kelly + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; +} + +.hljs-name { + color:#01a3a3; +} + +.hljs-tag,.hljs-meta { + color:#778899; +} + +.hljs, +.hljs-subst { + color: #444 +} + +.hljs-comment { + color: #888888 +} + +.hljs-keyword, +.hljs-attribute, +.hljs-selector-tag, +.hljs-meta-keyword, +.hljs-doctag, +.hljs-name { + font-weight: bold +} + +.hljs-type, +.hljs-string, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #4286f4 +} + +.hljs-title, +.hljs-section { + color: #4286f4; + font-weight: bold +} + +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #BC6060 +} + +.hljs-literal { + color: #62bcbc +} + +.hljs-built_in, +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #25c6c6 +} + +.hljs-meta-string { + color: #4d99bf +} + +.hljs-emphasis { + font-style: italic +} + +.hljs-strong { + font-weight: bold +} diff --git a/lib/3rdparty/highlight/styles/nord.css b/lib/3rdparty/highlight/styles/nord.css new file mode 100644 index 0000000..4240384 --- /dev/null +++ b/lib/3rdparty/highlight/styles/nord.css @@ -0,0 +1,309 @@ +/* + * Copyright (c) 2017-present Arctic Ice Studio + * Copyright (c) 2017-present Sven Greb + * + * Project: Nord highlight.js + * Version: 0.1.0 + * Repository: https://github.com/arcticicestudio/nord-highlightjs + * License: MIT + * References: + * https://github.com/arcticicestudio/nord + */ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #2E3440; +} + +.hljs, +.hljs-subst { + color: #D8DEE9; +} + +.hljs-selector-tag { + color: #81A1C1; +} + +.hljs-selector-id { + color: #8FBCBB; + font-weight: bold; +} + +.hljs-selector-class { + color: #8FBCBB; +} + +.hljs-selector-attr { + color: #8FBCBB; +} + +.hljs-selector-pseudo { + color: #88C0D0; +} + +.hljs-addition { + background-color: rgba(163, 190, 140, 0.5); +} + +.hljs-deletion { + background-color: rgba(191, 97, 106, 0.5); +} + +.hljs-built_in, +.hljs-type { + color: #8FBCBB; +} + +.hljs-class { + color: #8FBCBB; +} + +.hljs-function { + color: #88C0D0; +} + +.hljs-function > .hljs-title { + color: #88C0D0; +} + +.hljs-keyword, +.hljs-literal, +.hljs-symbol { + color: #81A1C1; +} + +.hljs-number { + color: #B48EAD; +} + +.hljs-regexp { + color: #EBCB8B; +} + +.hljs-string { + color: #A3BE8C; +} + +.hljs-title { + color: #8FBCBB; +} + +.hljs-params { + color: #D8DEE9; +} + +.hljs-bullet { + color: #81A1C1; +} + +.hljs-code { + color: #8FBCBB; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-formula { + color: #8FBCBB; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-link:hover { + text-decoration: underline; +} + +.hljs-quote { + color: #4C566A; +} + +.hljs-comment { + color: #4C566A; +} + +.hljs-doctag { + color: #8FBCBB; +} + +.hljs-meta, +.hljs-meta-keyword { + color: #5E81AC; +} + +.hljs-meta-string { + color: #A3BE8C; +} + +.hljs-attr { + color: #8FBCBB; +} + +.hljs-attribute { + color: #D8DEE9; +} + +.hljs-builtin-name { + color: #81A1C1; +} + +.hljs-name { + color: #81A1C1; +} + +.hljs-section { + color: #88C0D0; +} + +.hljs-tag { + color: #81A1C1; +} + +.hljs-variable { + color: #D8DEE9; +} + +.hljs-template-variable { + color: #D8DEE9; +} + +.hljs-template-tag { + color: #5E81AC; +} + +.abnf .hljs-attribute { + color: #88C0D0; +} + +.abnf .hljs-symbol { + color: #EBCB8B; +} + +.apache .hljs-attribute { + color: #88C0D0; +} + +.apache .hljs-section { + color: #81A1C1; +} + +.arduino .hljs-built_in { + color: #88C0D0; +} + +.aspectj .hljs-meta { + color: #D08770; +} + +.aspectj > .hljs-title { + color: #88C0D0; +} + +.bnf .hljs-attribute { + color: #8FBCBB; +} + +.clojure .hljs-name { + color: #88C0D0; +} + +.clojure .hljs-symbol { + color: #EBCB8B; +} + +.coq .hljs-built_in { + color: #88C0D0; +} + +.cpp .hljs-meta-string { + color: #8FBCBB; +} + +.css .hljs-built_in { + color: #88C0D0; +} + +.css .hljs-keyword { + color: #D08770; +} + +.diff .hljs-meta { + color: #8FBCBB; +} + +.ebnf .hljs-attribute { + color: #8FBCBB; +} + +.glsl .hljs-built_in { + color: #88C0D0; +} + +.groovy .hljs-meta:not(:first-child) { + color: #D08770; +} + +.haxe .hljs-meta { + color: #D08770; +} + +.java .hljs-meta { + color: #D08770; +} + +.ldif .hljs-attribute { + color: #8FBCBB; +} + +.lisp .hljs-name { + color: #88C0D0; +} + +.lua .hljs-built_in { + color: #88C0D0; +} + +.moonscript .hljs-built_in { + color: #88C0D0; +} + +.nginx .hljs-attribute { + color: #88C0D0; +} + +.nginx .hljs-section { + color: #5E81AC; +} + +.pf .hljs-built_in { + color: #88C0D0; +} + +.processing .hljs-built_in { + color: #88C0D0; +} + +.scss .hljs-keyword { + color: #81A1C1; +} + +.stylus .hljs-keyword { + color: #81A1C1; +} + +.swift .hljs-meta { + color: #D08770; +} + +.vim .hljs-built_in { + color: #88C0D0; + font-style: italic; +} + +.yaml .hljs-meta { + color: #D08770; +} diff --git a/lib/3rdparty/highlight/styles/routeros.css b/lib/3rdparty/highlight/styles/routeros.css new file mode 100644 index 0000000..ebe2399 --- /dev/null +++ b/lib/3rdparty/highlight/styles/routeros.css @@ -0,0 +1,108 @@ +/* + + highlight.js style for Microtik RouterOS script + +*/ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #F0F0F0; +} + +/* Base color: saturation 0; */ + +.hljs, +.hljs-subst { + color: #444; +} + +.hljs-comment { + color: #888888; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-meta-keyword, +.hljs-doctag, +.hljs-name { + font-weight: bold; +} + +.hljs-attribute { + color: #0E9A00; +} + +.hljs-function { + color: #99069A; +} + +.hljs-builtin-name { + color: #99069A; +} + +/* User color: hue: 0 */ + +.hljs-type, +.hljs-string, +.hljs-number, +.hljs-selector-id, +.hljs-selector-class, +.hljs-quote, +.hljs-template-tag, +.hljs-deletion { + color: #880000; +} + +.hljs-title, +.hljs-section { + color: #880000; + font-weight: bold; +} + +.hljs-regexp, +.hljs-symbol, +.hljs-variable, +.hljs-template-variable, +.hljs-link, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #BC6060; +} + + +/* Language color: hue: 90; */ + +.hljs-literal { + color: #78A960; +} + +.hljs-built_in, +.hljs-bullet, +.hljs-code, +.hljs-addition { + color: #0C9A9A; +} + + +/* Meta color: hue: 200 */ + +.hljs-meta { + color: #1f7199; +} + +.hljs-meta-string { + color: #4d99bf; +} + + +/* Misc effects */ + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/lib/3rdparty/highlight/styles/shades-of-purple.css b/lib/3rdparty/highlight/styles/shades-of-purple.css new file mode 100644 index 0000000..c0e899e --- /dev/null +++ b/lib/3rdparty/highlight/styles/shades-of-purple.css @@ -0,0 +1,97 @@ +/** + * Shades of Purple Theme — for Highlightjs. + * + * @author (c) Ahmad Awais + * @link GitHub Repo → https://github.com/ahmadawais/Shades-of-Purple-HighlightJS + * @version 1.5.0 + */ + +.hljs { + display: block; + overflow-x: auto; + /* Custom font is optional */ + /* font-family: 'Operator Mono', 'Fira Code', 'Menlo', 'Monaco', 'Courier New', 'monospace'; */ + line-height: 1.45; + padding: 2rem; + background: #2d2b57; + font-weight: normal; +} + +.hljs-title { + color: #fad000; + font-weight: normal; +} + +.hljs-name { + color: #a1feff; +} + +.hljs-tag { + color: #ffffff; +} + +.hljs-attr { + color: #f8d000; + font-style: italic; +} + +.hljs-built_in, +.hljs-selector-tag, +.hljs-section { + color: #fb9e00; +} + +.hljs-keyword { + color: #fb9e00; +} + +.hljs, +.hljs-subst { + color: #e3dfff; +} + +.hljs-string, +.hljs-attribute, +.hljs-symbol, +.hljs-bullet, +.hljs-addition, +.hljs-code, +.hljs-regexp, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo, +.hljs-template-tag, +.hljs-quote, +.hljs-deletion { + color: #4cd213; +} + +.hljs-meta, +.hljs-meta-string { + color: #fb9e00; +} + +.hljs-comment { + color: #ac65ff; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-literal, +.hljs-name, +.hljs-strong { + font-weight: normal; +} + +.hljs-literal, +.hljs-number { + color: #fa658d; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} diff --git a/lib/3rdparty/highlight/styles/vs2015.css b/lib/3rdparty/highlight/styles/vs2015.css new file mode 100644 index 0000000..d1d9be3 --- /dev/null +++ b/lib/3rdparty/highlight/styles/vs2015.css @@ -0,0 +1,115 @@ +/* + * Visual Studio 2015 dark style + * Author: Nicolas LLOBERA + */ + +.hljs { + display: block; + overflow-x: auto; + padding: 0.5em; + background: #1E1E1E; + color: #DCDCDC; +} + +.hljs-keyword, +.hljs-literal, +.hljs-symbol, +.hljs-name { + color: #569CD6; +} +.hljs-link { + color: #569CD6; + text-decoration: underline; +} + +.hljs-built_in, +.hljs-type { + color: #4EC9B0; +} + +.hljs-number, +.hljs-class { + color: #B8D7A3; +} + +.hljs-string, +.hljs-meta-string { + color: #D69D85; +} + +.hljs-regexp, +.hljs-template-tag { + color: #9A5334; +} + +.hljs-subst, +.hljs-function, +.hljs-title, +.hljs-params, +.hljs-formula { + color: #DCDCDC; +} + +.hljs-comment, +.hljs-quote { + color: #57A64A; + font-style: italic; +} + +.hljs-doctag { + color: #608B4E; +} + +.hljs-meta, +.hljs-meta-keyword, +.hljs-tag { + color: #9B9B9B; +} + +.hljs-variable, +.hljs-template-variable { + color: #BD63C5; +} + +.hljs-attr, +.hljs-attribute, +.hljs-builtin-name { + color: #9CDCFE; +} + +.hljs-section { + color: gold; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-strong { + font-weight: bold; +} + +/*.hljs-code { + font-family:'Monospace'; +}*/ + +.hljs-bullet, +.hljs-selector-tag, +.hljs-selector-id, +.hljs-selector-class, +.hljs-selector-attr, +.hljs-selector-pseudo { + color: #D7BA7D; +} + +.hljs-addition { + background-color: #144212; + display: inline-block; + width: 100%; +} + +.hljs-deletion { + background-color: #600; + display: inline-block; + width: 100%; +} diff --git a/lib/3rdparty/highlight/styles/xcode.css b/lib/3rdparty/highlight/styles/xcode.css index 43dddad..b305665 100644 --- a/lib/3rdparty/highlight/styles/xcode.css +++ b/lib/3rdparty/highlight/styles/xcode.css @@ -12,55 +12,66 @@ XCode style (c) Angel Garcia color: black; } +/* Gray DOCTYPE selectors like WebKit */ +.xml .hljs-meta { + color: #c0c0c0; +} + .hljs-comment, .hljs-quote { - color: #006a00; + color: #007400; } +.hljs-tag, +.hljs-attribute, .hljs-keyword, .hljs-selector-tag, -.hljs-literal { - color: #aa0d91; -} - +.hljs-literal, .hljs-name { - color: #008; + color: #aa0d91; } .hljs-variable, .hljs-template-variable { - color: #660; + color: #3F6E74; } -.hljs-string { +.hljs-code, +.hljs-string, +.hljs-meta-string { color: #c41a16; } .hljs-regexp, .hljs-link { - color: #080; + color: #0E0EFF; } .hljs-title, -.hljs-tag, .hljs-symbol, .hljs-bullet, -.hljs-number, -.hljs-meta { +.hljs-number { color: #1c00cf; } .hljs-section, +.hljs-meta { + color: #643820; +} + + .hljs-class .hljs-title, .hljs-type, -.hljs-attr, .hljs-built_in, .hljs-builtin-name, .hljs-params { color: #5c2699; } -.hljs-attribute, +.hljs-attr { + color: #836C28; +} + .hljs-subst { color: #000; } diff --git a/lib/3rdparty/highlight/styles/xt256.css b/lib/3rdparty/highlight/styles/xt256.css index 58df82c..3e35ad2 100644 --- a/lib/3rdparty/highlight/styles/xt256.css +++ b/lib/3rdparty/highlight/styles/xt256.css @@ -11,7 +11,7 @@ overflow-x: auto; color: #eaeaea; background: #000; - padding: 0.5; + padding: 0.5em; } .hljs-subst { diff --git a/lib/3rdparty/pixi-ease.js b/lib/3rdparty/pixi-ease.js new file mode 100644 index 0000000..201fb85 --- /dev/null +++ b/lib/3rdparty/pixi-ease.js @@ -0,0 +1,4090 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o difference ? difference : change; + this.object.rotation += delta * sign; + } + } + }]); + + return face; +}(wait); + +module.exports = face; + +},{"./wait":11,"yy-angle":22}],3:[function(require,module,exports){ +'use strict'; + +var Ease = { + list: require('./list'), + wait: require('./wait'), + to: require('./to'), + shake: require('./shake'), + tint: require('./tint'), + face: require('./face'), + angle: require('./angle'), + target: require('./target'), + movie: require('./movie'), + load: require('./load') +}; + +PIXI.extras.Ease = Ease; + +module.exports = Ease; + +},{"./angle":1,"./face":2,"./list":4,"./load":5,"./movie":6,"./shake":7,"./target":8,"./tint":9,"./to":10,"./wait":11}],4:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Events = require('eventemitter3'); + +var Angle = require('./angle'); +var Face = require('./face'); +var Load = require('./load'); +var Movie = require('./movie'); +var Shake = require('./shake'); +var Target = require('./target'); +var Tint = require('./tint'); +var To = require('./to'); +var Wait = require('./wait'); + +var Ease = function (_Events) { + _inherits(Ease, _Events); + + /** + * Main class for creating eases + * @param {object} [options] + * @param {boolean} [options.noTicker] don't add the update function to PIXI.ticker + * @param {PIXI.ticker} [options.ticker=PIXI.ticker.shared] use this PIXI.ticker for the list + * @extends eventemitter + * @fire done + * @fire each + */ + function Ease(options) { + _classCallCheck(this, Ease); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (Ease.__proto__ || Object.getPrototypeOf(Ease)).call(this)); + + if (!options.noTicker) { + var ticker = options.ticker || PIXI.ticker.shared; + ticker.add(function () { + return _this.update(ticker.elapsedMS); + }); + } + _this.list = []; + _this.empty = true; + _this.removeWaiting = []; + _this.removeAllWaiting = false; + return _this; + } + + /** + * Add animation(s) to animation list + * @param {(object|object[])} any animation class + * @return {object} first animation + */ + + + _createClass(Ease, [{ + key: 'add', + value: function add() { + var first = void 0; + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = arguments[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var arg = _step.value; + + if (Array.isArray(arg)) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = arg[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var entry = _step2.value; + + if (!first) { + first = entry; + } + this.list.push(entry); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } else { + first = arg; + this.list.push(arg); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + this.empty = false; + return first; + } + + /** + * remove animation(s) + * @param {object|array} animate - the animation (or array of animations) to remove; can be null + */ + + }, { + key: 'remove', + value: function remove(animate) { + if (this.inUpdate) { + this.removeWaiting.push(animate); + } else { + var index = this.list.indexOf(animate); + if (index !== -1) { + this.list.splice(index, 1); + } + } + } + + /** + * remove all animations from list + * @inherited from yy-loop + */ + + }, { + key: 'removeAll', + value: function removeAll() { + if (this.inUpdate) { + this.removeAllWaiting = true; + } else { + this.list = []; + } + } + + /** + * update frame + * this is automatically added to PIXI.ticker unless options.noTicker is set + * if using options.noTicker, this should be called manually + * @param {number} elasped time in MS since last update + */ + + }, { + key: 'update', + value: function update(elapsed) { + this.inUpdate = true; + for (var i = 0, _i = this.list.length; i < _i; i++) { + if (this.list[i] && this.list[i].update(elapsed)) { + this.list.splice(i, 1); + i--; + _i--; + } + } + this.emit('each', this); + if (this.list.length === 0 && !this.empty) { + this.emit('done', this); + this.empty = true; + } + this.inUpdate = false; + if (this.removeAllWaiting) { + this.removeAll(); + this.removeAllWaiting = false; + } + while (this.removeWaiting.length) { + this.remove(this.removeWaiting.pop()); + } + } + + /** + * number of animations + * @type {number} + */ + + }, { + key: 'to', + + + /** + * default options for all eases + * @typedef {object} EaseOptions + * @param {object} [EaseOptions.options] + * @param {number} [EaseOptions.options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [EaseOptions.options.pause] start the animation paused + * @param {boolean|number} [EaseOptions.options.repeat] true: repeat animation forever n: repeat animation n times + * @param {boolean|number} [EaseOptions.options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * @param {Function} [EaseOptions.options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set + * @param {string|Function} [EaseOptions.options.ease] name or function from easing.js (see http://easings.net for examples) + */ + + /** + * ease parameters of object + * @param {PIXI.DisplayObject} object to animate + * @param {object} goto - parameters to animate, e.g.: {alpha: 5, scale: {3, 5}, scale: 5, rotation: Math.PI} + * @param {number} duration - time to run + * @fires done + * @fires wait + * @fires first + * @fires each + * @fires loop + * @fires reverse + */ + value: function to() { + return this.add(new (Function.prototype.bind.apply(To, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** + * animate object's {x, y} using an angle + * @param {object} object to animate + * @param {number} angle in radians + * @param {number} speed in pixels/millisecond + * @param {number} [duration=0] in milliseconds; if 0, then continues forever + * @param {object} [options] @see {@link Wait} + */ + + }, { + key: 'angle', + value: function angle() { + return this.add(new (Function.prototype.bind.apply(Angle, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.face class; see Ease.to class below for parameters */ + + }, { + key: 'face', + value: function face() { + return this.add(new (Function.prototype.bind.apply(Face, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.load class; see Ease.to class below for parameters */ + + }, { + key: 'load', + value: function load() { + return this.add(new (Function.prototype.bind.apply(Load, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.movie class; see Ease.to class below for parameters */ + + }, { + key: 'movie', + value: function movie() { + return this.add(new (Function.prototype.bind.apply(Movie, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.shake class; see Ease.to class below for parameters */ + + }, { + key: 'shake', + value: function shake() { + return this.add(new (Function.prototype.bind.apply(Shake, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.target class; see Ease.to class below for parameters */ + + }, { + key: 'target', + value: function target() { + return this.add(new (Function.prototype.bind.apply(Target, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.angle tint; see Ease.to class below for parameters */ + + }, { + key: 'tint', + value: function tint() { + return this.add(new (Function.prototype.bind.apply(Tint, [null].concat(Array.prototype.slice.call(arguments))))()); + } + + /** helper to add to the list a new Ease.wait class; see Ease.to class below for parameters */ + + }, { + key: 'wait', + value: function wait() { + return this.add(new (Function.prototype.bind.apply(Wait, [null].concat(Array.prototype.slice.call(arguments))))()); + } + }, { + key: 'count', + get: function get() { + return this.list.length; + } + + /** + * number of active animations + * @type {number} + */ + + }, { + key: 'countRunning', + get: function get() { + var count = 0; + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = this.list[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var entry = _step3.value; + + if (!entry.pause) { + count++; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + return count; + } + }]); + + return Ease; +}(Events); + +module.exports = Ease; + +},{"./angle":1,"./face":2,"./load":5,"./movie":6,"./shake":7,"./target":8,"./tint":9,"./to":10,"./wait":11,"eventemitter3":12}],5:[function(require,module,exports){ +'use strict'; + +var wait = require('./wait'); +var to = require('./to'); +var tint = require('./tint'); +var shake = require('./shake'); +var angle = require('./angle'); +var face = require('./face'); +var target = require('./target'); +var movie = require('./movie'); + +/** + * restart an animation = requires a saved state + * @param {object} object(s) to animate + */ +function load(object, load) { + if (!load) { + return null; + } + var options = { load: load }; + switch (load.type) { + case 'Wait': + return new wait(object, options); + case 'To': + return new to(object, null, null, options); + case 'Tint': + return new tint(object, null, null, options); + case 'Shake': + return new shake(object, null, null, options); + case 'Angle': + return new angle(object, null, null, null, options); + case 'Face': + return new face(object[0], object[1], null, options); + case 'Target': + return new target(object[0], object[1], null, options); + case 'Movie': + return new movie(object, object[1], null, options); + } +} + +module.exports = load; + +},{"./angle":1,"./face":2,"./movie":6,"./shake":7,"./target":8,"./tint":9,"./to":10,"./wait":11}],6:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** + * animate a movie of textures + */ + +var movie = function (_wait) { + _inherits(movie, _wait); + + /** + * @param {object} object to animate + * @param {PIXI.Texture[]} textures + * @param {number} [duration=0] time to run (use 0 for infinite duration--should only be used with customized easing functions) + * @param {object} [options] + * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [options.pause] start the animation paused + * @param {(boolean|number)} [options.repeat] true: repeat animation forever n: repeat animation n times + * @param {(boolean|number)} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * @param {(boolean|number)} [options.continue] true: continue animation with new starting values n: continue animation n times + * @param {Function} [options.load] loads an animation using a .save() object note the * parameters below cannot be loaded and must be re-set + * @param {Function} [options.ease] function from easing.js (see http://easings.net for examples) + * @emits {done} animation expires + * @emits {wait} each update during a wait + * @emits {first} first update when animation starts + * @emits {each} each update while animation is running + * @emits {loop} when animation is repeated + * @emits {reverse} when animation is reversed + */ + function movie(object, textures, duration, options) { + _classCallCheck(this, movie); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (movie.__proto__ || Object.getPrototypeOf(movie)).call(this, object, options)); + + _this.type = 'Movie'; + if (Array.isArray(object)) { + _this.list = object; + _this.object = _this.list[0]; + } + if (options.load) { + _this.load(options.load); + } else { + _this.textures = textures; + _this.duration = duration; + _this.current = 0; + _this.length = textures.length; + _this.interval = duration / _this.length; + _this.isReverse = false; + _this.restart(); + } + return _this; + } + + _createClass(movie, [{ + key: 'save', + value: function save() { + var save = _get(movie.prototype.__proto__ || Object.getPrototypeOf(movie.prototype), 'save', this).call(this); + save.goto = this.goto; + save.current = this.current; + save.length = this.length; + save.interval = this.interval; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(movie.prototype.__proto__ || Object.getPrototypeOf(movie.prototype), 'load', this).call(this, _load); + this.goto = _load.goto; + this.current = _load.current; + this.interval = _load.current; + } + }, { + key: 'restart', + value: function restart() { + this.current = 0; + this.time = 0; + this.isReverse = false; + } + }, { + key: 'reverse', + value: function reverse() { + this.isReverse = !this.isReverse; + } + }, { + key: 'calculate', + value: function calculate() { + var index = Math.round(this.options.ease(this.time, 0, this.length - 1, this.duration)); + if (this.isReverse) { + index = this.length - 1 - index; + } + if (this.list) { + for (var i = 0; i < this.list.length; i++) { + this.list[i].texture = this.textures[index]; + } + } else { + this.object.texture = this.textures[index]; + } + } + }]); + + return movie; +}(wait); + +module.exports = movie; + +},{"./wait":11}],7:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** + * shakes an object or list of objects + */ + +var shake = function (_wait) { + _inherits(shake, _wait); + + /** + * @param {object|array} object or list of objects to shake + * @param {number} amount to shake + * @param {number} duration (in milliseconds) to shake + * @param {object} options (see Animate.wait) + */ + function shake(object, amount, duration, options) { + _classCallCheck(this, shake); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (shake.__proto__ || Object.getPrototypeOf(shake)).call(this, object, options)); + + _this.type = 'Shake'; + if (Array.isArray(object)) { + _this.array = true; + _this.list = object; + } + if (options.load) { + _this.load(options.load); + } else { + if (_this.list) { + _this.start = []; + for (var i = 0; i < object.length; i++) { + var target = object[i]; + _this.start[i] = { x: target.x, y: target.y }; + } + } else { + _this.start = { x: object.x, y: object.y }; + } + _this.amount = amount; + _this.duration = duration; + } + return _this; + } + + _createClass(shake, [{ + key: 'save', + value: function save() { + var save = _get(shake.prototype.__proto__ || Object.getPrototypeOf(shake.prototype), 'save', this).call(this); + save.start = this.start; + save.amount = this.amount; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(shake.prototype.__proto__ || Object.getPrototypeOf(shake.prototype), 'load', this).call(this, _load); + this.start = _load.start; + this.amount = _load.amount; + } + }, { + key: 'calculate', + value: function calculate() /*elapsed*/{ + var object = this.object; + var start = this.start; + var amount = this.amount; + if (this.array) { + var list = this.list; + for (var i = 0; i < list.length; i++) { + var _object = list[i]; + var actual = start[i]; + _object.x = actual.x + Math.floor(Math.random() * amount * 2) - amount; + _object.y = actual.y + Math.floor(Math.random() * amount * 2) - amount; + } + } + object.x = start.x + Math.floor(Math.random() * amount * 2) - amount; + object.y = start.y + Math.floor(Math.random() * amount * 2) - amount; + } + }, { + key: 'done', + value: function done() { + var object = this.object; + var start = this.start; + if (this.array) { + var list = this.list; + for (var i = 0; i < list.length; i++) { + var _object2 = list[i]; + var actual = start[i]; + _object2.x = actual.x; + _object2.y = actual.y; + } + } else { + object.x = start.x; + object.y = start.y; + } + } + }]); + + return shake; +}(wait); + +module.exports = shake; + +},{"./wait":11}],8:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** move an object to a target's location */ + +var target = function (_wait) { + _inherits(target, _wait); + + /** + * move to a target + * @param {object} object - object to animate + * @param {object} target - object needs to contain {x: x, y: y} + * @param {number} speed - number of pixels to move per millisecond + * @param {object} [options] @see {@link Wait} + * @param {boolean} [options.keepAlive] don't cancel the animation when target is reached + */ + function target(object, _target, speed, options) { + _classCallCheck(this, target); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (target.__proto__ || Object.getPrototypeOf(target)).call(this, object, options)); + + _this.type = 'Target'; + _this.target = _target; + if (options.load) { + _this.load(options.load); + } else { + _this.speed = speed; + } + return _this; + } + + _createClass(target, [{ + key: 'save', + value: function save() { + var save = _get(target.prototype.__proto__ || Object.getPrototypeOf(target.prototype), 'save', this).call(this); + save.speed = this.speed; + save.keepAlive = this.options.keepAlive; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(target.prototype.__proto__ || Object.getPrototypeOf(target.prototype), 'load', this).call(this, _load); + this.speed = _load.speed; + this.options.keepAlive = _load.keepAlive; + } + }, { + key: 'calculate', + value: function calculate(elapsed) { + var deltaX = this.target.x - this.object.x; + var deltaY = this.target.y - this.object.y; + if (deltaX === 0 && deltaY === 0) { + this.emit('done', this.object); + if (!this.options.keepAlive) { + return true; + } + } else { + var angle = Math.atan2(deltaY, deltaX); + this.object.x += Math.cos(angle) * elapsed * this.speed; + this.object.y += Math.sin(angle) * elapsed * this.speed; + if (deltaX >= 0 !== this.target.x - this.object.x >= 0) { + this.object.x = this.target.x; + } + if (deltaY >= 0 !== this.target.y - this.object.y >= 0) { + this.object.y = this.target.y; + } + } + } + }]); + + return target; +}(wait); + +module.exports = target; + +},{"./wait":11}],9:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Color = require('yy-color'); +var wait = require('./wait'); + +var tint = function (_wait) { + _inherits(tint, _wait); + + /** + * @param {PIXI.DisplayObject|PIXI.DisplayObject[]} object + * @param {number|number[]} tint + * @param {number} [duration] in milliseconds + * @param {object} [options] @see {@link Wait} + */ + function tint(object, _tint, duration, options) { + _classCallCheck(this, tint); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (tint.__proto__ || Object.getPrototypeOf(tint)).call(this, object, options)); + + _this.type = 'Tint'; + if (Array.isArray(object)) { + _this.list = object; + _this.object = _this.list[0]; + } + _this.duration = duration; + if (options.load) { + _this.load(options.load); + } else if (Array.isArray(_tint)) { + _this.tints = [_this.object.tint].concat(_toConsumableArray(_tint)); + } else { + _this.start = _this.object.tint; + _this.to = _tint; + } + return _this; + } + + _createClass(tint, [{ + key: 'save', + value: function save() { + var save = _get(tint.prototype.__proto__ || Object.getPrototypeOf(tint.prototype), 'save', this).call(this); + save.start = this.start; + save.to = this.to; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(tint.prototype.__proto__ || Object.getPrototypeOf(tint.prototype), 'load', this).call(this, _load); + this.start = _load.start; + this.to = _load.to; + } + }, { + key: 'calculate', + value: function calculate() { + var percent = this.options.ease(this.time, 0, 1, this.duration); + if (this.tints) { + var each = 1 / (this.tints.length - 1); + var per = each; + for (var i = 1; i < this.tints.length; i++) { + if (percent <= per) { + var color = Color.blend(1 - (per - percent) / each, this.tints[i - 1], this.tints[i]); + if (this.list) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = this.list[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var object = _step.value; + + object.tint = color; + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } else { + this.object.tint = color; + } + break; + } + per += each; + } + } else { + var _color = Color.blend(percent, this.start, this.to); + if (this.list) { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = this.list[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var _object = _step2.value; + + _object.tint = _color; + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } else { + this.object.tint = _color; + } + } + } + }, { + key: 'reverse', + value: function reverse() { + if (this.tints) { + var tints = []; + for (var i = this.tints.length - 1; i >= 0; i--) { + tints.push(this.tints[i]); + } + this.tints = tints; + } else { + var swap = this.to; + this.to = this.start; + this.start = swap; + } + } + }]); + + return tint; +}(wait); + +module.exports = tint; + +},{"./wait":11,"yy-color":23}],10:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var wait = require('./wait'); + +/** animate any numeric parameter of an object or array of objects */ + +var to = function (_wait) { + _inherits(to, _wait); + + /** + * @private + * @param {object} object to animate + * @param {object} goto - parameters to animate, e.g.: {alpha: 5, scale: {3, 5}, scale: 5, rotation: Math.PI} + * @param {number} duration - time to run + * @param {object} [options] + * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [options.pause] start the animation paused + * @param {boolean|number} [options.repeat] true: repeat animation forever n: repeat animation n times + * @param {boolean|number} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * @param {Function} [options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set + * @param {string|Function} [options.ease] name or function from easing.js (see http://easings.net for examples) + * @emits to:done animation expires + * @emits to:wait each update during a wait + * @emits to:first first update when animation starts + * @emits to:each each update while animation is running + * @emits to:loop when animation is repeated + * @emits to:reverse when animation is reversed + */ + function to(object, goto, duration, options) { + _classCallCheck(this, to); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (to.__proto__ || Object.getPrototypeOf(to)).call(this, object, options)); + + _this.type = 'To'; + if (Array.isArray(object)) { + _this.list = object; + _this.object = _this.list[0]; + } + if (options.load) { + _this.load(options.load); + } else { + _this.goto = goto; + _this.fixScale(); + _this.duration = duration; + _this.restart(); + } + return _this; + } + + /** + * converts scale from { scale: n } to { scale: { x: n, y: n }} + * @private + */ + + + _createClass(to, [{ + key: 'fixScale', + value: function fixScale() { + if (typeof this.goto['scale'] !== 'undefined' && !Number.isNaN(this.goto['scale'])) { + this.goto['scale'] = { x: this.goto['scale'], y: this.goto['scale'] }; + } + } + }, { + key: 'save', + value: function save() { + var save = _get(to.prototype.__proto__ || Object.getPrototypeOf(to.prototype), 'save', this).call(this); + save.goto = this.goto; + save.start = this.start; + save.delta = this.delta; + save.keys = this.keys; + return save; + } + }, { + key: 'load', + value: function load(_load) { + _get(to.prototype.__proto__ || Object.getPrototypeOf(to.prototype), 'load', this).call(this, _load); + this.goto = _load.goto; + this.start = _load.start; + this.delta = _load.delta; + this.keys = _load.keys; + } + }, { + key: 'restart', + value: function restart() { + var i = 0; + var start = this.start = []; + var delta = this.delta = []; + var keys = this.keys = []; + var goto = this.goto; + var object = this.object; + + // loops through all keys in goto object + for (var key in goto) { + + // handles keys with one additional level e.g.: goto = {scale: {x: 5, y: 3}} + if (isNaN(goto[key])) { + keys[i] = { key: key, children: [] }; + start[i] = []; + delta[i] = []; + var j = 0; + for (var key2 in goto[key]) { + keys[i].children[j] = key2; + start[i][j] = parseFloat(object[key][key2]); + start[i][j] = this._correctDOM(key2, start[i][j]); + start[i][j] = isNaN(this.start[i][j]) ? 0 : start[i][j]; + delta[i][j] = goto[key][key2] - start[i][j]; + j++; + } + } else { + start[i] = parseFloat(object[key]); + start[i] = this._correctDOM(key, start[i]); + start[i] = isNaN(this.start[i]) ? 0 : start[i]; + delta[i] = goto[key] - start[i]; + keys[i] = key; + } + i++; + } + this.time = 0; + } + }, { + key: 'reverse', + value: function reverse() { + var object = this.object; + var keys = this.keys; + var goto = this.goto; + var delta = this.delta; + var start = this.start; + + for (var i = 0, _i = keys.length; i < _i; i++) { + var key = keys[i]; + if (isNaN(goto[key])) { + for (var j = 0, _j = key.children.length; j < _j; j++) { + delta[i][j] = -delta[i][j]; + start[i][j] = parseFloat(object[key.key][key.children[j]]); + start[i][j] = isNaN(start[i][j]) ? 0 : start[i][j]; + } + } else { + delta[i] = -delta[i]; + start[i] = parseFloat(object[key]); + start[i] = isNaN(start[i]) ? 0 : start[i]; + } + } + } + }, { + key: 'calculate', + value: function calculate() /*elapsed*/{ + var object = this.object; + var list = this.list; + var keys = this.keys; + var goto = this.goto; + var time = this.time; + var start = this.start; + var delta = this.delta; + var duration = this.duration; + var ease = this.options.ease; + for (var i = 0, _i = this.keys.length; i < _i; i++) { + var key = keys[i]; + if (isNaN(goto[key])) { + var key1 = key.key; + for (var j = 0, _j = key.children.length; j < _j; j++) { + var key2 = key.children[j]; + var others = object[key1][key2] = time >= duration ? start[i][j] + delta[i][j] : ease(time, start[i][j], delta[i][j], duration); + if (list) { + for (var k = 1, _k = list.length; k < _k; k++) { + list[k][key1][key2] = others; + } + } + } + } else { + var _key = keys[i]; + var _others = object[_key] = time >= duration ? start[i] + delta[i] : ease(time, start[i], delta[i], duration); + if (list) { + for (var _j2 = 1, _j3 = this.list.length; _j2 < _j3; _j2++) { + list[_j2][_key] = _others; + } + } + } + } + } + }]); + + return to; +}(wait); + +module.exports = to; + +},{"./wait":11}],11:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Easing = require('penner'); +var EventEmitter = require('eventemitter3'); + +var wait = function (_EventEmitter) { + _inherits(wait, _EventEmitter); + + /** + * @param {object|object[]} object or list of objects to animate + * @param {object} [options] + * @param {number} [options.wait=0] n milliseconds before starting animation (can also be used to pause animation for a length of time) + * @param {boolean} [options.pause] start the animation paused + * @param {(boolean|number)} [options.repeat] true: repeat animation forever n: repeat animation n times + * @param {(boolean|number)} [options.reverse] true: reverse animation (if combined with repeat, then pulse) n: reverse animation n times + * + * @param {number} [options.id] user-generated id (e.g., I use it to properly load animations when an object has multiple animations running) + * @param {Function} [options.load] loads an animation using an .save() object note the * parameters below cannot be loaded and must be re-set + * @param {Function|string} [options.ease] function (or penner function name) from easing.js (see http://easings.net for examples)* + * + * @emits {done} animation expires + * @emits {wait} each update during a wait + * @emits {first} first update when animation starts + * @emits {each} each update while animation is running + * @emits {loop} when animation is repeated + * @emits {reverse} when animation is reversed + */ + function wait(object, options) { + _classCallCheck(this, wait); + + var _this = _possibleConstructorReturn(this, (wait.__proto__ || Object.getPrototypeOf(wait)).call(this)); + + _this.object = object; + _this.options = options || {}; + _this.type = 'Wait'; + if (_this.options.load) { + _this.load(_this.options.load); + } else { + _this.time = 0; + } + if (_this.options.ease && typeof _this.options.ease !== 'function') { + _this.options.easeName = _this.options.ease; + _this.options.ease = Easing[_this.options.ease]; + } + if (!_this.options.ease) { + _this.options.ease = Easing['linear']; + } + return _this; + } + + _createClass(wait, [{ + key: 'save', + value: function save() { + var save = { type: this.type, time: this.time, duration: this.duration, ease: this.options.easeName }; + var options = this.options; + if (options.wait) { + save.wait = options.wait; + } + if (typeof options.id !== 'undefined') { + save.id = options.id; + } + if (options.pause) { + save.pause = options.pause; + } + if (options.repeat) { + save.repeat = options.repeat; + } + if (options.reverse) { + save.reverse = options.reverse; + } + return save; + } + }, { + key: 'load', + value: function load(_load) { + this.options.wait = _load.wait; + this.options.pause = _load.pause; + this.options.repeat = _load.repeat; + this.options.reverse = _load.reverse; + this.options.id = _load.id; + this.options.ease = _load.ease; + if (this.options.ease && typeof this.options.ease !== 'function') { + this.options.easeName = this.options.ease; + this.options.ease = Easing[this.options.ease]; + } + if (!this.options.ease) { + this.options.ease = Easing['linear']; + } + this.time = _load.time; + this.duration = _load.duration; + } + + /** + * pause this entry + * @type {boolean} + */ + + }, { + key: 'end', + value: function end(leftOver) { + if (this.options.reverse) { + this.reverse(); + this.time = leftOver; + if (!this.options.repeat) { + if (this.options.reverse === true) { + this.options.reverse = false; + } else { + this.options.reverse--; + } + } else { + if (this.options.repeat !== true) { + this.options.repeat--; + } + } + this.emit('loop', this.list || this.object); + } else if (this.options.repeat) { + this.time = leftOver; + if (this.options.repeat !== true) { + this.options.repeat--; + } + this.emit('loop', this.list || this.object); + } else { + this.done(); + this.emit('done', this.list || this.object, leftOver); + // this.list = this.object = null + return true; + } + } + }, { + key: 'update', + value: function update(elapsed) { + var options = this.options; + if (options.pause) { + return; + } + if (options.wait) { + options.wait -= elapsed; + if (options.wait <= 0) { + elapsed = -options.wait; + options.wait = false; + } else { + this.emit('wait', elapsed, this.list || this.object); + return; + } + } + if (!this.first) { + this.first = true; + this.emit('first', this.list || this.object); + } + this.time += elapsed; + var leftOver = 0; + var duration = this.duration; + var time = this.time; + if (duration !== 0 && time > duration) { + leftOver = time - duration; + this.time = time = duration; + } + var force = this.calculate(elapsed); + this.emit('each', elapsed, this.list || this.object, this); + if (this.type === 'Wait' || duration !== 0 && time === duration) { + return this.end(leftOver); + } + return force || time === duration; + } + + // correct certain DOM values + + }, { + key: '_correctDOM', + value: function _correctDOM(key, value) { + switch (key) { + case 'opacity': + return isNaN(value) ? 1 : value; + } + return value; + } + }, { + key: 'reverse', + value: function reverse() {} + }, { + key: 'calculate', + value: function calculate() {} + }, { + key: 'done', + value: function done() {} + }, { + key: 'pause', + set: function set(value) { + this.options.pause = value; + }, + get: function get() { + return this.options.pause; + } + }]); + + return wait; +}(EventEmitter); + +module.exports = wait; + +},{"eventemitter3":12,"penner":13}],12:[function(require,module,exports){ +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Add a listener for a given event. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} context The context to invoke the listener with. + * @param {Boolean} once Specify if the listener is a one-time listener. + * @returns {EventEmitter} + * @private + */ +function addListener(emitter, event, fn, context, once) { + if (typeof fn !== 'function') { + throw new TypeError('The listener must be a function'); + } + + var listener = new EE(fn, context || emitter, once) + , evt = prefix ? prefix + event : event; + + if (!emitter._events[evt]) emitter._events[evt] = listener, emitter._eventsCount++; + else if (!emitter._events[evt].fn) emitter._events[evt].push(listener); + else emitter._events[evt] = [emitter._events[evt], listener]; + + return emitter; +} + +/** + * Clear event by name. + * + * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. + * @param {(String|Symbol)} evt The Event name. + * @private + */ +function clearEvent(emitter, evt) { + if (--emitter._eventsCount === 0) emitter._events = new Events(); + else delete emitter._events[evt]; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Array} The registered listeners. + * @public + */ +EventEmitter.prototype.listeners = function listeners(event) { + var evt = prefix ? prefix + event : event + , handlers = this._events[evt]; + + if (!handlers) return []; + if (handlers.fn) return [handlers.fn]; + + for (var i = 0, l = handlers.length, ee = new Array(l); i < l; i++) { + ee[i] = handlers[i].fn; + } + + return ee; +}; + +/** + * Return the number of listeners listening to a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Number} The number of listeners. + * @public + */ +EventEmitter.prototype.listenerCount = function listenerCount(event) { + var evt = prefix ? prefix + event : event + , listeners = this._events[evt]; + + if (!listeners) return 0; + if (listeners.fn) return 1; + return listeners.length; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {(String|Symbol)} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + return addListener(this, event, fn, context, false); +}; + +/** + * Add a one-time listener for a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn The listener function. + * @param {*} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + return addListener(this, event, fn, context, true); +}; + +/** + * Remove the listeners of a given event. + * + * @param {(String|Symbol)} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {*} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + clearEvent(this, evt); + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn && + (!once || listeners.once) && + (!context || listeners.context === context) + ) { + clearEvent(this, evt); + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn || + (once && !listeners[i].once) || + (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else clearEvent(this, evt); + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {(String|Symbol)} [event] The event name. + * @returns {EventEmitter} `this`. + * @public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) clearEvent(this, evt); + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + +},{}],13:[function(require,module,exports){ + +/* + Copyright © 2001 Robert Penner + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + Neither the name of the author nor the names of contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +(function() { + var penner, umd; + + umd = function(factory) { + if (typeof exports === 'object') { + return module.exports = factory; + } else if (typeof define === 'function' && define.amd) { + return define([], factory); + } else { + return this.penner = factory; + } + }; + + penner = { + linear: function(t, b, c, d) { + return c * t / d + b; + }, + easeInQuad: function(t, b, c, d) { + return c * (t /= d) * t + b; + }, + easeOutQuad: function(t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + }, + easeInOutQuad: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t + b; + } else { + return -c / 2 * ((--t) * (t - 2) - 1) + b; + } + }, + easeInCubic: function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + easeOutCubic: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOutCubic: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t + 2) + b; + } + }, + easeInQuart: function(t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + easeOutQuart: function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + easeInOutQuart: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } else { + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + } + }, + easeInQuint: function(t, b, c, d) { + return c * (t /= d) * t * t * t * t + b; + }, + easeOutQuint: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + easeInOutQuint: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + } + }, + easeInSine: function(t, b, c, d) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + easeOutSine: function(t, b, c, d) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + easeInOutSine: function(t, b, c, d) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + easeInExpo: function(t, b, c, d) { + if (t === 0) { + return b; + } else { + return c * Math.pow(2, 10 * (t / d - 1)) + b; + } + }, + easeOutExpo: function(t, b, c, d) { + if (t === d) { + return b + c; + } else { + return c * (-Math.pow(2, -10 * t / d) + 1) + b; + } + }, + easeInOutExpo: function(t, b, c, d) { + if (t === 0) { + b; + } + if (t === d) { + b + c; + } + if ((t /= d / 2) < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } else { + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + } + }, + easeInCirc: function(t, b, c, d) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + easeOutCirc: function(t, b, c, d) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + easeInOutCirc: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + } else { + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + } + }, + easeInElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + easeOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + }, + easeInOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d / 2) === 2) { + b + c; + } + if (!p) { + p = d * (.3 * 1.5); + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + if (t < 1) { + return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + } else { + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; + } + }, + easeInBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + easeOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + easeInOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + if ((t /= d / 2) < 1) { + return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b; + } else { + return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; + } + }, + easeInBounce: function(t, b, c, d) { + var v; + v = penner.easeOutBounce(d - t, 0, c, d); + return c - v + b; + }, + easeOutBounce: function(t, b, c, d) { + if ((t /= d) < 1 / 2.75) { + return c * (7.5625 * t * t) + b; + } else if (t < 2 / 2.75) { + return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b; + } else if (t < 2.5 / 2.75) { + return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b; + } else { + return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b; + } + }, + easeInOutBounce: function(t, b, c, d) { + var v; + if (t < d / 2) { + v = penner.easeInBounce(t * 2, 0, c, d); + return v * .5 + b; + } else { + v = penner.easeOutBounce(t * 2 - d, 0, c, d); + return v * .5 + c * .5 + b; + } + } + }; + + umd(penner); + +}).call(this); + +},{}],14:[function(require,module,exports){ +// A library of seedable RNGs implemented in Javascript. +// +// Usage: +// +// var seedrandom = require('seedrandom'); +// var random = seedrandom(1); // or any seed. +// var x = random(); // 0 <= x < 1. Every bit is random. +// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. + +// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. +// Period: ~2^116 +// Reported to pass all BigCrush tests. +var alea = require('./lib/alea'); + +// xor128, a pure xor-shift generator by George Marsaglia. +// Period: 2^128-1. +// Reported to fail: MatrixRank and LinearComp. +var xor128 = require('./lib/xor128'); + +// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. +// Period: 2^192-2^32 +// Reported to fail: CollisionOver, SimpPoker, and LinearComp. +var xorwow = require('./lib/xorwow'); + +// xorshift7, by François Panneton and Pierre L'ecuyer, takes +// a different approach: it adds robustness by allowing more shifts +// than Marsaglia's original three. It is a 7-shift generator +// with 256 bits, that passes BigCrush with no systmatic failures. +// Period 2^256-1. +// No systematic BigCrush failures reported. +var xorshift7 = require('./lib/xorshift7'); + +// xor4096, by Richard Brent, is a 4096-bit xor-shift with a +// very long period that also adds a Weyl generator. It also passes +// BigCrush with no systematic failures. Its long period may +// be useful if you have many generators and need to avoid +// collisions. +// Period: 2^4128-2^32. +// No systematic BigCrush failures reported. +var xor4096 = require('./lib/xor4096'); + +// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random +// number generator derived from ChaCha, a modern stream cipher. +// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf +// Period: ~2^127 +// No systematic BigCrush failures reported. +var tychei = require('./lib/tychei'); + +// The original ARC4-based prng included in this library. +// Period: ~2^1600 +var sr = require('./seedrandom'); + +sr.alea = alea; +sr.xor128 = xor128; +sr.xorwow = xorwow; +sr.xorshift7 = xorshift7; +sr.xor4096 = xor4096; +sr.tychei = tychei; + +module.exports = sr; + +},{"./lib/alea":15,"./lib/tychei":16,"./lib/xor128":17,"./lib/xor4096":18,"./lib/xorshift7":19,"./lib/xorwow":20,"./seedrandom":21}],15:[function(require,module,exports){ +// A port of an algorithm by Johannes Baagøe , 2010 +// http://baagoe.com/en/RandomMusings/javascript/ +// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror +// Original work is under MIT license - + +// Copyright (C) 2010 by Johannes Baagøe +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// 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. + + + +(function(global, module, define) { + +function Alea(seed) { + var me = this, mash = Mash(); + + me.next = function() { + var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 + me.s0 = me.s1; + me.s1 = me.s2; + return me.s2 = t - (me.c = t | 0); + }; + + // Apply the seeding algorithm from Baagoe. + me.c = 1; + me.s0 = mash(' '); + me.s1 = mash(' '); + me.s2 = mash(' '); + me.s0 -= mash(seed); + if (me.s0 < 0) { me.s0 += 1; } + me.s1 -= mash(seed); + if (me.s1 < 0) { me.s1 += 1; } + me.s2 -= mash(seed); + if (me.s2 < 0) { me.s2 += 1; } + mash = null; +} + +function copy(f, t) { + t.c = f.c; + t.s0 = f.s0; + t.s1 = f.s1; + t.s2 = f.s2; + return t; +} + +function impl(seed, opts) { + var xg = new Alea(seed), + state = opts && opts.state, + prng = xg.next; + prng.int32 = function() { return (xg.next() * 0x100000000) | 0; } + prng.double = function() { + return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 + }; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +function Mash() { + var n = 0xefc8249d; + + var mash = function(data) { + data = data.toString(); + for (var i = 0; i < data.length; i++) { + n += data.charCodeAt(i); + var h = 0.02519603282416938 * n; + n = h >>> 0; + h -= n; + h *= n; + n = h >>> 0; + h -= n; + n += h * 0x100000000; // 2^32 + } + return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 + }; + + return mash; +} + + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.alea = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],16:[function(require,module,exports){ +// A Javascript implementaion of the "Tyche-i" prng algorithm by +// Samuel Neves and Filipe Araujo. +// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var b = me.b, c = me.c, d = me.d, a = me.a; + b = (b << 25) ^ (b >>> 7) ^ c; + c = (c - d) | 0; + d = (d << 24) ^ (d >>> 8) ^ a; + a = (a - b) | 0; + me.b = b = (b << 20) ^ (b >>> 12) ^ c; + me.c = c = (c - d) | 0; + me.d = (d << 16) ^ (c >>> 16) ^ a; + return me.a = (a - b) | 0; + }; + + /* The following is non-inverted tyche, which has better internal + * bit diffusion, but which is about 25% slower than tyche-i in JS. + me.next = function() { + var a = me.a, b = me.b, c = me.c, d = me.d; + a = (me.a + me.b | 0) >>> 0; + d = me.d ^ a; d = d << 16 ^ d >>> 16; + c = me.c + d | 0; + b = me.b ^ c; b = b << 12 ^ d >>> 20; + me.a = a = a + b | 0; + d = d ^ a; me.d = d = d << 8 ^ d >>> 24; + me.c = c = c + d | 0; + b = b ^ c; + return me.b = (b << 7 ^ b >>> 25); + } + */ + + me.a = 0; + me.b = 0; + me.c = 2654435769 | 0; + me.d = 1367130551; + + if (seed === Math.floor(seed)) { + // Integer seed. + me.a = (seed / 0x100000000) | 0; + me.b = seed | 0; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 20; k++) { + me.b ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.a = f.a; + t.b = f.b; + t.c = f.c; + t.d = f.d; + return t; +}; + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.tychei = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],17:[function(require,module,exports){ +// A Javascript implementaion of the "xor128" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + + // Set up generator function. + me.next = function() { + var t = me.x ^ (me.x << 11); + me.x = me.y; + me.y = me.z; + me.z = me.w; + return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); + }; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor128 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],18:[function(require,module,exports){ +// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. +// +// This fast non-cryptographic random number generator is designed for +// use in Monte-Carlo algorithms. It combines a long-period xorshift +// generator with a Weyl generator, and it passes all common batteries +// of stasticial tests for randomness while consuming only a few nanoseconds +// for each prng generated. For background on the generator, see Brent's +// paper: "Some long-period random number generators using shifts and xors." +// http://arxiv.org/pdf/1004.3115v1.pdf +// +// Usage: +// +// var xor4096 = require('xor4096'); +// random = xor4096(1); // Seed with int32 or string. +// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. +// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. +// +// For nonzero numeric keys, this impelementation provides a sequence +// identical to that by Brent's xorgens 3 implementaion in C. This +// implementation also provides for initalizing the generator with +// string seeds, or for saving and restoring the state of the generator. +// +// On Chrome, this prng benchmarks about 2.1 times slower than +// Javascript's built-in Math.random(). + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + var w = me.w, + X = me.X, i = me.i, t, v; + // Update Weyl generator. + me.w = w = (w + 0x61c88647) | 0; + // Update xor generator. + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + // Update Xor generator array state. + v = X[i] = v ^ t; + me.i = i; + // Result is the combination. + return (v + (w ^ (w >>> 16))) | 0; + }; + + function init(me, seed) { + var t, v, i, j, w, X = [], limit = 128; + if (seed === (seed | 0)) { + // Numeric seeds initialize v, which is used to generates X. + v = seed; + seed = null; + } else { + // String seeds are mixed into v and X one character at a time. + seed = seed + '\0'; + v = 0; + limit = Math.max(limit, seed.length); + } + // Initialize circular array and weyl value. + for (i = 0, j = -32; j < limit; ++j) { + // Put the unicode characters into the array, and shuffle them. + if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); + // After 32 shuffles, take v as the starting w value. + if (j === 0) w = v; + v ^= v << 10; + v ^= v >>> 15; + v ^= v << 4; + v ^= v >>> 13; + if (j >= 0) { + w = (w + 0x61c88647) | 0; // Weyl. + t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. + i = (0 == t) ? i + 1 : 0; // Count zeroes. + } + } + // We have detected all zeroes; make the key nonzero. + if (i >= 128) { + X[(seed && seed.length || 0) & 127] = -1; + } + // Run the generator 512 times to further mix the state before using it. + // Factoring this as a function slows the main generator, so it is just + // unrolled here. The weyl generator is not advanced while warming up. + i = 127; + for (j = 4 * 128; j > 0; --j) { + v = X[(i + 34) & 127]; + t = X[i = ((i + 1) & 127)]; + v ^= v << 13; + t ^= t << 17; + v ^= v >>> 15; + t ^= t >>> 12; + X[i] = v ^ t; + } + // Storing state as object members is faster than using closure variables. + me.w = w; + me.X = X; + me.i = i; + } + + init(me, seed); +} + +function copy(f, t) { + t.i = f.i; + t.w = f.w; + t.X = f.X.slice(); + return t; +}; + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.X) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xor4096 = impl; +} + +})( + this, // window object or global + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + +},{}],19:[function(require,module,exports){ +// A Javascript implementaion of the "xorshift7" algorithm by +// François Panneton and Pierre L'ecuyer: +// "On the Xorgshift Random Number Generators" +// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf + +(function(global, module, define) { + +function XorGen(seed) { + var me = this; + + // Set up generator function. + me.next = function() { + // Update xor generator. + var X = me.x, i = me.i, t, v, w; + t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); + t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); + t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); + t = X[(i + 4) & 7]; v ^= t ^ (t << 7); + t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); + X[i] = v; + me.i = (i + 1) & 7; + return v; + }; + + function init(me, seed) { + var j, w, X = []; + + if (seed === (seed | 0)) { + // Seed state array using a 32-bit integer. + w = X[0] = seed; + } else { + // Seed state using a string. + seed = '' + seed; + for (j = 0; j < seed.length; ++j) { + X[j & 7] = (X[j & 7] << 15) ^ + (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); + } + } + // Enforce an array length of 8, not all zeroes. + while (X.length < 8) X.push(0); + for (j = 0; j < 8 && X[j] === 0; ++j); + if (j == 8) w = X[7] = -1; else w = X[j]; + + me.x = X; + me.i = 0; + + // Discard an initial 256 values. + for (j = 256; j > 0; --j) { + me.next(); + } + } + + init(me, seed); +} + +function copy(f, t) { + t.x = f.x.slice(); + t.i = f.i; + return t; +} + +function impl(seed, opts) { + if (seed == null) seed = +(new Date); + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (state.x) copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorshift7 = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + +},{}],20:[function(require,module,exports){ +// A Javascript implementaion of the "xorwow" prng algorithm by +// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper + +(function(global, module, define) { + +function XorGen(seed) { + var me = this, strseed = ''; + + // Set up generator function. + me.next = function() { + var t = (me.x ^ (me.x >>> 2)); + me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; + return (me.d = (me.d + 362437 | 0)) + + (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; + }; + + me.x = 0; + me.y = 0; + me.z = 0; + me.w = 0; + me.v = 0; + + if (seed === (seed | 0)) { + // Integer seed. + me.x = seed; + } else { + // String seed. + strseed += seed; + } + + // Mix in string seed, then discard an initial batch of 64 values. + for (var k = 0; k < strseed.length + 64; k++) { + me.x ^= strseed.charCodeAt(k) | 0; + if (k == strseed.length) { + me.d = me.x << 10 ^ me.x >>> 4; + } + me.next(); + } +} + +function copy(f, t) { + t.x = f.x; + t.y = f.y; + t.z = f.z; + t.w = f.w; + t.v = f.v; + t.d = f.d; + return t; +} + +function impl(seed, opts) { + var xg = new XorGen(seed), + state = opts && opts.state, + prng = function() { return (xg.next() >>> 0) / 0x100000000; }; + prng.double = function() { + do { + var top = xg.next() >>> 11, + bot = (xg.next() >>> 0) / 0x100000000, + result = (top + bot) / (1 << 21); + } while (result === 0); + return result; + }; + prng.int32 = xg.next; + prng.quick = prng; + if (state) { + if (typeof(state) == 'object') copy(state, xg); + prng.state = function() { return copy(xg, {}); } + } + return prng; +} + +if (module && module.exports) { + module.exports = impl; +} else if (define && define.amd) { + define(function() { return impl; }); +} else { + this.xorwow = impl; +} + +})( + this, + (typeof module) == 'object' && module, // present in node.js + (typeof define) == 'function' && define // present with an AMD loader +); + + + +},{}],21:[function(require,module,exports){ +/* +Copyright 2014 David Bau. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +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. + +*/ + +(function (pool, math) { +// +// The following constants are related to IEEE 754 limits. +// +var global = this, + width = 256, // each RC4 output is 0 <= x < 256 + chunks = 6, // at least six RC4 outputs for each double + digits = 52, // there are 52 significant digits in a double + rngname = 'random', // rngname: name for Math.random and Math.seedrandom + startdenom = math.pow(width, chunks), + significance = math.pow(2, digits), + overflow = significance * 2, + mask = width - 1, + nodecrypto; // node.js crypto module, initialized at the bottom. + +// +// seedrandom() +// This is the seedrandom function described above. +// +function seedrandom(seed, options, callback) { + var key = []; + options = (options == true) ? { entropy: true } : (options || {}); + + // Flatten the seed string or build one from local entropy if needed. + var shortseed = mixkey(flatten( + options.entropy ? [seed, tostring(pool)] : + (seed == null) ? autoseed() : seed, 3), key); + + // Use the seed to initialize an ARC4 generator. + var arc4 = new ARC4(key); + + // This function returns a random double in [0, 1) that contains + // randomness in every bit of the mantissa of the IEEE 754 value. + var prng = function() { + var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 + d = startdenom, // and denominator d = 2 ^ 48. + x = 0; // and no 'extra last byte'. + while (n < significance) { // Fill up all significant digits by + n = (n + x) * width; // shifting numerator and + d *= width; // denominator and generating a + x = arc4.g(1); // new least-significant-byte. + } + while (n >= overflow) { // To avoid rounding up, before adding + n /= 2; // last byte, shift everything + d /= 2; // right using integer math until + x >>>= 1; // we have exactly the desired bits. + } + return (n + x) / d; // Form the number within [0, 1). + }; + + prng.int32 = function() { return arc4.g(4) | 0; } + prng.quick = function() { return arc4.g(4) / 0x100000000; } + prng.double = prng; + + // Mix the randomness into accumulated entropy. + mixkey(tostring(arc4.S), pool); + + // Calling convention: what to return as a function of prng, seed, is_math. + return (options.pass || callback || + function(prng, seed, is_math_call, state) { + if (state) { + // Load the arc4 state from the given state if it has an S array. + if (state.S) { copy(state, arc4); } + // Only provide the .state method if requested via options.state. + prng.state = function() { return copy(arc4, {}); } + } + + // If called as a method of Math (Math.seedrandom()), mutate + // Math.random because that is how seedrandom.js has worked since v1.0. + if (is_math_call) { math[rngname] = prng; return seed; } + + // Otherwise, it is a newer calling convention, so return the + // prng directly. + else return prng; + })( + prng, + shortseed, + 'global' in options ? options.global : (this == math), + options.state); +} +math['seed' + rngname] = seedrandom; + +// +// ARC4 +// +// An ARC4 implementation. The constructor takes a key in the form of +// an array of at most (width) integers that should be 0 <= x < (width). +// +// The g(count) method returns a pseudorandom integer that concatenates +// the next (count) outputs from ARC4. Its return value is a number x +// that is in the range 0 <= x < (width ^ count). +// +function ARC4(key) { + var t, keylen = key.length, + me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; + + // The empty key [] is treated as [0]. + if (!keylen) { key = [keylen++]; } + + // Set up S using the standard key scheduling algorithm. + while (i < width) { + s[i] = i++; + } + for (i = 0; i < width; i++) { + s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; + s[j] = t; + } + + // The "g" method returns the next (count) outputs as one number. + (me.g = function(count) { + // Using instance members instead of closure state nearly doubles speed. + var t, r = 0, + i = me.i, j = me.j, s = me.S; + while (count--) { + t = s[i = mask & (i + 1)]; + r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; + } + me.i = i; me.j = j; + return r; + // For robust unpredictability, the function call below automatically + // discards an initial batch of values. This is called RC4-drop[256]. + // See http://google.com/search?q=rsa+fluhrer+response&btnI + })(width); +} + +// +// copy() +// Copies internal state of ARC4 to or from a plain object. +// +function copy(f, t) { + t.i = f.i; + t.j = f.j; + t.S = f.S.slice(); + return t; +}; + +// +// flatten() +// Converts an object tree to nested arrays of strings. +// +function flatten(obj, depth) { + var result = [], typ = (typeof obj), prop; + if (depth && typ == 'object') { + for (prop in obj) { + try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} + } + } + return (result.length ? result : typ == 'string' ? obj : obj + '\0'); +} + +// +// mixkey() +// Mixes a string seed into a key that is an array of integers, and +// returns a shortened string seed that is equivalent to the result key. +// +function mixkey(seed, key) { + var stringseed = seed + '', smear, j = 0; + while (j < stringseed.length) { + key[mask & j] = + mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); + } + return tostring(key); +} + +// +// autoseed() +// Returns an object for autoseeding, using window.crypto and Node crypto +// module if available. +// +function autoseed() { + try { + var out; + if (nodecrypto && (out = nodecrypto.randomBytes)) { + // The use of 'out' to remember randomBytes makes tight minified code. + out = out(width); + } else { + out = new Uint8Array(width); + (global.crypto || global.msCrypto).getRandomValues(out); + } + return tostring(out); + } catch (e) { + var browser = global.navigator, + plugins = browser && browser.plugins; + return [+new Date, global, plugins, global.screen, tostring(pool)]; + } +} + +// +// tostring() +// Converts an array of charcodes to a string +// +function tostring(a) { + return String.fromCharCode.apply(0, a); +} + +// +// When seedrandom.js is loaded, we immediately mix a few bits +// from the built-in RNG into the entropy pool. Because we do +// not want to interfere with deterministic PRNG state later, +// seedrandom will not call math.random on its own again after +// initialization. +// +mixkey(math.random(), pool); + +// +// Nodejs and AMD support: export the implementation as a module using +// either convention. +// +if ((typeof module) == 'object' && module.exports) { + module.exports = seedrandom; + // When in node.js, try using crypto package for autoseeding. + try { + nodecrypto = require('crypto'); + } catch (ex) {} +} else if ((typeof define) == 'function' && define.amd) { + define(function() { return seedrandom; }); +} + +// End anonymous scope, and pass initial values. +})( + [], // pool: entropy pool starts empty + Math // math: package containing random, pow, and seedrandom +); + +},{"crypto":25}],22:[function(require,module,exports){ +// angle.js +// Released under MIT license +// Author: David Figatner +// Copyright (c) 2016-17 YOPEY YOPEY LLC + +var _toDegreeConversion = 180 / Math.PI +var _toRadianConversion = Math.PI / 180 + +/** @constant {number} */ +var UP = Math.PI / 2 +var DOWN = 3 * Math.PI / 2 +var LEFT = Math.PI +var RIGHT = 0 + +var NORTH = UP +var SOUTH = DOWN +var WEST = LEFT +var EAST = RIGHT + +var PI_2 = Math.PI * 2 +var PI_QUARTER = Math.PI / 4 +var PI_HALF = Math.PI / 2 + +/** + * converts from radians to degrees (all other functions expect radians) + * @param {number} radians + * @return {number} degrees + */ +function toDegrees(radians) +{ + return radians * _toDegreeConversion +} + +/** + * converts from degrees to radians (all other functions expect radians) + * @param {number} degrees + * @return {number} radians + */ +function toRadians(degrees) +{ + return degrees * _toRadianConversion +} + +/** + * returns whether the target angle is between angle1 and angle2 (in radians) + * (based on: http://stackoverflow.com/questions/11406189/determine-if-angle-lies-between-2-other-angles) + * @param {number} target angle + * @param {number} angle1 + * @param {number} angle2 + * @return {boolean} + */ +function isAngleBetween(target, angle1, angle2) +{ + var rAngle = ((angle2 - angle1) % PI_2 + PI_2) % PI_2 + if (rAngle >= Math.PI) + { + var swap = angle1 + angle1 = angle2 + angle2 = swap + } + + if (angle1 <= angle2) + { + return target >= angle1 && target <= angle2 + } + else + { + return target >= angle1 || target <= angle2 + } +} + +/** + * returns +1 or -1 based on whether the difference between two angles is positive or negative (in radians) + * @param {number} target angle + * @param {number} source angle + * @return {number} 1 or -1 + */ +function differenceAnglesSign(target, source) +{ + function mod(a, n) + { + return (a % n + n) % n + } + + var a = target - source + return mod((a + Math.PI), PI_2) - Math.PI > 0 ? 1 : -1 +} + +/** + * returns the normalized difference between two angles (in radians) + * @param {number} a - first angle + * @param {number} b - second angle + * @return {number} normalized difference between a and b + */ +function differenceAngles(a, b) +{ + var c = Math.abs(a - b) % PI_2 + return c > Math.PI ? (PI_2 - c) : c +} + +/** + * returns a target angle that is the shortest way to rotate an object between start and to--may choose a negative angle + * @param {number} start + * @param {number} to + * @return {number} shortest target angle + */ +function shortestAngle(start, to) +{ + var difference = differenceAngles(to, start) + var sign = differenceAnglesSign(to, start) + var delta = difference * sign + return delta + start +} + +/** + * returns the normalized angle (0 - PI x 2) + * @param {number} radians + * @return {number} normalized angle in radians + */ +function normalize(radians) +{ + return radians - PI_2 * Math.floor(radians / PI_2) +} + +/** + * returns angle between two points (in radians) + * @param {Point} [point1] {x: x, y: y} + * @param {Point} [point2] {x: x, y: y} + * @param {number} [x1] + * @param {number} [y1] + * @param {number} [x2] + * @param {number} [y2] + * @return {number} angle + */ +function angleTwoPoints(/* (point1, point2) OR (x1, y1, x2, y2) */) +{ + if (arguments.length === 4) + { + return Math.atan2(arguments[3] - arguments[1], arguments[2] - arguments[0]) + } + else + { + return Math.atan2(arguments[1].y - arguments[0].y, arguments[1].x - arguments[0].x) + } +} + +/** + * returns distance between two points + * @param {Point} [point1] {x: x, y: y} + * @param {Point} [point2] {x: x, y: y} + * @param {number} [x1] + * @param {number} [y1] + * @param {number} [x2] + * @param {number} [y2] + * @return {number} distance + */ +function distanceTwoPoints(/* (point1, point2) OR (x1, y1, x2, y2) */) +{ + if (arguments.length === 2) + { + return Math.sqrt(Math.pow(arguments[1].x - arguments[0].x, 2) + Math.pow(arguments[1].y - arguments[0].y, 2)) + } + else + { + return Math.sqrt(Math.pow(arguments[2] - arguments[0], 2) + Math.pow(arguments[3] - arguments[1], 2)) + } +} + +/** + * returns the squared distance between two points + * @param {Point} [point1] {x: x, y: y} + * @param {Point} [point2] {x: x, y: y} + * @param {number} [x1] + * @param {number} [y1] + * @param {number} [x2] + * @param {number} [y2] + * @return {number} squared distance + */ +function distanceTwoPointsSquared(/* (point1, point2) OR (x1, y1, x2, y2) */) +{ + if (arguments.length === 2) + { + return Math.pow(arguments[1].x - arguments[0].x, 2) + Math.pow(arguments[1].y - arguments[0].y, 2) + } + else + { + return Math.pow(arguments[2] - arguments[0], 2) + Math.pow(arguments[3] - arguments[1], 2) + } +} + +/** + * returns the closest cardinal (N, S, E, W) to the given angle (in radians) + * @param {number} angle + * @return {number} closest cardinal in radians + */ +function closestAngle(angle) +{ + var left = differenceAngles(angle, LEFT) + var right = differenceAngles(angle, RIGHT) + var up = differenceAngles(angle, UP) + var down = differenceAngles(angle, DOWN) + if (left <= right && left <= up && left <= down) + { + return LEFT + } + else if (right <= up && right <= down) + { + return RIGHT + } + else if (up <= down) + { + return UP + } + else + { + return DOWN + } +} + +/** + * checks whether angles a1 and a2 are equal (after normalizing) + * @param {number} a1 + * @param {number} a2 + * @param {number} [wiggle] return true if the difference between the angles is <= wiggle + * @return {boolean} a1 === a2 + */ +function equals(a1, a2, wiggle) +{ + if (wiggle) + { + return differenceAngles(a1, a2) < wiggle + } + else + { + return normalize(a1) === normalize(a2) + } +} + +/** + * return a text representation of the cardinal direction + * @param {number} angle + * @returns {string} UP, DOWN, LEFT, RIGHT, or NOT CARDINAL + */ +function explain(angle) +{ + switch (angle) + { + case UP: return 'UP' + case DOWN: return 'DOWN' + case LEFT: return 'LEFT' + case RIGHT: return 'RIGHT' + default: return 'NOT CARDINAL' + } +} + +module.exports = { + UP: UP, + DOWN: DOWN, + LEFT: LEFT, + RIGHT: RIGHT, + NORTH: NORTH, + SOUTH: SOUTH, + WEST: WEST, + EAST: EAST, + PI_2: PI_2, + PI_QUARTER: PI_QUARTER, + PI_HALF: PI_HALF, + + toDegrees: toDegrees, + toRadians: toRadians, + isAngleBetween: isAngleBetween, + differenceAnglesSign: differenceAnglesSign, + differenceAngles: differenceAngles, + shortestAngle: shortestAngle, + normalize: normalize, + angleTwoPoints: angleTwoPoints, + distanceTwoPoints: distanceTwoPoints, + distanceTwoPointsSquared: distanceTwoPointsSquared, + closestAngle: closestAngle, + equals: equals, + explain: explain +} +},{}],23:[function(require,module,exports){ +// yy-color +// by David Figatner +// MIT License +// (c) YOPEY YOPEY LLC 2017 +// https://github.com/davidfig/color + +var Random = require('yy-random') + +/** + * converts a #FFFFFF to 0x123456 + * @param {string} color + * @return {string} + */ +function poundToHex(color) +{ + return '0x' + parseInt(color.substr(1)).toString(16) +} + +/** + * converts a 0x123456 to #FFFFFF + * @param {string} color + * @return {string} + */ +function hexToPound(color) +{ + return '#' + color.substr(2) +} + +/** + * converts a number to #FFFFFF + * @param {number} color + * @return {string} + */ +function valueToPound(color) +{ + return '#' + color.toString(16) +} + +/** + * based on tinycolor + * https://github.com/bgrins/TinyColor + * BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE + * @param {string} color + * @returns {object} + */ +function hexToHsl (color) +{ + var rgb = this.hexToRgb(color), + r = rgb.r, + g = rgb.g, + b = rgb.b + var max = Math.max(r, g, b), + min = Math.min(r, g, b) + var h, s, l = (max + min) / 2 + + if (max === min) + { + h = s = 0 // achromatic + } + else + { + var d = max - min + s = l > 0.5 ? d / (2 - max - min) : d / (max + min) + switch (max) + { + case r: h = (g - b) / d + (g < b ? 6 : 0); break + case g: h = (b - r) / d + 2; break + case b: h = (r - g) / d + 4; break + } + + h /= 6 + } + + return { h: h, s: s, l: l } +} + +/** based on tinycolor +* https://github.com/bgrins/TinyColor +* BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE +* @param {object|number} color {h, s, b} or h +* @param {number} [s] +* @param {number} [l] +* @returns number +*/ +function hslToHex(color) +{ + var r, g, b, h, s, l + if (arguments.length === 1) + { + h = color.h, + s = color.s, + l = color.l + } + else + { + h = arguments[0] + s = arguments[1] + l = arguments[2] + } + + function hue2rgb(p, q, t) { + if (t < 0) t += 1 + if (t > 1) t -= 1 + if (t < 1/6) return p + (q - p) * 6 * t + if (t < 1/2) return q + if (t < 2/3) return p + (q - p) * (2/3 - t) * 6 + return p + } + + if (s === 0) + { + r = g = b = l // achromatic + } + else + { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s + var p = 2 * l - q + r = hue2rgb(p, q, h + 1/3) + g = hue2rgb(p, q, h) + b = hue2rgb(p, q, h - 1/3) + } + + return this.rgbToHex(r * 255, g * 255, b * 255) +} + +/* darkens a color by the percentage +* @param {object} color in hex (0xabcdef) +* @param {number} amount +* @return {number} +*/ +function darken(color, amount) +{ + return this.blend(amount, color, 0) +} + +/** based on tinycolor +* https://github.com/bgrins/TinyColor +* BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE +* @param {object} color +* @param {number} amount +*/ +function saturate(color, amount) +{ + amount = (amount === 0) ? 0 : (amount || 10) + var hsl = this.hexToHsl(color) + hsl.s += amount / 100 + hsl.s = Math.min(1, Math.max(0, hsl.s)) + return this.hslToHex(hsl) +} + +/** based on tinycolor +* https://github.com/bgrins/TinyColor +* BSD license: https://github.com/bgrins/TinyColor/blob/master/LICENSE +* @param {object} color +* @param {number} amount +*/ +function desaturate(color, amount) +{ + amount = (amount === 0) ? 0 : (amount || 10) + var hsl = this.hexToHsl(color) + hsl.s -= amount / 100 + hsl.s = Math.min(1, Math.max(0, hsl.s)) + return this.hslToHex(hsl) +} + +/** + * blends two colors together + * @param {number} percent [0.0 - 1.0] + * @param {string} color1 first color in 0x123456 format + * @param {string} color2 second color in 0x123456 format + * @return {number} + */ +function blend(percent, color1, color2) +{ + if (percent === 0) + { + return color1 + } + if (percent === 1) + { + return color2 + } + var r1 = color1 >> 16 + var g1 = color1 >> 8 & 0x0000ff + var b1 = color1 & 0x0000ff + var r2 = color2 >> 16 + var g2 = color2 >> 8 & 0x0000ff + var b2 = color2 & 0x0000ff + var percent1 = 1 - percent + var r = percent1 * r1 + percent * r2 + var g = percent1 * g1 + percent * g2 + var b = percent1 * b1 + percent * b2 + return r << 16 | g << 8 | b +} + +/** + * returns a hex color into an rgb value + * @param {number} hex + * @return {string} + */ +function hexToRgb(hex) +{ + if (hex === 0) + { + hex = '0x000000' + } + else if (typeof hex !== 'string') + { + var s = '000000' + hex.toString(16) + hex = '0x' + s.substr(s.length - 6) + } + var result = /^0x?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex) + return result ? { + r: parseInt(result[1], 16), + g: parseInt(result[2], 16), + b: parseInt(result[3], 16) + } : null +} + +/** + * rgb color to hex in the form of 0x123456 + * @param {(number|string)} r first number or 'rgb(...)' string + * @param {(number|null)} g + * @param {(number|null)} b + * @return {string} + */ +function rgbToHex(r, g, b) +{ + if (arguments.length === 1) { + if (Array.isArray(arguments[0])) { + var number = arguments[0] + r = number[0] + g = number[1] + b = number[2] + } else { + var parse = r.replace(/( *rgb *\( *)|( )|(\) *;?)/,'') + var numbers = parse.split(',') + r = numbers[0] + g = numbers[1] + b = numbers[2] + } + } + return '0x' + ((1 << 24) + (parseInt(r) << 16) + (parseInt(g) << 8) + parseInt(b)).toString(16).slice(1) +} + +/** + * returns a random color with balanced r, g, b values (i.e., r, g, b either have the same value or are 0) + * @param {number} min value for random number + * @param {number} max value for random number + * @return {number} color + */ +function random(min, max) +{ + function random() + { + return Random.range(min, max) + } + + var colors = [{r:1, g:1, b:1}, {r:1, g:1, b:0}, {r:1,g:0,b:1}, {r:0,g:1,b:1}, {r:1,g:0,b:0}, {r:0,g:1,b:0}, {r:0,g:0,b:1}] + var color = Random.pick(colors) + min = min || 0 + max = max || 255 + return this.rgbToHex(color.r ? random() : 0, color.g ? random() : 0, color.b ? random() : 0) +} + +// h: 0-360, s: 0-1, l: 0-1 +/** + * returns a random color based on hsl + * @param {number} hMin [0, 360] + * @param {number} hMax [hMin, 360] + * @param {number} sMin [0, 1] + * @param {number} sMax [sMin, 1] + * @param {number} lMin [0, 1] + * @param {number} lMax [lMin, 1] + */ +function randomHSL(hMin, hMax, sMin, sMax, lMin, lMax) +{ + var color = { + h: Random.range(hMin, hMax), + s: Random.range(sMin, sMax, true), + l: Random.range(lMin, lMax, true) + } + return this.hslToHex(color) +} + +/** + * returns random colors based on HSL with different hues + * based on http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/ + * @returns {number[]} colors in hex format (0x123456) + */ +function randomGoldenRatioHSL(count, saturation, luminosity) +{ + var goldenRatio = 0.618033988749895 + var h = Random.get(1, true) + var colors = [] + for (var i = 0; i < count; i++) + { + colors.push(this.hslToHex(h, saturation, luminosity)) + h = (h + goldenRatio) % 1 + } + return colors +} + +module.exports = { + poundToHex: poundToHex, + hexToPound: hexToPound, + valueToPound: valueToPound, + hexToHsl: hexToHsl, + hslToHex: hslToHex, + hexToRgb: hexToRgb, + rgbToHex: rgbToHex, + darken: darken, + saturate: saturate, + desaturate: desaturate, + blend: blend, + random: random, + randomHSL: randomHSL, + randomGoldenRatioHSL: randomGoldenRatioHSL +} +},{"yy-random":24}],24:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +// yy-random +// by David Figatner +// MIT license +// copyright YOPEY YOPEY LLC 2016-17 +// https://github.com/davidfig/random + +var seedrandom = require('seedrandom'); + +var Random = function () { + function Random() { + _classCallCheck(this, Random); + + this.generator = Math.random; + } + + /** + * generates a seeded number + * @param {number} seed + * @param {object} [options] + * @param {string} [PRNG="alea"] - name of algorithm, see https://github.com/davidbau/seedrandom + * @param {boolean} [save=true] + */ + + + _createClass(Random, [{ + key: 'seed', + value: function seed(_seed, options) { + options = options || {}; + this.generator = seedrandom[options.PRNG || 'alea'](_seed, { state: options.state }); + this.options = options; + } + + /** + * saves the state of the random generator + * can only be used after Random.seed() is called + * @returns {number} state + */ + + }, { + key: 'save', + value: function save() { + if (this.generator !== Math.random) { + return this.generator.state(); + } + } + + /** + * restores the state of the random generator + * @param {number} state + */ + + }, { + key: 'restore', + value: function restore(state) { + this.generator = seedrandom[this.options.PRNG || 'alea']('', { state: state }); + } + + /** + * changes the generator to use the old Math.sin-based random function + * based on : http://stackoverflow.com/questions/521295/javascript-random-seeds + * (deprecated) Use only for compatibility purposes + * @param {number} seed + */ + + }, { + key: 'seedOld', + value: function seedOld(seed) { + this.generator = function () { + var x = Math.sin(seed++) * 10000; + return x - Math.floor(x); + }; + } + + /** + * create a separate random generator using the seed + * @param {number} seed + * @return {object} + */ + + }, { + key: 'separateSeed', + value: function separateSeed(seed) { + var random = new Random(); + random.seed(seed); + return random; + } + + /** + * resets the random number this.generator to Math.random() + */ + + }, { + key: 'reset', + value: function reset() { + this.generator = Math.random; + } + + /** + * returns a random number using the this.generator between [0, ceiling - 1] + * @param {number} ceiling + * @param {boolean} [useFloat=false] + * @return {number} + */ + + }, { + key: 'get', + value: function get(ceiling, useFloat) { + var negative = ceiling < 0 ? -1 : 1; + ceiling *= negative; + var result = void 0; + if (useFloat) { + result = this.generator() * ceiling; + } else { + result = Math.floor(this.generator() * ceiling); + } + return result * negative; + } + + /** + * returns a random integer between 0 - Number.MAX_SAFE_INTEGER + * @return {number} + */ + + }, { + key: 'getHuge', + value: function getHuge() { + return this.get(Number.MAX_SAFE_INTEGER); + } + + /** + * random number [middle - range, middle + range] + * @param {number} middle + * @param {number} delta + * @param {boolean} [useFloat=false] + * @return {number} + */ + + }, { + key: 'middle', + value: function middle(_middle, delta, useFloat) { + var half = delta / 2; + return this.range(_middle - half, _middle + half, useFloat); + } + + /** + * random number [start, end] + * @param {number} start + * @param {number} end + * @param {boolean} [useFloat=false] if true, then range is (start, end)--i.e., not inclusive to start and end + * @return {number} + */ + + }, { + key: 'range', + value: function range(start, end, useFloat) { + // case where there is no range + if (end === start) { + return end; + } + + if (useFloat) { + return this.get(end - start, true) + start; + } else { + var range = void 0; + if (start < 0 && end > 0) { + range = -start + end + 1; + } else if (start === 0 && end > 0) { + range = end + 1; + } else if (start < 0 && end === 0) { + range = start - 1; + start = 1; + } else if (start < 0 && end < 0) { + range = end - start - 1; + } else { + range = end - start + 1; + } + return Math.floor(this.generator() * range) + start; + } + } + + /** + * an array of random numbers between [start, end] + * @param {number} start + * @param {number} end + * @param {number} count + * @param {boolean} [useFloat=false] + * @return {number[]} + */ + + }, { + key: 'rangeMultiple', + value: function rangeMultiple(start, end, count, useFloat) { + var array = []; + for (var i = 0; i < count; i++) { + array.push(this.range(start, end, useFloat)); + } + return array; + } + + /** + * an array of random numbers between [middle - range, middle + range] + * @param {number} middle + * @param {number} range + * @param {number} count + * @param {boolean} [useFloat=false] + * @return {number[]} + */ + + }, { + key: 'middleMultiple', + value: function middleMultiple(middle, range, count, useFloat) { + var array = []; + for (var i = 0; i < count; i++) { + array.push(middle(middle, range, useFloat)); + } + return array; + } + + /** + * @param {number} [chance=0.5] + * returns random sign (either +1 or -1) + * @return {number} + */ + + }, { + key: 'sign', + value: function sign(chance) { + chance = chance || 0.5; + return this.generator() < chance ? 1 : -1; + } + + /** + * tells you whether a random chance was achieved + * @param {number} [percent=0.5] + * @return {boolean} + */ + + }, { + key: 'chance', + value: function chance(percent) { + return this.generator() < (percent || 0.5); + } + + /** + * returns a random angle in radians [0 - 2 * Math.PI) + */ + + }, { + key: 'angle', + value: function angle() { + return this.get(Math.PI * 2, true); + } + + /** + * Shuffle array (either in place or copied) + * from http://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array + * @param {Array} array + * @param {boolean} [copy=false] whether to shuffle in place (default) or return a new shuffled array + * @return {Array} a shuffled array + */ + + }, { + key: 'shuffle', + value: function shuffle(array, copy) { + if (copy) { + array = array.slice(); + } + if (array.length === 0) { + return array; + } + + var currentIndex = array.length, + temporaryValue = void 0, + randomIndex = void 0; + + // While there remain elements to shuffle... + while (0 !== currentIndex) { + // Pick a remaining element... + randomIndex = this.get(currentIndex); + currentIndex -= 1; + + // And swap it with the current element. + temporaryValue = array[currentIndex]; + array[currentIndex] = array[randomIndex]; + array[randomIndex] = temporaryValue; + } + return array; + } + + /** + * picks a random element from an array + * @param {Array} array + * @return {*} + */ + + }, { + key: 'pick', + value: function pick(array, remove) { + if (!remove) { + return array[this.get(array.length)]; + } else { + var pick = this.get(array.length); + var temp = array[pick]; + array.splice(pick, 1); + return temp; + } + } + + /** + * returns a random property from an object + * from http://stackoverflow.com/questions/2532218/pick-random-property-from-a-javascript-object + * @param {object} obj + * @return {*} + */ + + }, { + key: 'property', + value: function property(obj) { + var result; + var count = 0; + for (var prop in obj) { + if (this.chance(1 / ++count)) { + result = prop; + } + } + return result; + } + + /** + * creates a random set where each entry is a value between [min, max] + * @param {number} min + * @param {number} max + * @param {number} amount of numbers in set + * @param {number[]} + */ + + }, { + key: 'set', + value: function set(min, max, amount) { + var set = [], + all = [], + i; + for (i = min; i < max; i++) { + all.push(i); + } + + for (i = 0; i < amount; i++) { + var found = this.get(all.length); + set.push(all[found]); + all.splice(found, 1); + } + return set; + } + + /** + * returns a set of numbers with a randomly even distribution (i.e., no overlapping and filling the space) + * @param {number} start position + * @param {number} end position + * @param {number} count of non-start/end points + * @param {boolean} [includeStart=false] includes start point (count++) + * @param {boolean} [includeEnd=false] includes end point (count++) + * @param {boolean} [useFloat=false] + * @param {number[]} + */ + + }, { + key: 'distribution', + value: function distribution(start, end, count, includeStart, includeEnd, useFloat) { + var interval = Math.floor((end - start) / count); + var halfInterval = interval / 2; + var quarterInterval = interval / 4; + var set = []; + if (includeStart) { + set.push(start); + } + for (var i = 0; i < count; i++) { + set.push(start + i * interval + halfInterval + this.range(-quarterInterval, quarterInterval, useFloat)); + } + if (includeEnd) { + set.push(end); + } + return set; + } + + /** + * returns a random number based on weighted probability between [min, max] + * from http://stackoverflow.com/questions/22656126/javascript-random-number-with-weighted-probability + * @param {number} min value + * @param {number} max value + * @param {number} target for average value + * @param {number} stddev - standard deviation + */ + + }, { + key: 'weightedProbabilityInt', + value: function weightedProbabilityInt(min, max, target, stddev) { + function normRand() { + var x1 = void 0, + x2 = void 0, + rad = void 0; + do { + x1 = 2 * this.get(1, true) - 1; + x2 = 2 * this.get(1, true) - 1; + rad = x1 * x1 + x2 * x2; + } while (rad >= 1 || rad === 0); + var c = Math.sqrt(-2 * Math.log(rad) / rad); + return x1 * c; + } + + stddev = stddev || 1; + if (Math.random() < 0.81546) { + while (true) { + var sample = normRand() * stddev + target; + if (sample >= min && sample <= max) { + return sample; + } + } + } else { + return this.range(min, max); + } + } + + /* + * returns a random hex color (0 - 0xffffff) + * @return {number} + */ + + }, { + key: 'color', + value: function color() { + return this.get(0xffffff); + } + }]); + + return Random; +}(); + +module.exports = new Random(); + +},{"seedrandom":14}],25:[function(require,module,exports){ + +},{}]},{},[3]); diff --git a/lib/3rdparty/pixi-viewport.js b/lib/3rdparty/pixi-viewport.js new file mode 100644 index 0000000..d0308e3 --- /dev/null +++ b/lib/3rdparty/pixi-viewport.js @@ -0,0 +1,3465 @@ +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= this.time) { + this.parent.x = toX.end; + this.toX = null; + this.parent.emit('bounce-x-end', this.parent); + } else { + this.parent.x = this.ease(toX.time, toX.start, toX.delta, this.time); + } + this.parent.dirty = true; + } + if (this.toY) { + var toY = this.toY; + toY.time += elapsed; + this.parent.emit('moved', { viewport: this.parent, type: 'bounce-y' }); + if (toY.time >= this.time) { + this.parent.y = toY.end; + this.toY = null; + this.parent.emit('bounce-y-end', this.parent); + } else { + this.parent.y = this.ease(toY.time, toY.start, toY.delta, this.time); + } + this.parent.dirty = true; + } + } + }, { + key: 'calcUnderflowX', + value: function calcUnderflowX() { + var x = void 0; + switch (this.underflowX) { + case -1: + x = 0; + break; + case 1: + x = this.parent.screenWidth - this.parent.screenWorldWidth; + break; + default: + x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2; + } + return x; + } + }, { + key: 'calcUnderflowY', + value: function calcUnderflowY() { + var y = void 0; + switch (this.underflowY) { + case -1: + y = 0; + break; + case 1: + y = this.parent.screenHeight - this.parent.screenWorldHeight; + break; + default: + y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2; + } + return y; + } + }, { + key: 'bounce', + value: function bounce() { + if (this.paused) { + return; + } + + var oob = void 0; + var decelerate = this.parent.plugins['decelerate']; + if (decelerate && (decelerate.x || decelerate.y)) { + if (decelerate.x && decelerate.percentChangeX === decelerate.friction || decelerate.y && decelerate.percentChangeY === decelerate.friction) { + oob = this.parent.OOB(); + if (oob.left && this.left || oob.right && this.right) { + decelerate.percentChangeX = this.friction; + } + if (oob.top && this.top || oob.bottom && this.bottom) { + decelerate.percentChangeY = this.friction; + } + } + } + var drag = this.parent.plugins['drag'] || {}; + var pinch = this.parent.plugins['pinch'] || {}; + decelerate = decelerate || {}; + if (!drag.active && !pinch.active && (!this.toX || !this.toY) && (!decelerate.x || !decelerate.y)) { + oob = oob || this.parent.OOB(); + var point = oob.cornerPoint; + if (!this.toX && !decelerate.x) { + var x = null; + if (oob.left && this.left) { + x = this.parent.screenWorldWidth < this.parent.screenWidth ? this.calcUnderflowX() : 0; + } else if (oob.right && this.right) { + x = this.parent.screenWorldWidth < this.parent.screenWidth ? this.calcUnderflowX() : -point.x; + } + if (x !== null && this.parent.x !== x) { + this.toX = { time: 0, start: this.parent.x, delta: x - this.parent.x, end: x }; + this.parent.emit('bounce-x-start', this.parent); + } + } + if (!this.toY && !decelerate.y) { + var y = null; + if (oob.top && this.top) { + y = this.parent.screenWorldHeight < this.parent.screenHeight ? this.calcUnderflowY() : 0; + } else if (oob.bottom && this.bottom) { + y = this.parent.screenWorldHeight < this.parent.screenHeight ? this.calcUnderflowY() : -point.y; + } + if (y !== null && this.parent.y !== y) { + this.toY = { time: 0, start: this.parent.y, delta: y - this.parent.y, end: y }; + this.parent.emit('bounce-y-start', this.parent); + } + } + } + } + }, { + key: 'reset', + value: function reset() { + this.toX = this.toY = null; + } + }]); + + return Bounce; +}(Plugin); + +},{"./plugin":9,"./utils":12}],2:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(ClampZoom, _Plugin); + + /** + * @private + * @param {object} [options] + * @param {number} [options.minWidth] minimum width + * @param {number} [options.minHeight] minimum height + * @param {number} [options.maxWidth] maximum width + * @param {number} [options.maxHeight] maximum height + */ + function ClampZoom(parent, options) { + _classCallCheck(this, ClampZoom); + + var _this = _possibleConstructorReturn(this, (ClampZoom.__proto__ || Object.getPrototypeOf(ClampZoom)).call(this, parent)); + + _this.minWidth = options.minWidth; + _this.minHeight = options.minHeight; + _this.maxWidth = options.maxWidth; + _this.maxHeight = options.maxHeight; + return _this; + } + + _createClass(ClampZoom, [{ + key: 'resize', + value: function resize() { + this.clamp(); + } + }, { + key: 'clamp', + value: function clamp() { + if (this.paused) { + return; + } + + var width = this.parent.worldScreenWidth; + var height = this.parent.worldScreenHeight; + if (this.minWidth && width < this.minWidth) { + this.parent.fitWidth(this.minWidth); + width = this.parent.worldScreenWidth; + height = this.parent.worldScreenHeight; + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + if (this.maxWidth && width > this.maxWidth) { + this.parent.fitWidth(this.maxWidth); + width = this.parent.worldScreenWidth; + height = this.parent.worldScreenHeight; + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + if (this.minHeight && height < this.minHeight) { + this.parent.fitHeight(this.minHeight); + width = this.parent.worldScreenWidth; + height = this.parent.worldScreenHeight; + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + if (this.maxHeight && height > this.maxHeight) { + this.parent.fitHeight(this.maxHeight); + this.parent.emit('zoomed', { viewport: this.parent, type: 'clamp-zoom' }); + } + } + }]); + + return ClampZoom; +}(Plugin); + +},{"./plugin":9}],3:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); +var utils = require('./utils'); + +module.exports = function (_Plugin) { + _inherits(clamp, _Plugin); + + /** + * @private + * @param {object} options + * @param {(number|boolean)} [options.left] clamp left; true=0 + * @param {(number|boolean)} [options.right] clamp right; true=viewport.worldWidth + * @param {(number|boolean)} [options.top] clamp top; true=0 + * @param {(number|boolean)} [options.bottom] clamp bottom; true=viewport.worldHeight + * @param {string} [options.direction] (all, x, or y) using clamps of [0, viewport.worldWidth/viewport.worldHeight]; replaces left/right/top/bottom if set + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + */ + function clamp(parent, options) { + _classCallCheck(this, clamp); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (clamp.__proto__ || Object.getPrototypeOf(clamp)).call(this, parent)); + + if (typeof options.direction === 'undefined') { + _this.left = utils.defaults(options.left, null); + _this.right = utils.defaults(options.right, null); + _this.top = utils.defaults(options.top, null); + _this.bottom = utils.defaults(options.bottom, null); + } else { + _this.left = options.direction === 'x' || options.direction === 'all'; + _this.right = options.direction === 'x' || options.direction === 'all'; + _this.top = options.direction === 'y' || options.direction === 'all'; + _this.bottom = options.direction === 'y' || options.direction === 'all'; + } + _this.parseUnderflow(options.underflow || 'center'); + _this.move(); + return _this; + } + + _createClass(clamp, [{ + key: 'parseUnderflow', + value: function parseUnderflow(clamp) { + clamp = clamp.toLowerCase(); + if (clamp === 'center') { + this.underflowX = 0; + this.underflowY = 0; + } else { + this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0; + this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0; + } + } + }, { + key: 'move', + value: function move() { + this.update(); + } + }, { + key: 'update', + value: function update() { + if (this.paused) { + return; + } + + var decelerate = this.parent.plugins['decelerate'] || {}; + if (this.left !== null || this.right !== null) { + var moved = void 0; + if (this.parent.screenWorldWidth < this.parent.screenWidth) { + switch (this.underflowX) { + case -1: + if (this.parent.x !== 0) { + this.parent.x = 0; + moved = true; + } + break; + case 1: + if (this.parent.x !== this.parent.screenWidth - this.parent.screenWorldWidth) { + this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth; + moved = true; + } + break; + default: + if (this.parent.x !== (this.parent.screenWidth - this.parent.screenWorldWidth) / 2) { + this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2; + moved = true; + } + } + } else { + if (this.left !== null) { + if (this.parent.left < (this.left === true ? 0 : this.left)) { + this.parent.x = -(this.left === true ? 0 : this.left) * this.parent.scale.x; + decelerate.x = 0; + moved = true; + } + } + if (this.right !== null) { + if (this.parent.right > (this.right === true ? this.parent.worldWidth : this.right)) { + this.parent.x = -(this.right === true ? this.parent.worldWidth : this.right) * this.parent.scale.x + this.parent.screenWidth; + decelerate.x = 0; + moved = true; + } + } + } + if (moved) { + this.parent.emit('moved', { viewport: this.parent, type: 'clamp-x' }); + } + } + if (this.top !== null || this.bottom !== null) { + var _moved = void 0; + if (this.parent.screenWorldHeight < this.parent.screenHeight) { + switch (this.underflowY) { + case -1: + if (this.parent.y !== 0) { + this.parent.y = 0; + _moved = true; + } + break; + case 1: + if (this.parent.y !== this.parent.screenHeight - this.parent.screenWorldHeight) { + this.parent.y = this.parent.screenHeight - this.parent.screenWorldHeight; + _moved = true; + } + break; + default: + if (this.parent.y !== (this.parent.screenHeight - this.parent.screenWorldHeight) / 2) { + this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2; + _moved = true; + } + } + } else { + if (this.top !== null) { + if (this.parent.top < (this.top === true ? 0 : this.top)) { + this.parent.y = -(this.top === true ? 0 : this.top) * this.parent.scale.y; + decelerate.y = 0; + _moved = true; + } + } + if (this.bottom !== null) { + if (this.parent.bottom > (this.bottom === true ? this.parent.worldHeight : this.bottom)) { + this.parent.y = -(this.bottom === true ? this.parent.worldHeight : this.bottom) * this.parent.scale.y + this.parent.screenHeight; + decelerate.y = 0; + _moved = true; + } + } + } + if (_moved) { + this.parent.emit('moved', { viewport: this.parent, type: 'clamp-y' }); + } + } + } + }]); + + return clamp; +}(Plugin); + +},{"./plugin":9,"./utils":12}],4:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Decelerate, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.friction=0.95] percent to decelerate after movement + * @param {number} [options.bounce=0.8] percent to decelerate when past boundaries (only applicable when viewport.bounce() is active) + * @param {number} [options.minSpeed=0.01] minimum velocity before stopping/reversing acceleration + */ + function Decelerate(parent, options) { + _classCallCheck(this, Decelerate); + + var _this = _possibleConstructorReturn(this, (Decelerate.__proto__ || Object.getPrototypeOf(Decelerate)).call(this, parent)); + + options = options || {}; + _this.friction = options.friction || 0.95; + _this.bounce = options.bounce || 0.5; + _this.minSpeed = typeof options.minSpeed !== 'undefined' ? options.minSpeed : 0.01; + _this.saved = []; + return _this; + } + + _createClass(Decelerate, [{ + key: 'down', + value: function down() { + this.saved = []; + this.x = this.y = false; + } + }, { + key: 'move', + value: function move() { + if (this.paused) { + return; + } + + var count = this.parent.countDownPointers(); + if (count === 1 || count > 1 && !this.parent.plugins['pinch']) { + this.saved.push({ x: this.parent.x, y: this.parent.y, time: performance.now() }); + if (this.saved.length > 60) { + this.saved.splice(0, 30); + } + } + } + }, { + key: 'up', + value: function up() { + if (this.parent.countDownPointers() === 0 && this.saved.length) { + var now = performance.now(); + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = this.saved[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var save = _step.value; + + if (save.time >= now - 100) { + var time = now - save.time; + this.x = (this.parent.x - save.x) / time; + this.y = (this.parent.y - save.y) / time; + this.percentChangeX = this.percentChangeY = this.friction; + break; + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + } + + /** + * manually activate plugin + * @param {object} options + * @param {number} [options.x] + * @param {number} [options.y] + */ + + }, { + key: 'activate', + value: function activate(options) { + options = options || {}; + if (typeof options.x !== 'undefined') { + this.x = options.x; + this.percentChangeX = this.friction; + } + if (typeof options.y !== 'undefined') { + this.y = options.y; + this.percentChangeY = this.friction; + } + } + }, { + key: 'update', + value: function update(elapsed) { + if (this.paused) { + return; + } + + var moved = void 0; + if (this.x) { + this.parent.x += this.x * elapsed; + this.x *= this.percentChangeX; + if (Math.abs(this.x) < this.minSpeed) { + this.x = 0; + } + moved = true; + } + if (this.y) { + this.parent.y += this.y * elapsed; + this.y *= this.percentChangeY; + if (Math.abs(this.y) < this.minSpeed) { + this.y = 0; + } + moved = true; + } + if (moved) { + this.parent.dirty = true; + this.parent.emit('moved', { viewport: this.parent, type: 'decelerate' }); + } + } + }, { + key: 'reset', + value: function reset() { + this.x = this.y = null; + } + }]); + + return Decelerate; +}(Plugin); + +},{"./plugin":9,"./utils":12}],5:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Drag, _Plugin); + + /** + * enable one-finger touch to drag + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {string} [options.direction=all] direction to drag (all, x, or y) + * @param {boolean} [options.wheel=true] use wheel to scroll in y direction (unless wheel plugin is active) + * @param {number} [options.wheelScroll=1] number of pixels to scroll with each wheel spin + * @param {boolean} [options.reverse] reverse the direction of the wheel scroll + * @param {boolean|string} [options.clampWheel] (true, x, or y) clamp wheel (to avoid weird bounce with mouse wheel) + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + */ + function Drag(parent, options) { + _classCallCheck(this, Drag); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (Drag.__proto__ || Object.getPrototypeOf(Drag)).call(this, parent)); + + _this.moved = false; + _this.wheelActive = utils.defaults(options.wheel, true); + _this.wheelScroll = options.wheelScroll || 1; + _this.reverse = options.reverse ? 1 : -1; + _this.clampWheel = options.clampWheel; + _this.xDirection = !options.direction || options.direction === 'all' || options.direction === 'x'; + _this.yDirection = !options.direction || options.direction === 'all' || options.direction === 'y'; + _this.parseUnderflow(options.underflow || 'center'); + return _this; + } + + _createClass(Drag, [{ + key: 'parseUnderflow', + value: function parseUnderflow(clamp) { + clamp = clamp.toLowerCase(); + if (clamp === 'center') { + this.underflowX = 0; + this.underflowY = 0; + } else { + this.underflowX = clamp.indexOf('left') !== -1 ? -1 : clamp.indexOf('right') !== -1 ? 1 : 0; + this.underflowY = clamp.indexOf('top') !== -1 ? -1 : clamp.indexOf('bottom') !== -1 ? 1 : 0; + } + } + }, { + key: 'down', + value: function down(e) { + if (this.paused) { + return; + } + var count = this.parent.countDownPointers(); + if ((count === 1 || count > 1 && !this.parent.plugins['pinch']) && this.parent.parent) { + var parent = this.parent.parent.toLocal(e.data.global); + this.last = { x: e.data.global.x, y: e.data.global.y, parent: parent }; + this.current = e.data.pointerId; + } else { + this.last = null; + } + } + }, { + key: 'move', + value: function move(e) { + if (this.paused) { + return; + } + if (this.last && this.current === e.data.pointerId) { + var x = e.data.global.x; + var y = e.data.global.y; + var count = this.parent.countDownPointers(); + if (count === 1 || count > 1 && !this.parent.plugins['pinch']) { + var distX = x - this.last.x; + var distY = y - this.last.y; + if (this.moved || this.xDirection && this.parent.checkThreshold(distX) || this.yDirection && this.parent.checkThreshold(distY)) { + var newParent = this.parent.parent.toLocal(e.data.global); + if (this.xDirection) { + this.parent.x += newParent.x - this.last.parent.x; + } + if (this.yDirection) { + this.parent.y += newParent.y - this.last.parent.y; + } + this.last = { x: x, y: y, parent: newParent }; + if (!this.moved) { + this.parent.emit('drag-start', { screen: this.last, world: this.parent.toWorld(this.last), viewport: this.parent }); + } + this.moved = true; + this.parent.dirty = true; + this.parent.emit('moved', { viewport: this.parent, type: 'drag' }); + } + } else { + this.moved = false; + } + } + } + }, { + key: 'up', + value: function up() { + var touches = this.parent.getTouchPointers(); + if (touches.length === 1) { + var pointer = touches[0]; + if (pointer.last) { + var parent = this.parent.parent.toLocal(pointer.last); + this.last = { x: pointer.last.x, y: pointer.last.y, parent: parent }; + this.current = pointer.last.data.pointerId; + } + this.moved = false; + } else if (this.last) { + if (this.moved) { + this.parent.emit('drag-end', { screen: this.last, world: this.parent.toWorld(this.last), viewport: this.parent }); + this.last = this.moved = false; + } + } + } + }, { + key: 'wheel', + value: function wheel(e) { + if (this.paused) { + return; + } + + if (this.wheelActive) { + var wheel = this.parent.plugins['wheel']; + if (!wheel) { + this.parent.x += e.deltaX * this.wheelScroll * this.reverse; + this.parent.y += e.deltaY * this.wheelScroll * this.reverse; + if (this.clampWheel) { + this.clamp(); + } + this.parent.emit('wheel-scroll', this.parent); + this.parent.emit('moved', this.parent); + this.parent.dirty = true; + e.preventDefault(); + return true; + } + } + } + }, { + key: 'resume', + value: function resume() { + this.last = null; + this.paused = false; + } + }, { + key: 'clamp', + value: function clamp() { + var decelerate = this.parent.plugins['decelerate'] || {}; + if (this.clampWheel !== 'y') { + if (this.parent.screenWorldWidth < this.parent.screenWidth) { + switch (this.underflowX) { + case -1: + this.parent.x = 0; + break; + case 1: + this.parent.x = this.parent.screenWidth - this.parent.screenWorldWidth; + break; + default: + this.parent.x = (this.parent.screenWidth - this.parent.screenWorldWidth) / 2; + } + } else { + if (this.parent.left < 0) { + this.parent.x = 0; + decelerate.x = 0; + } else if (this.parent.right > this.parent.worldWidth) { + this.parent.x = -this.parent.worldWidth * this.parent.scale.x + this.parent.screenWidth; + decelerate.x = 0; + } + } + } + if (this.clampWheel !== 'x') { + if (this.parent.screenWorldHeight < this.parent.screenHeight) { + switch (this.underflowY) { + case -1: + this.parent.y = 0; + break; + case 1: + this.parent.y = this.parent.screenHeight - this.parent.screenWorldHeight; + break; + default: + this.parent.y = (this.parent.screenHeight - this.parent.screenWorldHeight) / 2; + } + } else { + if (this.parent.top < 0) { + this.parent.y = 0; + decelerate.y = 0; + } + if (this.parent.bottom > this.parent.worldHeight) { + this.parent.y = -this.parent.worldHeight * this.parent.scale.y + this.parent.screenHeight; + decelerate.y = 0; + } + } + } + } + }, { + key: 'active', + get: function get() { + return this.moved; + } + }]); + + return Drag; +}(Plugin); + +},{"./plugin":9,"./utils":12}],6:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Follow, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {PIXI.DisplayObject} target to follow (object must include {x: x-coordinate, y: y-coordinate}) + * @param {object} [options] + * @param {number} [options.speed=0] to follow in pixels/frame (0=teleport to location) + * @param {number} [options.radius] radius (in world coordinates) of center circle where movement is allowed without moving the viewport + */ + function Follow(parent, target, options) { + _classCallCheck(this, Follow); + + var _this = _possibleConstructorReturn(this, (Follow.__proto__ || Object.getPrototypeOf(Follow)).call(this, parent)); + + options = options || {}; + _this.speed = options.speed || 0; + _this.target = target; + _this.radius = options.radius; + return _this; + } + + _createClass(Follow, [{ + key: 'update', + value: function update() { + if (this.paused) { + return; + } + + var center = this.parent.center; + var toX = this.target.x, + toY = this.target.y; + if (this.radius) { + var distance = Math.sqrt(Math.pow(this.target.y - center.y, 2) + Math.pow(this.target.x - center.x, 2)); + if (distance > this.radius) { + var angle = Math.atan2(this.target.y - center.y, this.target.x - center.x); + toX = this.target.x - Math.cos(angle) * this.radius; + toY = this.target.y - Math.sin(angle) * this.radius; + } else { + return; + } + } + if (this.speed) { + var deltaX = toX - center.x; + var deltaY = toY - center.y; + if (deltaX || deltaY) { + var _angle = Math.atan2(toY - center.y, toX - center.x); + var changeX = Math.cos(_angle) * this.speed; + var changeY = Math.sin(_angle) * this.speed; + var x = Math.abs(changeX) > Math.abs(deltaX) ? toX : center.x + changeX; + var y = Math.abs(changeY) > Math.abs(deltaY) ? toY : center.y + changeY; + this.parent.moveCenter(x, y); + this.parent.emit('moved', { viewport: this.parent, type: 'follow' }); + } + } else { + this.parent.moveCenter(toX, toY); + this.parent.emit('moved', { viewport: this.parent, type: 'follow' }); + } + } + }]); + + return Follow; +}(Plugin); + +},{"./plugin":9}],7:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(MouseEdges, _Plugin); + + /** + * Scroll viewport when mouse hovers near one of the edges. + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.radius] distance from center of screen in screen pixels + * @param {number} [options.distance] distance from all sides in screen pixels + * @param {number} [options.top] alternatively, set top distance (leave unset for no top scroll) + * @param {number} [options.bottom] alternatively, set bottom distance (leave unset for no top scroll) + * @param {number} [options.left] alternatively, set left distance (leave unset for no top scroll) + * @param {number} [options.right] alternatively, set right distance (leave unset for no top scroll) + * @param {number} [options.speed=8] speed in pixels/frame to scroll viewport + * @param {boolean} [options.reverse] reverse direction of scroll + * @param {boolean} [options.noDecelerate] don't use decelerate plugin even if it's installed + * @param {boolean} [options.linear] if using radius, use linear movement (+/- 1, +/- 1) instead of angled movement (Math.cos(angle from center), Math.sin(angle from center)) + * + * @event mouse-edge-start(Viewport) emitted when mouse-edge starts + * @event mouse-edge-end(Viewport) emitted when mouse-edge ends + */ + function MouseEdges(parent, options) { + _classCallCheck(this, MouseEdges); + + var _this = _possibleConstructorReturn(this, (MouseEdges.__proto__ || Object.getPrototypeOf(MouseEdges)).call(this, parent)); + + options = options || {}; + _this.options = options; + _this.reverse = options.reverse ? 1 : -1; + _this.noDecelerate = options.noDecelerate; + _this.linear = options.linear; + _this.radiusSquared = Math.pow(options.radius, 2); + _this.resize(); + _this.speed = options.speed || 8; + return _this; + } + + _createClass(MouseEdges, [{ + key: 'resize', + value: function resize() { + var options = this.options; + var distance = options.distance; + if (utils.exists(distance)) { + this.left = distance; + this.top = distance; + this.right = window.innerWidth - distance; + this.bottom = window.innerHeight - distance; + } else if (!this.radius) { + this.left = utils.exists(options.left) ? options.left : null; + this.top = utils.exists(options.top) ? options.top : null; + this.right = utils.exists(options.right) ? window.innerWidth - options.right : null; + this.bottom = utils.exists(options.bottom) ? window.innerHeight - options.bottom : null; + } + } + }, { + key: 'down', + value: function down() { + this.horizontal = this.vertical = null; + } + }, { + key: 'move', + value: function move(e) { + if (e.data.identifier !== 'MOUSE' || e.data.buttons !== 0) { + return; + } + var x = e.data.global.x; + var y = e.data.global.y; + + if (this.radiusSquared) { + var center = this.parent.toScreen(this.parent.center); + var distance = Math.pow(center.x - x, 2) + Math.pow(center.y - y, 2); + if (distance >= this.radiusSquared) { + var angle = Math.atan2(center.y - y, center.x - x); + if (this.linear) { + this.horizontal = Math.round(Math.cos(angle)) * this.speed * this.reverse * (60 / 1000); + this.vertical = Math.round(Math.sin(angle)) * this.speed * this.reverse * (60 / 1000); + } else { + this.horizontal = Math.cos(angle) * this.speed * this.reverse * (60 / 1000); + this.vertical = Math.sin(angle) * this.speed * this.reverse * (60 / 1000); + } + } else { + if (this.horizontal) { + this.decelerateHorizontal(); + } + if (this.vertical) { + this.decelerateVertical(); + } + this.horizontal = this.vertical = 0; + } + } else { + if (utils.exists(this.left) && x < this.left) { + this.horizontal = 1 * this.reverse * this.speed * (60 / 1000); + } else if (utils.exists(this.right) && x > this.right) { + this.horizontal = -1 * this.reverse * this.speed * (60 / 1000); + } else { + this.decelerateHorizontal(); + this.horizontal = 0; + } + if (utils.exists(this.top) && y < this.top) { + this.vertical = 1 * this.reverse * this.speed * (60 / 1000); + } else if (utils.exists(this.bottom) && y > this.bottom) { + this.vertical = -1 * this.reverse * this.speed * (60 / 1000); + } else { + this.decelerateVertical(); + this.vertical = 0; + } + } + } + }, { + key: 'decelerateHorizontal', + value: function decelerateHorizontal() { + var decelerate = this.parent.plugins['decelerate']; + if (this.horizontal && decelerate && !this.noDecelerate) { + decelerate.activate({ x: this.horizontal * this.speed * this.reverse / (1000 / 60) }); + } + } + }, { + key: 'decelerateVertical', + value: function decelerateVertical() { + var decelerate = this.parent.plugins['decelerate']; + if (this.vertical && decelerate && !this.noDecelerate) { + decelerate.activate({ y: this.vertical * this.speed * this.reverse / (1000 / 60) }); + } + } + }, { + key: 'up', + value: function up() { + if (this.horizontal) { + this.decelerateHorizontal(); + } + if (this.vertical) { + this.decelerateVertical(); + } + this.horizontal = this.vertical = null; + } + }, { + key: 'update', + value: function update() { + if (this.paused) { + return; + } + + if (this.horizontal || this.vertical) { + var center = this.parent.center; + if (this.horizontal) { + center.x += this.horizontal * this.speed; + } + if (this.vertical) { + center.y += this.vertical * this.speed; + } + this.parent.moveCenter(center); + this.parent.emit('moved', { viewport: this.parent, type: 'mouse-edges' }); + } + } + }]); + + return MouseEdges; +}(Plugin); + +},{"./plugin":9,"./utils":12}],8:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Pinch, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {boolean} [options.noDrag] disable two-finger dragging + * @param {number} [options.percent=1.0] percent to modify pinch speed + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of two fingers + */ + function Pinch(parent, options) { + _classCallCheck(this, Pinch); + + var _this = _possibleConstructorReturn(this, (Pinch.__proto__ || Object.getPrototypeOf(Pinch)).call(this, parent)); + + options = options || {}; + _this.percent = options.percent || 1.0; + _this.noDrag = options.noDrag; + _this.center = options.center; + return _this; + } + + _createClass(Pinch, [{ + key: 'down', + value: function down() { + if (this.parent.countDownPointers() >= 2) { + this.active = true; + } + } + }, { + key: 'move', + value: function move(e) { + if (this.paused || !this.active) { + return; + } + + var x = e.data.global.x; + var y = e.data.global.y; + + var pointers = this.parent.getTouchPointers(); + if (pointers.length >= 2) { + var first = pointers[0]; + var second = pointers[1]; + var last = first.last && second.last ? Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2)) : null; + if (first.pointerId === e.data.pointerId) { + first.last = { x: x, y: y, data: e.data }; + } else if (second.pointerId === e.data.pointerId) { + second.last = { x: x, y: y, data: e.data }; + } + if (last) { + var oldPoint = void 0; + var point = { x: first.last.x + (second.last.x - first.last.x) / 2, y: first.last.y + (second.last.y - first.last.y) / 2 }; + if (!this.center) { + oldPoint = this.parent.toLocal(point); + } + var dist = Math.sqrt(Math.pow(second.last.x - first.last.x, 2) + Math.pow(second.last.y - first.last.y, 2)); + var change = (dist - last) / this.parent.screenWidth * this.parent.scale.x * this.percent; + this.parent.scale.x += change; + this.parent.scale.y += change; + this.parent.emit('zoomed', { viewport: this.parent, type: 'pinch' }); + var clamp = this.parent.plugins['clamp-zoom']; + if (clamp) { + clamp.clamp(); + } + if (this.center) { + this.parent.moveCenter(this.center); + } else { + var newPoint = this.parent.toGlobal(oldPoint); + this.parent.x += point.x - newPoint.x; + this.parent.y += point.y - newPoint.y; + this.parent.emit('moved', { viewport: this.parent, type: 'pinch' }); + } + if (!this.noDrag && this.lastCenter) { + this.parent.x += point.x - this.lastCenter.x; + this.parent.y += point.y - this.lastCenter.y; + this.parent.emit('moved', { viewport: this.parent, type: 'pinch' }); + } + this.lastCenter = point; + this.moved = true; + } else { + if (!this.pinching) { + this.parent.emit('pinch-start', this.parent); + this.pinching = true; + } + } + this.parent.dirty = true; + } + } + }, { + key: 'up', + value: function up() { + if (this.pinching) { + if (this.parent.touches.length <= 1) { + this.active = false; + this.lastCenter = null; + this.pinching = false; + this.moved = false; + this.parent.emit('pinch-end', this.parent); + } + } + } + }]); + + return Pinch; +}(Plugin); + +},{"./plugin":9}],9:[function(require,module,exports){ +"use strict"; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +module.exports = function () { + function Plugin(parent) { + _classCallCheck(this, Plugin); + + this.parent = parent; + this.paused = false; + } + + _createClass(Plugin, [{ + key: "down", + value: function down() {} + }, { + key: "move", + value: function move() {} + }, { + key: "up", + value: function up() {} + }, { + key: "wheel", + value: function wheel() {} + }, { + key: "update", + value: function update() {} + }, { + key: "resize", + value: function resize() {} + }, { + key: "reset", + value: function reset() {} + }, { + key: "pause", + value: function pause() { + this.paused = true; + } + }, { + key: "resume", + value: function resume() { + this.paused = false; + } + }]); + + return Plugin; +}(); + +},{}],10:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); +var utils = require('./utils'); + +module.exports = function (_Plugin) { + _inherits(SnapZoom, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired zoom + * @param {boolean} [options.noMove] zoom but do not move + * + * @event snap-zoom-start(Viewport) emitted each time a fit animation starts + * @event snap-zoom-end(Viewport) emitted each time fit reaches its target + * @event snap-zoom-end(Viewport) emitted each time fit reaches its target + */ + function SnapZoom(parent, options) { + _classCallCheck(this, SnapZoom); + + var _this = _possibleConstructorReturn(this, (SnapZoom.__proto__ || Object.getPrototypeOf(SnapZoom)).call(this, parent)); + + options = options || {}; + _this.width = options.width; + _this.height = options.height; + if (_this.width > 0) { + _this.x_scale = parent._screenWidth / _this.width; + } + if (_this.height > 0) { + _this.y_scale = parent._screenHeight / _this.height; + } + _this.xIndependent = utils.exists(_this.x_scale); + _this.yIndependent = utils.exists(_this.y_scale); + _this.x_scale = _this.xIndependent ? _this.x_scale : _this.y_scale; + _this.y_scale = _this.yIndependent ? _this.y_scale : _this.x_scale; + + _this.time = utils.defaults(options.time, 1000); + _this.ease = utils.ease(options.ease, 'easeInOutSine'); + _this.center = options.center; + _this.noMove = options.noMove; + _this.stopOnResize = options.stopOnResize; + _this.removeOnInterrupt = options.removeOnInterrupt; + _this.removeOnComplete = utils.defaults(options.removeOnComplete, true); + _this.interrupt = utils.defaults(options.interrupt, true); + if (_this.time === 0) { + parent.container.scale.x = _this.x_scale; + parent.container.scale.y = _this.y_scale; + if (_this.removeOnComplete) { + _this.parent.removePlugin('snap-zoom'); + } + } else if (options.forceStart) { + _this.createSnapping(); + } + return _this; + } + + _createClass(SnapZoom, [{ + key: 'createSnapping', + value: function createSnapping() { + var scale = this.parent.scale; + this.snapping = { time: 0, startX: scale.x, startY: scale.y, deltaX: this.x_scale - scale.x, deltaY: this.y_scale - scale.y }; + this.parent.emit('snap-zoom-start', this.parent); + } + }, { + key: 'resize', + value: function resize() { + this.snapping = null; + + if (this.width > 0) { + this.x_scale = this.parent._screenWidth / this.width; + } + if (this.height > 0) { + this.y_scale = this.parent._screenHeight / this.height; + } + this.x_scale = this.xIndependent ? this.x_scale : this.y_scale; + this.y_scale = this.yIndependent ? this.y_scale : this.x_scale; + } + }, { + key: 'reset', + value: function reset() { + this.snapping = null; + } + }, { + key: 'wheel', + value: function wheel() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap-zoom'); + } + } + }, { + key: 'down', + value: function down() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap-zoom'); + } else if (this.interrupt) { + this.snapping = null; + } + } + }, { + key: 'update', + value: function update(elapsed) { + if (this.paused) { + return; + } + if (this.interrupt && this.parent.countDownPointers() !== 0) { + return; + } + + var oldCenter = void 0; + if (!this.center && !this.noMove) { + oldCenter = this.parent.center; + } + if (!this.snapping) { + if (this.parent.scale.x !== this.x_scale || this.parent.scale.y !== this.y_scale) { + this.createSnapping(); + } + } else if (this.snapping) { + var snapping = this.snapping; + snapping.time += elapsed; + if (snapping.time >= this.time) { + this.parent.scale.set(this.x_scale, this.y_scale); + if (this.removeOnComplete) { + this.parent.removePlugin('snap-zoom'); + } + this.parent.emit('snap-zoom-end', this.parent); + this.snapping = null; + } else { + var _snapping = this.snapping; + this.parent.scale.x = this.ease(_snapping.time, _snapping.startX, _snapping.deltaX, this.time); + this.parent.scale.y = this.ease(_snapping.time, _snapping.startY, _snapping.deltaY, this.time); + } + var clamp = this.parent.plugins['clamp-zoom']; + if (clamp) { + clamp.clamp(); + } + if (!this.noMove) { + if (!this.center) { + this.parent.moveCenter(oldCenter); + } else { + this.parent.moveCenter(this.center); + } + } + } + } + }, { + key: 'resume', + value: function resume() { + this.snapping = null; + _get(SnapZoom.prototype.__proto__ || Object.getPrototypeOf(SnapZoom.prototype), 'resume', this).call(this); + } + }]); + + return SnapZoom; +}(Plugin); + +},{"./plugin":9,"./utils":12}],11:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); +var utils = require('./utils'); + +module.exports = function (_Plugin) { + _inherits(Snap, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {number} x + * @param {number} y + * @param {object} [options] + * @param {boolean} [options.topLeft] snap to the top-left of viewport instead of center + * @param {number} [options.friction=0.8] friction/frame to apply if decelerate is active + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired location + * + * @event snap-start(Viewport) emitted each time a snap animation starts + * @event snap-restart(Viewport) emitted each time a snap resets because of a change in viewport size + * @event snap-end(Viewport) emitted each time snap reaches its target + * @event snap-remove(Viewport) emitted if snap plugin is removed + */ + function Snap(parent, x, y, options) { + _classCallCheck(this, Snap); + + var _this = _possibleConstructorReturn(this, (Snap.__proto__ || Object.getPrototypeOf(Snap)).call(this, parent)); + + options = options || {}; + _this.friction = options.friction || 0.8; + _this.time = options.time || 1000; + _this.ease = utils.ease(options.ease, 'easeInOutSine'); + _this.x = x; + _this.y = y; + _this.topLeft = options.topLeft; + _this.interrupt = utils.defaults(options.interrupt, true); + _this.removeOnComplete = options.removeOnComplete; + _this.removeOnInterrupt = options.removeOnInterrupt; + if (options.forceStart) { + _this.startEase(); + } + return _this; + } + + _createClass(Snap, [{ + key: 'snapStart', + value: function snapStart() { + this.percent = 0; + this.snapping = { time: 0 }; + var current = this.topLeft ? this.parent.corner : this.parent.center; + this.deltaX = this.x - current.x; + this.deltaY = this.y - current.y; + this.startX = current.x; + this.startY = current.y; + this.parent.emit('snap-start', this.parent); + } + }, { + key: 'wheel', + value: function wheel() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap'); + } + } + }, { + key: 'down', + value: function down() { + if (this.removeOnInterrupt) { + this.parent.removePlugin('snap'); + } else if (this.interrupt) { + this.snapping = null; + } + } + }, { + key: 'up', + value: function up() { + if (this.parent.countDownPointers() === 0) { + var decelerate = this.parent.plugins['decelerate']; + if (decelerate && (decelerate.x || decelerate.y)) { + decelerate.percentChangeX = decelerate.percentChangeY = this.friction; + } + } + } + }, { + key: 'update', + value: function update(elapsed) { + if (this.paused) { + return; + } + if (this.interrupt && this.parent.countDownPointers() !== 0) { + return; + } + if (!this.snapping) { + var current = this.topLeft ? this.parent.corner : this.parent.center; + if (current.x !== this.x || current.y !== this.y) { + this.snapStart(); + } + } else { + var snapping = this.snapping; + snapping.time += elapsed; + var finished = void 0, + x = void 0, + y = void 0; + if (snapping.time > this.time) { + finished = true; + x = this.startX + this.deltaX; + y = this.startY + this.deltaY; + } else { + var percent = this.ease(snapping.time, 0, 1, this.time); + x = this.startX + this.deltaX * percent; + y = this.startY + this.deltaY * percent; + } + if (this.topLeft) { + this.parent.moveCorner(x, y); + } else { + this.parent.moveCenter(x, y); + } + this.parent.emit('moved', { viewport: this.parent, type: 'snap' }); + if (finished) { + if (this.removeOnComplete) { + this.parent.removePlugin('snap'); + } + this.parent.emit('snap-end', this.parent); + this.snapping = null; + } + } + } + }]); + + return Snap; +}(Plugin); + +},{"./plugin":9,"./utils":12}],12:[function(require,module,exports){ +'use strict'; + +var Penner = require('penner'); + +function exists(a) { + return a !== undefined && a !== null; +} + +function defaults(a, defaults) { + return a !== undefined && a !== null ? a : defaults; +} + +/** + * @param {(function|string)} [ease] + * @param {string} defaults for pennr equation + * @private + * @returns {function} correct penner equation + */ +function ease(ease, defaults) { + if (!exists(ease)) { + return Penner[defaults]; + } else if (typeof ease === 'function') { + return ease; + } else if (typeof ease === 'string') { + return Penner[ease]; + } +} + +module.exports = { + exists: exists, + defaults: defaults, + ease: ease +}; + +},{"penner":15}],13:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var utils = require('./utils'); +var Drag = require('./drag'); +var Pinch = require('./pinch'); +var Clamp = require('./clamp'); +var ClampZoom = require('./clamp-zoom'); +var Decelerate = require('./decelerate'); +var Bounce = require('./bounce'); +var Snap = require('./snap'); +var SnapZoom = require('./snap-zoom'); +var Follow = require('./follow'); +var Wheel = require('./wheel'); +var MouseEdges = require('./mouse-edges'); + +var PLUGIN_ORDER = ['drag', 'pinch', 'wheel', 'follow', 'mouse-edges', 'decelerate', 'bounce', 'snap-zoom', 'clamp-zoom', 'snap', 'clamp']; + +var Viewport = function (_PIXI$Container) { + _inherits(Viewport, _PIXI$Container); + + /** + * @extends PIXI.Container + * @extends EventEmitter + * @param {object} [options] + * @param {number} [options.screenWidth=window.innerWidth] + * @param {number} [options.screenHeight=window.innerHeight] + * @param {number} [options.worldWidth=this.width] + * @param {number} [options.worldHeight=this.height] + * @param {number} [options.threshold = 5] number of pixels to move to trigger an input event (e.g., drag, pinch) + * @param {(PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle)} [options.forceHitArea] change the default hitArea from world size to a new value + * @param {PIXI.ticker.Ticker} [options.ticker=PIXI.ticker.shared] use this PIXI.ticker for updates + * @param {PIXI.InteractionManager} [options.interaction=null] InteractionManager, available from instantiated WebGLRenderer/CanvasRenderer.plugins.interaction - used to calculate pointer postion relative to canvas location on screen + * @param {HTMLElement} [options.divWheel=document.body] div to attach the wheel event + * @fires clicked + * @fires drag-start + * @fires drag-end + * @fires drag-remove + * @fires pinch-start + * @fires pinch-end + * @fires pinch-remove + * @fires snap-start + * @fires snap-end + * @fires snap-remove + * @fires snap-zoom-start + * @fires snap-zoom-end + * @fires snap-zoom-remove + * @fires bounce-x-start + * @fires bounce-x-end + * @fires bounce-y-start + * @fires bounce-y-end + * @fires bounce-remove + * @fires wheel + * @fires wheel-remove + * @fires wheel-scroll + * @fires wheel-scroll-remove + * @fires mouse-edge-start + * @fires mouse-edge-end + * @fires mouse-edge-remove + * @fires moved + */ + function Viewport(options) { + _classCallCheck(this, Viewport); + + options = options || {}; + + var _this = _possibleConstructorReturn(this, (Viewport.__proto__ || Object.getPrototypeOf(Viewport)).call(this)); + + _this.plugins = {}; + _this.pluginsList = []; + _this._screenWidth = options.screenWidth; + _this._screenHeight = options.screenHeight; + _this._worldWidth = options.worldWidth; + _this._worldHeight = options.worldHeight; + _this.hitAreaFullScreen = utils.defaults(options.hitAreaFullScreen, true); + _this.forceHitArea = options.forceHitArea; + _this.threshold = utils.defaults(options.threshold, 5); + _this.interaction = options.interaction || null; + _this.div = options.divWheel || document.body; + _this.listeners(_this.div); + + /** + * active touch point ids on the viewport + * @type {number[]} + * @readonly + */ + _this.touches = []; + + _this.ticker = options.ticker || PIXI.ticker.shared; + _this.tickerFunction = function () { + return _this.update(); + }; + _this.ticker.add(_this.tickerFunction); + return _this; + } + + /** + * removes all event listeners from viewport + * (useful for cleanup of wheel and ticker events when removing viewport) + */ + + + _createClass(Viewport, [{ + key: 'removeListeners', + value: function removeListeners() { + this.ticker.remove(this.tickerFunction); + this.div.removeEventListener('wheel', this.wheelFunction); + } + + /** + * overrides PIXI.Container's destroy to also remove the 'wheel' and PIXI.Ticker listeners + */ + + }, { + key: 'destroy', + value: function destroy(options) { + _get(Viewport.prototype.__proto__ || Object.getPrototypeOf(Viewport.prototype), 'destroy', this).call(this, options); + this.removeListeners(); + } + + /** + * update animations + * @private + */ + + }, { + key: 'update', + value: function update() { + if (!this.pause) { + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = this.pluginsList[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var plugin = _step.value; + + plugin.update(this.ticker.elapsedMS); + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + } + if (!this.forceHitArea) { + this.hitArea.x = this.left; + this.hitArea.y = this.top; + this.hitArea.width = this.worldScreenWidth; + this.hitArea.height = this.worldScreenHeight; + } + } + + /** + * use this to set screen and world sizes--needed for pinch/wheel/clamp/bounce + * @param {number} screenWidth + * @param {number} screenHeight + * @param {number} [worldWidth] + * @param {number} [worldHeight] + */ + + }, { + key: 'resize', + value: function resize(screenWidth, screenHeight, worldWidth, worldHeight) { + this._screenWidth = screenWidth || window.innerWidth; + this._screenHeight = screenHeight || window.innerHeight; + this._worldWidth = worldWidth; + this._worldHeight = worldHeight; + this.resizePlugins(); + } + + /** + * called after a worldWidth/Height change + * @private + */ + + }, { + key: 'resizePlugins', + value: function resizePlugins() { + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = this.pluginsList[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var plugin = _step2.value; + + plugin.resize(); + } + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + } + + /** + * screen width in screen pixels + * @type {number} + */ + + }, { + key: 'listeners', + + + /** + * add input listeners + * @private + */ + value: function listeners(div) { + var _this2 = this; + + this.interactive = true; + if (!this.forceHitArea) { + this.hitArea = new PIXI.Rectangle(0, 0, this.worldWidth, this.worldHeight); + } + this.on('pointerdown', this.down); + this.on('pointermove', this.move); + this.on('pointerup', this.up); + this.on('pointerupoutside', this.up); + this.on('pointercancel', this.up); + this.on('pointerout', this.up); + this.wheelFunction = function (e) { + return _this2.handleWheel(e); + }; + div.addEventListener('wheel', this.wheelFunction); + this.leftDown = false; + } + + /** + * handle down events + * @private + */ + + }, { + key: 'down', + value: function down(e) { + if (this.pause) { + return; + } + if (e.data.pointerType === 'mouse') { + if (e.data.originalEvent.button == 0) { + this.leftDown = true; + } + } else { + this.touches.push(e.data.pointerId); + } + + if (this.countDownPointers() === 1) { + this.last = { x: e.data.global.x, y: e.data.global.y + + // clicked event does not fire if viewport is decelerating or bouncing + };var decelerate = this.plugins['decelerate']; + var bounce = this.plugins['bounce']; + if ((!decelerate || !decelerate.x && !decelerate.y) && (!bounce || !bounce.toX && !bounce.toY)) { + this.clickedAvailable = true; + } + } else { + this.clickedAvailable = false; + } + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = this.pluginsList[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var plugin = _step3.value; + + plugin.down(e); + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + } + + /** + * whether change exceeds threshold + * @private + * @param {number} change + */ + + }, { + key: 'checkThreshold', + value: function checkThreshold(change) { + if (Math.abs(change) >= this.threshold) { + return true; + } + return false; + } + + /** + * handle move events + * @private + */ + + }, { + key: 'move', + value: function move(e) { + if (this.pause) { + return; + } + + var _iteratorNormalCompletion4 = true; + var _didIteratorError4 = false; + var _iteratorError4 = undefined; + + try { + for (var _iterator4 = this.pluginsList[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { + var plugin = _step4.value; + + plugin.move(e); + } + } catch (err) { + _didIteratorError4 = true; + _iteratorError4 = err; + } finally { + try { + if (!_iteratorNormalCompletion4 && _iterator4.return) { + _iterator4.return(); + } + } finally { + if (_didIteratorError4) { + throw _iteratorError4; + } + } + } + + if (this.clickedAvailable) { + var distX = e.data.global.x - this.last.x; + var distY = e.data.global.y - this.last.y; + if (this.checkThreshold(distX) || this.checkThreshold(distY)) { + this.clickedAvailable = false; + } + } + } + + /** + * handle up events + * @private + */ + + }, { + key: 'up', + value: function up(e) { + if (this.pause) { + return; + } + + if (e.data.originalEvent instanceof MouseEvent && e.data.originalEvent.button == 0) { + this.leftDown = false; + } + + if (e.data.pointerType !== 'mouse') { + for (var i = 0; i < this.touches.length; i++) { + if (this.touches[i] === e.data.pointerId) { + this.touches.splice(i, 1); + break; + } + } + } + + var _iteratorNormalCompletion5 = true; + var _didIteratorError5 = false; + var _iteratorError5 = undefined; + + try { + for (var _iterator5 = this.pluginsList[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) { + var plugin = _step5.value; + + plugin.up(e); + } + } catch (err) { + _didIteratorError5 = true; + _iteratorError5 = err; + } finally { + try { + if (!_iteratorNormalCompletion5 && _iterator5.return) { + _iterator5.return(); + } + } finally { + if (_didIteratorError5) { + throw _iteratorError5; + } + } + } + + if (this.clickedAvailable && this.countDownPointers() === 0) { + this.emit('clicked', { screen: this.last, world: this.toWorld(this.last), viewport: this }); + this.clickedAvailable = false; + } + } + + /** + * gets pointer position if this.interaction is set + * @param {UIEvent} evt + * @private + */ + + }, { + key: 'getPointerPosition', + value: function getPointerPosition(evt) { + var point = new PIXI.Point(); + if (this.interaction) { + this.interaction.mapPositionToPoint(point, evt.clientX, evt.clientY); + } else { + point.x = evt.clientX; + point.y = evt.clientY; + } + return point; + } + + /** + * handle wheel events + * @private + */ + + }, { + key: 'handleWheel', + value: function handleWheel(e) { + if (this.pause) { + return; + } + + // only handle wheel events where the mouse is over the viewport + var point = this.toLocal(this.getPointerPosition(e)); + if (this.left <= point.x && point.x <= this.right && this.top <= point.y && point.y <= this.bottom) { + var result = void 0; + var _iteratorNormalCompletion6 = true; + var _didIteratorError6 = false; + var _iteratorError6 = undefined; + + try { + for (var _iterator6 = this.pluginsList[Symbol.iterator](), _step6; !(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done); _iteratorNormalCompletion6 = true) { + var plugin = _step6.value; + + if (plugin.wheel(e)) { + result = true; + } + } + } catch (err) { + _didIteratorError6 = true; + _iteratorError6 = err; + } finally { + try { + if (!_iteratorNormalCompletion6 && _iterator6.return) { + _iterator6.return(); + } + } finally { + if (_didIteratorError6) { + throw _iteratorError6; + } + } + } + + return result; + } + } + + /** + * change coordinates from screen to world + * @param {number|PIXI.Point} x + * @param {number} [y] + * @returns {PIXI.Point} + */ + + }, { + key: 'toWorld', + value: function toWorld() { + if (arguments.length === 2) { + var x = arguments[0]; + var y = arguments[1]; + return this.toLocal({ x: x, y: y }); + } else { + return this.toLocal(arguments[0]); + } + } + + /** + * change coordinates from world to screen + * @param {number|PIXI.Point} x + * @param {number} [y] + * @returns {PIXI.Point} + */ + + }, { + key: 'toScreen', + value: function toScreen() { + if (arguments.length === 2) { + var x = arguments[0]; + var y = arguments[1]; + return this.toGlobal({ x: x, y: y }); + } else { + var point = arguments[0]; + return this.toGlobal(point); + } + } + + /** + * screen width in world coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'moveCenter', + + + /** + * move center of viewport to point + * @param {(number|PIXI.PointLike)} x or point + * @param {number} [y] + * @return {Viewport} this + */ + value: function moveCenter() /*x, y | PIXI.Point*/{ + var x = void 0, + y = void 0; + if (!isNaN(arguments[0])) { + x = arguments[0]; + y = arguments[1]; + } else { + x = arguments[0].x; + y = arguments[0].y; + } + this.position.set((this.worldScreenWidth / 2 - x) * this.scale.x, (this.worldScreenHeight / 2 - y) * this.scale.y); + this._reset(); + return this; + } + + /** + * top-left corner + * @type {PIXI.PointLike} + */ + + }, { + key: 'moveCorner', + + + /** + * move viewport's top-left corner; also clamps and resets decelerate and bounce (as needed) + * @param {number|PIXI.Point} x|point + * @param {number} y + * @return {Viewport} this + */ + value: function moveCorner() /*x, y | point*/{ + if (arguments.length === 1) { + this.position.set(-arguments[0].x * this.scale.x, -arguments[0].y * this.scale.y); + } else { + this.position.set(-arguments[0] * this.scale.x, -arguments[1] * this.scale.y); + } + this._reset(); + return this; + } + + /** + * change zoom so the width fits in the viewport + * @param {number} [width=this._worldWidth] in world coordinates + * @param {boolean} [center] maintain the same center + * @return {Viewport} this + */ + + }, { + key: 'fitWidth', + value: function fitWidth(width, center) { + var save = void 0; + if (center) { + save = this.center; + } + width = width || this.worldWidth; + this.scale.x = this.screenWidth / width; + this.scale.y = this.scale.x; + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * change zoom so the height fits in the viewport + * @param {number} [height=this._worldHeight] in world coordinates + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} this + */ + + }, { + key: 'fitHeight', + value: function fitHeight(height, center) { + var save = void 0; + if (center) { + save = this.center; + } + height = height || this.worldHeight; + this.scale.y = this.screenHeight / height; + this.scale.x = this.scale.y; + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * change zoom so it fits the entire world in the viewport + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} this + */ + + }, { + key: 'fitWorld', + value: function fitWorld(center) { + var save = void 0; + if (center) { + save = this.center; + } + this.scale.x = this._screenWidth / this._worldWidth; + this.scale.y = this._screenHeight / this._worldHeight; + if (this.scale.x < this.scale.y) { + this.scale.y = this.scale.x; + } else { + this.scale.x = this.scale.y; + } + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * change zoom so it fits the size or the entire world in the viewport + * @param {boolean} [center] maintain the same center of the screen after zoom + * @param {number} [width] desired width + * @param {number} [height] desired height + * @return {Viewport} this + */ + + }, { + key: 'fit', + value: function fit(center, width, height) { + var save = void 0; + if (center) { + save = this.center; + } + width = width || this.worldWidth; + height = height || this.worldHeight; + this.scale.x = this.screenWidth / width; + this.scale.y = this.screenHeight / height; + if (this.scale.x < this.scale.y) { + this.scale.y = this.scale.x; + } else { + this.scale.x = this.scale.y; + } + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * zoom viewport by a certain percent (in both x and y direction) + * @param {number} percent change (e.g., 0.25 would increase a starting scale of 1.0 to 1.25) + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} the viewport + */ + + }, { + key: 'zoomPercent', + value: function zoomPercent(percent, center) { + var save = void 0; + if (center) { + save = this.center; + } + var scale = this.scale.x + this.scale.x * percent; + this.scale.set(scale); + if (center) { + this.moveCenter(save); + } + return this; + } + + /** + * zoom viewport by increasing/decreasing width by a certain number of pixels + * @param {number} change in pixels + * @param {boolean} [center] maintain the same center of the screen after zoom + * @return {Viewport} the viewport + */ + + }, { + key: 'zoom', + value: function zoom(change, center) { + this.fitWidth(change + this.worldScreenWidth, center); + return this; + } + + /** + * @param {object} [options] + * @param {number} [options.width] the desired width to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.height] the desired height to snap (to maintain aspect ratio, choose only width or height) + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of the viewport + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired zoom + */ + + }, { + key: 'snapZoom', + value: function snapZoom(options) { + this.plugins['snap-zoom'] = new SnapZoom(this, options); + this.pluginsSort(); + return this; + } + + /** + * @private + * @typedef OutOfBounds + * @type {object} + * @property {boolean} left + * @property {boolean} right + * @property {boolean} top + * @property {boolean} bottom + */ + + /** + * is container out of world bounds + * @return {OutOfBounds} + * @private + */ + + }, { + key: 'OOB', + value: function OOB() { + var result = {}; + result.left = this.left < 0; + result.right = this.right > this._worldWidth; + result.top = this.top < 0; + result.bottom = this.bottom > this._worldHeight; + result.cornerPoint = { + x: this._worldWidth * this.scale.x - this._screenWidth, + y: this._worldHeight * this.scale.y - this._screenHeight + }; + return result; + } + + /** + * world coordinates of the right edge of the screen + * @type {number} + */ + + }, { + key: 'countDownPointers', + + + /** + * count of mouse/touch pointers that are down on the viewport + * @private + * @return {number} + */ + value: function countDownPointers() { + return (this.leftDown ? 1 : 0) + this.touches.length; + } + + /** + * array of touch pointers that are down on the viewport + * @private + * @return {PIXI.InteractionTrackingData[]} + */ + + }, { + key: 'getTouchPointers', + value: function getTouchPointers() { + var results = []; + var pointers = this.trackedPointers; + for (var key in pointers) { + var pointer = pointers[key]; + if (this.touches.indexOf(pointer.pointerId) !== -1) { + results.push(pointer); + } + } + return results; + } + + /** + * array of pointers that are down on the viewport + * @private + * @return {PIXI.InteractionTrackingData[]} + */ + + }, { + key: 'getPointers', + value: function getPointers() { + var results = []; + var pointers = this.trackedPointers; + for (var key in pointers) { + results.push(pointers[key]); + } + return results; + } + + /** + * clamps and resets bounce and decelerate (as needed) after manually moving viewport + * @private + */ + + }, { + key: '_reset', + value: function _reset() { + if (this.plugins['bounce']) { + this.plugins['bounce'].reset(); + this.plugins['bounce'].bounce(); + } + if (this.plugins['decelerate']) { + this.plugins['decelerate'].reset(); + } + if (this.plugins['snap']) { + this.plugins['snap'].reset(); + } + if (this.plugins['clamp']) { + this.plugins['clamp'].update(); + } + if (this.plugins['clamp-zoom']) { + this.plugins['clamp-zoom'].clamp(); + } + this.dirty = true; + } + + // PLUGINS + + /** + * removes installed plugin + * @param {string} type of plugin (e.g., 'drag', 'pinch') + */ + + }, { + key: 'removePlugin', + value: function removePlugin(type) { + if (this.plugins[type]) { + this.plugins[type] = null; + this.emit(type + '-remove'); + this.pluginsSort(); + } + } + + /** + * pause plugin + * @param {string} type of plugin (e.g., 'drag', 'pinch') + */ + + }, { + key: 'pausePlugin', + value: function pausePlugin(type) { + if (this.plugins[type]) { + this.plugins[type].pause(); + } + } + + /** + * resume plugin + * @param {string} type of plugin (e.g., 'drag', 'pinch') + */ + + }, { + key: 'resumePlugin', + value: function resumePlugin(type) { + if (this.plugins[type]) { + this.plugins[type].resume(); + } + } + + /** + * sort plugins for updates + * @private + */ + + }, { + key: 'pluginsSort', + value: function pluginsSort() { + this.pluginsList = []; + var _iteratorNormalCompletion7 = true; + var _didIteratorError7 = false; + var _iteratorError7 = undefined; + + try { + for (var _iterator7 = PLUGIN_ORDER[Symbol.iterator](), _step7; !(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done); _iteratorNormalCompletion7 = true) { + var plugin = _step7.value; + + if (this.plugins[plugin]) { + this.pluginsList.push(this.plugins[plugin]); + } + } + } catch (err) { + _didIteratorError7 = true; + _iteratorError7 = err; + } finally { + try { + if (!_iteratorNormalCompletion7 && _iterator7.return) { + _iterator7.return(); + } + } finally { + if (_didIteratorError7) { + throw _iteratorError7; + } + } + } + } + + /** + * enable one-finger touch to drag + * @param {object} [options] + * @param {string} [options.direction=all] direction to drag (all, x, or y) + * @param {boolean} [options.wheel=true] use wheel to scroll in y direction (unless wheel plugin is active) + * @param {number} [options.wheelScroll=10] number of pixels to scroll with each wheel spin + * @param {boolean} [options.reverse] reverse the direction of the wheel scroll + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + */ + + }, { + key: 'drag', + value: function drag(options) { + this.plugins['drag'] = new Drag(this, options); + this.pluginsSort(); + return this; + } + + /** + * clamp to world boundaries or other provided boundaries + * NOTES: + * clamp is disabled if called with no options; use { direction: 'all' } for all edge clamping + * screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {object} [options] + * @param {(number|boolean)} [options.left] clamp left; true=0 + * @param {(number|boolean)} [options.right] clamp right; true=viewport.worldWidth + * @param {(number|boolean)} [options.top] clamp top; true=0 + * @param {(number|boolean)} [options.bottom] clamp bottom; true=viewport.worldHeight + * @param {string} [options.direction] (all, x, or y) using clamps of [0, viewport.worldWidth/viewport.worldHeight]; replaces left/right/top/bottom if set + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + * @return {Viewport} this + */ + + }, { + key: 'clamp', + value: function clamp(options) { + this.plugins['clamp'] = new Clamp(this, options); + this.pluginsSort(); + return this; + } + + /** + * decelerate after a move + * @param {object} [options] + * @param {number} [options.friction=0.95] percent to decelerate after movement + * @param {number} [options.bounce=0.8] percent to decelerate when past boundaries (only applicable when viewport.bounce() is active) + * @param {number} [options.minSpeed=0.01] minimum velocity before stopping/reversing acceleration + * @return {Viewport} this + */ + + }, { + key: 'decelerate', + value: function decelerate(options) { + this.plugins['decelerate'] = new Decelerate(this, options); + this.pluginsSort(); + return this; + } + + /** + * bounce on borders + * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {object} [options] + * @param {string} [options.sides=all] all, horizontal, vertical, or combination of top, bottom, right, left (e.g., 'top-bottom-right') + * @param {number} [options.friction=0.5] friction to apply to decelerate if active + * @param {number} [options.time=150] time in ms to finish bounce + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {string} [options.underflow=center] (top/bottom/center and left/right/center, or center) where to place world if too small for screen + * @return {Viewport} this + */ + + }, { + key: 'bounce', + value: function bounce(options) { + this.plugins['bounce'] = new Bounce(this, options); + this.pluginsSort(); + return this; + } + + /** + * enable pinch to zoom and two-finger touch to drag + * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {number} [options.percent=1.0] percent to modify pinch speed + * @param {boolean} [options.noDrag] disable two-finger dragging + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of center of two fingers + * @return {Viewport} this + */ + + }, { + key: 'pinch', + value: function pinch(options) { + this.plugins['pinch'] = new Pinch(this, options); + this.pluginsSort(); + return this; + } + + /** + * snap to a point + * @param {number} x + * @param {number} y + * @param {object} [options] + * @param {boolean} [options.topLeft] snap to the top-left of viewport instead of center + * @param {number} [options.friction=0.8] friction/frame to apply if decelerate is active + * @param {number} [options.time=1000] + * @param {string|function} [options.ease=easeInOutSine] ease function or name (see http://easings.net/ for supported names) + * @param {boolean} [options.interrupt=true] pause snapping with any user input on the viewport + * @param {boolean} [options.removeOnComplete] removes this plugin after snapping is complete + * @param {boolean} [options.removeOnInterrupt] removes this plugin if interrupted by any user input + * @param {boolean} [options.forceStart] starts the snap immediately regardless of whether the viewport is at the desired location + * @return {Viewport} this + */ + + }, { + key: 'snap', + value: function snap(x, y, options) { + this.plugins['snap'] = new Snap(this, x, y, options); + this.pluginsSort(); + return this; + } + + /** + * follow a target + * @param {PIXI.DisplayObject} target to follow (object must include {x: x-coordinate, y: y-coordinate}) + * @param {object} [options] + * @param {number} [options.speed=0] to follow in pixels/frame (0=teleport to location) + * @param {number} [options.radius] radius (in world coordinates) of center circle where movement is allowed without moving the viewport + * @return {Viewport} this + */ + + }, { + key: 'follow', + value: function follow(target, options) { + this.plugins['follow'] = new Follow(this, target, options); + this.pluginsSort(); + return this; + } + + /** + * zoom using mouse wheel + * @param {object} [options] + * @param {number} [options.percent=0.1] percent to scroll with each spin + * @param {boolean} [options.reverse] reverse the direction of the scroll + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of current mouse position + * @return {Viewport} this + */ + + }, { + key: 'wheel', + value: function wheel(options) { + this.plugins['wheel'] = new Wheel(this, options); + this.pluginsSort(); + return this; + } + + /** + * enable clamping of zoom to constraints + * NOTE: screenWidth, screenHeight, worldWidth, and worldHeight needs to be set for this to work properly + * @param {object} [options] + * @param {number} [options.minWidth] minimum width + * @param {number} [options.minHeight] minimum height + * @param {number} [options.maxWidth] maximum width + * @param {number} [options.maxHeight] maximum height + * @return {Viewport} this + */ + + }, { + key: 'clampZoom', + value: function clampZoom(options) { + this.plugins['clamp-zoom'] = new ClampZoom(this, options); + this.pluginsSort(); + return this; + } + + /** + * Scroll viewport when mouse hovers near one of the edges or radius-distance from center of screen. + * @param {object} [options] + * @param {number} [options.radius] distance from center of screen in screen pixels + * @param {number} [options.distance] distance from all sides in screen pixels + * @param {number} [options.top] alternatively, set top distance (leave unset for no top scroll) + * @param {number} [options.bottom] alternatively, set bottom distance (leave unset for no top scroll) + * @param {number} [options.left] alternatively, set left distance (leave unset for no top scroll) + * @param {number} [options.right] alternatively, set right distance (leave unset for no top scroll) + * @param {number} [options.speed=8] speed in pixels/frame to scroll viewport + * @param {boolean} [options.reverse] reverse direction of scroll + * @param {boolean} [options.noDecelerate] don't use decelerate plugin even if it's installed + * @param {boolean} [options.linear] if using radius, use linear movement (+/- 1, +/- 1) instead of angled movement (Math.cos(angle from center), Math.sin(angle from center)) + */ + + }, { + key: 'mouseEdges', + value: function mouseEdges(options) { + this.plugins['mouse-edges'] = new MouseEdges(this, options); + this.pluginsSort(); + return this; + } + + /** + * pause viewport (including animation updates such as decelerate) + * NOTE: when setting pause=true, all touches and mouse actions are cleared (i.e., if mousedown was active, it becomes inactive for purposes of the viewport) + * @type {boolean} + */ + + }, { + key: 'screenWidth', + get: function get() { + return this._screenWidth; + }, + set: function set(value) { + this._screenWidth = value; + } + + /** + * screen height in screen pixels + * @type {number} + */ + + }, { + key: 'screenHeight', + get: function get() { + return this._screenHeight; + }, + set: function set(value) { + this._screenHeight = value; + } + + /** + * world width in pixels + * @type {number} + */ + + }, { + key: 'worldWidth', + get: function get() { + if (this._worldWidth) { + return this._worldWidth; + } else { + return this.width; + } + }, + set: function set(value) { + this._worldWidth = value; + this.resizePlugins(); + } + + /** + * world height in pixels + * @type {number} + */ + + }, { + key: 'worldHeight', + get: function get() { + if (this._worldHeight) { + return this._worldHeight; + } else { + return this.height; + } + }, + set: function set(value) { + this._worldHeight = value; + this.resizePlugins(); + } + }, { + key: 'worldScreenWidth', + get: function get() { + return this._screenWidth / this.scale.x; + } + + /** + * screen height in world coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'worldScreenHeight', + get: function get() { + return this._screenHeight / this.scale.y; + } + + /** + * world width in screen coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'screenWorldWidth', + get: function get() { + return this._worldWidth * this.scale.x; + } + + /** + * world height in screen coordinates + * @type {number} + * @readonly + */ + + }, { + key: 'screenWorldHeight', + get: function get() { + return this._worldHeight * this.scale.y; + } + + /** + * get center of screen in world coordinates + * @type {PIXI.PointLike} + */ + + }, { + key: 'center', + get: function get() { + return { x: this.worldScreenWidth / 2 - this.x / this.scale.x, y: this.worldScreenHeight / 2 - this.y / this.scale.y }; + }, + set: function set(value) { + this.moveCenter(value); + } + }, { + key: 'corner', + get: function get() { + return { x: -this.x / this.scale.x, y: -this.y / this.scale.y }; + }, + set: function set(value) { + this.moveCorner(value); + } + }, { + key: 'right', + get: function get() { + return -this.x / this.scale.x + this.worldScreenWidth; + }, + set: function set(value) { + this.x = -value * this.scale.x + this.screenWidth; + this._reset(); + } + + /** + * world coordinates of the left edge of the screen + * @type {number} + */ + + }, { + key: 'left', + get: function get() { + return -this.x / this.scale.x; + }, + set: function set(value) { + this.x = -value * this.scale.x; + this._reset(); + } + + /** + * world coordinates of the top edge of the screen + * @type {number} + */ + + }, { + key: 'top', + get: function get() { + return -this.y / this.scale.y; + }, + set: function set(value) { + this.y = -value * this.scale.y; + this._reset(); + } + + /** + * world coordinates of the bottom edge of the screen + * @type {number} + */ + + }, { + key: 'bottom', + get: function get() { + return -this.y / this.scale.y + this.worldScreenHeight; + }, + set: function set(value) { + this.y = -value * this.scale.y + this.screenHeight; + this._reset(); + } + /** + * determines whether the viewport is dirty (i.e., needs to be renderered to the screen because of a change) + * @type {boolean} + */ + + }, { + key: 'dirty', + get: function get() { + return this._dirty; + }, + set: function set(value) { + this._dirty = value; + } + + /** + * permanently changes the Viewport's hitArea + *

NOTE: normally the hitArea = PIXI.Rectangle(Viewport.left, Viewport.top, Viewport.worldScreenWidth, Viewport.worldScreenHeight)

+ * @type {(PIXI.Rectangle|PIXI.Circle|PIXI.Ellipse|PIXI.Polygon|PIXI.RoundedRectangle)} + */ + + }, { + key: 'forceHitArea', + get: function get() { + return this._forceHitArea; + }, + set: function set(value) { + if (value) { + this._forceHitArea = value; + this.hitArea = value; + } else { + this._forceHitArea = false; + this.hitArea = new PIXI.Rectangle(0, 0, this.worldWidth, this.worldHeight); + } + } + }, { + key: 'pause', + get: function get() { + return this._pause; + }, + set: function set(value) { + this._pause = value; + if (value) { + this.touches = []; + this.leftDown = false; + } + } + }]); + + return Viewport; +}(PIXI.Container); + +/** + * fires after a mouse or touch click + * @event Viewport#clicked + * @type {object} + * @property {PIXI.PointLike} screen + * @property {PIXI.PointLike} world + * @property {Viewport} viewport + */ + +/** + * fires when a drag starts + * @event Viewport#drag-start + * @type {object} + * @property {PIXI.PointLike} screen + * @property {PIXI.PointLike} world + * @property {Viewport} viewport + */ + +/** + * fires when a drag ends + * @event Viewport#drag-end + * @type {object} + * @property {PIXI.PointLike} screen + * @property {PIXI.PointLike} world + * @property {Viewport} viewport + */ + +/** + * fires when a pinch starts + * @event Viewport#pinch-start + * @type {Viewport} + */ + +/** + * fires when a pinch end + * @event Viewport#pinch-end + * @type {Viewport} + */ + +/** + * fires when a snap starts + * @event Viewport#snap-start + * @type {Viewport} + */ + +/** + * fires when a snap ends + * @event Viewport#snap-end + * @type {Viewport} + */ + +/** + * fires when a snap-zoom starts + * @event Viewport#snap-zoom-start + * @type {Viewport} + */ + +/** + * fires when a snap-zoom ends + * @event Viewport#snap-zoom-end + * @type {Viewport} + */ + +/** + * fires when a bounce starts in the x direction + * @event Viewport#bounce-x-start + * @type {Viewport} + */ + +/** + * fires when a bounce ends in the x direction + * @event Viewport#bounce-x-end + * @type {Viewport} + */ + +/** + * fires when a bounce starts in the y direction + * @event Viewport#bounce-y-start + * @type {Viewport} + */ + +/** + * fires when a bounce ends in the y direction + * @event Viewport#bounce-y-end + * @type {Viewport} + */ + +/** + * fires when for a mouse wheel event + * @event Viewport#wheel + * @type {object} + * @property {object} wheel + * @property {number} wheel.dx + * @property {number} wheel.dy + * @property {number} wheel.dz + * @property {Viewport} viewport + */ + +/** + * fires when a wheel-scroll occurs + * @event Viewport#wheel-scroll + * @type {Viewport} + */ + +/** + * fires when a mouse-edge starts to scroll + * @event Viewport#mouse-edge-start + * @type {Viewport} + */ + +/** + * fires when the mouse-edge scrolling ends + * @event Viewport#mouse-edge-end + * @type {Viewport} + */ + +/** + * fires when viewport moves through UI interaction, deceleration, or follow + * @event Viewport#moved + * @type {object} + * @property {Viewport} viewport + * @property {string} type (drag, snap, pinch, follow, bounce-x, bounce-y, clamp-x, clamp-y, decelerate, mouse-edges, wheel) + */ + +/** + * fires when viewport moves through UI interaction, deceleration, or follow + * @event Viewport#zoomed + * @type {object} + * @property {Viewport} viewport + * @property {string} type (drag-zoom, pinch, wheel, clamp-zoom) + */ + +PIXI.extras.Viewport = Viewport; + +module.exports = Viewport; + +},{"./bounce":1,"./clamp":3,"./clamp-zoom":2,"./decelerate":4,"./drag":5,"./follow":6,"./mouse-edges":7,"./pinch":8,"./snap":11,"./snap-zoom":10,"./utils":12,"./wheel":14}],14:[function(require,module,exports){ +'use strict'; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Plugin = require('./plugin'); + +module.exports = function (_Plugin) { + _inherits(Wheel, _Plugin); + + /** + * @private + * @param {Viewport} parent + * @param {object} [options] + * @param {number} [options.percent=0.1] percent to scroll with each spin + * @param {boolean} [options.reverse] reverse the direction of the scroll + * @param {PIXI.Point} [options.center] place this point at center during zoom instead of current mouse position + * + * @event wheel({wheel: {dx, dy, dz}, event, viewport}) + */ + function Wheel(parent, options) { + _classCallCheck(this, Wheel); + + var _this = _possibleConstructorReturn(this, (Wheel.__proto__ || Object.getPrototypeOf(Wheel)).call(this, parent)); + + options = options || {}; + _this.percent = options.percent || 0.1; + _this.center = options.center; + _this.reverse = options.reverse; + return _this; + } + + _createClass(Wheel, [{ + key: 'wheel', + value: function wheel(e) { + if (this.paused) { + return; + } + + var change = void 0; + if (this.reverse) { + change = e.deltaY > 0 ? 1 + this.percent : 1 - this.percent; + } else { + change = e.deltaY > 0 ? 1 - this.percent : 1 + this.percent; + } + var point = this.parent.getPointerPosition(e); + + var oldPoint = void 0; + if (!this.center) { + oldPoint = this.parent.toLocal(point); + } + this.parent.scale.x *= change; + this.parent.scale.y *= change; + this.parent.emit('zoomed', { viewport: this.parent, type: 'wheel' }); + var clamp = this.parent.plugins['clamp-zoom']; + if (clamp) { + clamp.clamp(); + } + + if (this.center) { + this.parent.moveCenter(this.center); + } else { + var newPoint = this.parent.toGlobal(oldPoint); + this.parent.x += point.x - newPoint.x; + this.parent.y += point.y - newPoint.y; + } + this.parent.emit('moved', { viewport: this.parent, type: 'wheel' }); + this.parent.emit('wheel', { wheel: { dx: e.deltaX, dy: e.deltaY, dz: e.deltaZ }, event: e, viewport: this.parent }); + e.preventDefault(); + } + }]); + + return Wheel; +}(Plugin); + +},{"./plugin":9}],15:[function(require,module,exports){ + +/* + Copyright © 2001 Robert Penner + All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, + are permitted provided that the following conditions are met: + + Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + Neither the name of the author nor the names of contributors may be used to endorse + or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +(function() { + var penner, umd; + + umd = function(factory) { + if (typeof exports === 'object') { + return module.exports = factory; + } else if (typeof define === 'function' && define.amd) { + return define([], factory); + } else { + return this.penner = factory; + } + }; + + penner = { + linear: function(t, b, c, d) { + return c * t / d + b; + }, + easeInQuad: function(t, b, c, d) { + return c * (t /= d) * t + b; + }, + easeOutQuad: function(t, b, c, d) { + return -c * (t /= d) * (t - 2) + b; + }, + easeInOutQuad: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t + b; + } else { + return -c / 2 * ((--t) * (t - 2) - 1) + b; + } + }, + easeInCubic: function(t, b, c, d) { + return c * (t /= d) * t * t + b; + }, + easeOutCubic: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t + 1) + b; + }, + easeInOutCubic: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t + 2) + b; + } + }, + easeInQuart: function(t, b, c, d) { + return c * (t /= d) * t * t * t + b; + }, + easeOutQuart: function(t, b, c, d) { + return -c * ((t = t / d - 1) * t * t * t - 1) + b; + }, + easeInOutQuart: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t + b; + } else { + return -c / 2 * ((t -= 2) * t * t * t - 2) + b; + } + }, + easeInQuint: function(t, b, c, d) { + return c * (t /= d) * t * t * t * t + b; + }, + easeOutQuint: function(t, b, c, d) { + return c * ((t = t / d - 1) * t * t * t * t + 1) + b; + }, + easeInOutQuint: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return c / 2 * t * t * t * t * t + b; + } else { + return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; + } + }, + easeInSine: function(t, b, c, d) { + return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; + }, + easeOutSine: function(t, b, c, d) { + return c * Math.sin(t / d * (Math.PI / 2)) + b; + }, + easeInOutSine: function(t, b, c, d) { + return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; + }, + easeInExpo: function(t, b, c, d) { + if (t === 0) { + return b; + } else { + return c * Math.pow(2, 10 * (t / d - 1)) + b; + } + }, + easeOutExpo: function(t, b, c, d) { + if (t === d) { + return b + c; + } else { + return c * (-Math.pow(2, -10 * t / d) + 1) + b; + } + }, + easeInOutExpo: function(t, b, c, d) { + if (t === 0) { + b; + } + if (t === d) { + b + c; + } + if ((t /= d / 2) < 1) { + return c / 2 * Math.pow(2, 10 * (t - 1)) + b; + } else { + return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; + } + }, + easeInCirc: function(t, b, c, d) { + return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; + }, + easeOutCirc: function(t, b, c, d) { + return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; + }, + easeInOutCirc: function(t, b, c, d) { + if ((t /= d / 2) < 1) { + return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; + } else { + return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; + } + }, + easeInElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + }, + easeOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d) === 1) { + b + c; + } + if (!p) { + p = d * .3; + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; + }, + easeInOutElastic: function(t, b, c, d) { + var a, p, s; + s = 1.70158; + p = 0; + a = c; + if (t === 0) { + b; + } else if ((t /= d / 2) === 2) { + b + c; + } + if (!p) { + p = d * (.3 * 1.5); + } + if (a < Math.abs(c)) { + a = c; + s = p / 4; + } else { + s = p / (2 * Math.PI) * Math.asin(c / a); + } + if (t < 1) { + return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + } else { + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; + } + }, + easeInBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * (t /= d) * t * ((s + 1) * t - s) + b; + }, + easeOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; + }, + easeInOutBack: function(t, b, c, d, s) { + if (s === void 0) { + s = 1.70158; + } + if ((t /= d / 2) < 1) { + return c / 2 * (t * t * (((s *= 1.525) + 1) * t - s)) + b; + } else { + return c / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + b; + } + }, + easeInBounce: function(t, b, c, d) { + var v; + v = penner.easeOutBounce(d - t, 0, c, d); + return c - v + b; + }, + easeOutBounce: function(t, b, c, d) { + if ((t /= d) < 1 / 2.75) { + return c * (7.5625 * t * t) + b; + } else if (t < 2 / 2.75) { + return c * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + b; + } else if (t < 2.5 / 2.75) { + return c * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + b; + } else { + return c * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + b; + } + }, + easeInOutBounce: function(t, b, c, d) { + var v; + if (t < d / 2) { + v = penner.easeInBounce(t * 2, 0, c, d); + return v * .5 + b; + } else { + v = penner.easeOutBounce(t * 2 - d, 0, c, d); + return v * .5 + c * .5 + b; + } + } + }; + + umd(penner); + +}).call(this); + +},{}]},{},[13]); diff --git a/lib/pixi/bundle.js b/lib/pixi/bundle.js index 04d2693..2aeabb0 100755 --- a/lib/pixi/bundle.js +++ b/lib/pixi/bundle.js @@ -10,6 +10,7 @@ import Timeline from './timeline.js' import Theme from './theme.js' import Button from './button.js' import ButtonGroup from './buttongroup.js' +import Scrollview from './scrollview.js' import Slider from './slider.js' import Switch from './switch.js' import Popup from './popup.js' @@ -41,6 +42,7 @@ window.AppTest = AppTest window.Theme = Theme window.Button = Button window.ButtonGroup = ButtonGroup +window.Scrollview = Scrollview window.Slider = Slider window.Switch = Switch window.Popup = Popup diff --git a/lib/pixi/scrollbox.js b/lib/pixi/scrollbox.js new file mode 100644 index 0000000..83bcd9b --- /dev/null +++ b/lib/pixi/scrollbox.js @@ -0,0 +1,585 @@ + + +/** + * pixi.js scrollbox: a masked content box that can scroll vertically or horizontally with scrollbars + */ +export default class Scrollbox extends PIXI.Container { + /** + * create a scrollbox + * @param {object} options + * @param {boolean} [options.dragScroll=true] user may drag the content area to scroll content + * @param {string} [options.overflowX=auto] (none, scroll, hidden, auto) this changes whether the scrollbar is shown + * @param {string} [options.overflowY=auto] (none, scroll, hidden, auto) this changes whether the scrollbar is shown + * @param {string} [options.overflow] (none, scroll, hidden, auto) sets overflowX and overflowY to this value + * @param {number} [options.boxWidth=100] width of scrollbox including scrollbar (in pixels) + * @param {number} [options.boxHeight=100] height of scrollbox including scrollbar (in pixels) + * @param {number} [options.scrollbarSize=10] size of scrollbar (in pixels) + * @param {number} [options.scrollbarOffsetHorizontal=0] offset of horizontal scrollbar (in pixels) + * @param {number} [options.scrollbarOffsetVertical=0] offset of vertical scrollbar (in pixels) + * @param {boolean} [options.stopPropagation=true] call stopPropagation on any events that impact scrollbox + * @param {number} [options.scrollbarBackground=0xdddddd] background color of scrollbar + * @param {number} [options.scrollbarBackgroundAlpha=1] alpha of background of scrollbar + * @param {number} [options.scrollbarForeground=0x888888] foreground color of scrollbar + * @param {number} [options.scrollbarForegroundAlpha=1] alpha of foreground of scrollbar + * @param {string} [options.underflow=top-left] what to do when content underflows the scrollbox size: none: do nothing; (left/right/center AND top/bottom/center); OR center (e.g., 'top-left', 'center', 'none', 'bottomright') + * @param {(boolean|number)} [options.fade] fade the scrollbar when not in use (true = 1000ms) + * @param {number} [options.fadeWait=3000] time to wait before fading the scrollbar if options.fade is set + * @param {(string|function)} [options.fadeEase=easeInOutSine] easing function to use for fading + */ + constructor(options) + { + super() + this.options = Object.assign({}, { + "boxWidth": 100, + "boxHeight": 100, + "scrollbarSize": 10, + "scrollbarBackground": 14540253, + "scrollbarBackgroundAlpha": 1, + "scrollbarForeground": 8947848, + "scrollbarForegroundAlpha": 1, + "dragScroll": true, + "stopPropagation": true, + "scrollbarOffsetHorizontal": 0, + "scrollbarOffsetVertical": 0, + "underflow": "top-left", + "fadeScrollbar": false, + "fadeWait": 3000, + "fadeEase": "easeInOutSine" + }, options) + this.ease = new PIXI.extras.Ease.list() + + /** + * content in placed in here + * you can use any function from pixi-viewport on content to manually move the content (see https://davidfig.github.io/pixi-viewport/jsdoc/) + * @type {PIXI.extras.Viewport} + */ + this.content = this.addChild(new PIXI.extras.Viewport({ passiveWheel: this.options.stopPropagation, stopPropagation: this.options.stopPropagation, screenWidth: this.options.boxWidth, screenHeight: this.options.boxHeight })) + this.content + .decelerate() + .on('moved', () => this._drawScrollbars()) + + /** + * graphics element for drawing the scrollbars + * @type {PIXI.Graphics} + */ + this.scrollbar = this.addChild(new PIXI.Graphics()) + this.scrollbar.interactive = true + this.scrollbar.on('pointerdown', this.scrollbarDown, this) + this.interactive = true + this.on('pointermove', this.scrollbarMove, this) + this.on('pointerup', this.scrollbarUp, this) + this.on('pointercancel', this.scrollbarUp, this) + this.on('pointerupoutside', this.scrollbarUp, this) + this._maskContent = this.addChild(new PIXI.Graphics()) + this.update() + } + + /** + * offset of horizontal scrollbar (in pixels) + * @type {number} + */ + get scrollbarOffsetHorizontal() + { + return this.options.scrollbarOffsetHorizontal + } + set scrollbarOffsetHorizontal(value) + { + this.options.scrollbarOffsetHorizontal = value + } + + /** + * offset of vertical scrollbar (in pixels) + * @type {number} + */ + get scrollbarOffsetVertical() + { + return this.options.scrollbarOffsetVertical + } + set scrollbarOffsetVertical(value) + { + this.options.scrollbarOffsetVertical = value + } + + /** + * disable the scrollbox (if set to true this will also remove the mask) + * @type {boolean} + */ + get disable() + { + return this._disabled + } + set disable(value) + { + if (this._disabled !== value) + { + this._disabled = value + this.update() + } + } + + /** + * call stopPropagation on any events that impact scrollbox + * @type {boolean} + */ + get stopPropagation() + { + return this.options.stopPropagation + } + set stopPropagation(value) + { + this.options.stopPropagation = value + } + + /** + * user may drag the content area to scroll content + * @type {boolean} + */ + get dragScroll() + { + return this.options.dragScroll + } + set dragScroll(value) + { + this.options.dragScroll = value + if (value) + { + this.content.drag() + } + else + { + this.content.removePlugin('drag') + } + this.update() + } + + /** + * width of scrollbox including the scrollbar (if visible)- this changes the size and not the scale of the box + * @type {number} + */ + get boxWidth() + { + return this.options.boxWidth + } + set boxWidth(value) + { + this.options.boxWidth = value + this.content.screenWidth = value + this.update() + } + + /** + * sets overflowX and overflowY to (scroll, hidden, auto) changing whether the scrollbar is shown + * scroll = always show scrollbar + * hidden = hide overflow and do not show scrollbar + * auto = if content is larger than box size, then show scrollbar + * @type {string} + */ + get overflow() + { + return this.options.overflow + } + set overflow(value) + { + this.options.overflow = value + this.options.overflowX = value + this.options.overflowY = value + this.update() + } + + /** + * sets overflowX to (scroll, hidden, auto) changing whether the scrollbar is shown + * scroll = always show scrollbar + * hidden = hide overflow and do not show scrollbar + * auto = if content is larger than box size, then show scrollbar + * @type {string} + */ + get overflowX() + { + return this.options.overflowX + } + set overflowX(value) + { + this.options.overflowX = value + this.update() + } + + /** + * sets overflowY to (scroll, hidden, auto) changing whether the scrollbar is shown + * scroll = always show scrollbar + * hidden = hide overflow and do not show scrollbar + * auto = if content is larger than box size, then show scrollbar + * @type {string} + */ + get overflowY() + { + return this.options.overflowY + } + set overflowY(value) + { + this.options.overflowY = value + this.update() + } + + /** + * height of scrollbox including the scrollbar (if visible) - this changes the size and not the scale of the box + * @type {number} + */ + get boxHeight() + { + return this.options.boxHeight + } + set boxHeight(value) + { + this.options.boxHeight = value + this.content.screenHeight = value + this.update() + } + + /** + * scrollbar size in pixels + * @type {number} + */ + get scrollbarSize() + { + return this.options.scrollbarSize + } + set scrollbarSize(value) + { + this.options.scrollbarSize = value + } + + /** + * width of scrollbox less the scrollbar (if visible) + * @type {number} + * @readonly + */ + get contentWidth() + { + return this.options.boxWidth - (this.isScrollbarVertical ? this.options.scrollbarSize : 0) + } + + /** + * height of scrollbox less the scrollbar (if visible) + * @type {number} + * @readonly + */ + get contentHeight() + { + return this.options.boxHeight - (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0) + } + + /** + * is the vertical scrollbar visible + * @type {boolean} + * @readonly + */ + get isScrollbarVertical() + { + return this._isScrollbarVertical + } + + /** + * is the horizontal scrollbar visible + * @type {boolean} + * @readonly + */ + get isScrollbarHorizontal() + { + return this._isScrollbarHorizontal + } + + /** + * top coordinate of scrollbar + */ + get scrollTop() + { + return this.content.top + } + + /** + * left coordinate of scrollbar + */ + get scrollLeft() + { + return this.content.left + } + + /** + * width of content area + * if not set then it uses content.width to calculate width + */ + get scrollWidth() + { + return this._scrollWidth || this.content.width + } + set scrollWidth(value) + { + this._scrollWidth = value + } + + /** + * height of content area + * if not set then it uses content.height to calculate height + */ + get scrollHeight() + { + return this._scrollHeight || this.content.height + } + set scrollHeight(value) + { + this._scrollHeight = value + } + + /** + * draws scrollbars + * @private + */ + _drawScrollbars() + { + this._isScrollbarHorizontal = this.overflowX === 'scroll' ? true : ['hidden', 'none'].indexOf(this.overflowX) !== -1 ? false : this.scrollWidth > this.options.boxWidth + this._isScrollbarVertical = this.overflowY === 'scroll' ? true : ['hidden', 'none'].indexOf(this.overflowY) !== -1 ? false : this.scrollHeight > this.options.boxHeight + this.scrollbar.clear() + let options = {} + options.left = 0 + options.right = this.scrollWidth + (this._isScrollbarVertical ? this.options.scrollbarSize : 0) + options.top = 0 + options.bottom = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0) + const width = this.scrollWidth + (this.isScrollbarVertical ? this.options.scrollbarSize : 0) + const height = this.scrollHeight + (this.isScrollbarHorizontal ? this.options.scrollbarSize : 0) + this.scrollbarTop = (this.content.top / height) * this.boxHeight + this.scrollbarTop = this.scrollbarTop < 0 ? 0 : this.scrollbarTop + this.scrollbarHeight = (this.boxHeight / height) * this.boxHeight + this.scrollbarHeight = this.scrollbarTop + this.scrollbarHeight > this.boxHeight ? this.boxHeight - this.scrollbarTop : this.scrollbarHeight + this.scrollbarLeft = (this.content.left / width) * this.boxWidth + this.scrollbarLeft = this.scrollbarLeft < 0 ? 0 : this.scrollbarLeft + this.scrollbarWidth = (this.boxWidth / width) * this.boxWidth + this.scrollbarWidth = this.scrollbarWidth + this.scrollbarLeft > this.boxWidth ? this.boxWidth - this.scrollbarLeft : this.scrollbarWidth + if (this.isScrollbarVertical) + { + this.scrollbar + .beginFill(this.options.scrollbarBackground, this.options.scrollbarBackgroundAlpha) + .drawRect(this.boxWidth - this.scrollbarSize + this.options.scrollbarOffsetVertical, 0, this.scrollbarSize, this.boxHeight) + .endFill() + } + if (this.isScrollbarHorizontal) + { + this.scrollbar + .beginFill(this.options.scrollbarBackground, this.options.scrollbarBackgroundAlpha) + .drawRect(0, this.boxHeight - this.scrollbarSize + this.options.scrollbarOffsetHorizontal, this.boxWidth, this.scrollbarSize) + .endFill() + } + if (this.isScrollbarVertical) + { + this.scrollbar + .beginFill(this.options.scrollbarForeground, this.options.scrollbarForegroundAlpha) + .drawRect(this.boxWidth - this.scrollbarSize + this.options.scrollbarOffsetVertical, this.scrollbarTop, this.scrollbarSize, this.scrollbarHeight) + .endFill() + } + if (this.isScrollbarHorizontal) + { + this.scrollbar + .beginFill(this.options.scrollbarForeground, this.options.scrollbarForegroundAlpha) + .drawRect(this.scrollbarLeft, this.boxHeight - this.scrollbarSize + this.options.scrollbarOffsetHorizontal, this.scrollbarWidth, this.scrollbarSize) + .endFill() + } + // this.content.forceHitArea = new PIXI.Rectangle(0, 0 , this.boxWidth, this.boxHeight) + this.activateFade() + } + + /** + * draws mask layer + * @private + */ + _drawMask() + { + this._maskContent + .beginFill(0) + .drawRect(0, 0, this.boxWidth, this.boxHeight) + .endFill() + this.content.mask = this._maskContent + } + + /** + * call when scrollbox content changes + */ + update() + { + this.content.mask = null + this._maskContent.clear() + if (!this._disabled) + { + this._drawScrollbars() + this._drawMask() + if (this.options.dragScroll) + { + const direction = this.isScrollbarHorizontal && this.isScrollbarVertical ? 'all' : this.isScrollbarHorizontal ? 'x' : 'y' + if (direction !== null) + { + this.content + .drag({ clampWheel: true, direction }) + .clamp({ direction, underflow: this.options.underflow }) + } + } + } + } + + /** + * show the scrollbar and restart the timer for fade if options.fade is set + */ + activateFade() + { + if (this.options.fade) + { + if (this.fade) + { + this.ease.remove(this.fade) + } + this.scrollbar.alpha = 1 + const time = this.options.fade === true ? 1000 : this.options.fade + this.fade = this.ease.to(this.scrollbar, { alpha: 0 }, time, { wait: this.options.fadeWait, ease: this.options.fadeEase }) + this.fade.on('each', () => this.content.dirty = true) + } + } + + /** + * handle pointer down on scrollbar + * @param {PIXI.interaction.InteractionEvent} e + * @private + */ + scrollbarDown(e) + { + const local = this.toLocal(e.data.global) + if (this.isScrollbarHorizontal) + { + if (local.y > this.boxHeight - this.scrollbarSize) + { + if (local.x >= this.scrollbarLeft && local.x <= this.scrollbarLeft + this.scrollbarWidth) + { + this.pointerDown = { type: 'horizontal', last: local } + } + else + { + if (local.x > this.scrollbarLeft) + { + this.content.left += this.content.worldScreenWidth + this.update() + } + else + { + this.content.left -= this.content.worldScreenWidth + this.update() + } + } + if (this.options.stopPropagation) + { + e.stopPropagation() + } + return + } + } + if (this.isScrollbarVertical) + { + if (local.x > this.boxWidth - this.scrollbarSize) + { + if (local.y >= this.scrollbarTop && local.y <= this.scrollbarTop + this.scrollbarWidth) + { + this.pointerDown = { type: 'vertical', last: local } + } + else + { + if (local.y > this.scrollbarTop) + { + this.content.top += this.content.worldScreenHeight + this.update() + } + else + { + this.content.top -= this.content.worldScreenHeight + this.update() + } + } + if (this.options.stopPropagation) + { + e.stopPropagation() + } + return + } + } + } + + /** + * handle pointer move on scrollbar + * @param {PIXI.interaction.InteractionEvent} e + * @private + */ + scrollbarMove(e) + { + if (this.pointerDown) + { + if (this.pointerDown.type === 'horizontal') + { + const local = this.toLocal(e.data.global) + this.content.left += local.x - this.pointerDown.last.x + this.pointerDown.last = local + this.update() + } + else if (this.pointerDown.type === 'vertical') + { + const local = this.toLocal(e.data.global) + this.content.top += local.y - this.pointerDown.last.y + this.pointerDown.last = local + this.update() + } + if (this.options.stopPropagation) + { + e.stopPropagation() + } + } + } + + /** + * handle pointer down on scrollbar + * @private + */ + scrollbarUp() + { + this.pointerDown = null + } + + /** + * resize the mask for the container + * @param {object} options + * @param {number} [options.boxWidth] width of scrollbox including scrollbar (in pixels) + * @param {number} [options.boxHeight] height of scrollbox including scrollbar (in pixels) + * @param {number} [options.scrollWidth] set the width of the inside of the scrollbox (leave null to use content.width) + * @param {number} [options.scrollHeight] set the height of the inside of the scrollbox (leave null to use content.height) + */ + resize(options) + { + this.options.boxWidth = typeof options.boxWidth !== 'undefined' ? options.boxWidth : this.options.boxWidth + this.options.boxHeight = typeof options.boxHeight !== 'undefined' ? options.boxHeight : this.options.boxHeight + if (options.scrollWidth) + { + this.scrollWidth = options.scrollWidth + } + if (options.scrollHeight) + { + this.scrollHeight = options.scrollHeight + } + this.content.resize(this.options.boxWidth, this.options.boxHeight, this.scrollWidth, this.scrollHeight) + this.update() + } + + /** + * ensure that the bounding box is visible + * @param {number} x - relative to content's coordinate system + * @param {number} y + * @param {number} width + * @param {number} height + */ + ensureVisible(x, y, width, height) + { + this.content.ensureVisible(x, y, width, height) + this._drawScrollbars() + } +} diff --git a/lib/pixi/scrollbox.min.js b/lib/pixi/scrollbox.min.js deleted file mode 100644 index 2d68476..0000000 --- a/lib/pixi/scrollbox.min.js +++ /dev/null @@ -1 +0,0 @@ -!function o(s,a,u){function h(e,t){if(!a[e]){if(!s[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(l)return l(e,!0);var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}var n=a[e]={exports:{}};s[e][0].call(n.exports,function(t){return h(s[e][1][t]||t)},n,n.exports,o,s,a,u)}return a[e].exports}for(var l="function"==typeof require&&require,t=0;tthis.options.boxWidth,this._isScrollbarVertical="scroll"===this.overflowY||-1===["hidden","none"].indexOf(this.overflowY)&&this.scrollHeight>this.options.boxHeight,this.scrollbar.clear();var t={left:0};t.right=this.scrollWidth+(this._isScrollbarVertical?this.options.scrollbarSize:0),t.top=0,t.bottom=this.scrollHeight+(this.isScrollbarHorizontal?this.options.scrollbarSize:0);var e=this.scrollWidth+(this.isScrollbarVertical?this.options.scrollbarSize:0),r=this.scrollHeight+(this.isScrollbarHorizontal?this.options.scrollbarSize:0);this.scrollbarTop=this.content.top/r*this.boxHeight,this.scrollbarTop=this.scrollbarTop<0?0:this.scrollbarTop,this.scrollbarHeight=this.boxHeight/r*this.boxHeight,this.scrollbarHeight=this.scrollbarTop+this.scrollbarHeight>this.boxHeight?this.boxHeight-this.scrollbarTop:this.scrollbarHeight,this.scrollbarLeft=this.content.left/e*this.boxWidth,this.scrollbarLeft=this.scrollbarLeft<0?0:this.scrollbarLeft,this.scrollbarWidth=this.boxWidth/e*this.boxWidth,this.scrollbarWidth=this.scrollbarWidth+this.scrollbarLeft>this.boxWidth?this.boxWidth-this.scrollbarLeft:this.scrollbarWidth,this.isScrollbarVertical&&this.scrollbar.beginFill(this.options.scrollbarBackground,this.options.scrollbarBackgroundAlpha).drawRect(this.boxWidth-this.scrollbarSize+this.options.scrollbarOffsetVertical,0,this.scrollbarSize,this.boxHeight).endFill(),this.isScrollbarHorizontal&&this.scrollbar.beginFill(this.options.scrollbarBackground,this.options.scrollbarBackgroundAlpha).drawRect(0,this.boxHeight-this.scrollbarSize+this.options.scrollbarOffsetHorizontal,this.boxWidth,this.scrollbarSize).endFill(),this.isScrollbarVertical&&this.scrollbar.beginFill(this.options.scrollbarForeground,this.options.scrollbarForegroundAlpha).drawRect(this.boxWidth-this.scrollbarSize+this.options.scrollbarOffsetVertical,this.scrollbarTop,this.scrollbarSize,this.scrollbarHeight).endFill(),this.isScrollbarHorizontal&&this.scrollbar.beginFill(this.options.scrollbarForeground,this.options.scrollbarForegroundAlpha).drawRect(this.scrollbarLeft,this.boxHeight-this.scrollbarSize+this.options.scrollbarOffsetHorizontal,this.scrollbarWidth,this.scrollbarSize).endFill(),this.activateFade()}},{key:"_drawMask",value:function(){this._maskContent.beginFill(0).drawRect(0,0,this.boxWidth,this.boxHeight).endFill(),this.content.mask=this._maskContent}},{key:"update",value:function(){if(this.content.mask=null,this._maskContent.clear(),!this._disabled&&(this._drawScrollbars(),this._drawMask(),this.options.dragScroll)){var t=this.isScrollbarHorizontal&&this.isScrollbarVertical?"all":this.isScrollbarHorizontal?"x":"y";null!==t&&this.content.drag({clampWheel:!0,direction:t}).clamp({direction:t,underflow:this.options.underflow})}}},{key:"activateFade",value:function(){var t=this;if(this.options.fade){this.fade&&this.ease.remove(this.fade),this.scrollbar.alpha=1;var e=!0===this.options.fade?1e3:this.options.fade;this.fade=this.ease.to(this.scrollbar,{alpha:0},e,{wait:this.options.fadeWait,ease:this.options.fadeEase}),this.fade.on("each",function(){return t.content.dirty=!0})}}},{key:"scrollbarDown",value:function(t){var e=this.toLocal(t.data.global);return this.isScrollbarHorizontal&&e.y>this.boxHeight-this.scrollbarSize?(e.x>=this.scrollbarLeft&&e.x<=this.scrollbarLeft+this.scrollbarWidth?this.pointerDown={type:"horizontal",last:e}:(e.x>this.scrollbarLeft?this.content.left+=this.content.worldScreenWidth:this.content.left-=this.content.worldScreenWidth,this.update()),void(this.options.stopPropagation&&t.stopPropagation())):this.isScrollbarVertical&&e.x>this.boxWidth-this.scrollbarSize?(e.y>=this.scrollbarTop&&e.y<=this.scrollbarTop+this.scrollbarWidth?this.pointerDown={type:"vertical",last:e}:(e.y>this.scrollbarTop?this.content.top+=this.content.worldScreenHeight:this.content.top-=this.content.worldScreenHeight,this.update()),void(this.options.stopPropagation&&t.stopPropagation())):void 0}},{key:"scrollbarMove",value:function(t){if(this.pointerDown){if("horizontal"===this.pointerDown.type){var e=this.toLocal(t.data.global);this.content.left+=e.x-this.pointerDown.last.x,this.pointerDown.last=e,this.update()}else if("vertical"===this.pointerDown.type){var r=this.toLocal(t.data.global);this.content.top+=r.y-this.pointerDown.last.y,this.pointerDown.last=r,this.update()}this.options.stopPropagation&&t.stopPropagation()}}},{key:"scrollbarUp",value:function(){this.pointerDown=null}},{key:"resize",value:function(t){this.options.boxWidth=void 0!==t.boxWidth?t.boxWidth:this.options.boxWidth,this.options.boxHeight=void 0!==t.boxHeight?t.boxHeight:this.options.boxHeight,t.scrollWidth&&(this.scrollWidth=t.scrollWidth),t.scrollHeight&&(this.scrollHeight=t.scrollHeight),this.content.resize(this.options.boxWidth,this.options.boxHeight,this.scrollWidth,this.scrollHeight),this.update()}},{key:"ensureVisible",value:function(t,e,r,i){this.content.ensureVisible(t,e,r,i),this._drawScrollbars()}},{key:"scrollbarOffsetHorizontal",get:function(){return this.options.scrollbarOffsetHorizontal},set:function(t){this.options.scrollbarOffsetHorizontal=t}},{key:"scrollbarOffsetVertical",get:function(){return this.options.scrollbarOffsetVertical},set:function(t){this.options.scrollbarOffsetVertical=t}},{key:"disable",get:function(){return this._disabled},set:function(t){this._disabled!==t&&(this._disabled=t,this.update())}},{key:"stopPropagation",get:function(){return this.options.stopPropagation},set:function(t){this.options.stopPropagation=t}},{key:"dragScroll",get:function(){return this.options.dragScroll},set:function(t){(this.options.dragScroll=t)?this.content.drag():this.content.removePlugin("drag"),this.update()}},{key:"boxWidth",get:function(){return this.options.boxWidth},set:function(t){this.options.boxWidth=t,this.content.screenWidth=t,this.update()}},{key:"overflow",get:function(){return this.options.overflow},set:function(t){this.options.overflow=t,this.options.overflowX=t,this.options.overflowY=t,this.update()}},{key:"overflowX",get:function(){return this.options.overflowX},set:function(t){this.options.overflowX=t,this.update()}},{key:"overflowY",get:function(){return this.options.overflowY},set:function(t){this.options.overflowY=t,this.update()}},{key:"boxHeight",get:function(){return this.options.boxHeight},set:function(t){this.options.boxHeight=t,this.content.screenHeight=t,this.update()}},{key:"scrollbarSize",get:function(){return this.options.scrollbarSize},set:function(t){this.options.scrollbarSize=t}},{key:"contentWidth",get:function(){return this.options.boxWidth-(this.isScrollbarVertical?this.options.scrollbarSize:0)}},{key:"contentHeight",get:function(){return this.options.boxHeight-(this.isScrollbarHorizontal?this.options.scrollbarSize:0)}},{key:"isScrollbarVertical",get:function(){return this._isScrollbarVertical}},{key:"isScrollbarHorizontal",get:function(){return this._isScrollbarHorizontal}},{key:"scrollTop",get:function(){return this.content.top}},{key:"scrollLeft",get:function(){return this.content.left}},{key:"scrollWidth",get:function(){return this._scrollWidth||this.content.width},set:function(t){this._scrollWidth=t}},{key:"scrollHeight",get:function(){return this._scrollHeight||this.content.height},set:function(t){this._scrollHeight=t}}]),c);function c(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(c.__proto__||Object.getPrototypeOf(c)).call(this));return e.options=u(t,h),e.ease=new a.list,e.content=e.addChild(new s({passiveWheel:e.options.stopPropagation,stopPropagation:e.options.stopPropagation,screenWidth:e.options.boxWidth,screenHeight:e.options.boxHeight})),e.content.decelerate().on("moved",function(){return e._drawScrollbars()}),e.scrollbar=e.addChild(new o.Graphics),e.scrollbar.interactive=!0,e.scrollbar.on("pointerdown",e.scrollbarDown,e),e.interactive=!0,e.on("pointermove",e.scrollbarMove,e),e.on("pointerup",e.scrollbarUp,e),e.on("pointercancel",e.scrollbarUp,e),e.on("pointerupoutside",e.scrollbarUp,e),e._maskContent=e.addChild(new o.Graphics),e.update(),e}o&&o.extras&&(o.extras.Scrollbox=l),e.exports=l},{"./defaults":2,"./defaults.json":1,"pixi-ease":14,"pixi-viewport":52,"pixi.js":169}],4:[function(t,e,r){"use strict";function i(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(0>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t>>=e))<<3,e|=r=(15<(t>>>=r))<<2,(e|=r=(3<(t>>>=r))<<1)|(t>>>=r)>>1},r.log10=function(t){return 1e9<=t?9:1e8<=t?8:1e7<=t?7:1e6<=t?6:1e5<=t?5:1e4<=t?4:1e3<=t?3:100<=t?2:10<=t?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=i,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 n=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,i=e,n=7;for(r>>>=1;r;r>>>=1)i<<=1,i|=1&r,--n;t[e]=i<>>8&255]<<16|n[t>>>16&255]<<8|n[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 1+e|(~e&-~e)-1>>>i(t)+1}},{}],5:[function(t,e,r){"use strict";function i(t,e,r){r=r||2;var i,n,o,s,a,u,h,l=e&&e.length,c=l?e[0]*r:t.length,f=v(t,0,c,r,!0),d=[];if(!f||f.next===f.prev)return d;if(l&&(f=function(t,e,r,i){var n,o,s,a,u,h=[];for(n=0,o=e.length;n80*r){i=o=t[0],n=s=t[1];for(var p=r;po.x?n.x>s.x?n.x:s.x:o.x>s.x?o.x:s.x,l=n.y>o.y?n.y>s.y?n.y:s.y:o.y>s.y?o.y:s.y,c=_(a,u,e,r,i),f=_(h,l,e,r,i),d=t.prevZ,p=t.nextZ;d&&d.z>=c&&p&&p.z<=f;){if(d!==t.prev&&d!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;if(d=d.prevZ,p!==t.prev&&p!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}for(;d&&d.z>=c;){if(d!==t.prev&&d!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,d.x,d.y)&&0<=T(d.prev,d,d.next))return!1;d=d.prevZ}for(;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&w(n.x,n.y,o.x,o.y,s.x,s.y,p.x,p.y)&&0<=T(p.prev,p,p.next))return!1;p=p.nextZ}return!0}function f(t,e,r){var i=t;do{var n=i.prev,o=i.next.next;!a(n,o)&&p(n,i,i.next,o)&&E(n,o)&&E(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),S(i),S(i.next),i=t=o),i=i.next}while(i!==t);return i}function d(t,e,r,i,n,o){var s,a,u=t;do{for(var h=u.next.next;h!==u.prev;){if(u.i!==h.i&&(a=h,(s=u).next.i!==a.i&&s.prev.i!==a.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&p(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(s,a)&&E(s,a)&&E(a,s)&&function(t,e){var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;for(;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next,r!==t;);return i}(s,a))){var l=O(u,h);return u=y(u,u.next),l=y(l,l.next),g(u,e,r,i,n,o),void g(l,e,r,i,n,o)}h=h.next}u=u.next}while(u!==t)}function m(t,e){return t.x-e.x}function b(t,e){if(e=function(t,e){var r,i=e,n=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=n&&s=i.x&&i.x>=l&&n!==i.x&&w(or.x)&&E(i,t)&&(r=i,f=u),i=i.next;return r}(t,e)){var r=O(e,t);y(r,r.next)}}function _(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function x(t){for(var e=t,r=t;(e.x=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},n.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},n.createVertexBuffer=function(t,e,r){return new n(t,t.ARRAY_BUFFER,e,r)},n.createIndexBuffer=function(t,e,r){return new n(t,t.ELEMENT_ARRAY_BUFFER,e,r)},n.create=function(t,e,r,i){return new n(t,e,r,i)},n.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},e.exports=n},{}],24:[function(t,e,r){function s(t,e,r){this.gl=t,this.framebuffer=t.createFramebuffer(),this.stencil=null,this.texture=null,this.width=e||100,this.height=r||100}var a=t("./GLTexture");s.prototype.enableTexture=function(t){var e=this.gl;this.texture=t||new a(e),this.texture.bind(),this.bind(),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture.texture,0)},s.prototype.enableStencil=function(){if(!this.stencil){var t=this.gl;this.stencil=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,this.stencil),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,this.stencil),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_STENCIL,this.width,this.height)}},s.prototype.clear=function(t,e,r,i){this.bind();var n=this.gl;n.clearColor(t,e,r,i),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT)},s.prototype.bind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.framebuffer)},s.prototype.unbind=function(){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null)},s.prototype.resize=function(t,e){var r=this.gl;this.width=t,this.height=e,this.texture&&this.texture.uploadData(null,t,e),this.stencil&&(r.bindRenderbuffer(r.RENDERBUFFER,this.stencil),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,t,e))},s.prototype.destroy=function(){var t=this.gl;this.texture&&this.texture.destroy(),t.deleteFramebuffer(this.framebuffer),this.gl=null,this.stencil=null,this.texture=null},s.createRGBA=function(t,e,r,i){var n=a.fromData(t,null,e,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(t,e,r);return o.enableTexture(n),o.unbind(),o},s.createFloat32=function(t,e,r,i){var n=new a.fromData(t,i,e,r);n.enableNearestScaling(),n.enableWrapClamp();var o=new s(t,e,r);return o.enableTexture(n),o.unbind(),o},e.exports=s},{"./GLTexture":26}],25:[function(t,e,r){function i(t,e,r,i,n){this.gl=t,i&&(e=u(e,i),r=u(r,i)),this.program=o(t,e,r,n),this.attributes=s(t,this.program),this.uniformData=a(t,this.program),this.uniforms=h(t,this.uniformData)}var o=t("./shader/compileProgram"),s=t("./shader/extractAttributes"),a=t("./shader/extractUniforms"),u=t("./shader/setPrecision"),h=t("./shader/generateUniformAccessObject");i.prototype.bind=function(){return this.gl.useProgram(this.program),this},i.prototype.destroy=function(){this.attributes=null,this.uniformData=null,this.uniforms=null,this.gl.deleteProgram(this.program)},e.exports=i},{"./shader/compileProgram":31,"./shader/extractAttributes":33,"./shader/extractUniforms":34,"./shader/generateUniformAccessObject":35,"./shader/setPrecision":39}],26:[function(t,e,r){function o(t,e,r,i,n){this.gl=t,this.texture=t.createTexture(),this.mipmap=!1,this.premultiplyAlpha=!1,this.width=e||-1,this.height=r||-1,this.format=i||t.RGBA,this.type=n||t.UNSIGNED_BYTE}var n=!(o.prototype.upload=function(t){this.bind();var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha);var r=t.videoWidth||t.width,i=t.videoHeight||t.height;i!==this.height||r!==this.width?e.texImage2D(e.TEXTURE_2D,0,this.format,this.format,this.type,t):e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.format,this.type,t),this.width=r,this.height=i});o.prototype.uploadData=function(t,e,r){this.bind();var i=this.gl;if(t instanceof Float32Array){if(!n){if(!i.getExtension("OES_texture_float"))throw new Error("floating point textures not available");n=!0}this.type=i.FLOAT}else this.type=this.type||i.UNSIGNED_BYTE;i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e!==this.width||r!==this.height?i.texImage2D(i.TEXTURE_2D,0,this.format,e,r,0,this.format,this.type,t||null):i.texSubImage2D(i.TEXTURE_2D,0,0,0,e,r,this.format,this.type,t||null),this.width=e,this.height=r},o.prototype.bind=function(t){var e=this.gl;void 0!==t&&e.activeTexture(e.TEXTURE0+t),e.bindTexture(e.TEXTURE_2D,this.texture)},o.prototype.unbind=function(){var t=this.gl;t.bindTexture(t.TEXTURE_2D,null)},o.prototype.minFilter=function(t){var e=this.gl;this.bind(),this.mipmap?e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR_MIPMAP_LINEAR:e.NEAREST_MIPMAP_NEAREST):e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t?e.LINEAR:e.NEAREST)},o.prototype.magFilter=function(t){var e=this.gl;this.bind(),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t?e.LINEAR:e.NEAREST)},o.prototype.enableMipmap=function(){var t=this.gl;this.bind(),this.mipmap=!0,t.generateMipmap(t.TEXTURE_2D)},o.prototype.enableLinearScaling=function(){this.minFilter(!0),this.magFilter(!0)},o.prototype.enableNearestScaling=function(){this.minFilter(!1),this.magFilter(!1)},o.prototype.enableWrapClamp=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)},o.prototype.enableWrapRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT)},o.prototype.enableWrapMirrorRepeat=function(){var t=this.gl;this.bind(),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.MIRRORED_REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.MIRRORED_REPEAT)},o.prototype.destroy=function(){this.gl.deleteTexture(this.texture)},o.fromSource=function(t,e,r){var i=new o(t);return i.premultiplyAlpha=r||!1,i.upload(e),i},o.fromData=function(t,e,r,i){var n=new o(t);return n.uploadData(e,r,i),n},e.exports=o},{}],27:[function(t,e,r){var n=t("./setVertexAttribArrays");function i(t,e){if(this.nativeVaoExtension=null,i.FORCE_NATIVE||(this.nativeVaoExtension=t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object")),this.nativeState=e,this.nativeVaoExtension){this.nativeVao=this.nativeVaoExtension.createVertexArrayOES();var r=t.getParameter(t.MAX_VERTEX_ATTRIBS);this.nativeState={tempAttribState:new Array(r),attribState:new Array(r)}}this.gl=t,this.attributes=[],this.indexBuffer=null,this.dirty=!1}i.prototype.constructor=i,(e.exports=i).FORCE_NATIVE=!1,i.prototype.bind=function(){if(this.nativeVao){if(this.nativeVaoExtension.bindVertexArrayOES(this.nativeVao),this.dirty)return this.dirty=!1,this.activate(),this;this.indexBuffer&&this.indexBuffer.bind()}else this.activate();return this},i.prototype.unbind=function(){return this.nativeVao&&this.nativeVaoExtension.bindVertexArrayOES(null),this},i.prototype.activate=function(){for(var t=this.gl,e=null,r=0;r=this.time?(this.parent.x=e.end,this.toX=null,this.parent.emit("bounce-x-end",this.parent)):this.parent.x=this.ease(e.time,e.start,e.delta,this.time)}if(this.toY){var r=this.toY;r.time+=t,this.parent.emit("moved",{viewport:this.parent,type:"bounce-y"}),r.time>=this.time?(this.parent.y=r.end,this.toY=null,this.parent.emit("bounce-y-end",this.parent)):this.parent.y=this.ease(r.time,r.start,r.delta,this.time)}}}},{key:"calcUnderflowX",value:function(){var t=void 0;switch(this.underflowX){case-1:t=0;break;case 1:t=this.parent.screenWidth-this.parent.screenWorldWidth;break;default:t=(this.parent.screenWidth-this.parent.screenWorldWidth)/2}return t}},{key:"calcUnderflowY",value:function(){var t=void 0;switch(this.underflowY){case-1:t=0;break;case 1:t=this.parent.screenHeight-this.parent.screenWorldHeight;break;default:t=(this.parent.screenHeight-this.parent.screenWorldHeight)/2}return t}},{key:"bounce",value:function(){if(!this.paused){var t=void 0,e=this.parent.plugins.decelerate;e&&(e.x||e.y)&&(e.x&&e.percentChangeX===e.friction||e.y&&e.percentChangeY===e.friction)&&(((t=this.parent.OOB()).left&&this.left||t.right&&this.right)&&(e.percentChangeX=this.friction),(t.top&&this.top||t.bottom&&this.bottom)&&(e.percentChangeY=this.friction));var r=this.parent.plugins.drag||{},i=this.parent.plugins.pinch||{};if(e=e||{},!(r.active||i.active||this.toX&&this.toY||e.x&&e.y)){var n=(t=t||this.parent.OOB()).cornerPoint;if(!this.toX&&!e.x){var o=null;t.left&&this.left?o=this.parent.screenWorldWidththis.maxWidth){var i=this.parent.scale.x;this.parent.fitWidth(this.maxWidth,!1,!1,!0),this.parent.scale.y*=this.parent.scale.x/i,t=this.parent.worldScreenWidth,e=this.parent.worldScreenHeight,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}if(this.minHeight&&ethis.maxHeight){var o=this.parent.scale.y;this.parent.fitHeight(this.maxHeight,!1,!1,!0),this.parent.scale.x*=this.parent.scale.y/o,this.parent.emit("zoomed",{viewport:this.parent,type:"clamp-zoom"})}}}}]),s)},{"./plugin":48}],42:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r(!0===this.right?this.parent.worldWidth:this.right)&&(this.parent.x=-(!0===this.right?this.parent.worldWidth:this.right)*this.parent.scale.x+this.parent.screenWidth,r=!(e.x=0));r&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-x"})}if(null!==this.top||null!==this.bottom){var i=void 0;if(this.parent.screenWorldHeight(!0===this.bottom?this.parent.worldHeight:this.bottom)&&(this.parent.y=-(!0===this.bottom?this.parent.worldHeight:this.bottom)*this.parent.scale.y+this.parent.screenHeight,i=!(e.y=0));i&&this.parent.emit("moved",{viewport:this.parent,original:t,type:"clamp-y"})}}}}]),a)},{"./plugin":48,"./utils":51}],43:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r=t-100){var a=t-s.time;this.x=(this.parent.x-s.x)/a,this.y=(this.parent.y-s.y)/a,this.percentChangeX=this.percentChangeY=this.friction;break}}}catch(t){r=!0,i=t}finally{try{!e&&o.return&&o.return()}finally{if(r)throw i}}}}},{key:"activate",value:function(t){void 0!==(t=t||{}).x&&(this.x=t.x,this.percentChangeX=this.friction),void 0!==t.y&&(this.y=t.y,this.percentChangeY=this.friction)}},{key:"update",value:function(t){if(!this.paused){var e=void 0;this.x&&(this.parent.x+=this.x*t,this.x*=this.percentChangeX,Math.abs(this.x)this.parent.worldWidth&&(this.parent.x=-this.parent.worldWidth*this.parent.scale.x+this.parent.screenWidth,t.x=0);if("x"!==this.clampWheel)if(this.parent.screenWorldHeightthis.parent.worldHeight&&(this.parent.y=-this.parent.worldHeight*this.parent.scale.y+this.parent.screenHeight,t.y=0)}},{key:"active",get:function(){return this.moved}}]),u)},{"./plugin":48,"./utils":51,"pixi.js":169}],45:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;rthis.radius))return;var n=Math.atan2(this.target.y-e.y,this.target.x-e.x);r=this.target.x-Math.cos(n)*this.radius,i=this.target.y-Math.sin(n)*this.radius}var o=r-e.x,s=i-e.y;if(o||s)if(this.speed)if(this.acceleration){var a=Math.atan2(i-e.y,r-e.x),u=Math.sqrt(Math.pow(o,2)+Math.pow(s,2));if(u){var h=(Math.pow(this.velocity.x,2)+Math.pow(this.velocity.y,2))/(2*this.acceleration);this.velocity=hMath.abs(o)?r:e.x+l,d=Math.abs(c)>Math.abs(s)?i:e.y+c;this.parent.moveCenter(f,d),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}else{var p=Math.atan2(i-e.y,r-e.x),v=Math.cos(p)*this.speed,y=Math.sin(p)*this.speed,g=Math.abs(v)>Math.abs(o)?r:e.x+v,m=Math.abs(y)>Math.abs(s)?i:e.y+y;this.parent.moveCenter(g,m),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}else this.parent.moveCenter(r,i),this.parent.emit("moved",{viewport:this.parent,type:"follow"})}}}]),s)},{"./plugin":48}],46:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r=this.radiusSquared){var n=Math.atan2(i.y-r,i.x-e);this.linear?(this.horizontal=Math.round(Math.cos(n))*this.speed*this.reverse*.06,this.vertical=Math.round(Math.sin(n))*this.speed*this.reverse*.06):(this.horizontal=Math.cos(n)*this.speed*this.reverse*.06,this.vertical=Math.sin(n)*this.speed*this.reverse*.06)}else this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=0}else o.exists(this.left)&&ethis.right?this.horizontal=-1*this.reverse*this.speed*.06:(this.decelerateHorizontal(),this.horizontal=0),o.exists(this.top)&&rthis.bottom?this.vertical=-1*this.reverse*this.speed*.06:(this.decelerateVertical(),this.vertical=0)}}},{key:"decelerateHorizontal",value:function(){var t=this.parent.plugins.decelerate;this.horizontal&&t&&!this.noDecelerate&&t.activate({x:this.horizontal*this.speed*this.reverse/(1e3/60)})}},{key:"decelerateVertical",value:function(){var t=this.parent.plugins.decelerate;this.vertical&&t&&!this.noDecelerate&&t.activate({y:this.vertical*this.speed*this.reverse/(1e3/60)})}},{key:"up",value:function(){this.horizontal&&this.decelerateHorizontal(),this.vertical&&this.decelerateVertical(),this.horizontal=this.vertical=null}},{key:"update",value:function(){if(!this.paused&&(this.horizontal||this.vertical)){var t=this.parent.center;this.horizontal&&(t.x+=this.horizontal*this.speed),this.vertical&&(t.y+=this.vertical*this.speed),this.parent.moveCenter(t),this.parent.emit("moved",{viewport:this.parent,type:"mouse-edges"})}}}]),a)},{"./plugin":48,"./utils":51}],47:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r=this.time)this.parent.scale.set(this.x_scale,this.y_scale),this.removeOnComplete&&this.parent.removePlugin("snap-zoom"),this.parent.emit("snap-zoom-end",this.parent),this.snapping=null;else{var i=this.snapping;this.parent.scale.x=this.ease(i.time,i.startX,i.deltaX,this.time),this.parent.scale.y=this.ease(i.time,i.startY,i.deltaY,this.time)}var n=this.parent.plugins["clamp-zoom"];n&&n.clamp(),this.noMove||(this.center?this.parent.moveCenter(this.center):this.parent.moveCenter(e))}}else this.parent.scale.x===this.x_scale&&this.parent.scale.y===this.y_scale||this.createSnapping()}}},{key:"resume",value:function(){this.snapping=null,function t(e,r,i){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,r);if(void 0===n){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,i)}if("value"in n)return n.value;var s=n.get;return void 0!==s?s.call(i):void 0}(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"resume",this).call(this)}}]),a)},{"./plugin":48,"./utils":51}],50:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;rthis.time)r=!0,i=this.startX+this.deltaX,n=this.startY+this.deltaY;else{var o=this.ease(e.time,0,1,this.time);i=this.startX+this.deltaX*o,n=this.startY+this.deltaY*o}this.topLeft?this.parent.moveCorner(i,n):this.parent.moveCenter(i,n),this.parent.emit("moved",{viewport:this.parent,type:"snap"}),r&&(this.removeOnComplete&&this.parent.removePlugin("snap"),this.parent.emit("snap-end",this.parent),this.snapping=null)}else{var s=this.topLeft?this.parent.corner:this.parent.center;s.x===this.x&&s.y===this.y||this.snapStart()}}}]),a)},{"./plugin":48,"./utils":51}],51:[function(t,e,r){"use strict";var i=t("penner");function n(t){return null!=t}e.exports={exists:n,defaults:function(t,e){return null!=t?t:e},ease:function(t,e){return n(t)?"function"==typeof t?t:"string"==typeof t?i[t]:void 0:i[e]}}},{penner:11}],52:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r=this.threshold}},{key:"move",value:function(t){if(!this.pause&&this.worldVisible){var e=void 0,r=!0,i=!1,n=void 0;try{for(var o,s=this.pluginsList[Symbol.iterator]();!(r=(o=s.next()).done);r=!0)o.value.move(t)&&(e=!0)}catch(t){i=!0,n=t}finally{try{!r&&s.return&&s.return()}finally{if(i)throw n}}if(this.clickedAvailable){var a=t.data.global.x-this.last.x,u=t.data.global.y-this.last.y;(this.checkThreshold(a)||this.checkThreshold(u))&&(this.clickedAvailable=!1)}e&&this.stopEvent&&t.stopPropagation()}}},{key:"up",value:function(t){if(!this.pause&&this.worldVisible){if("mouse"===t.data.pointerType&&(this.isMouseDown=!1),"mouse"!==t.data.pointerType)for(var e=0;ethis._worldWidth,t.top=this.top<0,t.bottom=this.bottom>this._worldHeight,t.cornerPoint={x:this._worldWidth*this.scale.x-this._screenWidth,y:this._worldHeight*this.scale.y-this._screenHeight},t}},{key:"countDownPointers",value:function(){return(this.isMouseDown?1:0)+this.touches.length}},{key:"getTouchPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e){var i=e[r];-1!==this.touches.indexOf(i.pointerId)&&t.push(i)}return t}},{key:"getPointers",value:function(){var t=[],e=this.trackedPointers;for(var r in e)t.push(e[r]);return t}},{key:"_reset",value:function(){this.plugins.bounce&&(this.plugins.bounce.reset(),this.plugins.bounce.bounce()),this.plugins.decelerate&&this.plugins.decelerate.reset(),this.plugins.snap&&this.plugins.snap.reset(),this.plugins.clamp&&this.plugins.clamp.update(),this.plugins["clamp-zoom"]&&this.plugins["clamp-zoom"].clamp()}},{key:"userPlugin",value:function(t,e){var r=2this.right&&(this.right=t+r),ethis.bottom&&(this.bottom=e+i)}},{key:"screenWidth",get:function(){return this._screenWidth},set:function(t){this._screenWidth=t}},{key:"screenHeight",get:function(){return this._screenHeight},set:function(t){this._screenHeight=t}},{key:"worldWidth",get:function(){return this._worldWidth?this._worldWidth:this.width},set:function(t){this._worldWidth=t,this.resizePlugins()}},{key:"worldHeight",get:function(){return this._worldHeight?this._worldHeight:this.height},set:function(t){this._worldHeight=t,this.resizePlugins()}},{key:"worldScreenWidth",get:function(){return this.screenWidth/this.scale.x}},{key:"worldScreenHeight",get:function(){return this.screenHeight/this.scale.y}},{key:"screenWorldWidth",get:function(){return this.worldWidth*this.scale.x}},{key:"screenWorldHeight",get:function(){return this.worldHeight*this.scale.y}},{key:"center",get:function(){return new o.Point(this.worldScreenWidth/2-this.x/this.scale.x,this.worldScreenHeight/2-this.y/this.scale.y)},set:function(t){this.moveCenter(t)}},{key:"corner",get:function(){return new o.Point(-this.x/this.scale.x,-this.y/this.scale.y)},set:function(t){this.moveCorner(t)}},{key:"right",get:function(){return-this.x/this.scale.x+this.worldScreenWidth},set:function(t){this.x=-t*this.scale.x+this.screenWidth,this._reset()}},{key:"left",get:function(){return-this.x/this.scale.x},set:function(t){this.x=-t*this.scale.x,this._reset()}},{key:"top",get:function(){return-this.y/this.scale.y},set:function(t){this.y=-t*this.scale.y,this._reset()}},{key:"bottom",get:function(){return-this.y/this.scale.y+this.worldScreenHeight},set:function(t){this.y=-t*this.scale.y+this.screenHeight,this._reset()}},{key:"dirty",get:function(){return this._dirty},set:function(t){this._dirty=t}},{key:"forceHitArea",get:function(){return this._forceHitArea},set:function(t){t?(this._forceHitArea=t,this.hitArea=t):(this._forceHitArea=!1,this.hitArea=new o.Rectangle(0,0,this.worldWidth,this.worldHeight))}},{key:"pause",get:function(){return this._pause},set:function(t){this._pause=t,this.lastViewport=null,this.moving=!1,this.zooming=!1,t&&(this.touches=[],this.isMouseDown=!1)}}]),_);function _(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,_),t=t||{};var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(_.__proto__||Object.getPrototypeOf(_)).call(this));return e.plugins={},e.pluginsList=[],e._screenWidth=t.screenWidth||window.innerWidth,e._screenHeight=t.screenHeight||window.innerHeight,e._worldWidth=t.worldWidth,e._worldHeight=t.worldHeight,e.hitAreaFullScreen=s.defaults(t.hitAreaFullScreen,!0),e.forceHitArea=t.forceHitArea,e.passiveWheel=s.defaults(t.passiveWheel,!0),e.stopEvent=t.stopPropagation,e.threshold=s.defaults(t.threshold,5),e.interaction=t.interaction||null,e.div=t.divWheel||document.body,e.listeners(e.div),e.div.oncontextmenu=function(t){return t.preventDefault()},e.touches=[],t.noTicker||(e.ticker=t.ticker||(o.Ticker?o.Ticker.shared:o.ticker.shared),e.tickerFunction=function(){return e.update(e.ticker.elapsedMS)},e.ticker.add(e.tickerFunction)),e}void 0!==o&&(o.extras?o.extras.Viewport=b:o.extras={Viewport:b}),e.exports=b},{"./bounce":40,"./clamp":42,"./clamp-zoom":41,"./decelerate":43,"./drag":44,"./follow":45,"./mouse-edges":46,"./pinch":47,"./snap":50,"./snap-zoom":49,"./utils":51,"./wheel":53,"pixi.js":169}],53:[function(t,e,r){"use strict";var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r=this.smooth&&(this.smoothing=null)}}},{key:"wheel",value:function(t){if(!this.paused){var e=this.parent.getPointerPosition(t),r=(this.reverse?-1:1)*-t.deltaY*(t.deltaMode?120:1)/500,i=Math.pow(2,(1+this.percent)*r);if(this.smooth){var n=this.smoothing?this.smoothing.x*(this.smooth-this.smoothingCount):0,o=this.smoothing?this.smoothing.y*(this.smooth-this.smoothingCount):0;this.smoothing={x:((this.parent.scale.x+n)*i-this.parent.scale.x)/this.smooth,y:((this.parent.scale.y+o)*i-this.parent.scale.y)/this.smooth},this.smoothingCount=0,this.smoothingCenter=e}else{var s=void 0;this.center||(s=this.parent.toLocal(e)),this.parent.scale.x*=i,this.parent.scale.y*=i,this.parent.emit("zoomed",{viewport:this.parent,type:"wheel"});var a=this.parent.plugins["clamp-zoom"];if(a&&a.clamp(),this.center)this.parent.moveCenter(this.center);else{var u=this.parent.toGlobal(s);this.parent.x+=e.x-u.x,this.parent.y+=e.y-u.y}}this.parent.emit("moved",{viewport:this.parent,type:"wheel"}),this.parent.emit("wheel",{wheel:{dx:t.deltaX,dy:t.deltaY,dz:t.deltaZ},event:t,viewport:this.parent}),this.parent.passiveWheel||t.preventDefault()}}}]),s)},{"./plugin":48}],54:[function(t,e,r){"use strict";r.__esModule=!0;var u=function(t){{if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}}(t("../core")),i=o(t("ismobilejs")),n=o(t("./accessibleTarget"));function o(t){return t&&t.__esModule?t:{default:t}}u.utils.mixins.delayMixin(u.DisplayObject.prototype,n.default);var s=(a.prototype.createTouchHook=function(){var t=this,e=document.createElement("button");e.style.width="1px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.left="-1000px",e.style.zIndex=2,e.style.backgroundColor="#FF0000",e.title="HOOK DIV",e.addEventListener("focus",function(){t.isMobileAccessabillity=!0,t.activate(),document.body.removeChild(e)}),document.body.appendChild(e)},a.prototype.activate=function(){this.isActive||(this.isActive=!0,window.document.addEventListener("mousemove",this._onMouseMove,!0),window.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),this.renderer.view.parentNode&&this.renderer.view.parentNode.appendChild(this.div))},a.prototype.deactivate=function(){this.isActive&&!this.isMobileAccessabillity&&(this.isActive=!1,window.document.removeEventListener("mousemove",this._onMouseMove,!0),window.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),this.div.parentNode&&this.div.parentNode.removeChild(this.div))},a.prototype.updateAccessibleObjects=function(t){if(t.visible){t.accessible&&t.interactive&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);for(var e=t.children,r=0;rthis.renderer.width&&(t.width=this.renderer.width-t.x),t.y+t.height>this.renderer.height&&(t.height=this.renderer.height-t.y)},a.prototype.addChild=function(t){var e=this.pool.pop();e||((e=document.createElement("button")).style.width="100px",e.style.height="100px",e.style.backgroundColor=this.debug?"rgba(255,0,0,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=2,e.style.borderStyle="none",-1]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i,r.SHAPES={POLY:0,RECT:1,CIRC:2,ELIP:3,RREC:4},r.PRECISION={LOW:"lowp",MEDIUM:"mediump",HIGH:"highp"},r.TRANSFORM_MODE={STATIC:0,DYNAMIC:1},r.TEXT_GRADIENT={LINEAR_VERTICAL:0,LINEAR_HORIZONTAL:1},r.UPDATE_PRIORITY={INTERACTION:50,HIGH:25,NORMAL:0,LOW:-25,UTILITY:-50}},{}],61:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("../math");var n=(o.prototype.isEmpty=function(){return this.minX>this.maxX||this.minY>this.maxY},o.prototype.clear=function(){this.updateID++,this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0},o.prototype.getRectangle=function(t){return this.minX>this.maxX||this.minY>this.maxY?i.Rectangle.EMPTY:((t=t||new i.Rectangle(0,0,1,1)).x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)},o.prototype.addPoint=function(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)},o.prototype.addQuad=function(t){var e=this.minX,r=this.minY,i=this.maxX,n=this.maxY,o=t[0],s=t[1];e=oi?t.maxX:i,this.maxY=t.maxY>n?t.maxY:n},o.prototype.addBoundsMask=function(t,e){var r=t.minX>e.minX?t.minX:e.minX,i=t.minY>e.minY?t.minY:e.minY,n=t.maxXe.x?t.minX:e.x,i=t.minY>e.y?t.minY:e.y,n=t.maxXthis.children.length)throw new Error(t+"addChildAt: The index "+e+" supplied is out of bounds "+this.children.length);return t.parent&&t.parent.removeChild(t),t.parent=this,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),t},c.prototype.swapChildren=function(t,e){if(t!==e){var r=this.getChildIndex(t),i=this.getChildIndex(e);this.children[r]=e,this.children[i]=t,this.onChildrenChange(r=this.children.length)throw new Error("The index "+e+" supplied is out of bounds "+this.children.length);var r=this.getChildIndex(t);(0,s.removeItems)(this.children,r,1),this.children.splice(e,0,t),this.onChildrenChange(e)},c.prototype.getChildAt=function(t){if(t<0||t>=this.children.length)throw new Error("getChildAt: Index ("+t+") does not exist.");return this.children[t]},c.prototype.removeChild=function(t){var e=arguments.length;if(1T.CURVES.maxSegments&&(e=T.CURVES.maxSegments),e},T.prototype.lineStyle=function(){var t=0>16&255)/255,r=(t.tint>>8&255)/255,i=(255&t.tint)/255,n=0;n>16&255)/255*e*255<<16)+((s>>8&255)/255*r*255<<8)+(255&s)/255*i*255,o._lineTint=((a>>16&255)/255*e*255<<16)+((a>>8&255)/255*r*255<<8)+(255&a)/255*i*255}},a.prototype.renderPolygon=function(t,e,r){r.moveTo(t[0],t[1]);for(var i=1;i=this.x&&t=this.y&&e=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){if(e>=this.y+this.radius&&e<=this.y+this.height-this.radius||t>=this.x+this.radius&&t<=this.x+this.width-this.radius)return!0;var r=t-(this.x+this.radius),i=e-(this.y+this.radius),n=this.radius*this.radius;if(r*r+i*i<=n)return!0;if((r=t-(this.x+this.width-this.radius))*r+i*i<=n)return!0;if(r*r+(i=e-(this.y+this.height-this.radius))*i<=n)return!0;if((r=t-(this.x+this.radius))*r+i*i<=n)return!0}return!1},s);function s(){var t=0this.checkCountMax&&(this.checkCount=0,this.run()))},u.prototype.run=function(){for(var t=this.renderer.textureManager,e=t._managedTextures,r=!1,i=0;ithis.maxIdle&&(t.destroyTexture(n,!0),r=!(e[i]=null))}if(r){for(var o=0,s=0;s 0.5)"," {"," color = vec4(1.0, 0.0, 0.0, 1.0);"," }"," else"," {"," color = vec4(0.0, 1.0, 0.0, 1.0);"," }"," gl_FragColor = mix(sample, masky, 0.5);"," gl_FragColor *= sample.a;","}"].join("\n")}}]),f);function f(t,e,r){for(var i in function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,f),this.vertexSrc=t||f.defaultVertexSrc,this.fragmentSrc=e||f.defaultFragmentSrc,this._blendMode=a.BLEND_MODES.NORMAL,this.uniformData=r||(0,o.default)(this.vertexSrc,this.fragmentSrc,"projectionMatrix|uSampler"),this.uniforms={},this.uniformData)this.uniforms[i]=this.uniformData[i].value,this.uniformData[i].type&&(this.uniformData[i].type=this.uniformData[i].type.toLowerCase());this.glShaders={},l[this.vertexSrc+this.fragmentSrc]||(l[this.vertexSrc+this.fragmentSrc]=(0,s.uid)()),this.glShaderKey=l[this.vertexSrc+this.fragmentSrc],this.padding=4,this.resolution=u.default.FILTER_RESOLUTION,this.enabled=!0,this.autoFit=!0}r.default=c},{"../../../const":60,"../../../settings":115,"../../../utils":139,"./extractUniformsFromSrc":101}],101:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t,e,r){var i=o(t),n=o(e);return Object.assign(i,n)};var i,n=t("pixi-gl-core");var c=((i=n)&&i.__esModule?i:{default:i}).default.shader.defaultValue;function o(t){for(var e=new RegExp("^(projectionMatrix|uSampler|filterArea|filterClamp)$"),r={},i=void 0,n=t.replace(/\s+/g," ").split(/\s*;\s*/),o=0;o=i&&f.x=n&&f.y>16)+(65280&t)+((255&t)<<16)}},{key:"texture",get:function(){return this._texture},set:function(t){this._texture!==t&&(this._texture=t||u.default.EMPTY,this.cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,t&&(t.baseTexture.hasLoaded?this._onTextureUpdate():t.once("update",this._onTextureUpdate,this)))}}]),p);function p(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p);var e=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,c.call(this));return e._anchor=new o.ObservablePoint(e._onAnchorUpdate,e,t?t.defaultAnchor.x:0,t?t.defaultAnchor.y:0),e._texture=null,e._width=0,e._height=0,e._tint=null,e._tintRGB=null,e.tint=16777215,e.blendMode=a.BLEND_MODES.NORMAL,e.shader=null,e.cachedTint=16777215,e.texture=t||u.default.EMPTY,e.vertexData=new Float32Array(8),e.vertexTrimmedData=null,e._transformID=-1,e._textureID=-1,e._transformTrimmedID=-1,e._textureTrimmedID=-1,e.pluginName="sprite",e}r.default=d},{"../const":60,"../display/Container":62,"../math":84,"../textures/Texture":129,"../utils":139}],117:[function(t,e,r){"use strict";r.__esModule=!0;var i=n(t("../../renderers/canvas/CanvasRenderer")),l=t("../../const"),c=t("../../math"),f=n(t("./CanvasTinter"));function n(t){return t&&t.__esModule?t:{default:t}}var d=new c.Matrix,o=(s.prototype.render=function(t){var e=t._texture,r=this.renderer,i=e._frame.width,n=e._frame.height,o=t.transform.worldTransform,s=0,a=0;if(!(e.orig.width<=0||e.orig.height<=0)&&e.baseTexture.source&&(r.setBlendMode(t.blendMode),e.valid)){r.context.globalAlpha=t.worldAlpha;var u=e.baseTexture.scaleMode===l.SCALE_MODES.LINEAR;r.smoothProperty&&r.context[r.smoothProperty]!==u&&(r.context[r.smoothProperty]=u),a=e.trim?(s=e.trim.width/2+e.trim.x-t.anchor.x*e.orig.width,e.trim.height/2+e.trim.y-t.anchor.y*e.orig.height):(s=(.5-t.anchor.x)*e.orig.width,(.5-t.anchor.y)*e.orig.height),e.rotate&&(o.copy(d),o=d,c.GroupD8.matrixAppendRotationInv(o,e.rotate,s,a),a=s=0),s-=i/2,a-=n/2,r.roundPixels?(r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution|0,o.ty*r.resolution|0),s|=0,a|=0):r.context.setTransform(o.a,o.b,o.c,o.d,o.tx*r.resolution,o.ty*r.resolution);var h=e.baseTexture.resolution;16777215!==t.tint?(t.cachedTint===t.tint&&t.tintedTexture.tintId===t._texture._updateID||(t.cachedTint=t.tint,t.tintedTexture=f.default.getTintedTexture(t,t.tint)),r.context.drawImage(t.tintedTexture,0,0,i*h,n*h,s*r.resolution,a*r.resolution,i*r.resolution,n*r.resolution)):r.context.drawImage(e.baseTexture.source,e._frame.x*h,e._frame.y*h,i*h,n*h,s*r.resolution,a*r.resolution,i*r.resolution,n*r.resolution)}},s.prototype.destroy=function(){this.renderer=null},s);function s(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),this.renderer=t}r.default=o,i.default.registerPlugin("sprite",o)},{"../../const":60,"../../math":84,"../../renderers/canvas/CanvasRenderer":91,"./CanvasTinter":118}],118:[function(t,e,r){"use strict";r.__esModule=!0;var i,d=t("../../utils"),n=t("../../renderers/canvas/utils/canUseNewCanvasBlendModes");var a={getTintedTexture:function(t,e){var r=t._texture,i="#"+("00000"+(0|(e=a.roundColor(e))).toString(16)).substr(-6);r.tintCache=r.tintCache||{};var n=r.tintCache[i],o=void 0;if(n){if(n.tintId===r._updateID)return r.tintCache[i];o=r.tintCache[i]}else o=a.canvas||document.createElement("canvas");if(a.tintMethod(r,e,o),o.tintId=r._updateID,a.convertTintToImage){var s=new Image;s.src=o.toDataURL(),r.tintCache[i]=s}else r.tintCache[i]=o,a.canvas=null;return o},tintWithMultiply:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="multiply",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithOverlay:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.fillStyle="#"+("00000"+(0|e).toString(16)).substr(-6),i.fillRect(0,0,n.width,n.height),i.globalCompositeOperation="destination-atop",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore()},tintWithPerPixel:function(t,e,r){var i=r.getContext("2d"),n=t._frame.clone(),o=t.baseTexture.resolution;n.x*=o,n.y*=o,n.width*=o,n.height*=o,r.width=Math.ceil(n.width),r.height=Math.ceil(n.height),i.save(),i.globalCompositeOperation="copy",i.drawImage(t.baseTexture.source,n.x,n.y,n.width,n.height,0,0,n.width,n.height),i.restore();for(var s=(0,d.hex2rgb)(e),a=s[0],u=s[1],h=s[2],l=i.getImageData(0,0,n.width,n.height),c=l.data,f=0;f=this.size&&this.flush(),t._texture._uvs&&(this.sprites[this.currentIndex++]=t)},f.prototype.flush=function(){if(0!==this.currentIndex){var t=this.renderer.gl,e=this.MAX_TEXTURES,r=U.default.nextPow2(this.currentIndex),i=U.default.log2(r),n=this.buffers[i],o=this.sprites,s=this.groups,a=n.float32View,u=n.uint32View,h=this.boundTextures,l=this.renderer.boundTextures,c=this.renderer.textureGC.count,f=0,d=void 0,p=void 0,v=1,y=0,g=s[0],m=void 0,b=void 0,_=B.premultiplyBlendMode[o[0]._texture.baseTexture.premultipliedAlpha?1:0][o[0].blendMode];g.textureCount=0,g.start=0,g.blend=_,W++;var x=void 0;for(x=0;x=r.length)break;o=r[n++]}else{if((n=r.next()).done)break;o=n.value}var s=o;this.animations[e].push(this.textures[s])}}},f.prototype._parseComplete=function(){var t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)},f.prototype._nextBatch=function(){var t=this;this._processFrames(this._batchIndex*f.BATCH_SIZE),this._batchIndex++,setTimeout(function(){t._batchIndex*f.BATCH_SIZEthis.baseTexture.width,s=r+n>this.baseTexture.height;if(o||s){var a=o&&s?"and":"or",u="X: "+e+" + "+i+" = "+(e+i)+" > "+this.baseTexture.width,h="Y: "+r+" + "+n+" = "+(r+n)+" > "+this.baseTexture.height;throw new Error("Texture Error: frame does not fit inside the base Texture dimensions: "+u+" "+a+" "+h)}this.valid=i&&n&&this.baseTexture.hasLoaded,this.trim||this.rotate||(this.orig=t),this.valid&&this._updateUvs()}},{key:"rotate",get:function(){return this._rotate},set:function(t){this._rotate=t,this.valid&&this._updateUvs()}},{key:"width",get:function(){return this.orig.width}},{key:"height",get:function(){return this.orig.height}}]),v);function v(t,e,r,i,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,v);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,d.call(this));if(s.noFrame=!1,e||(s.noFrame=!0,e=new h.Rectangle(0,0,1,1)),t instanceof v&&(t=t.baseTexture),s.baseTexture=t,s._frame=e,s.trim=i,s.valid=!1,s.requiresUpdate=!1,s._uvs=null,s.orig=r||e,s._rotate=Number(n||0),!0===n)s._rotate=2;else if(s._rotate%2!=0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");return t.hasLoaded?(s.noFrame&&(e=new h.Rectangle(0,0,t.width,t.height),t.on("update",s.onBaseTextureUpdated,s)),s.frame=e):t.once("loaded",s.onBaseTextureLoaded,s),s.defaultAnchor=o?new h.Point(o.x,o.y):new h.Point(0,0),s._updateID=0,s.transform=null,s.textureCacheIds=[],s}function y(t){t.destroy=function(){},t.on=function(){},t.once=function(){},t.emit=function(){}}(r.default=p).EMPTY=new p(new o.default),y(p.EMPTY),y(p.EMPTY.baseTexture),p.WHITE=function(){var t=document.createElement("canvas");t.width=10,t.height=10;var e=t.getContext("2d");return e.fillStyle="white",e.fillRect(0,0,10,10),new p(new o.default(t))}(),y(p.WHITE),y(p.WHITE.baseTexture)},{"../math":84,"../settings":115,"../utils":139,"./BaseTexture":126,"./TextureUvs":131,"./VideoBaseTexture":132,eventemitter3:204}],130:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;re.priority){t.connect(r);break}e=(r=e).next}t.previous||t.connect(r)}else t.connect(r);return this._startIfPossible(),this},l.prototype.remove=function(t,e){for(var r=this._head.next;r;)r=r.match(t,e)?r.destroy():r.next;return this._head.next||this._cancelIfNeeded(),this},l.prototype.start=function(){this.started||(this.started=!0,this._requestIfNeeded())},l.prototype.stop=function(){this.started&&(this.started=!1,this._cancelIfNeeded())},l.prototype.destroy=function(){this.stop();for(var t=this._head.next;t;)t=t.destroy(!0);this._head.destroy(),this._head=null},l.prototype.update=function(){var t=0this.lastTime){(e=this.elapsedMS=t-this.lastTime)>this._maxElapsedMS&&(e=this._maxElapsedMS),this.deltaTime=e*o.default.TARGET_FPMS*this.speed;for(var r=this._head,i=r.next;i;)i=i.emit(this.deltaTime);r.next||this._cancelIfNeeded()}else this.deltaTime=this.elapsedMS=0;this.lastTime=t},i(l,[{key:"FPS",get:function(){return 1e3/this.elapsedMS}},{key:"minFPS",get:function(){return 1e3/this._maxElapsedMS},set:function(t){var e=Math.min(Math.max(0,t)/1e3,o.default.TARGET_FPMS);this._maxElapsedMS=1/e}}]),l);function l(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),this._head=new a.default(null,null,1/0),this._requestId=null,this._maxElapsedMS=100,this.autoStart=!1,this.deltaTime=1,this.elapsedMS=1/o.default.TARGET_FPMS,this.lastTime=-1,this.speed=1,this.started=!1,this._tick=function(t){e._requestId=null,e.started&&(e.update(t),e.started&&null===e._requestId&&e._head.next&&(e._requestId=requestAnimationFrame(e._tick)))}}r.default=h},{"../const":60,"../settings":115,"./TickerListener":134}],134:[function(t,e,r){"use strict";r.__esModule=!0;var i=(n.prototype.match=function(t,e){return e=e||null,this.fn===t&&this.context===e},n.prototype.emit=function(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));var e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e},n.prototype.connect=function(t){(this.previous=t).next&&(t.next.previous=this),this.next=t.next,t.next=this},n.prototype.destroy=function(){var t=0>16&255)/255,e[1]=(t>>8&255)/255,e[2]=(255&t)/255,e},r.hex2string=function(t){return t=t.toString(16),"#"+(t="000000".substr(0,6-t.length)+t)},r.rgb2hex=function(t){return(255*t[0]<<16)+(255*t[1]<<8)+(255*t[2]|0)},r.getResolutionOfUrl=function(t,e){var r=n.default.RETINA_PREFIX.exec(t);if(r)return parseFloat(r[1]);return void 0!==e?e:1},r.decomposeDataUri=function(t){var e=i.DATA_URI.exec(t);if(e)return{mediaType:e[1]?e[1].toLowerCase():void 0,subType:e[2]?e[2].toLowerCase():void 0,charset:e[3]?e[3].toLowerCase():void 0,encoding:e[4]?e[4].toLowerCase():void 0,data:e[5]};return},r.getUrlFileExtension=function(t){var e=i.URL_FILE_EXTENSION.exec(t);if(e)return e[1].toLowerCase();return},r.getSvgSize=function(t){var e=i.SVG_SIZE.exec(t),r={};e&&(r[e[1]]=Math.round(parseFloat(e[3])),r[e[5]]=Math.round(parseFloat(e[7])));return r},r.skipHello=function(){v=!0},r.sayHello=function(t){if(v)return;if(-1>16&255,i=t>>8&255,n=255&t;return(255*e<<24)+((r=r*e+.5|0)<<16)+((i=i*e+.5|0)<<8)+(n=n*e+.5|0)},r.premultiplyRgba=function(t,e,r,i){r=r||new Float32Array(4),i||void 0===i?(r[0]=t[0]*e,r[1]=t[1]*e,r[2]=t[2]*e):(r[0]=t[0],r[1]=t[1],r[2]=t[2]);return r[3]=e,r},r.premultiplyTintToRgba=function(t,e,r,i){(r=r||new Float32Array(4))[0]=(t>>16&255)/255,r[1]=(t>>8&255)/255,r[2]=(255&t)/255,!i&&void 0!==i||(r[0]*=e,r[1]*=e,r[2]*=e);return r[3]=e,r};var i=t("../const"),n=d(t("../settings")),o=d(t("eventemitter3")),s=d(t("./pluginTarget")),a=f(t("./mixin")),u=f(t("ismobilejs")),h=d(t("remove-array-items")),l=d(t("./mapPremultipliedBlendModes")),c=d(t("earcut"));function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var p=0,v=!1;r.isMobile=u,r.removeItems=h.default,r.EventEmitter=o.default,r.pluginTarget=s.default,r.mixins=a,r.earcut=c.default;var y=r.TextureCache=Object.create(null),g=r.BaseTextureCache=Object.create(null);var m=r.premultiplyBlendMode=(0,l.default)()},{"../const":60,"../settings":115,"./mapPremultipliedBlendModes":140,"./mixin":142,"./pluginTarget":143,earcut:5,eventemitter3:204,ismobilejs:7,"remove-array-items":205}],140:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(){for(var t=[],e=[],r=0;r<32;r++)t[r]=r,e[r]=r;t[n.BLEND_MODES.NORMAL_NPM]=n.BLEND_MODES.NORMAL,t[n.BLEND_MODES.ADD_NPM]=n.BLEND_MODES.ADD,t[n.BLEND_MODES.SCREEN_NPM]=n.BLEND_MODES.SCREEN,e[n.BLEND_MODES.NORMAL]=n.BLEND_MODES.NORMAL_NPM,e[n.BLEND_MODES.ADD]=n.BLEND_MODES.ADD_NPM,e[n.BLEND_MODES.SCREEN]=n.BLEND_MODES.SCREEN_NPM;var i=[];return i.push(e),i.push(t),i};var n=t("../const")},{"../const":60}],141:[function(t,e,r){"use strict";r.__esModule=!0,r.default=function(t){if(o.default.tablet||o.default.phone)return 4;return t};var i,n=t("ismobilejs"),o=(i=n)&&i.__esModule?i:{default:i}},{ismobilejs:7}],142:[function(t,e,r){"use strict";function i(t,e){if(t&&e)for(var r=Object.keys(e),i=0;i=this._durations[this.currentFrame];)i-=this._durations[this.currentFrame]*n,this._currentTime+=n;this._currentTime+=i/this._durations[this.currentFrame]}else this._currentTime+=e;this._currentTime<0&&!this.loop?(this.gotoAndStop(0),this.onComplete&&this.onComplete()):this._currentTime>=this._textures.length&&!this.loop?(this.gotoAndStop(this._textures.length-1),this.onComplete&&this.onComplete()):r!==this.currentFrame&&(this.loop&&this.onLoop&&(0r&&this.onLoop()),this.updateTexture())},u.prototype.updateTexture=function(){this._texture=this._textures[this.currentFrame],this._textureID=-1,this.cachedTint=16777215,this.updateAnchor&&this._anchor.copy(this._texture.defaultAnchor),this.onFrameChange&&this.onFrameChange(this.currentFrame)},u.prototype.destroy=function(t){this.stop(),s.prototype.destroy.call(this,t)},u.fromFrames=function(t){for(var e=[],r=0;ra&&(++p,A.utils.removeItems(i,1+f-p,1+y-f),y=f,f=-1,n.push(d),l=Math.max(l,d),c++,r.x=0,r.y+=t.lineHeight,u=null))}else n.push(h),l=Math.max(l,h),++c,++p,r.x=0,r.y+=t.lineHeight,u=null}var _=o.charAt(o.length-1);"\r"!==_&&"\n"!==_&&(/(?:\s)/.test(_)&&(h=d),n.push(h),l=Math.max(l,h));for(var x=[],w=0;w<=c;w++){var T=0;"right"===this._font.align?T=l-n[w]:"center"===this._font.align&&(T=(l-n[w])/2),x.push(T)}for(var E=i.length,O=this.tint,S=0;S=i&&u.x=n&&u.y>16&255)/255,s=(r>>8&255)/255,a=(255&r)/255,u=((i=i||3375104)>>16&255)/255,h=(i>>8&255)/255,l=(255&i)/255,c=[.3,.59,.11,0,0,o,s,a,t=t||.2,0,u,h,l,e=e||.15,0,o-u,s-h,a-l,0,0];this._loadMatrix(c,n)},u.prototype.night=function(t,e){var r=[-2*(t=t||.1),-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0];this._loadMatrix(r,e)},u.prototype.predator=function(t,e){var r=[11.224130630493164*t,-4.794486999511719*t,-2.8746118545532227*t,0*t,.40342438220977783*t,-3.6330697536468506*t,9.193157196044922*t,-2.951810836791992*t,0*t,-1.316135048866272*t,-3.2184197902679443*t,-4.2375030517578125*t,7.476448059082031*t,0*t,.8044459223747253*t,0,0,0,1,0];this._loadMatrix(r,e)},u.prototype.lsd=function(t){this._loadMatrix([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},u.prototype.reset=function(){this._loadMatrix([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],!1)},i(u,[{key:"matrix",get:function(){return this.uniforms.m},set:function(t){this.uniforms.m=t}},{key:"alpha",get:function(){return this.uniforms.uAlpha},set:function(t){this.uniforms.uAlpha=t}}]),u);function u(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,u);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,s.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\n\nuniform mat3 projectionMatrix;\n\nvarying vec2 vTextureCoord;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n}","varying vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform float m[20];\nuniform float uAlpha;\n\nvoid main(void)\n{\n vec4 c = texture2D(uSampler, vTextureCoord);\n\n if (uAlpha == 0.0) {\n gl_FragColor = c;\n return;\n }\n\n // Un-premultiply alpha before applying the color matrix. See issue #3539.\n if (c.a > 0.0) {\n c.rgb /= c.a;\n }\n\n vec4 result;\n\n result.r = (m[0] * c.r);\n result.r += (m[1] * c.g);\n result.r += (m[2] * c.b);\n result.r += (m[3] * c.a);\n result.r += m[4];\n\n result.g = (m[5] * c.r);\n result.g += (m[6] * c.g);\n result.g += (m[7] * c.b);\n result.g += (m[8] * c.a);\n result.g += m[9];\n\n result.b = (m[10] * c.r);\n result.b += (m[11] * c.g);\n result.b += (m[12] * c.b);\n result.b += (m[13] * c.a);\n result.b += m[14];\n\n result.a = (m[15] * c.r);\n result.a += (m[16] * c.g);\n result.a += (m[17] * c.b);\n result.a += (m[18] * c.a);\n result.a += m[19];\n\n vec3 rgb = mix(c.rgb, result.rgb, uAlpha);\n\n // Premultiply alpha again.\n rgb *= result.a;\n\n gl_FragColor = vec4(rgb, result.a);\n}\n"));return t.uniforms.m=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],t.alpha=1,t}(r.default=a).prototype.grayscale=a.prototype.greyscale},{"../../core":79,path:224}],165:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\nvoid main() {\n\n vec2 fragCoord = vTextureCoord * filterArea.xy;\n\n vec4 color;\n\n color = fxaa(uSampler, fragCoord, filterArea.xy, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n gl_FragColor = color;\n}\n'))}r.default=o},{"../../core":79,path:224}],167:[function(t,e,r){"use strict";r.__esModule=!0;var i=t("./fxaa/FXAAFilter");Object.defineProperty(r,"FXAAFilter",{enumerable:!0,get:function(){return c(i).default}});var n=t("./noise/NoiseFilter");Object.defineProperty(r,"NoiseFilter",{enumerable:!0,get:function(){return c(n).default}});var o=t("./displacement/DisplacementFilter");Object.defineProperty(r,"DisplacementFilter",{enumerable:!0,get:function(){return c(o).default}});var s=t("./blur/BlurFilter");Object.defineProperty(r,"BlurFilter",{enumerable:!0,get:function(){return c(s).default}});var a=t("./blur/BlurXFilter");Object.defineProperty(r,"BlurXFilter",{enumerable:!0,get:function(){return c(a).default}});var u=t("./blur/BlurYFilter");Object.defineProperty(r,"BlurYFilter",{enumerable:!0,get:function(){return c(u).default}});var h=t("./colormatrix/ColorMatrixFilter");Object.defineProperty(r,"ColorMatrixFilter",{enumerable:!0,get:function(){return c(h).default}});var l=t("./alpha/AlphaFilter");function c(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"AlphaFilter",{enumerable:!0,get:function(){return c(l).default}})},{"./alpha/AlphaFilter":157,"./blur/BlurFilter":158,"./blur/BlurXFilter":159,"./blur/BlurYFilter":160,"./colormatrix/ColorMatrixFilter":164,"./displacement/DisplacementFilter":165,"./fxaa/FXAAFilter":166,"./noise/NoiseFilter":168}],168:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;r 0.0) {\n color.rgb /= color.a;\n }\n\n color.r += diff;\n color.g += diff;\n color.b += diff;\n\n // Premultiply alpha again.\n color.rgb *= color.a;\n\n gl_FragColor = color;\n}\n"));return r.noise=t,r.seed=e,r}r.default=a},{"../../core":79,path:224}],169:[function(g,t,m){(function(t){"use strict";m.__esModule=!0,m.loader=m.prepare=m.particles=m.mesh=m.loaders=m.interaction=m.filters=m.extras=m.extract=m.accessibility=void 0;var e=g("./polyfill");Object.keys(e).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(m,t,{enumerable:!0,get:function(){return e[t]}})});var r=g("./core");Object.keys(r).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(m,t,{enumerable:!0,get:function(){return r[t]}})});var i,n=g("./deprecation"),o=(i=n)&&i.__esModule?i:{default:i},s=v(g("./accessibility")),a=v(g("./extract")),u=v(g("./extras")),h=v(g("./filters")),l=v(g("./interaction")),c=v(g("./loaders")),f=v(g("./mesh")),d=v(g("./particles")),p=v(g("./prepare"));function v(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}r.utils.mixins.performMixins();var y=c.shared||null;m.accessibility=s,m.extract=a,m.extras=u,m.filters=h,m.interaction=l,m.loaders=c,m.mesh=f,m.particles=d,m.prepare=p,m.loader=y,"function"==typeof o.default&&(0,o.default)(m),t.PIXI=m}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./accessibility":56,"./core":79,"./deprecation":145,"./extract":147,"./extras":155,"./filters":167,"./interaction":174,"./loaders":177,"./mesh":186,"./particles":189,"./polyfill":196,"./prepare":200}],170:[function(t,e,r){"use strict";r.__esModule=!0;var i=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};function n(t,e){for(var r=0;re?1:this._height/e;t[9]=t[11]=t[13]=t[15]=this._topHeight*r,t[17]=t[19]=t[21]=t[23]=this._height-this._bottomHeight*r,t[25]=t[27]=t[29]=t[31]=this._height},h.prototype.updateVerticalVertices=function(){var t=this.vertices,e=this._leftWidth+this._rightWidth,r=this._width>e?1:this._width/e;t[2]=t[10]=t[18]=t[26]=this._leftWidth*r,t[4]=t[12]=t[20]=t[28]=this._width-this._rightWidth*r,t[6]=t[14]=t[22]=t[30]=this._width},h.prototype._renderCanvas=function(t){var e=t.context,r=this.worldTransform,i=t.resolution,n=16777215!==this.tint,o=this._texture;n&&this._cachedTint!==this.tint&&(this._cachedTint=this.tint,this._tintedTexture=x.default.getTintedTexture(this,this.tint));var s=n?this._tintedTexture:o.baseTexture.source;this._canvasUvs||(this._canvasUvs=[0,0,0,0,0,0,0,0]);var a=this.vertices,u=this._canvasUvs,h=n?0:o.frame.x,l=n?0:o.frame.y,c=h+o.frame.width,f=l+o.frame.height;u[0]=h,u[1]=h+this._leftWidth,u[2]=c-this._rightWidth,u[3]=c,u[4]=l,u[5]=l+this._topHeight,u[6]=f-this._bottomHeight,u[7]=f;for(var d=0;d<8;d++)u[d]*=o.baseTexture.resolution;e.globalAlpha=this.worldAlpha,t.setBlendMode(this.blendMode),t.roundPixels?e.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i|0,r.ty*i|0):e.setTransform(r.a*i,r.b*i,r.c*i,r.d*i,r.tx*i,r.ty*i);for(var p=0;p<3;p++)for(var v=0;v<3;v++){var y=2*v+8*p,g=Math.max(1,u[v+1]-u[v]),m=Math.max(1,u[p+5]-u[p+4]),b=Math.max(1,a[10+y]-a[y]),_=Math.max(1,a[11+y]-a[1+y]);e.drawImage(s,u[v],u[p+4],g,m,a[y],a[1+y],b,_)}},h.prototype._refresh=function(){a.prototype._refresh.call(this);var t=this.uvs,e=this._texture;this._origWidth=e.orig.width,this._origHeight=e.orig.height;var r=1/this._origWidth,i=1/this._origHeight;t[0]=t[8]=t[16]=t[24]=0,t[1]=t[3]=t[5]=t[7]=0,t[6]=t[14]=t[22]=t[30]=1,t[25]=t[27]=t[29]=t[31]=1,t[2]=t[10]=t[18]=t[26]=r*this._leftWidth,t[4]=t[12]=t[20]=t[28]=1-r*this._rightWidth,t[9]=t[11]=t[13]=t[15]=i*this._topHeight,t[17]=t[19]=t[21]=t[23]=1-i*this._bottomHeight,this.updateHorizontalVertices(),this.updateVerticalVertices(),this.dirty++,this.multiplyUvs()},i(h,[{key:"width",get:function(){return this._width},set:function(t){this._width=t,this._refresh()}},{key:"height",get:function(){return this._height},set:function(t){this._height=t,this._refresh()}},{key:"leftWidth",get:function(){return this._leftWidth},set:function(t){this._leftWidth=t,this._refresh()}},{key:"rightWidth",get:function(){return this._rightWidth},set:function(t){this._rightWidth=t,this._refresh()}},{key:"topHeight",get:function(){return this._topHeight},set:function(t){this._topHeight=t,this._refresh()}},{key:"bottomHeight",get:function(){return this._bottomHeight},set:function(t){this._bottomHeight=t,this._refresh()}}]),h);function h(t,e,r,i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h);var o=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,a.call(this,t,4,4));return o._origWidth=t.orig.width,o._origHeight=t.orig.height,o._width=o._origWidth,o._height=o._origHeight,o._leftWidth=void 0!==e?e:10,o._rightWidth=void 0!==i?i:10,o._topHeight=void 0!==r?r:10,o._bottomHeight=void 0!==n?n:10,o._cachedTint=16777215,o._tintedTexture=null,o._canvasUvs=null,o.refresh(!0),o}r.default=u},{"../core/sprites/canvas/CanvasTinter":118,"./Plane":183}],183:[function(t,e,r){"use strict";r.__esModule=!0;var i,n=t("./Mesh"),o=(i=n)&&i.__esModule?i:{default:i};var s,a=(function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(u,s=o.default),u.prototype._refresh=function(){for(var t=this._texture,e=this.verticesX*this.verticesY,r=[],i=[],n=[],o=this.verticesX-1,s=this.verticesY-1,a=t.width/o,u=t.height/s,h=0;h=s.length){if(!t.autoResize)break;s.push(this._generateOneMoreBuffer(t))}var p=s[f];p.uploadDynamic(e,c,d);var v=t._bufferUpdateIDs[f]||0;(l=l||p._updateID>2,n[1]=(3&i[0])<<4|i[1]>>4,n[2]=(15&i[1])<<2|i[2]>>6,n[3]=63&i[2],r-(t.length-1)){case 2:n[3]=64,n[2]=64;break;case 1:n[3]=64}for(var s=0;s>>0,i=(r*=i)>>>0,i+=4294967296*(r-=i)}return 2.3283064365386963e-10*(i>>>0)}}();e.next=function(){var t=2091639*e.s0+2.3283064365386963e-10*e.c;return e.s0=e.s1,e.s1=e.s2,e.s2=t-(e.c=0|t)},e.c=1,e.s0=r(" "),e.s1=r(" "),e.s2=r(" "),e.s0-=r(t),e.s0<0&&(e.s0+=1),e.s1-=r(t),e.s1<0&&(e.s1+=1),e.s2-=r(t),e.s2<0&&(e.s2+=1),r=null}function s(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var r=new o(t),i=e&&e.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,i&&("object"==typeof i&&s(i,r),n.state=function(){return s(r,{})}),n}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.alea=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],214:[function(t,e,r){!function(t,e,r){function o(t){var n=this,e="";n.next=function(){var t=n.b,e=n.c,r=n.d,i=n.a;return t=t<<25^t>>>7^e,e=e-r|0,r=r<<24^r>>>8^i,i=i-t|0,n.b=t=t<<20^t>>>12^e,n.c=e=e-r|0,n.d=r<<16^e>>>16^i,n.a=i-t|0},n.a=0,n.b=0,n.c=-1640531527,n.d=1367130551,t===Math.floor(t)?(n.a=t/4294967296|0,n.b=0|t):e+=t;for(var r=0;r>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&("object"==typeof n&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.tychei=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],215:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var i=0;i>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&("object"==typeof n&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor128=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],216:[function(t,e,r){!function(t,e,r){function o(t){var o=this;o.next=function(){var t,e,r=o.w,i=o.X,n=o.i;return o.w=r=r+1640531527|0,e=i[n+34&127],t=i[n=n+1&127],e^=e<<13,t^=t<<17,e^=e>>>15,t^=t>>>12,e=i[n]=e^t,o.i=n,e+(r^r>>>16)|0},function(t,e){var r,i,n,o,s,a=[],u=128;for(e===(0|e)?(i=e,e=null):(e+="\0",i=0,u=Math.max(u,e.length)),n=0,o=-32;o>>15,i^=i<<4,i^=i>>>13,0<=o&&(s=s+1640531527|0,n=0==(r=a[127&o]^=i+s)?n+1:0);for(128<=n&&(a[127&(e&&e.length||0)]=-1),n=127,o=512;0>>15,r^=r>>>12,a[n]=i^r;t.w=s,t.X=a,t.i=n}(o,t)}function s(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&(n.X&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xor4096=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],217:[function(t,e,r){!function(t,e,r){function o(t){var n=this;n.next=function(){var t,e,r=n.x,i=n.i;return t=r[i],e=(t^=t>>>7)^t<<24,e^=(t=r[i+1&7])^t>>>10,e^=(t=r[i+3&7])^t>>>3,e^=(t=r[i+4&7])^t<<7,t=r[i+7&7],e^=(t^=t<<13)^t<<9,r[i]=e,n.i=i+1&7,e},function(t,e){var r,i=[];if(e===(0|e))i[0]=e;else for(e=""+e,r=0;r>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&(n.x&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorshift7=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],218:[function(t,e,r){!function(t,e,r){function o(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,t===((e.v=0)|t)?e.x=t:r+=t;for(var i=0;i>>4),e.next()}function s(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){function r(){return(i.next()>>>0)/4294967296}var i=new o(t),n=e&&e.state;return r.double=function(){do{var t=((i.next()>>>11)+(i.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},r.int32=i.next,r.quick=r,n&&("object"==typeof n&&s(n,i),r.state=function(){return s(i,{})}),r}e&&e.exports?e.exports=i:r&&r.amd?r(function(){return i}):this.xorwow=i}(0,"object"==typeof e&&e,"function"==typeof define&&define)},{}],219:[function(WZb,XZb,YZb){!function(ZZb,$Zb){var i$b,_Zb=eval("this"),a$b=256,e$b=$Zb.pow(a$b,6),f$b=$Zb.pow(2,52),g$b=2*f$b,h$b=a$b-1;function j$b(t,e,r){function i(){for(var t=s.g(6),e=e$b,r=0;t>>=1;return(t+r)/e}var n=[],o=n$b(function t(e,r){var i,n=[],o=typeof e;if(r&&"object"==o)for(i in e)try{n.push(t(e[i],r-1))}catch(t){}return n.length?n:"string"==o?e:e+"\0"}((e=1==e?{entropy:!0}:e||{}).entropy?[t,p$b(ZZb)]:null==t?function(){try{var t;return i$b&&(t=i$b.randomBytes)?t=t(a$b):(t=new Uint8Array(a$b),(_Zb.crypto||_Zb.msCrypto).getRandomValues(t)),p$b(t)}catch(t){var e=_Zb.navigator,r=e&&e.plugins;return[+new Date,_Zb,r,_Zb.screen,p$b(ZZb)]}}():t,3),n),s=new k$b(n);return i.int32=function(){return 0|s.g(4)},i.quick=function(){return s.g(4)/4294967296},i.double=i,n$b(p$b(s.S),ZZb),(e.pass||r||function(t,e,r,i){return i&&(i.S&&l$b(i,s),t.state=function(){return l$b(s,{})}),r?($Zb.random=t,e):t})(i,o,"global"in e?e.global:this==$Zb,e.state)}function k$b(t){var e,r=t.length,s=this,i=0,n=s.i=s.j=0,o=s.S=[];for(r||(t=[r++]);iMath.PI?c-r:r}function y(t){return t-c*Math.floor(t/c)}e.exports={UP:o,DOWN:s,LEFT:a,RIGHT:0,NORTH:u,SOUTH:h,WEST:l,EAST:0,PI_2:c,PI_QUARTER:f,PI_HALF:d,toDegrees:function(t){return t*i},toRadians:function(t){return t*n},isAngleBetween:function(t,e,r){if(((r-e)%c+c)%c>=Math.PI){var i=e;e=r,r=i}return e<=r?e<=t&&t<=r:e<=t||t<=r},differenceAnglesSign:p,differenceAngles:v,shortestAngle:function(t,e){return v(e,t)*p(e,t)+t},normalize:y,angleTwoPoints:function(){return 4===arguments.length?Math.atan2(arguments[3]-arguments[1],arguments[2]-arguments[0]):Math.atan2(arguments[1].y-arguments[0].y,arguments[1].x-arguments[0].x)},distanceTwoPoints:function(){return 2===arguments.length?Math.sqrt(Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2)):Math.sqrt(Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2))},distanceTwoPointsSquared:function(){return 2===arguments.length?Math.pow(arguments[1].x-arguments[0].x,2)+Math.pow(arguments[1].y-arguments[0].y,2):Math.pow(arguments[2]-arguments[0],2)+Math.pow(arguments[3]-arguments[1],2)},closestAngle:function(t){var e=v(t,a),r=v(t,0),i=v(t,o),n=v(t,s);return e<=r&&e<=i&&e<=n?a:r<=i&&r<=n?0:i<=n?o:s},equals:function(t,e,r){return r?v(t,e)>16)+t*(r>>16)<<16|i*(e>>8&255)+t*(r>>8&255)<<8|i*(255&e)+t*(255&r)},random:function(t,e){function r(){return a.range(t,e)}var i=a.pick([{r:1,g:1,b:1},{r:1,g:1,b:0},{r:1,g:0,b:1},{r:0,g:1,b:1},{r:1,g:0,b:0},{r:0,g:1,b:0},{r:0,g:0,b:1}]);return t=t||0,e=e||255,this.rgbToHex(i.r?r():0,i.g?r():0,i.b?r():0)},randomHSL:function(t,e,r,i,n,o){var s={h:a.range(t,e),s:a.range(r,i,!0),l:a.range(n,o,!0)};return this.hslToHex(s)},randomGoldenRatioHSL:function(t,e,r){for(var i=a.get(1,!0),n=[],o=0;o= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=m-b,E=Math.floor,O=String.fromCharCode;function S(t){throw new RangeError(c[t])}function d(t,e){for(var r=t.length,i=[];r--;)i[r]=e(t[r]);return i}function p(t,e){var r=t.split("@"),i="";return 1>>10&1023|55296),t=56320|1023&t),e+=O(t)}).join("")}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var i=0;for(t=r?E(t/a):t>>1,t+=E(t/e);f*_>>1E((g-p)/s))&&S("overflow"),p+=u*s,!(u<(h=a<=y?b:y+_<=a?_:a-y));a+=m)s>E(g/(l=m-h))&&S("overflow"),s*=l;y=A(p-o,e=f.length+1,0==o),E(p/e)>g-v&&S("overflow"),v+=E(p/e),p%=e,f.splice(p++,0,v)}return P(f)}function y(t){var e,r,i,n,o,s,a,u,h,l,c,f,d,p,v,y=[];for(f=(t=M(t)).length,e=w,o=x,s=r=0;sE((g-r)/(d=i+1))&&S("overflow"),r+=(a-e)*d,e=a,s=0;sg&&S("overflow"),c==e){for(u=r,h=m;!(u<(l=h<=o?b:o+_<=h?_:h-o));h+=m)v=u-l,p=m-l,y.push(O(C(l+v%p,0))),u=E(v/p);y.push(O(C(u,0))),o=A(r,d,i==n),r=0,++i}++r,++e}return y.join("")}if(n={version:"1.4.1",ucs2:{decode:M,encode:P},decode:v,encode:y,toASCII:function(t){return p(t,function(t){return h.test(t)?"xn--"+y(t):t})},toUnicode:function(t){return p(t,function(t){return u.test(t)?v(t.slice(4).toLowerCase()):t})}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return n});else if(e&&r)if(I.exports==e)r.exports=n;else for(o in n)n.hasOwnProperty(o)&&(e[o]=n[o]);else t.punycode=n}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],227:[function(t,e,r){"use strict";e.exports=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if("string"!=typeof t||0===t.length)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var a,u,h=t.length;0",'"',"`"," ","\r","\n","\t"]),N=["'"].concat(n),B=["%","/","?",";","#"].concat(N),F=["/","?","#"],U=/^[+a-z0-9A-Z_-]{0,63}$/,W=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,H={javascript:!0,"javascript:":!0},X={javascript:!0,"javascript:":!0},G={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},z=t("querystring");function o(t,e,r){if(t&&k.isObject(t)&&t instanceof M)return t;var i=new M;return i.parse(t,e,r),i}M.prototype.parse=function(t,e,r){if(!k.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=-1!==i&&i -

Scrollview

@@ -37,38 +36,35 @@ const app = new PIXIApp({ view: canvas, width: 900, - height: 250, + height: 400, transparent: false }).setup().run() -// let scrollview1 = new Scrollview({ -// x: 10, -// y: 20 -// }) +app.loader + .add('elephant1', './assets/elephant-1.jpg') + .add('elephant2', './assets/elephant-2.jpg') + .add('elephant3', './assets/elephant-3.jpg') + .load((loader, resources) => { + const sprite1 = new PIXI.Sprite(resources.elephant1.texture) + const sprite2 = new PIXI.Sprite(resources.elephant2.texture) + const sprite3 = new PIXI.Sprite(resources.elephant3.texture) -// let scrollview2 = new Scrollview({ -// x: 90, -// y: 20, -// fill: 0xfd355a, -// fillActive: 0x5954d3, -// controlFill: 0xfecd2d, -// controlFillActive: 0xfd413b, -// strokeActiveWidth: 4, -// controlStrokeActive: 0x50d968, -// controlStrokeActiveWidth: 12, -// controlStrokeActiveAlpha: .8, -// tooltip: 'Dies ist ein Switch' -// }) + const scrollview1 = new Scrollview({boxWidth: 300, boxHeight: 180}) + scrollview1.content.addChild(sprite1) + app.scene.addChild(scrollview1) -// const scrollbox = new PIXI.extras.Scrollbox({boxWidth: 500, boxHeight: 200}) -// scrollbox.x = 70 -// scrollbox.y = 30 - -// const sprite = new PIXI.Sprite(resources.fulda.texture) -// sprite.scale.set(.5, .5) -// scrollbox.content.addChild(sprite) -// app.stage.addChild(scrollbox) - -// app.scene.addChild(switch1, switch2) + const scrollview2 = new Scrollview({boxWidth: 300, boxHeight: 300}) + scrollview2.x = 500 + scrollview2.y = 30 + sprite2.x = 40 + sprite2.y = 40 + sprite2.scale.set(.3, .3) + sprite3.x = 60 + sprite3.y = 100 + sprite3.alpha = .6 + sprite3.scale.set(.5, .5) + scrollview2.content.addChild(sprite2, sprite3) + app.scene.addChild(scrollview2) + }) diff --git a/lib/pixi/scrollview.js b/lib/pixi/scrollview.js index 80ac66b..91569f0 100644 --- a/lib/pixi/scrollview.js +++ b/lib/pixi/scrollview.js @@ -1,5 +1,4 @@ -import Theme from './theme.js' -import Tooltip from './tooltip.js' +import Scrollbox from './scrollbox.js' /** * Callback for the switch action. @@ -54,140 +53,22 @@ import Tooltip from './tooltip.js' * app.scene.addChild(switch1) * * @class - * @extends PIXI.Container - * @see {@link http://pixijs.download/dev/docs/PIXI.Container.html|PIXI.Container} - * @see {@link https://www.iwm-tuebingen.de/iwmbrowser/lib/pixi/switch.html|DocTest} + * @extends PIXI.extras.Scrollbox + * @see {@link https://davidfig.github.io/pixi-scrollbox/jsdoc/Scrollbox.html|Scrollbox} + * @see {@link https://davidfig.github.io/pixi-viewport/jsdoc/Viewport.html|Viewport} */ -export default class Switch extends PIXI.Container { +export default class Scrollview extends Scrollbox { /** * Creates an instance of a Switch. * * @constructor - * @param {object} [opts] - An options object to specify to style and behaviour of the switch. - * @param {number} [opts.id=auto generated] - The id of the switch. - * @param {number} [opts.x=0] - The x position of the switch. Can be also set after creation with switch.x = 0. - * @param {number} [opts.y=0] - The y position of the switch. Can be also set after creation with switch.y = 0. - * @param {string|Theme} [opts.theme=dark] - The theme to use for this switch. Possible values are dark, light, red - * or a Theme object. - * @param {number} [opts.width=44] - The width of the switch. - * @param {number} [opts.height=28] - The height of the switch. - * @param {number} [opts.fill=Theme.fill] - The color of the switch background as a hex value. - * @param {number} [opts.fillAlpha=Theme.fillAlpha] - The alpha value of the background. - * @param {number} [opts.fillActive=Theme.fillActive] - The color of the switch background when activated. - * @param {number} [opts.fillActiveAlpha=Theme.fillActiveAlpha] - The alpha value of the background when activated. - * @param {number} [opts.stroke=Theme.stroke] - The color of the border as a hex value. - * @param {number} [opts.strokeWidth=Theme.strokeWidth] - The width of the border in pixel. - * @param {number} [opts.strokeAlpha=Theme.strokeAlpha] - The alpha value of the border. - * @param {number} [opts.strokeActive=Theme.strokeActive] - The color of the border when activated. - * @param {number} [opts.strokeActiveWidth=Theme.strokeActiveWidth] - The width of the border in pixel when activated. - * @param {number} [opts.strokeActiveAlpha=Theme.strokeActiveAlpha] - The alpha value of the border when activated. - * @param {number} [opts.controlFill=Theme.stroke] - The color of the switch control background as a hex value. - * @param {number} [opts.controlFillAlpha=Theme.strokeAlpha] - The alpha value of the background. - * @param {number} [opts.controlFillActive=Theme.stroke] - The color of the switch control background when activated. - * @param {number} [opts.controlFillActiveAlpha=Theme.strokeAlpha] - The alpha value of the background when activated. - * @param {number} [opts.controlStroke=Theme.stroke] - The color of the border as a hex value. - * @param {number} [opts.controlStrokeWidth=Theme.strokeWidth * 0.8] - The width of the border in pixel. - * @param {number} [opts.controlStrokeAlpha=Theme.strokeAlpha] - The alpha value of the border. - * @param {number} [opts.controlStrokeActive=Theme.stroke] - The color of the border when activated. - * @param {number} [opts.controlStrokeActiveWidth=Theme.strokeActiveWidth * 0.8] - The width of the border in pixel when activated. - * @param {number} [opts.controlStrokeActiveAlpha=Theme.strokeActiveAlpha] - The alpha value of the border when activated. - * @param {number} [opts.duration=Theme.fast] - The duration of the animation when the switch gets activated in seconds. - * @param {number} [opts.durationActive=Theme.fast] - The duration of the animation when the switch gets deactivated in seconds. - * @param {boolean} [opts.disabled=false] - Is the switch disabled? When disabled, the switch has a lower alpha value - * and cannot be clicked (interactive is set to false). - * @param {boolean} [opts.active=false] - Is the button initially active? - * @param {actionCallback} [opts.action] - Executed when the switch was triggered in inactive state (by pointerup). - * @param {actionActiveCallback} [opts.actionActive] - Executed when the button was triggered in active state (by pointerup). - * @param {beforeActionCallback} [opts.beforeAction] - Executed before an action is triggered. - * @param {afterActionCallback} [opts.afterAction] - Executed after an action was triggered. - * @param {string|object} [opts.tooltip] - A string for the label of the tooltip or an object to configure the tooltip - * to display. - * @param {boolean} [opts.visible=true] - Is the switch initially visible (property visible)? */ constructor(opts = {}) { - super() - - const theme = Theme.fromString(opts.theme) - this.theme = theme + super(opts) - this.opts = Object.assign({}, { - id: PIXI.utils.uid(), - x: 0, - y: 0, - width: 44, - height: 28, - fill: theme.fill, - fillAlpha: theme.fillAlpha, - fillActive: theme.primaryColor, - fillActiveAlpha: theme.fillActiveAlpha, - stroke: theme.stroke, - strokeWidth: theme.strokeWidth, - strokeAlpha: theme.strokeAlpha, - strokeActive: theme.primaryColor, - strokeActiveWidth: theme.strokeActiveWidth, - strokeActiveAlpha: theme.strokeActiveAlpha, - controlFill: theme.stroke, - controlFillAlpha: theme.strokeAlpha, - controlFillActive: theme.stroke, - controlFillActiveAlpha: theme.strokeAlpha, - controlStroke: theme.stroke, - controlStrokeWidth: theme.strokeWidth * .8, - controlStrokeAlpha: theme.strokeAlpha, - controlStrokeActive: theme.stroke, - controlStrokeActiveWidth: theme.strokeActiveWidth * .8, - controlStrokeActiveAlpha: theme.strokeActiveAlpha, - duration: theme.fast, - durationActive: theme.fast, - disabled: false, - active: false, - action: null, - actionActive: null, - beforeAction: null, - afterAction: null, - tooltip: null, - visible: true - }, opts) - - this.opts.controlRadius = this.opts.controlRadius || (this.opts.height / 2) - this.opts.controlRadiusActive = this.opts.controlRadiusActive || this.opts.controlRadius - - // Validation - //----------------- - if (this.opts.height > this.opts.width) { - this.opts.height = this.opts.width - } - - // Properties - //----------------- - this.id = this.opts.id - this.radius = this.opts.height / 2 - - this._active = null - this._disabled = null - - this.switchObj = null - this.control = null - this.tooltip = null - - this.visible = this.opts.visible - - // animated - //----------------- - this.tempAnimated = { - fill: this.opts.fill, - fillAlpha: this.opts.fillAlpha, - stroke: this.opts.stroke, - strokeWidth: this.opts.strokeWidth, - strokeAlpha: this.opts.strokeAlpha, - controlFill: this.opts.controlFill, - controlFillAlpha: this.opts.controlFillAlpha, - controlStroke: this.opts.controlStroke, - controlStrokeWidth: this.opts.controlStrokeWidth, - controlStrokeAlpha: this.opts.controlStrokeAlpha, - controlRadius: this.opts.controlRadius - } + this.opts = opts // setup //----------------- @@ -202,306 +83,19 @@ export default class Switch extends PIXI.Container { * Creates children and instantiates everything. * * @private - * @return {Switch} A reference to the switch for chaining. + * @return {Scrollview} A reference to the Scrollview for chaining. */ setup() { - // Switch - //----------------- - let switchObj = new PIXI.Graphics() - this.switchObj = switchObj - this.addChild(switchObj) - - // Control - //----------------- - this.xInactive = this.opts.controlRadius - this.xActive = this.opts.width - this.opts.controlRadiusActive - - let control = new PIXI.Graphics() - control.x = this.opts.active ? this.xActive : this.xInactive - control.y = this.opts.height / 2 - - this.control = control - - this.addChild(this.control) - - // interaction - //----------------- - this.switchObj.on('pointerover', e => { - TweenLite.to(this.control, this.theme.fast, {alpha: .83}) - }) - - this.switchObj.on('pointerout', e => { - TweenLite.to(this.control, this.theme.fast, {alpha: 1}) - }) - - this.switchObj.on('pointerdown', e => { - TweenLite.to(this.control, this.theme.fast, {alpha: .7}) - }) - - this.switchObj.on('pointerup', e => { - - if (this.opts.beforeAction) { - this.opts.beforeAction.call(this, e, this) - } - - this.active = !this.active - - if (this.active) { - if (this.opts.action) { - this.opts.action.call(this, e, this) - } - } else { - if (this.opts.actionActive) { - this.opts.actionActive.call(this, e, this) - } - } - - TweenLite.to(this.control, this.theme.fast, {alpha: .83}) - - if (this.opts.afterAction) { - this.opts.afterAction.call(this, e, this) - } - }) - - // disabled - //----------------- - this.disabled = this.opts.disabled - - // active - //----------------- - this.active = this.opts.active - - // tooltip - //----------------- - if (this.opts.tooltip) { - if (typeof this.opts.tooltip === 'string') { - this.tooltip = new Tooltip({ - object: this, - content: this.opts.tooltip - }) - } else { - this.opts.tooltip.object = this - this.tooltip = new Tooltip(this.opts.tooltip) - } - } - return this } /** - * Should be called to refresh the layout of the switch. Can be used after resizing. + * Should be called to refresh the layout of the Scrollview. Can be used after resizing. * - * @return {Switch} A reference to the switch for chaining. + * @return {Scrollview} A reference to the Scrollview for chaining. */ layout() { - - // set position - //----------------- - this.position.set(this.opts.x, this.opts.y) - - // draw - //----------------- - this.draw() - - return this - } - - /** - * Draws the switch to the canvas. - * - * @private - * @return {Switch} A reference to the switch for chaining. - */ - draw() { - - this.switchObj.clear() - if (this.active) { - this.switchObj.lineStyle(this.opts.strokeActiveWidth, this.opts.strokeActive, this.opts.strokeActiveAlpha) - this.switchObj.beginFill(this.opts.fillActive, this.opts.fillActiveAlpha) - } else { - this.switchObj.lineStyle(this.opts.strokeWidth, this.opts.stroke, this.opts.strokeAlpha) - this.switchObj.beginFill(this.opts.fill, this.opts.fillAlpha) - } - this.switchObj.moveTo(this.radius, 0) - this.switchObj.lineTo(this.opts.width - this.radius, 0) - this.switchObj.arcTo(this.opts.width, 0, this.opts.width, this.radius, this.radius) - this.switchObj.lineTo(this.opts.width, this.radius + 1) // BUGFIX: If not specified, there is a small area without a stroke. - this.switchObj.arcTo(this.opts.width, this.opts.height, this.opts.width - this.radius, this.opts.height, this.radius) - this.switchObj.lineTo(this.radius, this.opts.height) - this.switchObj.arcTo(0, this.opts.height, 0, this.radius, this.radius) - this.switchObj.arcTo(0, 0, this.radius, 0, this.radius) - this.switchObj.endFill() - - // Draw control - this.control.clear() - if (this.active) { - this.control.lineStyle(this.opts.controlStrokeActiveWidth, this.opts.controlStrokeActive, this.opts.controlStrokeActiveAlpha) - this.control.beginFill(this.opts.controlFillActive, this.opts.controlFillActiveAlpha) - this.control.drawCircle(0, 0, this.opts.controlRadiusActive - 1) - } else { - this.control.lineStyle(this.opts.controlStrokeWidth, this.opts.controlStroke, this.opts.controlStrokeAlpha) - this.control.beginFill(this.opts.controlFill, this.opts.controlFillAlpha) - this.control.drawCircle(0, 0, this.opts.controlRadius - 1) - } - this.control.endFill() - - return this - } - - /** - * Draws the animation. - * - * @private - * @return {Switch} A reference to the switch for chaining. - */ - drawAnimated() { - - this.switchObj.clear() - this.switchObj.lineStyle(this.tempAnimated.strokeWidth, this.tempAnimated.stroke, this.tempAnimated.strokeAlpha) - this.switchObj.beginFill(this.tempAnimated.fill, this.tempAnimated.fillAlpha) - this.switchObj.moveTo(this.radius, 0) - this.switchObj.lineTo(this.opts.width - this.radius, 0) - this.switchObj.arcTo(this.opts.width, 0, this.opts.width, this.radius, this.radius) - this.switchObj.lineTo(this.opts.width, this.radius + 1) // BUGFIX: If not specified, there is a small area without a stroke. - this.switchObj.arcTo(this.opts.width, this.opts.height, this.opts.width - this.radius, this.opts.height, this.radius) - this.switchObj.lineTo(this.radius, this.opts.height) - this.switchObj.arcTo(0, this.opts.height, 0, this.radius, this.radius) - this.switchObj.arcTo(0, 0, this.radius, 0, this.radius) - this.switchObj.endFill() - - this.control.clear() - this.control.lineStyle(this.tempAnimated.controlStrokeWidth, this.tempAnimated.controlStroke, this.tempAnimated.controlStrokeAlpha) - this.control.beginFill(this.tempAnimated.controlFill, this.tempAnimated.controlFillAlpha) - this.control.drawCircle(0, 0, this.tempAnimated.controlRadius - 1) - this.control.endFill() - - return this - } - - /** - * Gets or sets the active state. - * - * @member {boolean} - */ - get active() { - return this._active - } - - set active(value) { - - this._active = value - - if (this._active) { - - TweenLite.to(this.control, this.opts.duration, {x: this.xActive}) - TweenLite.to(this.tempAnimated, this.opts.duration, { - colorProps: { - fill: this.opts.fillActive, - stroke: this.opts.strokeActive, - controlFill: this.opts.controlFillActive, - controlStroke: this.opts.controlStrokeActive, - format: 'number' - }, - fillAlpha: this.opts.fillActiveAlpha, - strokeWidth: this.opts.strokeActiveWidth, - strokeAlpha: this.opts.strokeActiveAlpha, - controlFillAlpha: this.opts.controlFillActiveAlpha, - controlStrokeWidth: this.opts.controlStrokeActiveWidth, - controlStrokeAlpha: this.opts.controlStrokeActiveAlpha, - controlRadius: this.opts.controlRadiusActive, - onUpdate: () => this.drawAnimated(), - onComplete: () => this.draw() - }) - - - } else { - TweenLite.to(this.control, this.opts.durationActive, {x: this.xInactive}) - TweenLite.to(this.tempAnimated, this.opts.durationActive, { - colorProps: { - fill: this.opts.fill, - stroke: this.opts.stroke, - controlFill: this.opts.controlFill, - controlStroke: this.opts.controlStroke, - format: 'number' - }, - fillAlpha: this.opts.fillAlpha, - strokeWidth: this.opts.strokeWidth, - strokeAlpha: this.opts.strokeAlpha, - controlFillAlpha: this.opts.controlFillAlpha, - controlStrokeWidth: this.opts.controlStrokeWidth, - controlStrokeAlpha: this.opts.controlStrokeAlpha, - controlRadius: this.opts.controlRadius, - onUpdate: () => this.drawAnimated(), - onComplete: () => this.draw() - }) - } - } - - /** - * Gets or sets the disabled state. When disabled, the switch cannot be clicked. - * - * @member {boolean} - */ - get disabled() { - return this._disabled - } - - set disabled(value) { - - this._disabled = value - - if (this._disabled) { - this.switchObj.interactive = false - this.switchObj.buttonMode = false - this.switchObj.alpha = .5 - this.control.alpha = .5 - } else { - this.switchObj.interactive = true - this.switchObj.buttonMode = true - this.switchObj.alpha = 1 - this.control.alpha = 1 - } - } - - /** - * Shows the switch (sets his alpha values to 1). - * - * @return {Switch} A reference to the switch for chaining. - */ - show() { - - this.opts.strokeAlpha = 1 - this.opts.strokeActiveAlpha = 1 - this.opts.fillAlpha = 1 - this.opts.fillActiveAlpha = 1 - this.opts.controlStrokeAlpha = 1 - this.opts.controlStrokeActiveAlpha = 1 - this.opts.controlFillAlpha = 1 - this.opts.controlFillActiveAlpha = 1 - - this.layout() - - return this - } - - /** - * Hides the switch (sets his alpha values to 1). - * - * @return {Switch} A reference to the switch for chaining. - */ - hide() { - - this.opts.strokeAlpha = 0 - this.opts.strokeActiveAlpha = 0 - this.opts.fillAlpha = 0 - this.opts.fillActiveAlpha = 0 - this.opts.controlStrokeAlpha = 0 - this.opts.controlStrokeActiveAlpha = 0 - this.opts.controlFillAlpha = 0 - this.opts.controlFillActiveAlpha = 0 - - this.layout() return this } diff --git a/package-lock.json b/package-lock.json index afa5e69..4473515 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2439,11 +2439,6 @@ } } }, - "highlight.js": { - "version": "9.15.6", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.6.tgz", - "integrity": "sha512-zozTAWM1D6sozHo8kqhfYgsac+B+q0PmsjXeyDrYIHHcBN0zTVT66+s2GW1GZv7DbyaROdLXKdabwS/WqPyIdQ==" - }, "homedir-polyfill": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", diff --git a/package.json b/package.json index ad356f8..3a38c99 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,6 @@ "dependencies": { "gsap": "^2.1.2", "hammerjs": "^2.0.8", - "highlight.js": "^9.15.6", "material-design-icons": "^3.0.1", "optimal-select": "^4.0.1", "pixi-compressed-textures": "^1.1.8",