Created
January 28, 2025 17:42
-
-
Save tester248/b33627be0b3f00270c730e026f40cbbf to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! For license information please see server.js.LICENSE.txt */ | |
!(function(modules) { | |
var installedModules = {}; | |
function __webpack_require__(moduleId) { | |
if (installedModules[moduleId]) return installedModules[moduleId].exports; | |
var module = installedModules[moduleId] = { | |
i: moduleId, | |
l: !1, | |
exports: {} | |
}; | |
return modules[moduleId].call(module.exports, module, module.exports, __webpack_require__), | |
module.l = !0, module.exports; | |
} | |
__webpack_require__.m = modules, __webpack_require__.c = installedModules, __webpack_require__.d = function(exports, name, getter) { | |
__webpack_require__.o(exports, name) || Object.defineProperty(exports, name, { | |
enumerable: !0, | |
get: getter | |
}); | |
}, __webpack_require__.r = function(exports) { | |
"undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports, Symbol.toStringTag, { | |
value: "Module" | |
}), Object.defineProperty(exports, "__esModule", { | |
value: !0 | |
}); | |
}, __webpack_require__.t = function(value, mode) { | |
if (1 & mode && (value = __webpack_require__(value)), 8 & mode) return value; | |
if (4 & mode && "object" == typeof value && value && value.__esModule) return value; | |
var ns = Object.create(null); | |
if (__webpack_require__.r(ns), Object.defineProperty(ns, "default", { | |
enumerable: !0, | |
value: value | |
}), 2 & mode && "string" != typeof value) for (var key in value) __webpack_require__.d(ns, key, function(key) { | |
return value[key]; | |
}.bind(null, key)); | |
return ns; | |
}, __webpack_require__.n = function(module) { | |
var getter = module && module.__esModule ? function() { | |
return module.default; | |
} : function() { | |
return module; | |
}; | |
return __webpack_require__.d(getter, "a", getter), getter; | |
}, __webpack_require__.o = function(object, property) { | |
return Object.prototype.hasOwnProperty.call(object, property); | |
}, __webpack_require__.p = "", __webpack_require__(__webpack_require__.s = 518); | |
})([ function(module, exports) { | |
module.exports = require("util"); | |
}, function(module, exports, __webpack_require__) { | |
(function(module) { | |
module.exports = (function() { | |
"use strict"; | |
var hookCallback; | |
function utils_hooks__hooks() { | |
return hookCallback.apply(null, arguments); | |
} | |
function isArray(input) { | |
return "[object Array]" === Object.prototype.toString.call(input); | |
} | |
function isDate(input) { | |
return input instanceof Date || "[object Date]" === Object.prototype.toString.call(input); | |
} | |
function hasOwnProp(a, b) { | |
return Object.prototype.hasOwnProperty.call(a, b); | |
} | |
function extend(a, b) { | |
for (var i in b) hasOwnProp(b, i) && (a[i] = b[i]); | |
return hasOwnProp(b, "toString") && (a.toString = b.toString), hasOwnProp(b, "valueOf") && (a.valueOf = b.valueOf), | |
a; | |
} | |
function create_utc__createUTC(input, format, locale, strict) { | |
return createLocalOrUTC(input, format, locale, strict, !0).utc(); | |
} | |
function getParsingFlags(m) { | |
return null == m._pf && (m._pf = { | |
empty: !1, | |
unusedTokens: [], | |
unusedInput: [], | |
overflow: -2, | |
charsLeftOver: 0, | |
nullInput: !1, | |
invalidMonth: null, | |
invalidFormat: !1, | |
userInvalidated: !1, | |
iso: !1 | |
}), m._pf; | |
} | |
function valid__isValid(m) { | |
if (null == m._isValid) { | |
var flags = getParsingFlags(m); | |
m._isValid = !(isNaN(m._d.getTime()) || !(flags.overflow < 0) || flags.empty || flags.invalidMonth || flags.invalidWeekday || flags.nullInput || flags.invalidFormat || flags.userInvalidated), | |
m._strict && (m._isValid = m._isValid && 0 === flags.charsLeftOver && 0 === flags.unusedTokens.length && void 0 === flags.bigHour); | |
} | |
return m._isValid; | |
} | |
function valid__createInvalid(flags) { | |
var m = create_utc__createUTC(NaN); | |
return null != flags ? extend(getParsingFlags(m), flags) : getParsingFlags(m).userInvalidated = !0, | |
m; | |
} | |
var momentProperties = utils_hooks__hooks.momentProperties = []; | |
function copyConfig(to, from) { | |
var i, prop, val; | |
if (void 0 !== from._isAMomentObject && (to._isAMomentObject = from._isAMomentObject), | |
void 0 !== from._i && (to._i = from._i), void 0 !== from._f && (to._f = from._f), | |
void 0 !== from._l && (to._l = from._l), void 0 !== from._strict && (to._strict = from._strict), | |
void 0 !== from._tzm && (to._tzm = from._tzm), void 0 !== from._isUTC && (to._isUTC = from._isUTC), | |
void 0 !== from._offset && (to._offset = from._offset), void 0 !== from._pf && (to._pf = getParsingFlags(from)), | |
void 0 !== from._locale && (to._locale = from._locale), momentProperties.length > 0) for (i in momentProperties) void 0 !== (val = from[prop = momentProperties[i]]) && (to[prop] = val); | |
return to; | |
} | |
var updateInProgress = !1; | |
function Moment(config) { | |
copyConfig(this, config), this._d = new Date(null != config._d ? config._d.getTime() : NaN), | |
!1 === updateInProgress && (updateInProgress = !0, utils_hooks__hooks.updateOffset(this), | |
updateInProgress = !1); | |
} | |
function isMoment(obj) { | |
return obj instanceof Moment || null != obj && null != obj._isAMomentObject; | |
} | |
function absFloor(number) { | |
return number < 0 ? Math.ceil(number) : Math.floor(number); | |
} | |
function toInt(argumentForCoercion) { | |
var coercedNumber = +argumentForCoercion, value = 0; | |
return 0 !== coercedNumber && isFinite(coercedNumber) && (value = absFloor(coercedNumber)), | |
value; | |
} | |
function compareArrays(array1, array2, dontConvert) { | |
var i, len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0; | |
for (i = 0; i < len; i++) (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) && diffs++; | |
return diffs + lengthDiff; | |
} | |
function Locale() {} | |
var globalLocale, locales = {}; | |
function normalizeLocale(key) { | |
return key ? key.toLowerCase().replace("_", "-") : key; | |
} | |
function loadLocale(name) { | |
var oldLocale = null; | |
if (!locales[name] && void 0 !== module && module && module.exports) try { | |
oldLocale = globalLocale._abbr, __webpack_require__(694)("./" + name), locale_locales__getSetGlobalLocale(oldLocale); | |
} catch (e) {} | |
return locales[name]; | |
} | |
function locale_locales__getSetGlobalLocale(key, values) { | |
var data; | |
return key && (data = void 0 === values ? locale_locales__getLocale(key) : defineLocale(key, values)) && (globalLocale = data), | |
globalLocale._abbr; | |
} | |
function defineLocale(name, values) { | |
return null !== values ? (values.abbr = name, locales[name] = locales[name] || new Locale, | |
locales[name].set(values), locale_locales__getSetGlobalLocale(name), locales[name]) : (delete locales[name], | |
null); | |
} | |
function locale_locales__getLocale(key) { | |
var locale; | |
if (key && key._locale && key._locale._abbr && (key = key._locale._abbr), !key) return globalLocale; | |
if (!isArray(key)) { | |
if (locale = loadLocale(key)) return locale; | |
key = [ key ]; | |
} | |
return (function(names) { | |
for (var j, next, locale, split, i = 0; i < names.length; ) { | |
for (j = (split = normalizeLocale(names[i]).split("-")).length, next = (next = normalizeLocale(names[i + 1])) ? next.split("-") : null; j > 0; ) { | |
if (locale = loadLocale(split.slice(0, j).join("-"))) return locale; | |
if (next && next.length >= j && compareArrays(split, next, !0) >= j - 1) break; | |
j--; | |
} | |
i++; | |
} | |
return null; | |
})(key); | |
} | |
var aliases = {}; | |
function addUnitAlias(unit, shorthand) { | |
var lowerCase = unit.toLowerCase(); | |
aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit; | |
} | |
function normalizeUnits(units) { | |
return "string" == typeof units ? aliases[units] || aliases[units.toLowerCase()] : void 0; | |
} | |
function normalizeObjectUnits(inputObject) { | |
var normalizedProp, prop, normalizedInput = {}; | |
for (prop in inputObject) hasOwnProp(inputObject, prop) && (normalizedProp = normalizeUnits(prop)) && (normalizedInput[normalizedProp] = inputObject[prop]); | |
return normalizedInput; | |
} | |
function makeGetSet(unit, keepTime) { | |
return function(value) { | |
return null != value ? (get_set__set(this, unit, value), utils_hooks__hooks.updateOffset(this, keepTime), | |
this) : get_set__get(this, unit); | |
}; | |
} | |
function get_set__get(mom, unit) { | |
return mom._d["get" + (mom._isUTC ? "UTC" : "") + unit](); | |
} | |
function get_set__set(mom, unit, value) { | |
return mom._d["set" + (mom._isUTC ? "UTC" : "") + unit](value); | |
} | |
function getSet(units, value) { | |
var unit; | |
if ("object" == typeof units) for (unit in units) this.set(unit, units[unit]); else if ("function" == typeof this[units = normalizeUnits(units)]) return this[units](value); | |
return this; | |
} | |
function zeroFill(number, targetLength, forceSign) { | |
var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length; | |
return (number >= 0 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; | |
} | |
var formattingTokens = /(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {}; | |
function addFormatToken(token, padded, ordinal, callback) { | |
var func = callback; | |
"string" == typeof callback && (func = function() { | |
return this[callback](); | |
}), token && (formatTokenFunctions[token] = func), padded && (formatTokenFunctions[padded[0]] = function() { | |
return zeroFill(func.apply(this, arguments), padded[1], padded[2]); | |
}), ordinal && (formatTokenFunctions[ordinal] = function() { | |
return this.localeData().ordinal(func.apply(this, arguments), token); | |
}); | |
} | |
function formatMoment(m, format) { | |
return m.isValid() ? (format = expandFormat(format, m.localeData()), formatFunctions[format] = formatFunctions[format] || (function(format) { | |
var i, length, input, array = format.match(formattingTokens); | |
for (i = 0, length = array.length; i < length; i++) formatTokenFunctions[array[i]] ? array[i] = formatTokenFunctions[array[i]] : array[i] = (input = array[i]).match(/\[[\s\S]/) ? input.replace(/^\[|\]$/g, "") : input.replace(/\\/g, ""); | |
return function(mom) { | |
var output = ""; | |
for (i = 0; i < length; i++) output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; | |
return output; | |
}; | |
})(format), formatFunctions[format](m)) : m.localeData().invalidDate(); | |
} | |
function expandFormat(format, locale) { | |
var i = 5; | |
function replaceLongDateFormatTokens(input) { | |
return locale.longDateFormat(input) || input; | |
} | |
for (localFormattingTokens.lastIndex = 0; i >= 0 && localFormattingTokens.test(format); ) format = format.replace(localFormattingTokens, replaceLongDateFormatTokens), | |
localFormattingTokens.lastIndex = 0, i -= 1; | |
return format; | |
} | |
var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i, regexes = {}; | |
function addRegexToken(token, regex, strictRegex) { | |
var sth; | |
regexes[token] = "function" == typeof (sth = regex) && "[object Function]" === Object.prototype.toString.call(sth) ? regex : function(isStrict) { | |
return isStrict && strictRegex ? strictRegex : regex; | |
}; | |
} | |
function getParseRegexForToken(token, config) { | |
return hasOwnProp(regexes, token) ? regexes[token](config._strict, config._locale) : new RegExp(token.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, (function(matched, p1, p2, p3, p4) { | |
return p1 || p2 || p3 || p4; | |
})).replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&")); | |
} | |
var tokens = {}; | |
function addParseToken(token, callback) { | |
var i, func = callback; | |
for ("string" == typeof token && (token = [ token ]), "number" == typeof callback && (func = function(input, array) { | |
array[callback] = toInt(input); | |
}), i = 0; i < token.length; i++) tokens[token[i]] = func; | |
} | |
function addWeekParseToken(token, callback) { | |
addParseToken(token, (function(input, array, config, token) { | |
config._w = config._w || {}, callback(input, config._w, config, token); | |
})); | |
} | |
function addTimeToArrayFromToken(token, input, config) { | |
null != input && hasOwnProp(tokens, token) && tokens[token](input, config._a, config, token); | |
} | |
function daysInMonth(year, month) { | |
return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); | |
} | |
addFormatToken("M", [ "MM", 2 ], "Mo", (function() { | |
return this.month() + 1; | |
})), addFormatToken("MMM", 0, 0, (function(format) { | |
return this.localeData().monthsShort(this, format); | |
})), addFormatToken("MMMM", 0, 0, (function(format) { | |
return this.localeData().months(this, format); | |
})), addUnitAlias("month", "M"), addRegexToken("M", match1to2), addRegexToken("MM", match1to2, match2), | |
addRegexToken("MMM", matchWord), addRegexToken("MMMM", matchWord), addParseToken([ "M", "MM" ], (function(input, array) { | |
array[1] = toInt(input) - 1; | |
})), addParseToken([ "MMM", "MMMM" ], (function(input, array, config, token) { | |
var month = config._locale.monthsParse(input, token, config._strict); | |
null != month ? array[1] = month : getParsingFlags(config).invalidMonth = input; | |
})); | |
var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split("_"); | |
var defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"); | |
function setMonth(mom, value) { | |
var dayOfMonth; | |
return "string" == typeof value && "number" != typeof (value = mom.localeData().monthsParse(value)) || (dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)), | |
mom._d["set" + (mom._isUTC ? "UTC" : "") + "Month"](value, dayOfMonth)), mom; | |
} | |
function getSetMonth(value) { | |
return null != value ? (setMonth(this, value), utils_hooks__hooks.updateOffset(this, !0), | |
this) : get_set__get(this, "Month"); | |
} | |
function checkOverflow(m) { | |
var overflow, a = m._a; | |
return a && -2 === getParsingFlags(m).overflow && (overflow = a[1] < 0 || a[1] > 11 ? 1 : a[2] < 1 || a[2] > daysInMonth(a[0], a[1]) ? 2 : a[3] < 0 || a[3] > 24 || 24 === a[3] && (0 !== a[4] || 0 !== a[5] || 0 !== a[6]) ? 3 : a[4] < 0 || a[4] > 59 ? 4 : a[5] < 0 || a[5] > 59 ? 5 : a[6] < 0 || a[6] > 999 ? 6 : -1, | |
getParsingFlags(m)._overflowDayOfYear && (overflow < 0 || overflow > 2) && (overflow = 2), | |
getParsingFlags(m).overflow = overflow), m; | |
} | |
function warn(msg) { | |
!1 === utils_hooks__hooks.suppressDeprecationWarnings && "undefined" != typeof console && console.warn && console.warn("Deprecation warning: " + msg); | |
} | |
function deprecate(msg, fn) { | |
var firstTime = !0; | |
return extend((function() { | |
return firstTime && (warn(msg + "\n" + (new Error).stack), firstTime = !1), fn.apply(this, arguments); | |
}), fn); | |
} | |
var deprecations = {}; | |
utils_hooks__hooks.suppressDeprecationWarnings = !1; | |
var from_string__isoRegex = /^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/, isoDates = [ [ "YYYYYY-MM-DD", /[+-]\d{6}-\d{2}-\d{2}/ ], [ "YYYY-MM-DD", /\d{4}-\d{2}-\d{2}/ ], [ "GGGG-[W]WW-E", /\d{4}-W\d{2}-\d/ ], [ "GGGG-[W]WW", /\d{4}-W\d{2}/ ], [ "YYYY-DDD", /\d{4}-\d{3}/ ] ], isoTimes = [ [ "HH:mm:ss.SSSS", /(T| )\d\d:\d\d:\d\d\.\d+/ ], [ "HH:mm:ss", /(T| )\d\d:\d\d:\d\d/ ], [ "HH:mm", /(T| )\d\d:\d\d/ ], [ "HH", /(T| )\d\d/ ] ], aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; | |
function configFromISO(config) { | |
var i, l, string = config._i, match = from_string__isoRegex.exec(string); | |
if (match) { | |
for (getParsingFlags(config).iso = !0, i = 0, l = isoDates.length; i < l; i++) if (isoDates[i][1].exec(string)) { | |
config._f = isoDates[i][0]; | |
break; | |
} | |
for (i = 0, l = isoTimes.length; i < l; i++) if (isoTimes[i][1].exec(string)) { | |
config._f += (match[6] || " ") + isoTimes[i][0]; | |
break; | |
} | |
string.match(matchOffset) && (config._f += "Z"), configFromStringAndFormat(config); | |
} else config._isValid = !1; | |
} | |
function createDate(y, m, d, h, M, s, ms) { | |
var date = new Date(y, m, d, h, M, s, ms); | |
return y < 1970 && date.setFullYear(y), date; | |
} | |
function createUTCDate(y) { | |
var date = new Date(Date.UTC.apply(null, arguments)); | |
return y < 1970 && date.setUTCFullYear(y), date; | |
} | |
function daysInYear(year) { | |
return isLeapYear(year) ? 366 : 365; | |
} | |
function isLeapYear(year) { | |
return year % 4 == 0 && year % 100 != 0 || year % 400 == 0; | |
} | |
utils_hooks__hooks.createFromInputFallback = deprecate("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.", (function(config) { | |
config._d = new Date(config._i + (config._useUTC ? " UTC" : "")); | |
})), addFormatToken(0, [ "YY", 2 ], 0, (function() { | |
return this.year() % 100; | |
})), addFormatToken(0, [ "YYYY", 4 ], 0, "year"), addFormatToken(0, [ "YYYYY", 5 ], 0, "year"), | |
addFormatToken(0, [ "YYYYYY", 6, !0 ], 0, "year"), addUnitAlias("year", "y"), addRegexToken("Y", matchSigned), | |
addRegexToken("YY", match1to2, match2), addRegexToken("YYYY", match1to4, match4), | |
addRegexToken("YYYYY", match1to6, match6), addRegexToken("YYYYYY", match1to6, match6), | |
addParseToken([ "YYYYY", "YYYYYY" ], 0), addParseToken("YYYY", (function(input, array) { | |
array[0] = 2 === input.length ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); | |
})), addParseToken("YY", (function(input, array) { | |
array[0] = utils_hooks__hooks.parseTwoDigitYear(input); | |
})), utils_hooks__hooks.parseTwoDigitYear = function(input) { | |
return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3); | |
}; | |
var getSetYear = makeGetSet("FullYear", !1); | |
function weekOfYear(mom, firstDayOfWeek, firstDayOfWeekOfYear) { | |
var adjustedMoment, end = firstDayOfWeekOfYear - firstDayOfWeek, daysToDayOfWeek = firstDayOfWeekOfYear - mom.day(); | |
return daysToDayOfWeek > end && (daysToDayOfWeek -= 7), daysToDayOfWeek < end - 7 && (daysToDayOfWeek += 7), | |
adjustedMoment = local__createLocal(mom).add(daysToDayOfWeek, "d"), { | |
week: Math.ceil(adjustedMoment.dayOfYear() / 7), | |
year: adjustedMoment.year() | |
}; | |
} | |
addFormatToken("w", [ "ww", 2 ], "wo", "week"), addFormatToken("W", [ "WW", 2 ], "Wo", "isoWeek"), | |
addUnitAlias("week", "w"), addUnitAlias("isoWeek", "W"), addRegexToken("w", match1to2), | |
addRegexToken("ww", match1to2, match2), addRegexToken("W", match1to2), addRegexToken("WW", match1to2, match2), | |
addWeekParseToken([ "w", "ww", "W", "WW" ], (function(input, week, config, token) { | |
week[token.substr(0, 1)] = toInt(input); | |
})); | |
function defaults(a, b, c) { | |
return null != a ? a : null != b ? b : c; | |
} | |
function configFromArray(config) { | |
var i, date, currentDate, yearToUse, input = []; | |
if (!config._d) { | |
for (currentDate = (function(config) { | |
var now = new Date; | |
return config._useUTC ? [ now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() ] : [ now.getFullYear(), now.getMonth(), now.getDate() ]; | |
})(config), config._w && null == config._a[2] && null == config._a[1] && (function(config) { | |
var w, weekYear, week, weekday, dow, doy, temp; | |
null != (w = config._w).GG || null != w.W || null != w.E ? (dow = 1, doy = 4, weekYear = defaults(w.GG, config._a[0], weekOfYear(local__createLocal(), 1, 4).year), | |
week = defaults(w.W, 1), weekday = defaults(w.E, 1)) : (dow = config._locale._week.dow, | |
doy = config._locale._week.doy, weekYear = defaults(w.gg, config._a[0], weekOfYear(local__createLocal(), dow, doy).year), | |
week = defaults(w.w, 1), null != w.d ? (weekday = w.d) < dow && ++week : weekday = null != w.e ? w.e + dow : dow), | |
temp = (function(year, week, weekday, firstDayOfWeekOfYear, firstDayOfWeek) { | |
var dayOfYear, week1Jan = 6 + firstDayOfWeek - firstDayOfWeekOfYear, d = createUTCDate(year, 0, 1 + week1Jan).getUTCDay(); | |
return d < firstDayOfWeek && (d += 7), { | |
year: (dayOfYear = 1 + week1Jan + 7 * (week - 1) - d + (weekday = null != weekday ? 1 * weekday : firstDayOfWeek)) > 0 ? year : year - 1, | |
dayOfYear: dayOfYear > 0 ? dayOfYear : daysInYear(year - 1) + dayOfYear | |
}; | |
})(weekYear, week, weekday, doy, dow), config._a[0] = temp.year, config._dayOfYear = temp.dayOfYear; | |
})(config), config._dayOfYear && (yearToUse = defaults(config._a[0], currentDate[0]), | |
config._dayOfYear > daysInYear(yearToUse) && (getParsingFlags(config)._overflowDayOfYear = !0), | |
date = createUTCDate(yearToUse, 0, config._dayOfYear), config._a[1] = date.getUTCMonth(), | |
config._a[2] = date.getUTCDate()), i = 0; i < 3 && null == config._a[i]; ++i) config._a[i] = input[i] = currentDate[i]; | |
for (;i < 7; i++) config._a[i] = input[i] = null == config._a[i] ? 2 === i ? 1 : 0 : config._a[i]; | |
24 === config._a[3] && 0 === config._a[4] && 0 === config._a[5] && 0 === config._a[6] && (config._nextDay = !0, | |
config._a[3] = 0), config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input), | |
null != config._tzm && config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm), | |
config._nextDay && (config._a[3] = 24); | |
} | |
} | |
function configFromStringAndFormat(config) { | |
if (config._f !== utils_hooks__hooks.ISO_8601) { | |
config._a = [], getParsingFlags(config).empty = !0; | |
var i, parsedInput, tokens, token, skipped, string = "" + config._i, stringLength = string.length, totalParsedInputLength = 0; | |
for (tokens = expandFormat(config._f, config._locale).match(formattingTokens) || [], | |
i = 0; i < tokens.length; i++) token = tokens[i], (parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]) && ((skipped = string.substr(0, string.indexOf(parsedInput))).length > 0 && getParsingFlags(config).unusedInput.push(skipped), | |
string = string.slice(string.indexOf(parsedInput) + parsedInput.length), totalParsedInputLength += parsedInput.length), | |
formatTokenFunctions[token] ? (parsedInput ? getParsingFlags(config).empty = !1 : getParsingFlags(config).unusedTokens.push(token), | |
addTimeToArrayFromToken(token, parsedInput, config)) : config._strict && !parsedInput && getParsingFlags(config).unusedTokens.push(token); | |
getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength, string.length > 0 && getParsingFlags(config).unusedInput.push(string), | |
!0 === getParsingFlags(config).bigHour && config._a[3] <= 12 && config._a[3] > 0 && (getParsingFlags(config).bigHour = void 0), | |
config._a[3] = (function(locale, hour, meridiem) { | |
var isPm; | |
return null == meridiem ? hour : null != locale.meridiemHour ? locale.meridiemHour(hour, meridiem) : null != locale.isPM ? ((isPm = locale.isPM(meridiem)) && hour < 12 && (hour += 12), | |
isPm || 12 !== hour || (hour = 0), hour) : hour; | |
})(config._locale, config._a[3], config._meridiem), configFromArray(config), checkOverflow(config); | |
} else configFromISO(config); | |
} | |
function prepareConfig(config) { | |
var input = config._i, format = config._f; | |
return config._locale = config._locale || locale_locales__getLocale(config._l), | |
null === input || void 0 === format && "" === input ? valid__createInvalid({ | |
nullInput: !0 | |
}) : ("string" == typeof input && (config._i = input = config._locale.preparse(input)), | |
isMoment(input) ? new Moment(checkOverflow(input)) : (isArray(format) ? (function(config) { | |
var tempConfig, bestMoment, scoreToBeat, i, currentScore; | |
if (0 === config._f.length) return getParsingFlags(config).invalidFormat = !0, void (config._d = new Date(NaN)); | |
for (i = 0; i < config._f.length; i++) currentScore = 0, tempConfig = copyConfig({}, config), | |
null != config._useUTC && (tempConfig._useUTC = config._useUTC), tempConfig._f = config._f[i], | |
configFromStringAndFormat(tempConfig), valid__isValid(tempConfig) && (currentScore += getParsingFlags(tempConfig).charsLeftOver, | |
currentScore += 10 * getParsingFlags(tempConfig).unusedTokens.length, getParsingFlags(tempConfig).score = currentScore, | |
(null == scoreToBeat || currentScore < scoreToBeat) && (scoreToBeat = currentScore, | |
bestMoment = tempConfig)); | |
extend(config, bestMoment || tempConfig); | |
})(config) : format ? configFromStringAndFormat(config) : isDate(input) ? config._d = input : (function(config) { | |
var input = config._i; | |
void 0 === input ? config._d = new Date : isDate(input) ? config._d = new Date(+input) : "string" == typeof input ? (function(config) { | |
var matched = aspNetJsonRegex.exec(config._i); | |
null === matched ? (configFromISO(config), !1 === config._isValid && (delete config._isValid, | |
utils_hooks__hooks.createFromInputFallback(config))) : config._d = new Date(+matched[1]); | |
})(config) : isArray(input) ? (config._a = (function(arr, fn) { | |
var i, res = []; | |
for (i = 0; i < arr.length; ++i) res.push(fn(arr[i], i)); | |
return res; | |
})(input.slice(0), (function(obj) { | |
return parseInt(obj, 10); | |
})), configFromArray(config)) : "object" == typeof input ? (function(config) { | |
if (!config._d) { | |
var i = normalizeObjectUnits(config._i); | |
config._a = [ i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond ], | |
configFromArray(config); | |
} | |
})(config) : "number" == typeof input ? config._d = new Date(input) : utils_hooks__hooks.createFromInputFallback(config); | |
})(config), config)); | |
} | |
function createLocalOrUTC(input, format, locale, strict, isUTC) { | |
var res, c = {}; | |
return "boolean" == typeof locale && (strict = locale, locale = void 0), c._isAMomentObject = !0, | |
c._useUTC = c._isUTC = isUTC, c._l = locale, c._i = input, c._f = format, c._strict = strict, | |
(res = new Moment(checkOverflow(prepareConfig(c))))._nextDay && (res.add(1, "d"), | |
res._nextDay = void 0), res; | |
} | |
function local__createLocal(input, format, locale, strict) { | |
return createLocalOrUTC(input, format, locale, strict, !1); | |
} | |
addFormatToken("DDD", [ "DDDD", 3 ], "DDDo", "dayOfYear"), addUnitAlias("dayOfYear", "DDD"), | |
addRegexToken("DDD", match1to3), addRegexToken("DDDD", match3), addParseToken([ "DDD", "DDDD" ], (function(input, array, config) { | |
config._dayOfYear = toInt(input); | |
})), utils_hooks__hooks.ISO_8601 = function() {}; | |
var prototypeMin = deprecate("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548", (function() { | |
var other = local__createLocal.apply(null, arguments); | |
return other < this ? this : other; | |
})), prototypeMax = deprecate("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548", (function() { | |
var other = local__createLocal.apply(null, arguments); | |
return other > this ? this : other; | |
})); | |
function pickBy(fn, moments) { | |
var res, i; | |
if (1 === moments.length && isArray(moments[0]) && (moments = moments[0]), !moments.length) return local__createLocal(); | |
for (res = moments[0], i = 1; i < moments.length; ++i) moments[i].isValid() && !moments[i][fn](res) || (res = moments[i]); | |
return res; | |
} | |
function Duration(duration) { | |
var normalizedInput = normalizeObjectUnits(duration), years = normalizedInput.year || 0, quarters = normalizedInput.quarter || 0, months = normalizedInput.month || 0, weeks = normalizedInput.week || 0, days = normalizedInput.day || 0, hours = normalizedInput.hour || 0, minutes = normalizedInput.minute || 0, seconds = normalizedInput.second || 0, milliseconds = normalizedInput.millisecond || 0; | |
this._milliseconds = +milliseconds + 1e3 * seconds + 6e4 * minutes + 36e5 * hours, | |
this._days = +days + 7 * weeks, this._months = +months + 3 * quarters + 12 * years, | |
this._data = {}, this._locale = locale_locales__getLocale(), this._bubble(); | |
} | |
function isDuration(obj) { | |
return obj instanceof Duration; | |
} | |
function offset(token, separator) { | |
addFormatToken(token, 0, 0, (function() { | |
var offset = this.utcOffset(), sign = "+"; | |
return offset < 0 && (offset = -offset, sign = "-"), sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2); | |
})); | |
} | |
offset("Z", ":"), offset("ZZ", ""), addRegexToken("Z", matchOffset), addRegexToken("ZZ", matchOffset), | |
addParseToken([ "Z", "ZZ" ], (function(input, array, config) { | |
config._useUTC = !0, config._tzm = offsetFromString(input); | |
})); | |
var chunkOffset = /([\+\-]|\d\d)/gi; | |
function offsetFromString(string) { | |
var matches = (string || "").match(matchOffset) || [], parts = ((matches[matches.length - 1] || []) + "").match(chunkOffset) || [ "-", 0, 0 ], minutes = 60 * parts[1] + toInt(parts[2]); | |
return "+" === parts[0] ? minutes : -minutes; | |
} | |
function cloneWithOffset(input, model) { | |
var res, diff; | |
return model._isUTC ? (res = model.clone(), diff = (isMoment(input) || isDate(input) ? +input : +local__createLocal(input)) - +res, | |
res._d.setTime(+res._d + diff), utils_hooks__hooks.updateOffset(res, !1), res) : local__createLocal(input).local(); | |
} | |
function getDateOffset(m) { | |
return 15 * -Math.round(m._d.getTimezoneOffset() / 15); | |
} | |
function isUtc() { | |
return this._isUTC && 0 === this._offset; | |
} | |
utils_hooks__hooks.updateOffset = function() {}; | |
var aspNetRegex = /(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/, create__isoRegex = /^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/; | |
function create__createDuration(input, key) { | |
var sign, ret, diffRes, base, other, res, duration = input, match = null; | |
return isDuration(input) ? duration = { | |
ms: input._milliseconds, | |
d: input._days, | |
M: input._months | |
} : "number" == typeof input ? (duration = {}, key ? duration[key] = input : duration.milliseconds = input) : (match = aspNetRegex.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, | |
duration = { | |
y: 0, | |
d: toInt(match[2]) * sign, | |
h: toInt(match[3]) * sign, | |
m: toInt(match[4]) * sign, | |
s: toInt(match[5]) * sign, | |
ms: toInt(match[6]) * sign | |
}) : (match = create__isoRegex.exec(input)) ? (sign = "-" === match[1] ? -1 : 1, | |
duration = { | |
y: parseIso(match[2], sign), | |
M: parseIso(match[3], sign), | |
d: parseIso(match[4], sign), | |
h: parseIso(match[5], sign), | |
m: parseIso(match[6], sign), | |
s: parseIso(match[7], sign), | |
w: parseIso(match[8], sign) | |
}) : null == duration ? duration = {} : "object" == typeof duration && ("from" in duration || "to" in duration) && (base = local__createLocal(duration.from), | |
other = cloneWithOffset(other = local__createLocal(duration.to), base), base.isBefore(other) ? res = positiveMomentsDifference(base, other) : ((res = positiveMomentsDifference(other, base)).milliseconds = -res.milliseconds, | |
res.months = -res.months), (duration = {}).ms = (diffRes = res).milliseconds, duration.M = diffRes.months), | |
ret = new Duration(duration), isDuration(input) && hasOwnProp(input, "_locale") && (ret._locale = input._locale), | |
ret; | |
} | |
function parseIso(inp, sign) { | |
var res = inp && parseFloat(inp.replace(",", ".")); | |
return (isNaN(res) ? 0 : res) * sign; | |
} | |
function positiveMomentsDifference(base, other) { | |
var res = { | |
milliseconds: 0, | |
months: 0 | |
}; | |
return res.months = other.month() - base.month() + 12 * (other.year() - base.year()), | |
base.clone().add(res.months, "M").isAfter(other) && --res.months, res.milliseconds = +other - +base.clone().add(res.months, "M"), | |
res; | |
} | |
function createAdder(direction, name) { | |
return function(val, period) { | |
var tmp; | |
return null === period || isNaN(+period) || ((function(name, msg) { | |
deprecations[name] || (warn(msg), deprecations[name] = !0); | |
})(name, "moment()." + name + "(period, number) is deprecated. Please use moment()." + name + "(number, period)."), | |
tmp = val, val = period, period = tmp), add_subtract__addSubtract(this, create__createDuration(val = "string" == typeof val ? +val : val, period), direction), | |
this; | |
}; | |
} | |
function add_subtract__addSubtract(mom, duration, isAdding, updateOffset) { | |
var milliseconds = duration._milliseconds, days = duration._days, months = duration._months; | |
updateOffset = null == updateOffset || updateOffset, milliseconds && mom._d.setTime(+mom._d + milliseconds * isAdding), | |
days && get_set__set(mom, "Date", get_set__get(mom, "Date") + days * isAdding), | |
months && setMonth(mom, get_set__get(mom, "Month") + months * isAdding), updateOffset && utils_hooks__hooks.updateOffset(mom, days || months); | |
} | |
create__createDuration.fn = Duration.prototype; | |
var add_subtract__add = createAdder(1, "add"), add_subtract__subtract = createAdder(-1, "subtract"); | |
function moment_format__toISOString() { | |
var m = this.clone().utc(); | |
return 0 < m.year() && m.year() <= 9999 ? "function" == typeof Date.prototype.toISOString ? this.toDate().toISOString() : formatMoment(m, "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]") : formatMoment(m, "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]"); | |
} | |
function locale(key) { | |
var newLocaleData; | |
return void 0 === key ? this._locale._abbr : (null != (newLocaleData = locale_locales__getLocale(key)) && (this._locale = newLocaleData), | |
this); | |
} | |
utils_hooks__hooks.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ"; | |
var lang = deprecate("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.", (function(key) { | |
return void 0 === key ? this.localeData() : this.locale(key); | |
})); | |
function localeData() { | |
return this._locale; | |
} | |
function addWeekYearFormatToken(token, getter) { | |
addFormatToken(0, [ token, token.length ], 0, getter); | |
} | |
function weeksInYear(year, dow, doy) { | |
return weekOfYear(local__createLocal([ year, 11, 31 + dow - doy ]), dow, doy).week; | |
} | |
addFormatToken(0, [ "gg", 2 ], 0, (function() { | |
return this.weekYear() % 100; | |
})), addFormatToken(0, [ "GG", 2 ], 0, (function() { | |
return this.isoWeekYear() % 100; | |
})), addWeekYearFormatToken("gggg", "weekYear"), addWeekYearFormatToken("ggggg", "weekYear"), | |
addWeekYearFormatToken("GGGG", "isoWeekYear"), addWeekYearFormatToken("GGGGG", "isoWeekYear"), | |
addUnitAlias("weekYear", "gg"), addUnitAlias("isoWeekYear", "GG"), addRegexToken("G", matchSigned), | |
addRegexToken("g", matchSigned), addRegexToken("GG", match1to2, match2), addRegexToken("gg", match1to2, match2), | |
addRegexToken("GGGG", match1to4, match4), addRegexToken("gggg", match1to4, match4), | |
addRegexToken("GGGGG", match1to6, match6), addRegexToken("ggggg", match1to6, match6), | |
addWeekParseToken([ "gggg", "ggggg", "GGGG", "GGGGG" ], (function(input, week, config, token) { | |
week[token.substr(0, 2)] = toInt(input); | |
})), addWeekParseToken([ "gg", "GG" ], (function(input, week, config, token) { | |
week[token] = utils_hooks__hooks.parseTwoDigitYear(input); | |
})), addFormatToken("Q", 0, 0, "quarter"), addUnitAlias("quarter", "Q"), addRegexToken("Q", match1), | |
addParseToken("Q", (function(input, array) { | |
array[1] = 3 * (toInt(input) - 1); | |
})), addFormatToken("D", [ "DD", 2 ], "Do", "date"), addUnitAlias("date", "D"), | |
addRegexToken("D", match1to2), addRegexToken("DD", match1to2, match2), addRegexToken("Do", (function(isStrict, locale) { | |
return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; | |
})), addParseToken([ "D", "DD" ], 2), addParseToken("Do", (function(input, array) { | |
array[2] = toInt(input.match(match1to2)[0]); | |
})); | |
var getSetDayOfMonth = makeGetSet("Date", !0); | |
addFormatToken("d", 0, "do", "day"), addFormatToken("dd", 0, 0, (function(format) { | |
return this.localeData().weekdaysMin(this, format); | |
})), addFormatToken("ddd", 0, 0, (function(format) { | |
return this.localeData().weekdaysShort(this, format); | |
})), addFormatToken("dddd", 0, 0, (function(format) { | |
return this.localeData().weekdays(this, format); | |
})), addFormatToken("e", 0, 0, "weekday"), addFormatToken("E", 0, 0, "isoWeekday"), | |
addUnitAlias("day", "d"), addUnitAlias("weekday", "e"), addUnitAlias("isoWeekday", "E"), | |
addRegexToken("d", match1to2), addRegexToken("e", match1to2), addRegexToken("E", match1to2), | |
addRegexToken("dd", matchWord), addRegexToken("ddd", matchWord), addRegexToken("dddd", matchWord), | |
addWeekParseToken([ "dd", "ddd", "dddd" ], (function(input, week, config) { | |
var weekday = config._locale.weekdaysParse(input); | |
null != weekday ? week.d = weekday : getParsingFlags(config).invalidWeekday = input; | |
})), addWeekParseToken([ "d", "e", "E" ], (function(input, week, config, token) { | |
week[token] = toInt(input); | |
})); | |
var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"); | |
var defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"); | |
var defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"); | |
function meridiem(token, lowercase) { | |
addFormatToken(token, 0, 0, (function() { | |
return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); | |
})); | |
} | |
function matchMeridiem(isStrict, locale) { | |
return locale._meridiemParse; | |
} | |
addFormatToken("H", [ "HH", 2 ], 0, "hour"), addFormatToken("h", [ "hh", 2 ], 0, (function() { | |
return this.hours() % 12 || 12; | |
})), meridiem("a", !0), meridiem("A", !1), addUnitAlias("hour", "h"), addRegexToken("a", matchMeridiem), | |
addRegexToken("A", matchMeridiem), addRegexToken("H", match1to2), addRegexToken("h", match1to2), | |
addRegexToken("HH", match1to2, match2), addRegexToken("hh", match1to2, match2), | |
addParseToken([ "H", "HH" ], 3), addParseToken([ "a", "A" ], (function(input, array, config) { | |
config._isPm = config._locale.isPM(input), config._meridiem = input; | |
})), addParseToken([ "h", "hh" ], (function(input, array, config) { | |
array[3] = toInt(input), getParsingFlags(config).bigHour = !0; | |
})); | |
var getSetHour = makeGetSet("Hours", !0); | |
addFormatToken("m", [ "mm", 2 ], 0, "minute"), addUnitAlias("minute", "m"), addRegexToken("m", match1to2), | |
addRegexToken("mm", match1to2, match2), addParseToken([ "m", "mm" ], 4); | |
var getSetMinute = makeGetSet("Minutes", !1); | |
addFormatToken("s", [ "ss", 2 ], 0, "second"), addUnitAlias("second", "s"), addRegexToken("s", match1to2), | |
addRegexToken("ss", match1to2, match2), addParseToken([ "s", "ss" ], 5); | |
var token, getSetSecond = makeGetSet("Seconds", !1); | |
for (addFormatToken("S", 0, 0, (function() { | |
return ~~(this.millisecond() / 100); | |
})), addFormatToken(0, [ "SS", 2 ], 0, (function() { | |
return ~~(this.millisecond() / 10); | |
})), addFormatToken(0, [ "SSS", 3 ], 0, "millisecond"), addFormatToken(0, [ "SSSS", 4 ], 0, (function() { | |
return 10 * this.millisecond(); | |
})), addFormatToken(0, [ "SSSSS", 5 ], 0, (function() { | |
return 100 * this.millisecond(); | |
})), addFormatToken(0, [ "SSSSSS", 6 ], 0, (function() { | |
return 1e3 * this.millisecond(); | |
})), addFormatToken(0, [ "SSSSSSS", 7 ], 0, (function() { | |
return 1e4 * this.millisecond(); | |
})), addFormatToken(0, [ "SSSSSSSS", 8 ], 0, (function() { | |
return 1e5 * this.millisecond(); | |
})), addFormatToken(0, [ "SSSSSSSSS", 9 ], 0, (function() { | |
return 1e6 * this.millisecond(); | |
})), addUnitAlias("millisecond", "ms"), addRegexToken("S", match1to3, match1), addRegexToken("SS", match1to3, match2), | |
addRegexToken("SSS", match1to3, match3), token = "SSSS"; token.length <= 9; token += "S") addRegexToken(token, matchUnsigned); | |
function parseMs(input, array) { | |
array[6] = toInt(1e3 * ("0." + input)); | |
} | |
for (token = "S"; token.length <= 9; token += "S") addParseToken(token, parseMs); | |
var getSetMillisecond = makeGetSet("Milliseconds", !1); | |
addFormatToken("z", 0, 0, "zoneAbbr"), addFormatToken("zz", 0, 0, "zoneName"); | |
var momentPrototype__proto = Moment.prototype; | |
momentPrototype__proto.add = add_subtract__add, momentPrototype__proto.calendar = function(time, formats) { | |
var now = time || local__createLocal(), sod = cloneWithOffset(now, this).startOf("day"), diff = this.diff(sod, "days", !0), format = diff < -6 ? "sameElse" : diff < -1 ? "lastWeek" : diff < 0 ? "lastDay" : diff < 1 ? "sameDay" : diff < 2 ? "nextDay" : diff < 7 ? "nextWeek" : "sameElse"; | |
return this.format(formats && formats[format] || this.localeData().calendar(format, this, local__createLocal(now))); | |
}, momentPrototype__proto.clone = function() { | |
return new Moment(this); | |
}, momentPrototype__proto.diff = function(input, units, asFloat) { | |
var delta, output, a, b, wholeMonthDiff, anchor, that = cloneWithOffset(input, this), zoneDelta = 6e4 * (that.utcOffset() - this.utcOffset()); | |
return "year" === (units = normalizeUnits(units)) || "month" === units || "quarter" === units ? (a = this, | |
wholeMonthDiff = 12 * ((b = that).year() - a.year()) + (b.month() - a.month()), | |
anchor = a.clone().add(wholeMonthDiff, "months"), output = -(wholeMonthDiff + (b - anchor < 0 ? (b - anchor) / (anchor - a.clone().add(wholeMonthDiff - 1, "months")) : (b - anchor) / (a.clone().add(wholeMonthDiff + 1, "months") - anchor))), | |
"quarter" === units ? output /= 3 : "year" === units && (output /= 12)) : (delta = this - that, | |
output = "second" === units ? delta / 1e3 : "minute" === units ? delta / 6e4 : "hour" === units ? delta / 36e5 : "day" === units ? (delta - zoneDelta) / 864e5 : "week" === units ? (delta - zoneDelta) / 6048e5 : delta), | |
asFloat ? output : absFloor(output); | |
}, momentPrototype__proto.endOf = function(units) { | |
return void 0 === (units = normalizeUnits(units)) || "millisecond" === units ? this : this.startOf(units).add(1, "isoWeek" === units ? "week" : units).subtract(1, "ms"); | |
}, momentPrototype__proto.format = function(inputString) { | |
var output = formatMoment(this, inputString || utils_hooks__hooks.defaultFormat); | |
return this.localeData().postformat(output); | |
}, momentPrototype__proto.from = function(time, withoutSuffix) { | |
return this.isValid() ? create__createDuration({ | |
to: this, | |
from: time | |
}).locale(this.locale()).humanize(!withoutSuffix) : this.localeData().invalidDate(); | |
}, momentPrototype__proto.fromNow = function(withoutSuffix) { | |
return this.from(local__createLocal(), withoutSuffix); | |
}, momentPrototype__proto.to = function(time, withoutSuffix) { | |
return this.isValid() ? create__createDuration({ | |
from: this, | |
to: time | |
}).locale(this.locale()).humanize(!withoutSuffix) : this.localeData().invalidDate(); | |
}, momentPrototype__proto.toNow = function(withoutSuffix) { | |
return this.to(local__createLocal(), withoutSuffix); | |
}, momentPrototype__proto.get = getSet, momentPrototype__proto.invalidAt = function() { | |
return getParsingFlags(this).overflow; | |
}, momentPrototype__proto.isAfter = function(input, units) { | |
return "millisecond" === (units = normalizeUnits(void 0 !== units ? units : "millisecond")) ? +this > +(input = isMoment(input) ? input : local__createLocal(input)) : (isMoment(input) ? +input : +local__createLocal(input)) < +this.clone().startOf(units); | |
}, momentPrototype__proto.isBefore = function(input, units) { | |
var inputMs; | |
return "millisecond" === (units = normalizeUnits(void 0 !== units ? units : "millisecond")) ? +this < +(input = isMoment(input) ? input : local__createLocal(input)) : (inputMs = isMoment(input) ? +input : +local__createLocal(input), | |
+this.clone().endOf(units) < inputMs); | |
}, momentPrototype__proto.isBetween = function(from, to, units) { | |
return this.isAfter(from, units) && this.isBefore(to, units); | |
}, momentPrototype__proto.isSame = function(input, units) { | |
var inputMs; | |
return "millisecond" === (units = normalizeUnits(units || "millisecond")) ? +this == +(input = isMoment(input) ? input : local__createLocal(input)) : (inputMs = +local__createLocal(input), | |
+this.clone().startOf(units) <= inputMs && inputMs <= +this.clone().endOf(units)); | |
}, momentPrototype__proto.isValid = function() { | |
return valid__isValid(this); | |
}, momentPrototype__proto.lang = lang, momentPrototype__proto.locale = locale, momentPrototype__proto.localeData = localeData, | |
momentPrototype__proto.max = prototypeMax, momentPrototype__proto.min = prototypeMin, | |
momentPrototype__proto.parsingFlags = function() { | |
return extend({}, getParsingFlags(this)); | |
}, momentPrototype__proto.set = getSet, momentPrototype__proto.startOf = function(units) { | |
switch (units = normalizeUnits(units)) { | |
case "year": | |
this.month(0); | |
case "quarter": | |
case "month": | |
this.date(1); | |
case "week": | |
case "isoWeek": | |
case "day": | |
this.hours(0); | |
case "hour": | |
this.minutes(0); | |
case "minute": | |
this.seconds(0); | |
case "second": | |
this.milliseconds(0); | |
} | |
return "week" === units && this.weekday(0), "isoWeek" === units && this.isoWeekday(1), | |
"quarter" === units && this.month(3 * Math.floor(this.month() / 3)), this; | |
}, momentPrototype__proto.subtract = add_subtract__subtract, momentPrototype__proto.toArray = function() { | |
var m = this; | |
return [ m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond() ]; | |
}, momentPrototype__proto.toObject = function() { | |
var m = this; | |
return { | |
years: m.year(), | |
months: m.month(), | |
date: m.date(), | |
hours: m.hours(), | |
minutes: m.minutes(), | |
seconds: m.seconds(), | |
milliseconds: m.milliseconds() | |
}; | |
}, momentPrototype__proto.toDate = function() { | |
return this._offset ? new Date(+this) : this._d; | |
}, momentPrototype__proto.toISOString = moment_format__toISOString, momentPrototype__proto.toJSON = moment_format__toISOString, | |
momentPrototype__proto.toString = function() { | |
return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ"); | |
}, momentPrototype__proto.unix = function() { | |
return Math.floor(+this / 1e3); | |
}, momentPrototype__proto.valueOf = function() { | |
return +this._d - 6e4 * (this._offset || 0); | |
}, momentPrototype__proto.year = getSetYear, momentPrototype__proto.isLeapYear = function() { | |
return isLeapYear(this.year()); | |
}, momentPrototype__proto.weekYear = function(input) { | |
var year = weekOfYear(this, this.localeData()._week.dow, this.localeData()._week.doy).year; | |
return null == input ? year : this.add(input - year, "y"); | |
}, momentPrototype__proto.isoWeekYear = function(input) { | |
var year = weekOfYear(this, 1, 4).year; | |
return null == input ? year : this.add(input - year, "y"); | |
}, momentPrototype__proto.quarter = momentPrototype__proto.quarters = function(input) { | |
return null == input ? Math.ceil((this.month() + 1) / 3) : this.month(3 * (input - 1) + this.month() % 3); | |
}, momentPrototype__proto.month = getSetMonth, momentPrototype__proto.daysInMonth = function() { | |
return daysInMonth(this.year(), this.month()); | |
}, momentPrototype__proto.week = momentPrototype__proto.weeks = function(input) { | |
var week = this.localeData().week(this); | |
return null == input ? week : this.add(7 * (input - week), "d"); | |
}, momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = function(input) { | |
var week = weekOfYear(this, 1, 4).week; | |
return null == input ? week : this.add(7 * (input - week), "d"); | |
}, momentPrototype__proto.weeksInYear = function() { | |
var weekInfo = this.localeData()._week; | |
return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); | |
}, momentPrototype__proto.isoWeeksInYear = function() { | |
return weeksInYear(this.year(), 1, 4); | |
}, momentPrototype__proto.date = getSetDayOfMonth, momentPrototype__proto.day = momentPrototype__proto.days = function(input) { | |
var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); | |
return null != input ? (input = (function(input, locale) { | |
return "string" != typeof input ? input : isNaN(input) ? "number" == typeof (input = locale.weekdaysParse(input)) ? input : null : parseInt(input, 10); | |
})(input, this.localeData()), this.add(input - day, "d")) : day; | |
}, momentPrototype__proto.weekday = function(input) { | |
var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; | |
return null == input ? weekday : this.add(input - weekday, "d"); | |
}, momentPrototype__proto.isoWeekday = function(input) { | |
return null == input ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); | |
}, momentPrototype__proto.dayOfYear = function(input) { | |
var dayOfYear = Math.round((this.clone().startOf("day") - this.clone().startOf("year")) / 864e5) + 1; | |
return null == input ? dayOfYear : this.add(input - dayOfYear, "d"); | |
}, momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour, momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute, | |
momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond, momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond, | |
momentPrototype__proto.utcOffset = function(input, keepLocalTime) { | |
var localAdjust, offset = this._offset || 0; | |
return null != input ? ("string" == typeof input && (input = offsetFromString(input)), | |
Math.abs(input) < 16 && (input *= 60), !this._isUTC && keepLocalTime && (localAdjust = getDateOffset(this)), | |
this._offset = input, this._isUTC = !0, null != localAdjust && this.add(localAdjust, "m"), | |
offset !== input && (!keepLocalTime || this._changeInProgress ? add_subtract__addSubtract(this, create__createDuration(input - offset, "m"), 1, !1) : this._changeInProgress || (this._changeInProgress = !0, | |
utils_hooks__hooks.updateOffset(this, !0), this._changeInProgress = null)), this) : this._isUTC ? offset : getDateOffset(this); | |
}, momentPrototype__proto.utc = function(keepLocalTime) { | |
return this.utcOffset(0, keepLocalTime); | |
}, momentPrototype__proto.local = function(keepLocalTime) { | |
return this._isUTC && (this.utcOffset(0, keepLocalTime), this._isUTC = !1, keepLocalTime && this.subtract(getDateOffset(this), "m")), | |
this; | |
}, momentPrototype__proto.parseZone = function() { | |
return this._tzm ? this.utcOffset(this._tzm) : "string" == typeof this._i && this.utcOffset(offsetFromString(this._i)), | |
this; | |
}, momentPrototype__proto.hasAlignedHourOffset = function(input) { | |
return input = input ? local__createLocal(input).utcOffset() : 0, (this.utcOffset() - input) % 60 == 0; | |
}, momentPrototype__proto.isDST = function() { | |
return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset(); | |
}, momentPrototype__proto.isDSTShifted = function() { | |
if (void 0 !== this._isDSTShifted) return this._isDSTShifted; | |
var c = {}; | |
if (copyConfig(c, this), (c = prepareConfig(c))._a) { | |
var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); | |
this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; | |
} else this._isDSTShifted = !1; | |
return this._isDSTShifted; | |
}, momentPrototype__proto.isLocal = function() { | |
return !this._isUTC; | |
}, momentPrototype__proto.isUtcOffset = function() { | |
return this._isUTC; | |
}, momentPrototype__proto.isUtc = isUtc, momentPrototype__proto.isUTC = isUtc, momentPrototype__proto.zoneAbbr = function() { | |
return this._isUTC ? "UTC" : ""; | |
}, momentPrototype__proto.zoneName = function() { | |
return this._isUTC ? "Coordinated Universal Time" : ""; | |
}, momentPrototype__proto.dates = deprecate("dates accessor is deprecated. Use date instead.", getSetDayOfMonth), | |
momentPrototype__proto.months = deprecate("months accessor is deprecated. Use month instead", getSetMonth), | |
momentPrototype__proto.years = deprecate("years accessor is deprecated. Use year instead", getSetYear), | |
momentPrototype__proto.zone = deprecate("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779", (function(input, keepLocalTime) { | |
return null != input ? ("string" != typeof input && (input = -input), this.utcOffset(input, keepLocalTime), | |
this) : -this.utcOffset(); | |
})); | |
var momentPrototype = momentPrototype__proto; | |
function preParsePostFormat(string) { | |
return string; | |
} | |
var prototype__proto = Locale.prototype; | |
function lists__get(format, index, field, setter) { | |
var locale = locale_locales__getLocale(), utc = create_utc__createUTC().set(setter, index); | |
return locale[field](utc, format); | |
} | |
function list(format, index, field, count, setter) { | |
if ("number" == typeof format && (index = format, format = void 0), format = format || "", | |
null != index) return lists__get(format, index, field, setter); | |
var i, out = []; | |
for (i = 0; i < count; i++) out[i] = lists__get(format, i, field, setter); | |
return out; | |
} | |
prototype__proto._calendar = { | |
sameDay: "[Today at] LT", | |
nextDay: "[Tomorrow at] LT", | |
nextWeek: "dddd [at] LT", | |
lastDay: "[Yesterday at] LT", | |
lastWeek: "[Last] dddd [at] LT", | |
sameElse: "L" | |
}, prototype__proto.calendar = function(key, mom, now) { | |
var output = this._calendar[key]; | |
return "function" == typeof output ? output.call(mom, now) : output; | |
}, prototype__proto._longDateFormat = { | |
LTS: "h:mm:ss A", | |
LT: "h:mm A", | |
L: "MM/DD/YYYY", | |
LL: "MMMM D, YYYY", | |
LLL: "MMMM D, YYYY h:mm A", | |
LLLL: "dddd, MMMM D, YYYY h:mm A" | |
}, prototype__proto.longDateFormat = function(key) { | |
var format = this._longDateFormat[key], formatUpper = this._longDateFormat[key.toUpperCase()]; | |
return format || !formatUpper ? format : (this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, (function(val) { | |
return val.slice(1); | |
})), this._longDateFormat[key]); | |
}, prototype__proto._invalidDate = "Invalid date", prototype__proto.invalidDate = function() { | |
return this._invalidDate; | |
}, prototype__proto._ordinal = "%d", prototype__proto.ordinal = function(number) { | |
return this._ordinal.replace("%d", number); | |
}, prototype__proto._ordinalParse = /\d{1,2}/, prototype__proto.preparse = preParsePostFormat, | |
prototype__proto.postformat = preParsePostFormat, prototype__proto._relativeTime = { | |
future: "in %s", | |
past: "%s ago", | |
s: "a few seconds", | |
m: "a minute", | |
mm: "%d minutes", | |
h: "an hour", | |
hh: "%d hours", | |
d: "a day", | |
dd: "%d days", | |
M: "a month", | |
MM: "%d months", | |
y: "a year", | |
yy: "%d years" | |
}, prototype__proto.relativeTime = function(number, withoutSuffix, string, isFuture) { | |
var output = this._relativeTime[string]; | |
return "function" == typeof output ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); | |
}, prototype__proto.pastFuture = function(diff, output) { | |
var format = this._relativeTime[diff > 0 ? "future" : "past"]; | |
return "function" == typeof format ? format(output) : format.replace(/%s/i, output); | |
}, prototype__proto.set = function(config) { | |
var prop, i; | |
for (i in config) "function" == typeof (prop = config[i]) ? this[i] = prop : this["_" + i] = prop; | |
this._ordinalParseLenient = new RegExp(this._ordinalParse.source + "|" + /\d{1,2}/.source); | |
}, prototype__proto.months = function(m) { | |
return this._months[m.month()]; | |
}, prototype__proto._months = defaultLocaleMonths, prototype__proto.monthsShort = function(m) { | |
return this._monthsShort[m.month()]; | |
}, prototype__proto._monthsShort = defaultLocaleMonthsShort, prototype__proto.monthsParse = function(monthName, format, strict) { | |
var i, mom, regex; | |
for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), | |
i = 0; i < 12; i++) { | |
if (mom = create_utc__createUTC([ 2e3, i ]), strict && !this._longMonthsParse[i] && (this._longMonthsParse[i] = new RegExp("^" + this.months(mom, "").replace(".", "") + "$", "i"), | |
this._shortMonthsParse[i] = new RegExp("^" + this.monthsShort(mom, "").replace(".", "") + "$", "i")), | |
strict || this._monthsParse[i] || (regex = "^" + this.months(mom, "") + "|^" + this.monthsShort(mom, ""), | |
this._monthsParse[i] = new RegExp(regex.replace(".", ""), "i")), strict && "MMMM" === format && this._longMonthsParse[i].test(monthName)) return i; | |
if (strict && "MMM" === format && this._shortMonthsParse[i].test(monthName)) return i; | |
if (!strict && this._monthsParse[i].test(monthName)) return i; | |
} | |
}, prototype__proto.week = function(mom) { | |
return weekOfYear(mom, this._week.dow, this._week.doy).week; | |
}, prototype__proto._week = { | |
dow: 0, | |
doy: 6 | |
}, prototype__proto.firstDayOfYear = function() { | |
return this._week.doy; | |
}, prototype__proto.firstDayOfWeek = function() { | |
return this._week.dow; | |
}, prototype__proto.weekdays = function(m) { | |
return this._weekdays[m.day()]; | |
}, prototype__proto._weekdays = defaultLocaleWeekdays, prototype__proto.weekdaysMin = function(m) { | |
return this._weekdaysMin[m.day()]; | |
}, prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin, prototype__proto.weekdaysShort = function(m) { | |
return this._weekdaysShort[m.day()]; | |
}, prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort, prototype__proto.weekdaysParse = function(weekdayName) { | |
var i, mom, regex; | |
for (this._weekdaysParse = this._weekdaysParse || [], i = 0; i < 7; i++) if (this._weekdaysParse[i] || (mom = local__createLocal([ 2e3, 1 ]).day(i), | |
regex = "^" + this.weekdays(mom, "") + "|^" + this.weekdaysShort(mom, "") + "|^" + this.weekdaysMin(mom, ""), | |
this._weekdaysParse[i] = new RegExp(regex.replace(".", ""), "i")), this._weekdaysParse[i].test(weekdayName)) return i; | |
}, prototype__proto.isPM = function(input) { | |
return "p" === (input + "").toLowerCase().charAt(0); | |
}, prototype__proto._meridiemParse = /[ap]\.?m?\.?/i, prototype__proto.meridiem = function(hours, minutes, isLower) { | |
return hours > 11 ? isLower ? "pm" : "PM" : isLower ? "am" : "AM"; | |
}, locale_locales__getSetGlobalLocale("en", { | |
ordinalParse: /\d{1,2}(th|st|nd|rd)/, | |
ordinal: function(number) { | |
var b = number % 10; | |
return number + (1 === toInt(number % 100 / 10) ? "th" : 1 === b ? "st" : 2 === b ? "nd" : 3 === b ? "rd" : "th"); | |
} | |
}), utils_hooks__hooks.lang = deprecate("moment.lang is deprecated. Use moment.locale instead.", locale_locales__getSetGlobalLocale), | |
utils_hooks__hooks.langData = deprecate("moment.langData is deprecated. Use moment.localeData instead.", locale_locales__getLocale); | |
var mathAbs = Math.abs; | |
function duration_add_subtract__addSubtract(duration, input, value, direction) { | |
var other = create__createDuration(input, value); | |
return duration._milliseconds += direction * other._milliseconds, duration._days += direction * other._days, | |
duration._months += direction * other._months, duration._bubble(); | |
} | |
function absCeil(number) { | |
return number < 0 ? Math.floor(number) : Math.ceil(number); | |
} | |
function daysToMonths(days) { | |
return 4800 * days / 146097; | |
} | |
function monthsToDays(months) { | |
return 146097 * months / 4800; | |
} | |
function makeAs(alias) { | |
return function() { | |
return this.as(alias); | |
}; | |
} | |
var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asYears = makeAs("y"); | |
function makeGetter(name) { | |
return function() { | |
return this._data[name]; | |
}; | |
} | |
var milliseconds = makeGetter("milliseconds"), seconds = makeGetter("seconds"), minutes = makeGetter("minutes"), hours = makeGetter("hours"), days = makeGetter("days"), months = makeGetter("months"), years = makeGetter("years"); | |
var round = Math.round, thresholds = { | |
s: 45, | |
m: 45, | |
h: 22, | |
d: 26, | |
M: 11 | |
}; | |
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { | |
return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); | |
} | |
var iso_string__abs = Math.abs; | |
function iso_string__toISOString() { | |
var minutes, hours, seconds = iso_string__abs(this._milliseconds) / 1e3, days = iso_string__abs(this._days), months = iso_string__abs(this._months); | |
minutes = absFloor(seconds / 60), hours = absFloor(minutes / 60), seconds %= 60, | |
minutes %= 60; | |
var Y = absFloor(months / 12), M = months %= 12, D = days, h = hours, m = minutes, s = seconds, total = this.asSeconds(); | |
return total ? (total < 0 ? "-" : "") + "P" + (Y ? Y + "Y" : "") + (M ? M + "M" : "") + (D ? D + "D" : "") + (h || m || s ? "T" : "") + (h ? h + "H" : "") + (m ? m + "M" : "") + (s ? s + "S" : "") : "P0D"; | |
} | |
var duration_prototype__proto = Duration.prototype; | |
return duration_prototype__proto.abs = function() { | |
var data = this._data; | |
return this._milliseconds = mathAbs(this._milliseconds), this._days = mathAbs(this._days), | |
this._months = mathAbs(this._months), data.milliseconds = mathAbs(data.milliseconds), | |
data.seconds = mathAbs(data.seconds), data.minutes = mathAbs(data.minutes), data.hours = mathAbs(data.hours), | |
data.months = mathAbs(data.months), data.years = mathAbs(data.years), this; | |
}, duration_prototype__proto.add = function(input, value) { | |
return duration_add_subtract__addSubtract(this, input, value, 1); | |
}, duration_prototype__proto.subtract = function(input, value) { | |
return duration_add_subtract__addSubtract(this, input, value, -1); | |
}, duration_prototype__proto.as = function(units) { | |
var days, months, milliseconds = this._milliseconds; | |
if ("month" === (units = normalizeUnits(units)) || "year" === units) return days = this._days + milliseconds / 864e5, | |
months = this._months + daysToMonths(days), "month" === units ? months : months / 12; | |
switch (days = this._days + Math.round(monthsToDays(this._months)), units) { | |
case "week": | |
return days / 7 + milliseconds / 6048e5; | |
case "day": | |
return days + milliseconds / 864e5; | |
case "hour": | |
return 24 * days + milliseconds / 36e5; | |
case "minute": | |
return 1440 * days + milliseconds / 6e4; | |
case "second": | |
return 86400 * days + milliseconds / 1e3; | |
case "millisecond": | |
return Math.floor(864e5 * days) + milliseconds; | |
default: | |
throw new Error("Unknown unit " + units); | |
} | |
}, duration_prototype__proto.asMilliseconds = asMilliseconds, duration_prototype__proto.asSeconds = asSeconds, | |
duration_prototype__proto.asMinutes = asMinutes, duration_prototype__proto.asHours = asHours, | |
duration_prototype__proto.asDays = asDays, duration_prototype__proto.asWeeks = asWeeks, | |
duration_prototype__proto.asMonths = asMonths, duration_prototype__proto.asYears = asYears, | |
duration_prototype__proto.valueOf = function() { | |
return this._milliseconds + 864e5 * this._days + this._months % 12 * 2592e6 + 31536e6 * toInt(this._months / 12); | |
}, duration_prototype__proto._bubble = function() { | |
var seconds, minutes, hours, years, monthsFromDays, milliseconds = this._milliseconds, days = this._days, months = this._months, data = this._data; | |
return milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0 || (milliseconds += 864e5 * absCeil(monthsToDays(months) + days), | |
days = 0, months = 0), data.milliseconds = milliseconds % 1e3, seconds = absFloor(milliseconds / 1e3), | |
data.seconds = seconds % 60, minutes = absFloor(seconds / 60), data.minutes = minutes % 60, | |
hours = absFloor(minutes / 60), data.hours = hours % 24, days += absFloor(hours / 24), | |
months += monthsFromDays = absFloor(daysToMonths(days)), days -= absCeil(monthsToDays(monthsFromDays)), | |
years = absFloor(months / 12), months %= 12, data.days = days, data.months = months, | |
data.years = years, this; | |
}, duration_prototype__proto.get = function(units) { | |
return this[(units = normalizeUnits(units)) + "s"](); | |
}, duration_prototype__proto.milliseconds = milliseconds, duration_prototype__proto.seconds = seconds, | |
duration_prototype__proto.minutes = minutes, duration_prototype__proto.hours = hours, | |
duration_prototype__proto.days = days, duration_prototype__proto.weeks = function() { | |
return absFloor(this.days() / 7); | |
}, duration_prototype__proto.months = months, duration_prototype__proto.years = years, | |
duration_prototype__proto.humanize = function(withSuffix) { | |
var locale = this.localeData(), output = (function(posNegDuration, withoutSuffix, locale) { | |
var duration = create__createDuration(posNegDuration).abs(), seconds = round(duration.as("s")), minutes = round(duration.as("m")), hours = round(duration.as("h")), days = round(duration.as("d")), months = round(duration.as("M")), years = round(duration.as("y")), a = seconds < thresholds.s && [ "s", seconds ] || 1 === minutes && [ "m" ] || minutes < thresholds.m && [ "mm", minutes ] || 1 === hours && [ "h" ] || hours < thresholds.h && [ "hh", hours ] || 1 === days && [ "d" ] || days < thresholds.d && [ "dd", days ] || 1 === months && [ "M" ] || months < thresholds.M && [ "MM", months ] || 1 === years && [ "y" ] || [ "yy", years ]; | |
return a[2] = withoutSuffix, a[3] = +posNegDuration > 0, a[4] = locale, substituteTimeAgo.apply(null, a); | |
})(this, !withSuffix, locale); | |
return withSuffix && (output = locale.pastFuture(+this, output)), locale.postformat(output); | |
}, duration_prototype__proto.toISOString = iso_string__toISOString, duration_prototype__proto.toString = iso_string__toISOString, | |
duration_prototype__proto.toJSON = iso_string__toISOString, duration_prototype__proto.locale = locale, | |
duration_prototype__proto.localeData = localeData, duration_prototype__proto.toIsoString = deprecate("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)", iso_string__toISOString), | |
duration_prototype__proto.lang = lang, addFormatToken("X", 0, 0, "unix"), addFormatToken("x", 0, 0, "valueOf"), | |
addRegexToken("x", matchSigned), addRegexToken("X", /[+-]?\d+(\.\d{1,3})?/), addParseToken("X", (function(input, array, config) { | |
config._d = new Date(1e3 * parseFloat(input, 10)); | |
})), addParseToken("x", (function(input, array, config) { | |
config._d = new Date(toInt(input)); | |
})), utils_hooks__hooks.version = "2.10.6", hookCallback = local__createLocal, utils_hooks__hooks.fn = momentPrototype, | |
utils_hooks__hooks.min = function() { | |
return pickBy("isBefore", [].slice.call(arguments, 0)); | |
}, utils_hooks__hooks.max = function() { | |
return pickBy("isAfter", [].slice.call(arguments, 0)); | |
}, utils_hooks__hooks.utc = create_utc__createUTC, utils_hooks__hooks.unix = function(input) { | |
return local__createLocal(1e3 * input); | |
}, utils_hooks__hooks.months = function(format, index) { | |
return list(format, index, "months", 12, "month"); | |
}, utils_hooks__hooks.isDate = isDate, utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale, | |
utils_hooks__hooks.invalid = valid__createInvalid, utils_hooks__hooks.duration = create__createDuration, | |
utils_hooks__hooks.isMoment = isMoment, utils_hooks__hooks.weekdays = function(format, index) { | |
return list(format, index, "weekdays", 7, "day"); | |
}, utils_hooks__hooks.parseZone = function() { | |
return local__createLocal.apply(null, arguments).parseZone(); | |
}, utils_hooks__hooks.localeData = locale_locales__getLocale, utils_hooks__hooks.isDuration = isDuration, | |
utils_hooks__hooks.monthsShort = function(format, index) { | |
return list(format, index, "monthsShort", 12, "month"); | |
}, utils_hooks__hooks.weekdaysMin = function(format, index) { | |
return list(format, index, "weekdaysMin", 7, "day"); | |
}, utils_hooks__hooks.defineLocale = defineLocale, utils_hooks__hooks.weekdaysShort = function(format, index) { | |
return list(format, index, "weekdaysShort", 7, "day"); | |
}, utils_hooks__hooks.normalizeUnits = normalizeUnits, utils_hooks__hooks.relativeTimeThreshold = function(threshold, limit) { | |
return void 0 !== thresholds[threshold] && (void 0 === limit ? thresholds[threshold] : (thresholds[threshold] = limit, | |
!0)); | |
}, utils_hooks__hooks; | |
})(); | |
}).call(this, __webpack_require__(62)(module)); | |
}, function(module, exports) { | |
module.exports = require("fs"); | |
}, function(module, exports) { | |
module.exports = require("stream"); | |
}, function(module, exports) { | |
module.exports = require("path"); | |
}, function(module, exports) { | |
module.exports = require("events"); | |
}, function(module, exports, __webpack_require__) { | |
try { | |
var util = __webpack_require__(0); | |
if ("function" != typeof util.inherits) throw ""; | |
module.exports = util.inherits; | |
} catch (e) { | |
module.exports = __webpack_require__(552); | |
} | |
}, function(module, exports) { | |
module.exports = require("url"); | |
}, function(module, exports, __webpack_require__) { | |
"undefined" != typeof process && "renderer" === process.type ? module.exports = __webpack_require__(541) : module.exports = __webpack_require__(543); | |
}, function(module, exports) { | |
module.exports = require("crypto"); | |
}, function(module, exports) { | |
module.exports = require("buffer"); | |
}, function(module, exports) { | |
module.exports = require("http"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var byEbmlID = { | |
128: { | |
name: "ChapterDisplay", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains all possible strings to use for the chapter display." | |
}, | |
131: { | |
name: "TrackType", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "1-254", | |
description: "A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)." | |
}, | |
133: { | |
name: "ChapString", | |
cppname: "ChapterString", | |
level: 5, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains the string to use as the chapter atom." | |
}, | |
134: { | |
name: "CodecID", | |
level: 3, | |
type: "s", | |
mandatory: !0, | |
minver: 1, | |
description: "An ID corresponding to the codec, see the codec page for more info." | |
}, | |
136: { | |
name: "FlagDefault", | |
cppname: "TrackFlagDefault", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 1, | |
range: "0-1", | |
description: "Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)" | |
}, | |
137: { | |
name: "ChapterTrackNumber", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks." | |
}, | |
145: { | |
name: "ChapterTimeStart", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !0, | |
description: "Timestamp of the start of Chapter (not scaled)." | |
}, | |
146: { | |
name: "ChapterTimeEnd", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: "Timestamp of the end of Chapter (timestamp excluded, not scaled)." | |
}, | |
150: { | |
name: "CueRefTime", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !1, | |
description: "Timestamp of the referenced Block." | |
}, | |
151: { | |
name: "CueRefCluster", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
webm: !1, | |
description: "The Position of the Cluster containing the referenced Block." | |
}, | |
152: { | |
name: "ChapterFlagHidden", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" | |
}, | |
16980: { | |
name: "ContentCompAlgo", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping" | |
}, | |
16981: { | |
name: "ContentCompSettings", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track." | |
}, | |
17026: { | |
name: "DocType", | |
level: 1, | |
type: "s", | |
mandatory: !0, | |
default: "matroska", | |
minver: 1, | |
description: "A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files." | |
}, | |
17029: { | |
name: "DocTypeReadVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The minimum DocType version an interpreter has to support to read this file." | |
}, | |
17030: { | |
name: "EBMLVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The version of EBML parser used to create the file." | |
}, | |
17031: { | |
name: "DocTypeVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The version of DocType interpreter used to create the file." | |
}, | |
17476: { | |
name: "SegmentFamily", | |
level: 2, | |
type: "b", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
bytesize: 16, | |
description: "A randomly generated unique ID that all segments related to each other must use (128 bits)." | |
}, | |
17505: { | |
name: "DateUTC", | |
level: 2, | |
type: "d", | |
minver: 1, | |
description: "Date of the origin of timestamp (value 0), i.e. production date." | |
}, | |
17540: { | |
name: "TagDefault", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "0-1", | |
description: "Indication to know if this is the default/original language to use for the given tag. (1 bit)" | |
}, | |
17541: { | |
name: "TagBinary", | |
level: 4, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString." | |
}, | |
17543: { | |
name: "TagString", | |
level: 4, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "The value of the Element." | |
}, | |
17545: { | |
name: "Duration", | |
level: 2, | |
type: "f", | |
minver: 1, | |
range: "> 0", | |
description: "Duration of the segment (based on TimecodeScale)." | |
}, | |
17816: { | |
name: "ChapterFlagEnabled", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "0-1", | |
description: "Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)" | |
}, | |
18016: { | |
name: "FileMimeType", | |
level: 3, | |
type: "s", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "MIME type of the file." | |
}, | |
18017: { | |
name: "FileUsedStartTime", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX font extension" | |
}, | |
18018: { | |
name: "FileUsedEndTime", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX font extension" | |
}, | |
18037: { | |
name: "FileReferral", | |
level: 3, | |
type: "b", | |
webm: !1, | |
description: "A binary value that a track/codec can refer to when the attachment is needed." | |
}, | |
20529: { | |
name: "ContentEncodingOrder", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment." | |
}, | |
20530: { | |
name: "ContentEncodingScope", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "not 0", | |
description: "A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)" | |
}, | |
20531: { | |
name: "ContentEncodingType", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption" | |
}, | |
20532: { | |
name: "ContentCompression", | |
level: 5, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking." | |
}, | |
20533: { | |
name: "ContentEncryption", | |
level: 5, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise." | |
}, | |
21368: { | |
name: "CueBlockNumber", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 1, | |
range: "not 0", | |
description: "Number of the Block in the specified Cluster." | |
}, | |
22100: { | |
name: "ChapterStringUID", | |
level: 4, | |
type: "8", | |
mandatory: !1, | |
minver: 3, | |
webm: !0, | |
description: "A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage." | |
}, | |
22337: { | |
name: "WritingApp", | |
level: 2, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
description: 'Writing application ("mkvmerge-0.3.3").' | |
}, | |
22612: { | |
name: "SilentTracks", | |
cppname: "ClusterSilentTracks", | |
level: 2, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use." | |
}, | |
25152: { | |
name: "ContentEncoding", | |
level: 4, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Settings for one content encoding like compression or encryption." | |
}, | |
25188: { | |
name: "BitDepth", | |
cppname: "AudioBitDepth", | |
level: 4, | |
type: "u", | |
minver: 1, | |
range: "not 0", | |
description: "Bits per sample, mostly used for PCM." | |
}, | |
25906: { | |
name: "SignedElement", | |
level: 3, | |
type: "b", | |
multiple: !0, | |
webm: !1, | |
description: "An element ID whose data will be used to compute the signature." | |
}, | |
26148: { | |
name: "TrackTranslate", | |
level: 3, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "The track identification for the given Chapter Codec." | |
}, | |
26897: { | |
name: "ChapProcessCommand", | |
cppname: "ChapterProcessCommand", | |
level: 5, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains all the commands associated to the Atom." | |
}, | |
26914: { | |
name: "ChapProcessTime", | |
cppname: "ChapterProcessTime", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)." | |
}, | |
26916: { | |
name: "ChapterTranslate", | |
level: 2, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "A tuple of corresponding ID used by chapter codecs to represent this segment." | |
}, | |
26931: { | |
name: "ChapProcessData", | |
cppname: "ChapterProcessData", | |
level: 6, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands." | |
}, | |
26948: { | |
name: "ChapProcess", | |
cppname: "ChapterProcess", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains all the commands associated to the Atom." | |
}, | |
26965: { | |
name: "ChapProcessCodecID", | |
cppname: "ChapterProcessCodecID", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later." | |
}, | |
29555: { | |
name: "Tag", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Element containing elements specific to Tracks/Chapters." | |
}, | |
29572: { | |
name: "SegmentFilename", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "A filename corresponding to this segment." | |
}, | |
29766: { | |
name: "AttachmentLink", | |
cppname: "TrackAttachmentLink", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "The UID of an attachment that is used by this codec." | |
}, | |
2459272: { | |
name: "CodecName", | |
level: 3, | |
type: "8", | |
minver: 1, | |
description: "A human-readable string specifying the codec." | |
}, | |
408125543: { | |
name: "Segment", | |
level: "0", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment." | |
}, | |
17530: { | |
name: "TagLanguage", | |
level: 4, | |
type: "s", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: "und", | |
description: "Specifies the language of the tag specified, in the Matroska languages form." | |
}, | |
17827: { | |
name: "TagName", | |
level: 4, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The name of the Tag that is going to be stored." | |
}, | |
26568: { | |
name: "SimpleTag", | |
cppname: "TagSimple", | |
level: 3, | |
recursive: "1", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains general information about the target." | |
}, | |
25542: { | |
name: "TagAttachmentUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment." | |
}, | |
25540: { | |
name: "TagChapterUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment." | |
}, | |
25545: { | |
name: "TagEditionUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment." | |
}, | |
25541: { | |
name: "TagTrackUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment." | |
}, | |
25546: { | |
name: "TargetType", | |
cppname: "TagTargetType", | |
level: 4, | |
type: "s", | |
minver: 1, | |
webm: !1, | |
strong: "informational", | |
description: 'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).' | |
}, | |
26826: { | |
name: "TargetTypeValue", | |
cppname: "TagTargetTypeValue", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 50, | |
description: "A number to indicate the logical level of the target (see TargetType)." | |
}, | |
25536: { | |
name: "Targets", | |
cppname: "TagTargets", | |
level: 3, | |
type: "m", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment." | |
}, | |
307544935: { | |
name: "Tags", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here." | |
}, | |
17677: { | |
name: "ChapProcessPrivate", | |
cppname: "ChapterProcessPrivate", | |
level: 5, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: 'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.' | |
}, | |
17278: { | |
name: "ChapCountry", | |
cppname: "ChapterCountry", | |
level: 5, | |
type: "s", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "The countries corresponding to the string, same 2 octets as in Internet domains." | |
}, | |
17276: { | |
name: "ChapLanguage", | |
cppname: "ChapterLanguage", | |
level: 5, | |
type: "s", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
default: "eng", | |
description: "The languages corresponding to the string, in the bibliographic ISO-639-2 form." | |
}, | |
143: { | |
name: "ChapterTrack", | |
level: 4, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "List of tracks on which the chapter applies. If this element is not present, all tracks apply" | |
}, | |
25539: { | |
name: "ChapterPhysicalEquiv", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: 'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.' | |
}, | |
28348: { | |
name: "ChapterSegmentEditionUID", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "The EditionUID to play from the segment linked in ChapterSegmentUID." | |
}, | |
28263: { | |
name: "ChapterSegmentUID", | |
level: 4, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
range: ">0", | |
bytesize: 16, | |
description: "A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used." | |
}, | |
29636: { | |
name: "ChapterUID", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !0, | |
range: "not 0", | |
description: "A unique ID to identify the Chapter." | |
}, | |
182: { | |
name: "ChapterAtom", | |
level: 3, | |
recursive: "1", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains the atom information to use as the chapter atom (apply to all tracks)." | |
}, | |
17885: { | |
name: "EditionFlagOrdered", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)" | |
}, | |
17883: { | |
name: "EditionFlagDefault", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "If a flag is set (1) the edition should be used as the default one. (1 bit)" | |
}, | |
17853: { | |
name: "EditionFlagHidden", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" | |
}, | |
17852: { | |
name: "EditionUID", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "A unique ID to identify the edition. It's useful for tagging an edition." | |
}, | |
17849: { | |
name: "EditionEntry", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains all information about a segment edition." | |
}, | |
272869232: { | |
name: "Chapters", | |
level: 1, | |
type: "m", | |
minver: 1, | |
webm: !0, | |
description: "A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation." | |
}, | |
18094: { | |
name: "FileUID", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "Unique ID representing the file, as random as possible." | |
}, | |
18012: { | |
name: "FileData", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The data of the file." | |
}, | |
18030: { | |
name: "FileName", | |
level: 3, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Filename of the attached file." | |
}, | |
18046: { | |
name: "FileDescription", | |
level: 3, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "A human-friendly name for the attached file." | |
}, | |
24999: { | |
name: "AttachedFile", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "An attached file." | |
}, | |
423732329: { | |
name: "Attachments", | |
level: 1, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Contain attached files." | |
}, | |
235: { | |
name: "CueRefCodecState", | |
level: 5, | |
type: "u", | |
webm: !1, | |
default: 0, | |
description: "The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry." | |
}, | |
21343: { | |
name: "CueRefNumber", | |
level: 5, | |
type: "u", | |
webm: !1, | |
default: 1, | |
range: "not 0", | |
description: "Number of the referenced Block of Track X in the specified Cluster." | |
}, | |
219: { | |
name: "CueReference", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 2, | |
webm: !1, | |
description: "The Clusters containing the required referenced Blocks." | |
}, | |
234: { | |
name: "CueCodecState", | |
level: 4, | |
type: "u", | |
minver: 2, | |
webm: !1, | |
default: 0, | |
description: "The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry." | |
}, | |
178: { | |
name: "CueDuration", | |
level: 4, | |
type: "u", | |
mandatory: !1, | |
minver: 4, | |
webm: !1, | |
description: "The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues." | |
}, | |
240: { | |
name: "CueRelativePosition", | |
level: 4, | |
type: "u", | |
mandatory: !1, | |
minver: 4, | |
webm: !1, | |
description: "The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.", | |
position: "clusterRelative" | |
}, | |
241: { | |
name: "CueClusterPosition", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "The position of the Cluster containing the required Block.", | |
position: "segment" | |
}, | |
247: { | |
name: "CueTrack", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "The track for which a position is given." | |
}, | |
183: { | |
name: "CueTrackPositions", | |
level: 3, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contain positions for different tracks corresponding to the timestamp." | |
}, | |
179: { | |
name: "CueTime", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "Absolute timestamp according to the segment time base." | |
}, | |
187: { | |
name: "CuePoint", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contains all information relative to a seek point in the segment." | |
}, | |
475249515: { | |
name: "Cues", | |
level: 1, | |
type: "m", | |
minver: 1, | |
description: 'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.' | |
}, | |
18406: { | |
name: "ContentSigHashAlgo", | |
level: 6, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5" | |
}, | |
18405: { | |
name: "ContentSigAlgo", | |
level: 6, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA" | |
}, | |
18404: { | |
name: "ContentSigKeyID", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "This is the ID of the private key the data was signed with." | |
}, | |
18403: { | |
name: "ContentSignature", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "A cryptographic signature of the contents." | |
}, | |
18402: { | |
name: "ContentEncKeyID", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "For public key algorithms this is the ID of the public key the the data was encrypted with." | |
}, | |
18401: { | |
name: "ContentEncAlgo", | |
level: 6, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES" | |
}, | |
28032: { | |
name: "ContentEncodings", | |
level: 3, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Settings for several content encoding mechanisms like compression or encryption." | |
}, | |
196: { | |
name: "TrickMasterTrackSegmentUID", | |
level: 3, | |
type: "b", | |
divx: !0, | |
bytesize: 16, | |
description: "DivX trick track extenstions" | |
}, | |
199: { | |
name: "TrickMasterTrackUID", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
198: { | |
name: "TrickTrackFlag", | |
level: 3, | |
type: "u", | |
divx: !0, | |
default: 0, | |
description: "DivX trick track extenstions" | |
}, | |
193: { | |
name: "TrickTrackSegmentUID", | |
level: 3, | |
type: "b", | |
divx: !0, | |
bytesize: 16, | |
description: "DivX trick track extenstions" | |
}, | |
192: { | |
name: "TrickTrackUID", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
237: { | |
name: "TrackJoinUID", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
multiple: !0, | |
minver: 3, | |
webm: !1, | |
range: "not 0", | |
description: "The trackUID number of a track whose blocks are used to create this virtual track." | |
}, | |
233: { | |
name: "TrackJoinBlocks", | |
level: 4, | |
type: "m", | |
minver: 3, | |
webm: !1, | |
description: "Contains the list of all tracks whose Blocks need to be combined to create this virtual track" | |
}, | |
230: { | |
name: "TrackPlaneType", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 3, | |
webm: !1, | |
description: "The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)." | |
}, | |
229: { | |
name: "TrackPlaneUID", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 3, | |
webm: !1, | |
range: "not 0", | |
description: "The trackUID number of the track representing the plane." | |
}, | |
228: { | |
name: "TrackPlane", | |
level: 5, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 3, | |
webm: !1, | |
description: "Contains a video plane track that need to be combined to create this 3D track" | |
}, | |
227: { | |
name: "TrackCombinePlanes", | |
level: 4, | |
type: "m", | |
minver: 3, | |
webm: !1, | |
description: "Contains the list of all video plane tracks that need to be combined to create this 3D track" | |
}, | |
226: { | |
name: "TrackOperation", | |
level: 3, | |
type: "m", | |
minver: 3, | |
webm: !1, | |
description: "Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject." | |
}, | |
32123: { | |
name: "ChannelPositions", | |
cppname: "AudioPosition", | |
level: 4, | |
type: "b", | |
webm: !1, | |
description: "Table of horizontal angles for each successive channel, see appendix." | |
}, | |
159: { | |
name: "Channels", | |
cppname: "AudioChannels", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 1, | |
range: "not 0", | |
description: "Numbers of channels in the track." | |
}, | |
30901: { | |
name: "OutputSamplingFrequency", | |
cppname: "AudioOutputSamplingFreq", | |
level: 4, | |
type: "f", | |
minver: 1, | |
default: "Sampling Frequency", | |
range: "> 0", | |
description: "Real output sampling frequency in Hz (used for SBR techniques)." | |
}, | |
181: { | |
name: "SamplingFrequency", | |
cppname: "AudioSamplingFreq", | |
level: 4, | |
type: "f", | |
mandatory: !0, | |
minver: 1, | |
default: 8e3, | |
range: "> 0", | |
description: "Sampling frequency in Hz." | |
}, | |
225: { | |
name: "Audio", | |
cppname: "TrackAudio", | |
level: 3, | |
type: "m", | |
minver: 1, | |
description: "Audio settings." | |
}, | |
2327523: { | |
name: "FrameRate", | |
cppname: "VideoFrameRate", | |
level: 4, | |
type: "f", | |
range: "> 0", | |
strong: "Informational", | |
description: "Number of frames per second. only." | |
}, | |
3126563: { | |
name: "GammaValue", | |
cppname: "VideoGamma", | |
level: 4, | |
type: "f", | |
webm: !1, | |
range: "> 0", | |
description: "Gamma Value." | |
}, | |
3061028: { | |
name: "ColourSpace", | |
cppname: "VideoColourSpace", | |
level: 4, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
bytesize: 4, | |
description: "Same value as in AVI (32 bits)." | |
}, | |
21683: { | |
name: "AspectRatioType", | |
cppname: "VideoAspectRatio", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)." | |
}, | |
21682: { | |
name: "DisplayUnit", | |
cppname: "VideoDisplayUnit", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)." | |
}, | |
21690: { | |
name: "DisplayHeight", | |
cppname: "VideoDisplayHeight", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: "PixelHeight", | |
range: "not 0", | |
description: "Height of the video frames to display. The default value is only valid when DisplayUnit is 0." | |
}, | |
21680: { | |
name: "DisplayWidth", | |
cppname: "VideoDisplayWidth", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: "PixelWidth", | |
range: "not 0", | |
description: "Width of the video frames to display. The default value is only valid when DisplayUnit is 0." | |
}, | |
21725: { | |
name: "PixelCropRight", | |
cppname: "VideoPixelCropRight", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove on the right of the image." | |
}, | |
21708: { | |
name: "PixelCropLeft", | |
cppname: "VideoPixelCropLeft", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove on the left of the image." | |
}, | |
21691: { | |
name: "PixelCropTop", | |
cppname: "VideoPixelCropTop", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove at the top of the image." | |
}, | |
21674: { | |
name: "PixelCropBottom", | |
cppname: "VideoPixelCropBottom", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove at the bottom of the image (for HDTV content)." | |
}, | |
186: { | |
name: "PixelHeight", | |
cppname: "VideoPixelHeight", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "Height of the encoded video frames in pixels." | |
}, | |
176: { | |
name: "PixelWidth", | |
cppname: "VideoPixelWidth", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "Width of the encoded video frames in pixels." | |
}, | |
21433: { | |
name: "OldStereoMode", | |
level: 4, | |
type: "u", | |
maxver: "0", | |
webm: !1, | |
divx: !1, | |
description: "DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)." | |
}, | |
21440: { | |
name: "AlphaMode", | |
cppname: "VideoAlphaMode", | |
level: 4, | |
type: "u", | |
minver: 3, | |
webm: !0, | |
default: 0, | |
description: "Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data." | |
}, | |
21432: { | |
name: "StereoMode", | |
cppname: "VideoStereoMode", | |
level: 4, | |
type: "u", | |
minver: 3, | |
webm: !0, | |
default: 0, | |
description: "Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes." | |
}, | |
154: { | |
name: "FlagInterlaced", | |
cppname: "VideoFlagInterlaced", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !0, | |
default: 0, | |
range: "0-1", | |
description: "Set if the video is interlaced. (1 bit)" | |
}, | |
224: { | |
name: "Video", | |
cppname: "TrackVideo", | |
level: 3, | |
type: "m", | |
minver: 1, | |
description: "Video settings." | |
}, | |
26277: { | |
name: "TrackTranslateTrackID", | |
level: 4, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used." | |
}, | |
26303: { | |
name: "TrackTranslateCodec", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." | |
}, | |
26364: { | |
name: "TrackTranslateEditionUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment." | |
}, | |
22203: { | |
name: "SeekPreRoll", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
multiple: !1, | |
default: 0, | |
minver: 4, | |
webm: !0, | |
description: "After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid." | |
}, | |
22186: { | |
name: "CodecDelay", | |
level: 3, | |
type: "u", | |
multiple: !1, | |
default: 0, | |
minver: 4, | |
webm: !0, | |
description: "CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster." | |
}, | |
28587: { | |
name: "TrackOverlay", | |
level: 3, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc." | |
}, | |
170: { | |
name: "CodecDecodeAll", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !1, | |
default: 1, | |
range: "0-1", | |
description: "The codec can decode potentially damaged data (1 bit)." | |
}, | |
2536e3: { | |
name: "CodecDownloadURL", | |
level: 3, | |
type: "s", | |
multiple: !0, | |
webm: !1, | |
description: "A URL to download about the codec used." | |
}, | |
3883072: { | |
name: "CodecInfoURL", | |
level: 3, | |
type: "s", | |
multiple: !0, | |
webm: !1, | |
description: "A URL to find information about the codec used." | |
}, | |
3839639: { | |
name: "CodecSettings", | |
level: 3, | |
type: "8", | |
webm: !1, | |
description: "A string describing the encoding setting used." | |
}, | |
25506: { | |
name: "CodecPrivate", | |
level: 3, | |
type: "b", | |
minver: 1, | |
description: "Private data only known to the codec." | |
}, | |
2274716: { | |
name: "Language", | |
cppname: "TrackLanguage", | |
level: 3, | |
type: "s", | |
minver: 1, | |
default: "eng", | |
description: "Specifies the language of the track in the Matroska languages form." | |
}, | |
21358: { | |
name: "Name", | |
cppname: "TrackName", | |
level: 3, | |
type: "8", | |
minver: 1, | |
description: "A human-readable track name." | |
}, | |
21998: { | |
name: "MaxBlockAdditionID", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The maximum value of BlockAdditions for this track." | |
}, | |
21375: { | |
name: "TrackOffset", | |
level: 3, | |
type: "i", | |
webm: !1, | |
default: 0, | |
description: "A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track." | |
}, | |
2306383: { | |
name: "TrackTimecodeScale", | |
level: 3, | |
type: "f", | |
mandatory: !0, | |
minver: 1, | |
maxver: "3", | |
webm: !1, | |
default: 1, | |
range: "> 0", | |
description: "DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)." | |
}, | |
2313850: { | |
name: "DefaultDecodedFieldDuration", | |
cppname: "TrackDefaultDecodedFieldDuration", | |
level: 3, | |
type: "u", | |
minver: 4, | |
range: "not 0", | |
description: "The period in nanoseconds (not scaled by TimcodeScale)\nbetween two successive fields at the output of the decoding process (see the notes)" | |
}, | |
2352003: { | |
name: "DefaultDuration", | |
cppname: "TrackDefaultDuration", | |
level: 3, | |
type: "u", | |
minver: 1, | |
range: "not 0", | |
description: "Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)." | |
}, | |
28152: { | |
name: "MaxCache", | |
cppname: "TrackMaxCache", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: "The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed." | |
}, | |
28135: { | |
name: "MinCache", | |
cppname: "TrackMinCache", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used." | |
}, | |
156: { | |
name: "FlagLacing", | |
cppname: "TrackFlagLacing", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 1, | |
range: "0-1", | |
description: "Set if the track may contain blocks using lacing. (1 bit)" | |
}, | |
21930: { | |
name: "FlagForced", | |
cppname: "TrackFlagForced", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 0, | |
range: "0-1", | |
description: "Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)" | |
}, | |
185: { | |
name: "FlagEnabled", | |
cppname: "TrackFlagEnabled", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !0, | |
default: 1, | |
range: "0-1", | |
description: "Set if the track is usable. (1 bit)" | |
}, | |
29637: { | |
name: "TrackUID", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file." | |
}, | |
215: { | |
name: "TrackNumber", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)." | |
}, | |
174: { | |
name: "TrackEntry", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Describes a track with all elements." | |
}, | |
374648427: { | |
name: "Tracks", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "A top-level block of information with many tracks described." | |
}, | |
175: { | |
name: "EncryptedBlock", | |
level: 2, | |
type: "b", | |
multiple: !0, | |
webm: !1, | |
description: "Similar to EncryptedBlock Structure)" | |
}, | |
202: { | |
name: "ReferenceTimeCode", | |
level: 4, | |
type: "u", | |
multiple: !1, | |
mandatory: !0, | |
minver: 0, | |
webm: !1, | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
201: { | |
name: "ReferenceOffset", | |
level: 4, | |
type: "u", | |
multiple: !1, | |
mandatory: !0, | |
minver: 0, | |
webm: !1, | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
200: { | |
name: "ReferenceFrame", | |
level: 3, | |
type: "m", | |
multiple: !1, | |
minver: 0, | |
webm: !1, | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
207: { | |
name: "SliceDuration", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The (scaled) duration to apply to the element." | |
}, | |
206: { | |
name: "Delay", | |
cppname: "SliceDelay", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The (scaled) delay to apply to the element." | |
}, | |
203: { | |
name: "BlockAdditionID", | |
cppname: "SliceBlockAddID", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The ID of the BlockAdditional element (0 is the main Block)." | |
}, | |
205: { | |
name: "FrameNumber", | |
cppname: "SliceFrameNumber", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)." | |
}, | |
204: { | |
name: "LaceNumber", | |
cppname: "SliceLaceNumber", | |
level: 5, | |
type: "u", | |
minver: 1, | |
default: 0, | |
divx: !1, | |
description: "The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." | |
}, | |
232: { | |
name: "TimeSlice", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
divx: !1, | |
description: "Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." | |
}, | |
142: { | |
name: "Slices", | |
level: 3, | |
type: "m", | |
minver: 1, | |
divx: !1, | |
description: "Contains slices description." | |
}, | |
30114: { | |
name: "DiscardPadding", | |
level: 3, | |
type: "i", | |
minver: 4, | |
webm: !0, | |
description: "Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback." | |
}, | |
164: { | |
name: "CodecState", | |
level: 3, | |
type: "b", | |
minver: 2, | |
webm: !1, | |
description: "The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry." | |
}, | |
253: { | |
name: "ReferenceVirtual", | |
level: 3, | |
type: "i", | |
webm: !1, | |
description: "Relative position of the data that should be in position of the virtual block." | |
}, | |
251: { | |
name: "ReferenceBlock", | |
level: 3, | |
type: "i", | |
multiple: !0, | |
minver: 1, | |
description: "Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to." | |
}, | |
250: { | |
name: "ReferencePriority", | |
cppname: "FlagReferenced", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced." | |
}, | |
155: { | |
name: "BlockDuration", | |
level: 3, | |
type: "u", | |
minver: 1, | |
default: "TrackDuration", | |
description: 'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.' | |
}, | |
165: { | |
name: "BlockAdditional", | |
level: 5, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Interpreted by the codec as it wishes (using the BlockAddID)." | |
}, | |
238: { | |
name: "BlockAddID", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "not 0", | |
description: "An ID to identify the BlockAdditional level." | |
}, | |
166: { | |
name: "BlockMore", | |
level: 4, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contain the BlockAdditional and some parameters." | |
}, | |
30113: { | |
name: "BlockAdditions", | |
level: 3, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data." | |
}, | |
162: { | |
name: "BlockVirtual", | |
level: 3, | |
type: "b", | |
webm: !1, | |
description: "A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)" | |
}, | |
161: { | |
name: "Block", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
description: "Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)" | |
}, | |
160: { | |
name: "BlockGroup", | |
level: 2, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock." | |
}, | |
163: { | |
name: "SimpleBlock", | |
level: 2, | |
type: "b", | |
multiple: !0, | |
minver: 2, | |
webm: !0, | |
divx: !0, | |
description: "Similar to SimpleBlock Structure" | |
}, | |
171: { | |
name: "PrevSize", | |
cppname: "ClusterPrevSize", | |
level: 2, | |
type: "u", | |
minver: 1, | |
description: "Size of the previous Cluster, in octets. Can be useful for backward playing.", | |
position: "prevCluster" | |
}, | |
167: { | |
name: "Position", | |
cppname: "ClusterPosition", | |
level: 2, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: "The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.", | |
position: "segment" | |
}, | |
22743: { | |
name: "SilentTrackNumber", | |
cppname: "ClusterSilentTrackNumber", | |
level: 3, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster." | |
}, | |
231: { | |
name: "Timecode", | |
cppname: "ClusterTimecode", | |
level: 2, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "Absolute timestamp of the cluster (based on TimecodeScale)." | |
}, | |
524531317: { | |
name: "Cluster", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "The lower level element containing the (monolithic) Block structure." | |
}, | |
19840: { | |
name: "MuxingApp", | |
level: 2, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
description: 'Muxing application or library ("libmatroska-0.4.3").' | |
}, | |
31657: { | |
name: "Title", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "General name of the segment." | |
}, | |
2807730: { | |
name: "TimecodeScaleDenominator", | |
level: 2, | |
type: "u", | |
mandatory: !0, | |
minver: 4, | |
default: "1000000000", | |
description: "Timestamp scale numerator, see TimecodeScale." | |
}, | |
2807729: { | |
name: "TimecodeScale", | |
level: 2, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: "1000000", | |
description: "Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)." | |
}, | |
27045: { | |
name: "ChapterTranslateID", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used." | |
}, | |
27071: { | |
name: "ChapterTranslateCodec", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." | |
}, | |
27132: { | |
name: "ChapterTranslateEditionUID", | |
level: 3, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment." | |
}, | |
4096955: { | |
name: "NextFilename", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "An escaped filename corresponding to the next segment." | |
}, | |
4110627: { | |
name: "NextUID", | |
level: 2, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
bytesize: 16, | |
description: "A unique ID to identify the next chained segment (128 bits)." | |
}, | |
3965867: { | |
name: "PrevFilename", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "An escaped filename corresponding to the previous segment." | |
}, | |
3979555: { | |
name: "PrevUID", | |
level: 2, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
bytesize: 16, | |
description: "A unique ID to identify the previous chained segment (128 bits)." | |
}, | |
29604: { | |
name: "SegmentUID", | |
level: 2, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
bytesize: 16, | |
description: "A randomly generated unique ID to identify the current segment between many others (128 bits)." | |
}, | |
357149030: { | |
name: "Info", | |
level: 1, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contains miscellaneous general information and statistics on the file." | |
}, | |
21420: { | |
name: "SeekPosition", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "The position of the element in the segment in octets (0 = first level 1 element).", | |
position: "segment" | |
}, | |
21419: { | |
name: "SeekID", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
description: "The binary ID corresponding to the element name.", | |
type2: "ebmlID" | |
}, | |
19899: { | |
name: "Seek", | |
cppname: "SeekPoint", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contains a single seek entry to an EBML element." | |
}, | |
290298740: { | |
name: "SeekHead", | |
cppname: "SeekHeader", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "Contains the position of other level 1 elements." | |
}, | |
32379: { | |
name: "SignatureElementList", | |
level: 2, | |
type: "m", | |
multiple: !0, | |
webm: !1, | |
i: "Cluster|Block|BlockAdditional", | |
description: "A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption." | |
}, | |
32347: { | |
name: "SignatureElements", | |
level: 1, | |
type: "m", | |
webm: !1, | |
description: "Contains elements that will be used to compute the signature." | |
}, | |
32437: { | |
name: "Signature", | |
level: 1, | |
type: "b", | |
webm: !1, | |
description: "The signature of the data (until a new." | |
}, | |
32421: { | |
name: "SignaturePublicKey", | |
level: 1, | |
type: "b", | |
webm: !1, | |
description: "The public key to use with the algorithm (in the case of a PKI-based signature)." | |
}, | |
32410: { | |
name: "SignatureHash", | |
level: 1, | |
type: "u", | |
webm: !1, | |
description: "Hash algorithm used (1=SHA1-160, 2=MD5)." | |
}, | |
32394: { | |
name: "SignatureAlgo", | |
level: 1, | |
type: "u", | |
webm: !1, | |
description: "Signature algorithm used (1=RSA, 2=elliptic)." | |
}, | |
458458727: { | |
name: "SignatureSlot", | |
level: -1, | |
type: "m", | |
multiple: !0, | |
webm: !1, | |
description: "Contain signature of some (coming) elements in the stream." | |
}, | |
191: { | |
name: "CRC-32", | |
level: -1, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian", | |
crc: !0 | |
}, | |
236: { | |
name: "Void", | |
level: -1, | |
type: "b", | |
minver: 1, | |
description: "Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use." | |
}, | |
17139: { | |
name: "EBMLMaxSizeLength", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 8, | |
minver: 1, | |
description: "The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid." | |
}, | |
17138: { | |
name: "EBMLMaxIDLength", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 4, | |
minver: 1, | |
description: "The maximum length of the IDs you'll find in this file (4 or less in Matroska)." | |
}, | |
17143: { | |
name: "EBMLReadVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The minimum EBML version a parser has to support to read this file." | |
}, | |
440786851: { | |
name: "EBML", | |
level: "0", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Set the EBML characteristics of the data to follow. Each EBML document has to start with this." | |
} | |
}, byName = {}, schema = { | |
byEbmlID: byEbmlID, | |
byName: byName | |
}; | |
for (var ebmlID in byEbmlID) byName[byEbmlID[ebmlID].name.replace("-", "_")] = parseInt(ebmlID, 10); | |
module.exports = schema; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var byEbmlID = { | |
128: { | |
name: "ChapterDisplay", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains all possible strings to use for the chapter display." | |
}, | |
131: { | |
name: "TrackType", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "1-254", | |
description: "A set of track types coded on 8 bits (1: video, 2: audio, 3: complex, 0x10: logo, 0x11: subtitle, 0x12: buttons, 0x20: control)." | |
}, | |
133: { | |
name: "ChapString", | |
cppname: "ChapterString", | |
level: 5, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains the string to use as the chapter atom." | |
}, | |
134: { | |
name: "CodecID", | |
level: 3, | |
type: "s", | |
mandatory: !0, | |
minver: 1, | |
description: "An ID corresponding to the codec, see the codec page for more info." | |
}, | |
136: { | |
name: "FlagDefault", | |
cppname: "TrackFlagDefault", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 1, | |
range: "0-1", | |
description: "Set if that track (audio, video or subs) SHOULD be active if no language found matches the user preference. (1 bit)" | |
}, | |
137: { | |
name: "ChapterTrackNumber", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "UID of the Track to apply this chapter too. In the absense of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absense of this element indicates that the Chapter should be applied to any currently used Tracks." | |
}, | |
145: { | |
name: "ChapterTimeStart", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !0, | |
description: "Timestamp of the start of Chapter (not scaled)." | |
}, | |
146: { | |
name: "ChapterTimeEnd", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: "Timestamp of the end of Chapter (timestamp excluded, not scaled)." | |
}, | |
150: { | |
name: "CueRefTime", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !1, | |
description: "Timestamp of the referenced Block." | |
}, | |
151: { | |
name: "CueRefCluster", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
webm: !1, | |
description: "The Position of the Cluster containing the referenced Block." | |
}, | |
152: { | |
name: "ChapterFlagHidden", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "If a chapter is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" | |
}, | |
16980: { | |
name: "ContentCompAlgo", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The compression algorithm used. Algorithms that have been specified so far are: 0 - zlib, 3 - Header Stripping" | |
}, | |
16981: { | |
name: "ContentCompSettings", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "Settings that might be needed by the decompressor. For Header Stripping (ContentCompAlgo=3), the bytes that were removed from the beggining of each frames of the track." | |
}, | |
17026: { | |
name: "DocType", | |
level: 1, | |
type: "s", | |
mandatory: !0, | |
default: "matroska", | |
minver: 1, | |
description: "A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files." | |
}, | |
17029: { | |
name: "DocTypeReadVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The minimum DocType version an interpreter has to support to read this file." | |
}, | |
17030: { | |
name: "EBMLVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The version of EBML parser used to create the file." | |
}, | |
17031: { | |
name: "DocTypeVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The version of DocType interpreter used to create the file." | |
}, | |
17476: { | |
name: "SegmentFamily", | |
level: 2, | |
type: "b", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
bytesize: 16, | |
description: "A randomly generated unique ID that all segments related to each other must use (128 bits)." | |
}, | |
17505: { | |
name: "DateUTC", | |
level: 2, | |
type: "d", | |
minver: 1, | |
description: "Date of the origin of timestamp (value 0), i.e. production date." | |
}, | |
17540: { | |
name: "TagDefault", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "0-1", | |
description: "Indication to know if this is the default/original language to use for the given tag. (1 bit)" | |
}, | |
17541: { | |
name: "TagBinary", | |
level: 4, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "The values of the Tag if it is binary. Note that this cannot be used in the same SimpleTag as TagString." | |
}, | |
17543: { | |
name: "TagString", | |
level: 4, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "The value of the Element." | |
}, | |
17545: { | |
name: "Duration", | |
level: 2, | |
type: "f", | |
minver: 1, | |
range: "> 0", | |
description: "Duration of the segment (based on TimecodeScale)." | |
}, | |
17816: { | |
name: "ChapterFlagEnabled", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "0-1", | |
description: "Specify wether the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie should skip all the content between the TimeStart and TimeEnd of this chapter (see flag notes). (1 bit)" | |
}, | |
18016: { | |
name: "FileMimeType", | |
level: 3, | |
type: "s", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "MIME type of the file." | |
}, | |
18017: { | |
name: "FileUsedStartTime", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX font extension" | |
}, | |
18018: { | |
name: "FileUsedEndTime", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX font extension" | |
}, | |
18037: { | |
name: "FileReferral", | |
level: 3, | |
type: "b", | |
webm: !1, | |
description: "A binary value that a track/codec can refer to when the attachment is needed." | |
}, | |
20529: { | |
name: "ContentEncodingOrder", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder elements in the segment." | |
}, | |
20530: { | |
name: "ContentEncodingScope", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "not 0", | |
description: "A bit field that describes which elements have been modified in this way. Values (big endian) can be OR'ed. Possible values: 1 - all frame contents, 2 - the track's private data, 4 - the next ContentEncoding (next ContentEncodingOrder. Either the data inside ContentCompression and/or ContentEncryption)" | |
}, | |
20531: { | |
name: "ContentEncodingType", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A value describing what kind of transformation has been done. Possible values: 0 - compression, 1 - encryption" | |
}, | |
20532: { | |
name: "ContentCompression", | |
level: 5, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Settings describing the compression used. Must be present if the value of ContentEncodingType is 0 and absent otherwise. Each block must be decompressable even if no previous block is available in order not to prevent seeking." | |
}, | |
20533: { | |
name: "ContentEncryption", | |
level: 5, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Settings describing the encryption used. Must be present if the value of ContentEncodingType is 1 and absent otherwise." | |
}, | |
21368: { | |
name: "CueBlockNumber", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 1, | |
range: "not 0", | |
description: "Number of the Block in the specified Cluster." | |
}, | |
22100: { | |
name: "ChapterStringUID", | |
level: 4, | |
type: "8", | |
mandatory: !1, | |
minver: 3, | |
webm: !0, | |
description: "A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage." | |
}, | |
22337: { | |
name: "WritingApp", | |
level: 2, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
description: 'Writing application ("mkvmerge-0.3.3").' | |
}, | |
22612: { | |
name: "SilentTracks", | |
cppname: "ClusterSilentTracks", | |
level: 2, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking. Then you should decide what track to use." | |
}, | |
25152: { | |
name: "ContentEncoding", | |
level: 4, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Settings for one content encoding like compression or encryption." | |
}, | |
25188: { | |
name: "BitDepth", | |
cppname: "AudioBitDepth", | |
level: 4, | |
type: "u", | |
minver: 1, | |
range: "not 0", | |
description: "Bits per sample, mostly used for PCM." | |
}, | |
25906: { | |
name: "SignedElement", | |
level: 3, | |
type: "b", | |
multiple: !0, | |
webm: !1, | |
description: "An element ID whose data will be used to compute the signature." | |
}, | |
26148: { | |
name: "TrackTranslate", | |
level: 3, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "The track identification for the given Chapter Codec." | |
}, | |
26897: { | |
name: "ChapProcessCommand", | |
cppname: "ChapterProcessCommand", | |
level: 5, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains all the commands associated to the Atom." | |
}, | |
26914: { | |
name: "ChapProcessTime", | |
cppname: "ChapterProcessTime", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Defines when the process command should be handled (0: during the whole chapter, 1: before starting playback, 2: after playback of the chapter)." | |
}, | |
26916: { | |
name: "ChapterTranslate", | |
level: 2, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "A tuple of corresponding ID used by chapter codecs to represent this segment." | |
}, | |
26931: { | |
name: "ChapProcessData", | |
cppname: "ChapterProcessData", | |
level: 6, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains the command information. The data should be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands." | |
}, | |
26948: { | |
name: "ChapProcess", | |
cppname: "ChapterProcess", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains all the commands associated to the Atom." | |
}, | |
26965: { | |
name: "ChapProcessCodecID", | |
cppname: "ChapterProcessCodecID", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used. More codec IDs can be added later." | |
}, | |
29555: { | |
name: "Tag", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Element containing elements specific to Tracks/Chapters." | |
}, | |
29572: { | |
name: "SegmentFilename", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "A filename corresponding to this segment." | |
}, | |
29766: { | |
name: "AttachmentLink", | |
cppname: "TrackAttachmentLink", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "The UID of an attachment that is used by this codec." | |
}, | |
2459272: { | |
name: "CodecName", | |
level: 3, | |
type: "8", | |
minver: 1, | |
description: "A human-readable string specifying the codec." | |
}, | |
408125543: { | |
name: "Segment", | |
level: "0", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "This element contains all other top-level (level 1) elements. Typically a Matroska file is composed of 1 segment." | |
}, | |
17530: { | |
name: "TagLanguage", | |
level: 4, | |
type: "s", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: "und", | |
description: "Specifies the language of the tag specified, in the Matroska languages form." | |
}, | |
17827: { | |
name: "TagName", | |
level: 4, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The name of the Tag that is going to be stored." | |
}, | |
26568: { | |
name: "SimpleTag", | |
cppname: "TagSimple", | |
level: 3, | |
recursive: "1", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contains general information about the target." | |
}, | |
25542: { | |
name: "TagAttachmentUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the Attachment(s) the tags belong to. If the value is 0 at this level, the tags apply to all the attachments in the Segment." | |
}, | |
25540: { | |
name: "TagChapterUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the Chapter(s) the tags belong to. If the value is 0 at this level, the tags apply to all chapters in the Segment." | |
}, | |
25545: { | |
name: "TagEditionUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the EditionEntry(s) the tags belong to. If the value is 0 at this level, the tags apply to all editions in the Segment." | |
}, | |
25541: { | |
name: "TagTrackUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "A unique ID to identify the Track(s) the tags belong to. If the value is 0 at this level, the tags apply to all tracks in the Segment." | |
}, | |
25546: { | |
name: "TargetType", | |
cppname: "TagTargetType", | |
level: 4, | |
type: "s", | |
minver: 1, | |
webm: !1, | |
strong: "informational", | |
description: 'An string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc (see TargetType).' | |
}, | |
26826: { | |
name: "TargetTypeValue", | |
cppname: "TagTargetTypeValue", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 50, | |
description: "A number to indicate the logical level of the target (see TargetType)." | |
}, | |
25536: { | |
name: "Targets", | |
cppname: "TagTargets", | |
level: 3, | |
type: "m", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contain all UIDs where the specified meta data apply. It is empty to describe everything in the segment." | |
}, | |
307544935: { | |
name: "Tags", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Element containing elements specific to Tracks/Chapters. A list of valid tags can be found here." | |
}, | |
17677: { | |
name: "ChapProcessPrivate", | |
cppname: "ChapterProcessPrivate", | |
level: 5, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: 'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent.' | |
}, | |
17278: { | |
name: "ChapCountry", | |
cppname: "ChapterCountry", | |
level: 5, | |
type: "s", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "The countries corresponding to the string, same 2 octets as in Internet domains." | |
}, | |
17276: { | |
name: "ChapLanguage", | |
cppname: "ChapterLanguage", | |
level: 5, | |
type: "s", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
default: "eng", | |
description: "The languages corresponding to the string, in the bibliographic ISO-639-2 form." | |
}, | |
143: { | |
name: "ChapterTrack", | |
level: 4, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "List of tracks on which the chapter applies. If this element is not present, all tracks apply" | |
}, | |
25539: { | |
name: "ChapterPhysicalEquiv", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: 'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50), see complete list of values.' | |
}, | |
28348: { | |
name: "ChapterSegmentEditionUID", | |
level: 4, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "The EditionUID to play from the segment linked in ChapterSegmentUID." | |
}, | |
28263: { | |
name: "ChapterSegmentUID", | |
level: 4, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
range: ">0", | |
bytesize: 16, | |
description: "A segment to play in place of this chapter. Edition ChapterSegmentEditionUID should be used for this segment, otherwise no edition is used." | |
}, | |
29636: { | |
name: "ChapterUID", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !0, | |
range: "not 0", | |
description: "A unique ID to identify the Chapter." | |
}, | |
182: { | |
name: "ChapterAtom", | |
level: 3, | |
recursive: "1", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains the atom information to use as the chapter atom (apply to all tracks)." | |
}, | |
17885: { | |
name: "EditionFlagOrdered", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "Specify if the chapters can be defined multiple times and the order to play them is enforced. (1 bit)" | |
}, | |
17883: { | |
name: "EditionFlagDefault", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "If a flag is set (1) the edition should be used as the default one. (1 bit)" | |
}, | |
17853: { | |
name: "EditionFlagHidden", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
range: "0-1", | |
description: "If an edition is hidden (1), it should not be available to the user interface (but still to Control Tracks; see flag notes). (1 bit)" | |
}, | |
17852: { | |
name: "EditionUID", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "A unique ID to identify the edition. It's useful for tagging an edition." | |
}, | |
17849: { | |
name: "EditionEntry", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !0, | |
description: "Contains all information about a segment edition." | |
}, | |
272869232: { | |
name: "Chapters", | |
level: 1, | |
type: "m", | |
minver: 1, | |
webm: !0, | |
description: "A system to define basic menus and partition data. For more detailed information, look at the Chapters Explanation." | |
}, | |
18094: { | |
name: "FileUID", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
description: "Unique ID representing the file, as random as possible." | |
}, | |
18012: { | |
name: "FileData", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The data of the file." | |
}, | |
18030: { | |
name: "FileName", | |
level: 3, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Filename of the attached file." | |
}, | |
18046: { | |
name: "FileDescription", | |
level: 3, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "A human-friendly name for the attached file." | |
}, | |
24999: { | |
name: "AttachedFile", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "An attached file." | |
}, | |
423732329: { | |
name: "Attachments", | |
level: 1, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Contain attached files." | |
}, | |
235: { | |
name: "CueRefCodecState", | |
level: 5, | |
type: "u", | |
webm: !1, | |
default: 0, | |
description: "The position of the Codec State corresponding to this referenced element. 0 means that the data is taken from the initial Track Entry." | |
}, | |
21343: { | |
name: "CueRefNumber", | |
level: 5, | |
type: "u", | |
webm: !1, | |
default: 1, | |
range: "not 0", | |
description: "Number of the referenced Block of Track X in the specified Cluster." | |
}, | |
219: { | |
name: "CueReference", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 2, | |
webm: !1, | |
description: "The Clusters containing the required referenced Blocks." | |
}, | |
234: { | |
name: "CueCodecState", | |
level: 4, | |
type: "u", | |
minver: 2, | |
webm: !1, | |
default: 0, | |
description: "The position of the Codec State corresponding to this Cue element. 0 means that the data is taken from the initial Track Entry." | |
}, | |
178: { | |
name: "CueDuration", | |
level: 4, | |
type: "u", | |
mandatory: !1, | |
minver: 4, | |
webm: !1, | |
description: "The duration of the block according to the segment time base. If missing the track's DefaultDuration does not apply and no duration information is available in terms of the cues." | |
}, | |
240: { | |
name: "CueRelativePosition", | |
level: 4, | |
type: "u", | |
mandatory: !1, | |
minver: 4, | |
webm: !1, | |
description: "The relative position of the referenced block inside the cluster with 0 being the first possible position for an element inside that cluster.", | |
position: "clusterRelative" | |
}, | |
241: { | |
name: "CueClusterPosition", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "The position of the Cluster containing the required Block.", | |
position: "segment" | |
}, | |
247: { | |
name: "CueTrack", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "The track for which a position is given." | |
}, | |
183: { | |
name: "CueTrackPositions", | |
level: 3, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contain positions for different tracks corresponding to the timestamp." | |
}, | |
179: { | |
name: "CueTime", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "Absolute timestamp according to the segment time base." | |
}, | |
187: { | |
name: "CuePoint", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contains all information relative to a seek point in the segment." | |
}, | |
475249515: { | |
name: "Cues", | |
level: 1, | |
type: "m", | |
minver: 1, | |
description: 'A top-level element to speed seeking access. All entries are local to the segment. Should be mandatory for non "live" streams.' | |
}, | |
18406: { | |
name: "ContentSigHashAlgo", | |
level: 6, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The hash algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - SHA1-160 2 - MD5" | |
}, | |
18405: { | |
name: "ContentSigAlgo", | |
level: 6, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The algorithm used for the signature. A value of '0' means that the contents have not been signed but only encrypted. Predefined values: 1 - RSA" | |
}, | |
18404: { | |
name: "ContentSigKeyID", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "This is the ID of the private key the data was signed with." | |
}, | |
18403: { | |
name: "ContentSignature", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "A cryptographic signature of the contents." | |
}, | |
18402: { | |
name: "ContentEncKeyID", | |
level: 6, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "For public key algorithms this is the ID of the public key the the data was encrypted with." | |
}, | |
18401: { | |
name: "ContentEncAlgo", | |
level: 6, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The encryption algorithm used. The value '0' means that the contents have not been encrypted but only signed. Predefined values: 1 - DES, 2 - 3DES, 3 - Twofish, 4 - Blowfish, 5 - AES" | |
}, | |
28032: { | |
name: "ContentEncodings", | |
level: 3, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Settings for several content encoding mechanisms like compression or encryption." | |
}, | |
196: { | |
name: "TrickMasterTrackSegmentUID", | |
level: 3, | |
type: "b", | |
divx: !0, | |
bytesize: 16, | |
description: "DivX trick track extenstions" | |
}, | |
199: { | |
name: "TrickMasterTrackUID", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
198: { | |
name: "TrickTrackFlag", | |
level: 3, | |
type: "u", | |
divx: !0, | |
default: 0, | |
description: "DivX trick track extenstions" | |
}, | |
193: { | |
name: "TrickTrackSegmentUID", | |
level: 3, | |
type: "b", | |
divx: !0, | |
bytesize: 16, | |
description: "DivX trick track extenstions" | |
}, | |
192: { | |
name: "TrickTrackUID", | |
level: 3, | |
type: "u", | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
237: { | |
name: "TrackJoinUID", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
multiple: !0, | |
minver: 3, | |
webm: !1, | |
range: "not 0", | |
description: "The trackUID number of a track whose blocks are used to create this virtual track." | |
}, | |
233: { | |
name: "TrackJoinBlocks", | |
level: 4, | |
type: "m", | |
minver: 3, | |
webm: !1, | |
description: "Contains the list of all tracks whose Blocks need to be combined to create this virtual track" | |
}, | |
230: { | |
name: "TrackPlaneType", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 3, | |
webm: !1, | |
description: "The kind of plane this track corresponds to (0: left eye, 1: right eye, 2: background)." | |
}, | |
229: { | |
name: "TrackPlaneUID", | |
level: 6, | |
type: "u", | |
mandatory: !0, | |
minver: 3, | |
webm: !1, | |
range: "not 0", | |
description: "The trackUID number of the track representing the plane." | |
}, | |
228: { | |
name: "TrackPlane", | |
level: 5, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 3, | |
webm: !1, | |
description: "Contains a video plane track that need to be combined to create this 3D track" | |
}, | |
227: { | |
name: "TrackCombinePlanes", | |
level: 4, | |
type: "m", | |
minver: 3, | |
webm: !1, | |
description: "Contains the list of all video plane tracks that need to be combined to create this 3D track" | |
}, | |
226: { | |
name: "TrackOperation", | |
level: 3, | |
type: "m", | |
minver: 3, | |
webm: !1, | |
description: "Operation that needs to be applied on tracks to create this virtual track. For more details look at the Specification Notes on the subject." | |
}, | |
32123: { | |
name: "ChannelPositions", | |
cppname: "AudioPosition", | |
level: 4, | |
type: "b", | |
webm: !1, | |
description: "Table of horizontal angles for each successive channel, see appendix." | |
}, | |
159: { | |
name: "Channels", | |
cppname: "AudioChannels", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 1, | |
range: "not 0", | |
description: "Numbers of channels in the track." | |
}, | |
30901: { | |
name: "OutputSamplingFrequency", | |
cppname: "AudioOutputSamplingFreq", | |
level: 4, | |
type: "f", | |
minver: 1, | |
default: "Sampling Frequency", | |
range: "> 0", | |
description: "Real output sampling frequency in Hz (used for SBR techniques)." | |
}, | |
181: { | |
name: "SamplingFrequency", | |
cppname: "AudioSamplingFreq", | |
level: 4, | |
type: "f", | |
mandatory: !0, | |
minver: 1, | |
default: 8e3, | |
range: "> 0", | |
description: "Sampling frequency in Hz." | |
}, | |
225: { | |
name: "Audio", | |
cppname: "TrackAudio", | |
level: 3, | |
type: "m", | |
minver: 1, | |
description: "Audio settings." | |
}, | |
2327523: { | |
name: "FrameRate", | |
cppname: "VideoFrameRate", | |
level: 4, | |
type: "f", | |
range: "> 0", | |
strong: "Informational", | |
description: "Number of frames per second. only." | |
}, | |
3126563: { | |
name: "GammaValue", | |
cppname: "VideoGamma", | |
level: 4, | |
type: "f", | |
webm: !1, | |
range: "> 0", | |
description: "Gamma Value." | |
}, | |
3061028: { | |
name: "ColourSpace", | |
cppname: "VideoColourSpace", | |
level: 4, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
bytesize: 4, | |
description: "Same value as in AVI (32 bits)." | |
}, | |
21683: { | |
name: "AspectRatioType", | |
cppname: "VideoAspectRatio", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "Specify the possible modifications to the aspect ratio (0: free resizing, 1: keep aspect ratio, 2: fixed)." | |
}, | |
21682: { | |
name: "DisplayUnit", | |
cppname: "VideoDisplayUnit", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "How DisplayWidth & DisplayHeight should be interpreted (0: pixels, 1: centimeters, 2: inches, 3: Display Aspect Ratio)." | |
}, | |
21690: { | |
name: "DisplayHeight", | |
cppname: "VideoDisplayHeight", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: "PixelHeight", | |
range: "not 0", | |
description: "Height of the video frames to display. The default value is only valid when DisplayUnit is 0." | |
}, | |
21680: { | |
name: "DisplayWidth", | |
cppname: "VideoDisplayWidth", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: "PixelWidth", | |
range: "not 0", | |
description: "Width of the video frames to display. The default value is only valid when DisplayUnit is 0." | |
}, | |
21725: { | |
name: "PixelCropRight", | |
cppname: "VideoPixelCropRight", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove on the right of the image." | |
}, | |
21708: { | |
name: "PixelCropLeft", | |
cppname: "VideoPixelCropLeft", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove on the left of the image." | |
}, | |
21691: { | |
name: "PixelCropTop", | |
cppname: "VideoPixelCropTop", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove at the top of the image." | |
}, | |
21674: { | |
name: "PixelCropBottom", | |
cppname: "VideoPixelCropBottom", | |
level: 4, | |
type: "u", | |
minver: 1, | |
default: 0, | |
description: "The number of video pixels to remove at the bottom of the image (for HDTV content)." | |
}, | |
186: { | |
name: "PixelHeight", | |
cppname: "VideoPixelHeight", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "Height of the encoded video frames in pixels." | |
}, | |
176: { | |
name: "PixelWidth", | |
cppname: "VideoPixelWidth", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "Width of the encoded video frames in pixels." | |
}, | |
21433: { | |
name: "OldStereoMode", | |
level: 4, | |
type: "u", | |
maxver: "0", | |
webm: !1, | |
divx: !1, | |
description: "DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska. (0: mono, 1: right eye, 2: left eye, 3: both eyes)." | |
}, | |
21440: { | |
name: "AlphaMode", | |
cppname: "VideoAlphaMode", | |
level: 4, | |
type: "u", | |
minver: 3, | |
webm: !0, | |
default: 0, | |
description: "Alpha Video Mode. Presence of this element indicates that the BlockAdditional element could contain Alpha data." | |
}, | |
21432: { | |
name: "StereoMode", | |
cppname: "VideoStereoMode", | |
level: 4, | |
type: "u", | |
minver: 3, | |
webm: !0, | |
default: 0, | |
description: "Stereo-3D video mode (0: mono, 1: side by side (left eye is first), 2: top-bottom (right eye is first), 3: top-bottom (left eye is first), 4: checkboard (right is first), 5: checkboard (left is first), 6: row interleaved (right is first), 7: row interleaved (left is first), 8: column interleaved (right is first), 9: column interleaved (left is first), 10: anaglyph (cyan/red), 11: side by side (right eye is first), 12: anaglyph (green/magenta), 13 both eyes laced in one Block (left eye is first), 14 both eyes laced in one Block (right eye is first)) . There are some more details on 3D support in the Specification Notes." | |
}, | |
154: { | |
name: "FlagInterlaced", | |
cppname: "VideoFlagInterlaced", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !0, | |
default: 0, | |
range: "0-1", | |
description: "Set if the video is interlaced. (1 bit)" | |
}, | |
224: { | |
name: "Video", | |
cppname: "TrackVideo", | |
level: 3, | |
type: "m", | |
minver: 1, | |
description: "Video settings." | |
}, | |
26277: { | |
name: "TrackTranslateTrackID", | |
level: 4, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The binary value used to represent this track in the chapter codec data. The format depends on the ChapProcessCodecID used." | |
}, | |
26303: { | |
name: "TrackTranslateCodec", | |
level: 4, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." | |
}, | |
26364: { | |
name: "TrackTranslateEditionUID", | |
level: 4, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Specify an edition UID on which this translation applies. When not specified, it means for all editions found in the segment." | |
}, | |
22203: { | |
name: "SeekPreRoll", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
multiple: !1, | |
default: 0, | |
minver: 4, | |
webm: !0, | |
description: "After a discontinuity, SeekPreRoll is the duration in nanoseconds of the data the decoder must decode before the decoded data is valid." | |
}, | |
22186: { | |
name: "CodecDelay", | |
level: 3, | |
type: "u", | |
multiple: !1, | |
default: 0, | |
minver: 4, | |
webm: !0, | |
description: "CodecDelay is The codec-built-in delay in nanoseconds. This value must be subtracted from each block timestamp in order to get the actual timestamp. The value should be small so the muxing of tracks with the same actual timestamp are in the same Cluster." | |
}, | |
28587: { | |
name: "TrackOverlay", | |
level: 3, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap (see SilentTracks) the overlay track should be used instead. The order of multiple TrackOverlay matters, the first one is the one that should be used. If not found it should be the second, etc." | |
}, | |
170: { | |
name: "CodecDecodeAll", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !1, | |
default: 1, | |
range: "0-1", | |
description: "The codec can decode potentially damaged data (1 bit)." | |
}, | |
2536e3: { | |
name: "CodecDownloadURL", | |
level: 3, | |
type: "s", | |
multiple: !0, | |
webm: !1, | |
description: "A URL to download about the codec used." | |
}, | |
3883072: { | |
name: "CodecInfoURL", | |
level: 3, | |
type: "s", | |
multiple: !0, | |
webm: !1, | |
description: "A URL to find information about the codec used." | |
}, | |
3839639: { | |
name: "CodecSettings", | |
level: 3, | |
type: "8", | |
webm: !1, | |
description: "A string describing the encoding setting used." | |
}, | |
25506: { | |
name: "CodecPrivate", | |
level: 3, | |
type: "b", | |
minver: 1, | |
description: "Private data only known to the codec." | |
}, | |
2274716: { | |
name: "Language", | |
cppname: "TrackLanguage", | |
level: 3, | |
type: "s", | |
minver: 1, | |
default: "eng", | |
description: "Specifies the language of the track in the Matroska languages form." | |
}, | |
21358: { | |
name: "Name", | |
cppname: "TrackName", | |
level: 3, | |
type: "8", | |
minver: 1, | |
description: "A human-readable track name." | |
}, | |
21998: { | |
name: "MaxBlockAdditionID", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The maximum value of BlockAdditions for this track." | |
}, | |
21375: { | |
name: "TrackOffset", | |
level: 3, | |
type: "i", | |
webm: !1, | |
default: 0, | |
description: "A value to add to the Block's Timestamp. This can be used to adjust the playback offset of a track." | |
}, | |
2306383: { | |
name: "TrackTimecodeScale", | |
level: 3, | |
type: "f", | |
mandatory: !0, | |
minver: 1, | |
maxver: "3", | |
webm: !1, | |
default: 1, | |
range: "> 0", | |
description: "DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)." | |
}, | |
2313850: { | |
name: "DefaultDecodedFieldDuration", | |
cppname: "TrackDefaultDecodedFieldDuration", | |
level: 3, | |
type: "u", | |
minver: 4, | |
range: "not 0", | |
description: "The period in nanoseconds (not scaled by TimcodeScale)\nbetween two successive fields at the output of the decoding process (see the notes)" | |
}, | |
2352003: { | |
name: "DefaultDuration", | |
cppname: "TrackDefaultDuration", | |
level: 3, | |
type: "u", | |
minver: 1, | |
range: "not 0", | |
description: "Number of nanoseconds (not scaled via TimecodeScale) per frame ('frame' in the Matroska sense -- one element put into a (Simple)Block)." | |
}, | |
28152: { | |
name: "MaxCache", | |
cppname: "TrackMaxCache", | |
level: 3, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: "The maximum cache size required to store referenced frames in and the current frame. 0 means no cache is needed." | |
}, | |
28135: { | |
name: "MinCache", | |
cppname: "TrackMinCache", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "The minimum number of frames a player should be able to cache during playback. If set to 0, the reference pseudo-cache system is not used." | |
}, | |
156: { | |
name: "FlagLacing", | |
cppname: "TrackFlagLacing", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 1, | |
range: "0-1", | |
description: "Set if the track may contain blocks using lacing. (1 bit)" | |
}, | |
21930: { | |
name: "FlagForced", | |
cppname: "TrackFlagForced", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: 0, | |
range: "0-1", | |
description: "Set if that track MUST be active during playback. There can be many forced track for a kind (audio, video or subs), the player should select the one which language matches the user preference or the default + forced track. Overlay MAY happen between a forced and non-forced track of the same kind. (1 bit)" | |
}, | |
185: { | |
name: "FlagEnabled", | |
cppname: "TrackFlagEnabled", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 2, | |
webm: !0, | |
default: 1, | |
range: "0-1", | |
description: "Set if the track is usable. (1 bit)" | |
}, | |
29637: { | |
name: "TrackUID", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "A unique ID to identify the Track. This should be kept the same when making a direct stream copy of the Track to another file." | |
}, | |
215: { | |
name: "TrackNumber", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
range: "not 0", | |
description: "The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)." | |
}, | |
174: { | |
name: "TrackEntry", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Describes a track with all elements." | |
}, | |
374648427: { | |
name: "Tracks", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "A top-level block of information with many tracks described." | |
}, | |
175: { | |
name: "EncryptedBlock", | |
level: 2, | |
type: "b", | |
multiple: !0, | |
webm: !1, | |
description: "Similar to EncryptedBlock Structure)" | |
}, | |
202: { | |
name: "ReferenceTimeCode", | |
level: 4, | |
type: "u", | |
multiple: !1, | |
mandatory: !0, | |
minver: 0, | |
webm: !1, | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
201: { | |
name: "ReferenceOffset", | |
level: 4, | |
type: "u", | |
multiple: !1, | |
mandatory: !0, | |
minver: 0, | |
webm: !1, | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
200: { | |
name: "ReferenceFrame", | |
level: 3, | |
type: "m", | |
multiple: !1, | |
minver: 0, | |
webm: !1, | |
divx: !0, | |
description: "DivX trick track extenstions" | |
}, | |
207: { | |
name: "SliceDuration", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The (scaled) duration to apply to the element." | |
}, | |
206: { | |
name: "Delay", | |
cppname: "SliceDelay", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The (scaled) delay to apply to the element." | |
}, | |
203: { | |
name: "BlockAdditionID", | |
cppname: "SliceBlockAddID", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The ID of the BlockAdditional element (0 is the main Block)." | |
}, | |
205: { | |
name: "FrameNumber", | |
cppname: "SliceFrameNumber", | |
level: 5, | |
type: "u", | |
default: 0, | |
description: "The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)." | |
}, | |
204: { | |
name: "LaceNumber", | |
cppname: "SliceLaceNumber", | |
level: 5, | |
type: "u", | |
minver: 1, | |
default: 0, | |
divx: !1, | |
description: "The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." | |
}, | |
232: { | |
name: "TimeSlice", | |
level: 4, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
divx: !1, | |
description: "Contains extra time information about the data contained in the Block. While there are a few files in the wild with this element, it is no longer in use and has been deprecated. Being able to interpret this element is not required for playback." | |
}, | |
142: { | |
name: "Slices", | |
level: 3, | |
type: "m", | |
minver: 1, | |
divx: !1, | |
description: "Contains slices description." | |
}, | |
30114: { | |
name: "DiscardPadding", | |
level: 3, | |
type: "i", | |
minver: 4, | |
webm: !0, | |
description: "Duration in nanoseconds of the silent data added to the Block (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and should be discarded during playback." | |
}, | |
164: { | |
name: "CodecState", | |
level: 3, | |
type: "b", | |
minver: 2, | |
webm: !1, | |
description: "The new codec state to use. Data interpretation is private to the codec. This information should always be referenced by a seek entry." | |
}, | |
253: { | |
name: "ReferenceVirtual", | |
level: 3, | |
type: "i", | |
webm: !1, | |
description: "Relative position of the data that should be in position of the virtual block." | |
}, | |
251: { | |
name: "ReferenceBlock", | |
level: 3, | |
type: "i", | |
multiple: !0, | |
minver: 1, | |
description: "Timestamp of another frame used as a reference (ie: B or P frame). The timestamp is relative to the block it's attached to." | |
}, | |
250: { | |
name: "ReferencePriority", | |
cppname: "FlagReferenced", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 0, | |
description: "This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced." | |
}, | |
155: { | |
name: "BlockDuration", | |
level: 3, | |
type: "u", | |
minver: 1, | |
default: "TrackDuration", | |
description: 'The duration of the Block (based on TimecodeScale). This element is mandatory when DefaultDuration is set for the track (but can be omitted as other default values). When not written and with no DefaultDuration, the value is assumed to be the difference between the timestamp of this Block and the timestamp of the next Block in "display" order (not coding order). This element can be useful at the end of a Track (as there is not other Block available), or when there is a break in a track like for subtitle tracks. When set to 0 that means the frame is not a keyframe.' | |
}, | |
165: { | |
name: "BlockAdditional", | |
level: 5, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "Interpreted by the codec as it wishes (using the BlockAddID)." | |
}, | |
238: { | |
name: "BlockAddID", | |
level: 5, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
default: 1, | |
range: "not 0", | |
description: "An ID to identify the BlockAdditional level." | |
}, | |
166: { | |
name: "BlockMore", | |
level: 4, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Contain the BlockAdditional and some parameters." | |
}, | |
30113: { | |
name: "BlockAdditions", | |
level: 3, | |
type: "m", | |
minver: 1, | |
webm: !1, | |
description: "Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data." | |
}, | |
162: { | |
name: "BlockVirtual", | |
level: 3, | |
type: "b", | |
webm: !1, | |
description: "A Block with no data. It must be stored in the stream at the place the real Block should be in display order. (see Block Virtual)" | |
}, | |
161: { | |
name: "Block", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
description: "Block containing the actual data to be rendered and a timestamp relative to the Cluster Timecode. (see Block Structure)" | |
}, | |
160: { | |
name: "BlockGroup", | |
level: 2, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "Basic container of information containing a single Block or BlockVirtual, and information specific to that Block/VirtualBlock." | |
}, | |
163: { | |
name: "SimpleBlock", | |
level: 2, | |
type: "b", | |
multiple: !0, | |
minver: 2, | |
webm: !0, | |
divx: !0, | |
description: "Similar to SimpleBlock Structure" | |
}, | |
171: { | |
name: "PrevSize", | |
cppname: "ClusterPrevSize", | |
level: 2, | |
type: "u", | |
minver: 1, | |
description: "Size of the previous Cluster, in octets. Can be useful for backward playing.", | |
position: "prevCluster" | |
}, | |
167: { | |
name: "Position", | |
cppname: "ClusterPosition", | |
level: 2, | |
type: "u", | |
minver: 1, | |
webm: !1, | |
description: "The Position of the Cluster in the segment (0 in live broadcast streams). It might help to resynchronise offset on damaged streams.", | |
position: "segment" | |
}, | |
22743: { | |
name: "SilentTrackNumber", | |
cppname: "ClusterSilentTrackNumber", | |
level: 3, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster." | |
}, | |
231: { | |
name: "Timecode", | |
cppname: "ClusterTimecode", | |
level: 2, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "Absolute timestamp of the cluster (based on TimecodeScale)." | |
}, | |
524531317: { | |
name: "Cluster", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "The lower level element containing the (monolithic) Block structure." | |
}, | |
19840: { | |
name: "MuxingApp", | |
level: 2, | |
type: "8", | |
mandatory: !0, | |
minver: 1, | |
description: 'Muxing application or library ("libmatroska-0.4.3").' | |
}, | |
31657: { | |
name: "Title", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "General name of the segment." | |
}, | |
2807730: { | |
name: "TimecodeScaleDenominator", | |
level: 2, | |
type: "u", | |
mandatory: !0, | |
minver: 4, | |
default: "1000000000", | |
description: "Timestamp scale numerator, see TimecodeScale." | |
}, | |
2807729: { | |
name: "TimecodeScale", | |
level: 2, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
default: "1000000", | |
description: "Timestamp scale in nanoseconds (1.000.000 means all timestamps in the segment are expressed in milliseconds)." | |
}, | |
27045: { | |
name: "ChapterTranslateID", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The binary value used to represent this segment in the chapter codec data. The format depends on the ChapProcessCodecID used." | |
}, | |
27071: { | |
name: "ChapterTranslateCodec", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
webm: !1, | |
description: "The chapter codec using this ID (0: Matroska Script, 1: DVD-menu)." | |
}, | |
27132: { | |
name: "ChapterTranslateEditionUID", | |
level: 3, | |
type: "u", | |
multiple: !0, | |
minver: 1, | |
webm: !1, | |
description: "Specify an edition UID on which this correspondance applies. When not specified, it means for all editions found in the segment." | |
}, | |
4096955: { | |
name: "NextFilename", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "An escaped filename corresponding to the next segment." | |
}, | |
4110627: { | |
name: "NextUID", | |
level: 2, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
bytesize: 16, | |
description: "A unique ID to identify the next chained segment (128 bits)." | |
}, | |
3965867: { | |
name: "PrevFilename", | |
level: 2, | |
type: "8", | |
minver: 1, | |
webm: !1, | |
description: "An escaped filename corresponding to the previous segment." | |
}, | |
3979555: { | |
name: "PrevUID", | |
level: 2, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
bytesize: 16, | |
description: "A unique ID to identify the previous chained segment (128 bits)." | |
}, | |
29604: { | |
name: "SegmentUID", | |
level: 2, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
range: "not 0", | |
bytesize: 16, | |
description: "A randomly generated unique ID to identify the current segment between many others (128 bits)." | |
}, | |
357149030: { | |
name: "Info", | |
level: 1, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contains miscellaneous general information and statistics on the file." | |
}, | |
21420: { | |
name: "SeekPosition", | |
level: 3, | |
type: "u", | |
mandatory: !0, | |
minver: 1, | |
description: "The position of the element in the segment in octets (0 = first level 1 element).", | |
position: "segment" | |
}, | |
21419: { | |
name: "SeekID", | |
level: 3, | |
type: "b", | |
mandatory: !0, | |
minver: 1, | |
description: "The binary ID corresponding to the element name.", | |
type2: "ebmlID" | |
}, | |
19899: { | |
name: "Seek", | |
cppname: "SeekPoint", | |
level: 2, | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Contains a single seek entry to an EBML element." | |
}, | |
290298740: { | |
name: "SeekHead", | |
cppname: "SeekHeader", | |
level: 1, | |
type: "m", | |
multiple: !0, | |
minver: 1, | |
description: "Contains the position of other level 1 elements." | |
}, | |
32379: { | |
name: "SignatureElementList", | |
level: 2, | |
type: "m", | |
multiple: !0, | |
webm: !1, | |
i: "Cluster|Block|BlockAdditional", | |
description: "A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption." | |
}, | |
32347: { | |
name: "SignatureElements", | |
level: 1, | |
type: "m", | |
webm: !1, | |
description: "Contains elements that will be used to compute the signature." | |
}, | |
32437: { | |
name: "Signature", | |
level: 1, | |
type: "b", | |
webm: !1, | |
description: "The signature of the data (until a new." | |
}, | |
32421: { | |
name: "SignaturePublicKey", | |
level: 1, | |
type: "b", | |
webm: !1, | |
description: "The public key to use with the algorithm (in the case of a PKI-based signature)." | |
}, | |
32410: { | |
name: "SignatureHash", | |
level: 1, | |
type: "u", | |
webm: !1, | |
description: "Hash algorithm used (1=SHA1-160, 2=MD5)." | |
}, | |
32394: { | |
name: "SignatureAlgo", | |
level: 1, | |
type: "u", | |
webm: !1, | |
description: "Signature algorithm used (1=RSA, 2=elliptic)." | |
}, | |
458458727: { | |
name: "SignatureSlot", | |
level: -1, | |
type: "m", | |
multiple: !0, | |
webm: !1, | |
description: "Contain signature of some (coming) elements in the stream." | |
}, | |
191: { | |
name: "CRC-32", | |
level: -1, | |
type: "b", | |
minver: 1, | |
webm: !1, | |
description: "The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian", | |
crc: !0 | |
}, | |
236: { | |
name: "Void", | |
level: -1, | |
type: "b", | |
minver: 1, | |
description: "Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use." | |
}, | |
17139: { | |
name: "EBMLMaxSizeLength", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 8, | |
minver: 1, | |
description: "The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid." | |
}, | |
17138: { | |
name: "EBMLMaxIDLength", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 4, | |
minver: 1, | |
description: "The maximum length of the IDs you'll find in this file (4 or less in Matroska)." | |
}, | |
17143: { | |
name: "EBMLReadVersion", | |
level: 1, | |
type: "u", | |
mandatory: !0, | |
default: 1, | |
minver: 1, | |
description: "The minimum EBML version a parser has to support to read this file." | |
}, | |
440786851: { | |
name: "EBML", | |
level: "0", | |
type: "m", | |
mandatory: !0, | |
multiple: !0, | |
minver: 1, | |
description: "Set the EBML characteristics of the data to follow. Each EBML document has to start with this." | |
} | |
}, byName = {}, schema = { | |
byEbmlID: byEbmlID, | |
byName: byName | |
}; | |
for (var ebmlID in byEbmlID) byName[byEbmlID[ebmlID].name.replace("-", "_")] = parseInt(ebmlID, 10); | |
module.exports = schema; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var key, buffer = __webpack_require__(10), Buffer = buffer.Buffer, safer = {}; | |
for (key in buffer) buffer.hasOwnProperty(key) && "SlowBuffer" !== key && "Buffer" !== key && (safer[key] = buffer[key]); | |
var Safer = safer.Buffer = {}; | |
for (key in Buffer) Buffer.hasOwnProperty(key) && "allocUnsafe" !== key && "allocUnsafeSlow" !== key && (Safer[key] = Buffer[key]); | |
if (safer.Buffer.prototype = Buffer.prototype, Safer.from && Safer.from !== Uint8Array.from || (Safer.from = function(value, encodingOrOffset, length) { | |
if ("number" == typeof value) throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value); | |
if (value && void 0 === value.length) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); | |
return Buffer(value, encodingOrOffset, length); | |
}), Safer.alloc || (Safer.alloc = function(size, fill, encoding) { | |
if ("number" != typeof size) throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size); | |
if (size < 0 || size >= 2 * (1 << 30)) throw new RangeError('The value "' + size + '" is invalid for option "size"'); | |
var buf = Buffer(size); | |
return fill && 0 !== fill.length ? "string" == typeof encoding ? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), | |
buf; | |
}), !safer.kStringMaxLength) try { | |
safer.kStringMaxLength = process.binding("buffer").kStringMaxLength; | |
} catch (e) {} | |
safer.constants || (safer.constants = { | |
MAX_LENGTH: safer.kMaxLength | |
}, safer.kStringMaxLength && (safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength)), | |
module.exports = safer; | |
}, function(module, exports, __webpack_require__) { | |
var assert = __webpack_require__(24), Stream = __webpack_require__(3).Stream, util = __webpack_require__(0), UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/; | |
function _capitalize(str) { | |
return str.charAt(0).toUpperCase() + str.slice(1); | |
} | |
function _toss(name, expected, oper, arg, actual) { | |
throw new assert.AssertionError({ | |
message: util.format("%s (%s) is required", name, expected), | |
actual: void 0 === actual ? typeof arg : actual(arg), | |
expected: expected, | |
operator: oper || "===", | |
stackStartFunction: _toss.caller | |
}); | |
} | |
function _getClass(arg) { | |
return Object.prototype.toString.call(arg).slice(8, -1); | |
} | |
function noop() {} | |
var types = { | |
bool: { | |
check: function(arg) { | |
return "boolean" == typeof arg; | |
} | |
}, | |
func: { | |
check: function(arg) { | |
return "function" == typeof arg; | |
} | |
}, | |
string: { | |
check: function(arg) { | |
return "string" == typeof arg; | |
} | |
}, | |
object: { | |
check: function(arg) { | |
return "object" == typeof arg && null !== arg; | |
} | |
}, | |
number: { | |
check: function(arg) { | |
return "number" == typeof arg && !isNaN(arg); | |
} | |
}, | |
finite: { | |
check: function(arg) { | |
return "number" == typeof arg && !isNaN(arg) && isFinite(arg); | |
} | |
}, | |
buffer: { | |
check: function(arg) { | |
return Buffer.isBuffer(arg); | |
}, | |
operator: "Buffer.isBuffer" | |
}, | |
array: { | |
check: function(arg) { | |
return Array.isArray(arg); | |
}, | |
operator: "Array.isArray" | |
}, | |
stream: { | |
check: function(arg) { | |
return arg instanceof Stream; | |
}, | |
operator: "instanceof", | |
actual: _getClass | |
}, | |
date: { | |
check: function(arg) { | |
return arg instanceof Date; | |
}, | |
operator: "instanceof", | |
actual: _getClass | |
}, | |
regexp: { | |
check: function(arg) { | |
return arg instanceof RegExp; | |
}, | |
operator: "instanceof", | |
actual: _getClass | |
}, | |
uuid: { | |
check: function(arg) { | |
return "string" == typeof arg && UUID_REGEXP.test(arg); | |
}, | |
operator: "isUUID" | |
} | |
}; | |
module.exports = (function _setExports(ndebug) { | |
var out, keys = Object.keys(types); | |
return out = process.env.NODE_NDEBUG ? noop : function(arg, msg) { | |
arg || _toss(msg, "true", arg); | |
}, keys.forEach((function(k) { | |
if (ndebug) out[k] = noop; else { | |
var type = types[k]; | |
out[k] = function(arg, msg) { | |
type.check(arg) || _toss(msg, k, type.operator, arg, type.actual); | |
}; | |
} | |
})), keys.forEach((function(k) { | |
var name = "optional" + _capitalize(k); | |
if (ndebug) out[name] = noop; else { | |
var type = types[k]; | |
out[name] = function(arg, msg) { | |
null != arg && (type.check(arg) || _toss(msg, k, type.operator, arg, type.actual)); | |
}; | |
} | |
})), keys.forEach((function(k) { | |
var name = "arrayOf" + _capitalize(k); | |
if (ndebug) out[name] = noop; else { | |
var type = types[k], expected = "[" + k + "]"; | |
out[name] = function(arg, msg) { | |
var i; | |
for (Array.isArray(arg) || _toss(msg, expected, type.operator, arg, type.actual), | |
i = 0; i < arg.length; i++) type.check(arg[i]) || _toss(msg, expected, type.operator, arg, type.actual); | |
}; | |
} | |
})), keys.forEach((function(k) { | |
var name = "optionalArrayOf" + _capitalize(k); | |
if (ndebug) out[name] = noop; else { | |
var type = types[k], expected = "[" + k + "]"; | |
out[name] = function(arg, msg) { | |
var i; | |
if (null != arg) for (Array.isArray(arg) || _toss(msg, expected, type.operator, arg, type.actual), | |
i = 0; i < arg.length; i++) type.check(arg[i]) || _toss(msg, expected, type.operator, arg, type.actual); | |
}; | |
} | |
})), Object.keys(assert).forEach((function(k) { | |
out[k] = "AssertionError" !== k && ndebug ? noop : assert[k]; | |
})), out._setExports = _setExports, out; | |
})(process.env.NODE_NDEBUG); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var tryCatchTarget, es5 = __webpack_require__(66), canEvaluate = "undefined" == typeof navigator, errorObj = { | |
e: {} | |
}, globalObject = "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : void 0 !== this ? this : null; | |
function tryCatcher() { | |
try { | |
var target = tryCatchTarget; | |
return tryCatchTarget = null, target.apply(this, arguments); | |
} catch (e) { | |
return errorObj.e = e, errorObj; | |
} | |
} | |
function isPrimitive(val) { | |
return null == val || !0 === val || !1 === val || "string" == typeof val || "number" == typeof val; | |
} | |
function notEnumerableProp(obj, name, value) { | |
if (isPrimitive(obj)) return obj; | |
var descriptor = { | |
value: value, | |
configurable: !0, | |
enumerable: !1, | |
writable: !0 | |
}; | |
return es5.defineProperty(obj, name, descriptor), obj; | |
} | |
var inheritedDataKeys = (function() { | |
var excludedPrototypes = [ Array.prototype, Object.prototype, Function.prototype ], isExcludedProto = function(val) { | |
for (var i = 0; i < excludedPrototypes.length; ++i) if (excludedPrototypes[i] === val) return !0; | |
return !1; | |
}; | |
if (es5.isES5) { | |
var getKeys = Object.getOwnPropertyNames; | |
return function(obj) { | |
for (var ret = [], visitedKeys = Object.create(null); null != obj && !isExcludedProto(obj); ) { | |
var keys; | |
try { | |
keys = getKeys(obj); | |
} catch (e) { | |
return ret; | |
} | |
for (var i = 0; i < keys.length; ++i) { | |
var key = keys[i]; | |
if (!visitedKeys[key]) { | |
visitedKeys[key] = !0; | |
var desc = Object.getOwnPropertyDescriptor(obj, key); | |
null != desc && null == desc.get && null == desc.set && ret.push(key); | |
} | |
} | |
obj = es5.getPrototypeOf(obj); | |
} | |
return ret; | |
}; | |
} | |
var hasProp = {}.hasOwnProperty; | |
return function(obj) { | |
if (isExcludedProto(obj)) return []; | |
var ret = []; | |
enumeration: for (var key in obj) if (hasProp.call(obj, key)) ret.push(key); else { | |
for (var i = 0; i < excludedPrototypes.length; ++i) if (hasProp.call(excludedPrototypes[i], key)) continue enumeration; | |
ret.push(key); | |
} | |
return ret; | |
}; | |
})(), thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; | |
var rident = /^[a-z$_][a-z$_0-9]*$/i; | |
function safeToString(obj) { | |
try { | |
return obj + ""; | |
} catch (e) { | |
return "[no string representation]"; | |
} | |
} | |
function isError(obj) { | |
return obj instanceof Error || null !== obj && "object" == typeof obj && "string" == typeof obj.message && "string" == typeof obj.name; | |
} | |
function canAttachTrace(obj) { | |
return isError(obj) && es5.propertyIsWritable(obj, "stack"); | |
} | |
var ensureErrorObject = "stack" in new Error ? function(value) { | |
return canAttachTrace(value) ? value : new Error(safeToString(value)); | |
} : function(value) { | |
if (canAttachTrace(value)) return value; | |
try { | |
throw new Error(safeToString(value)); | |
} catch (err) { | |
return err; | |
} | |
}; | |
function classString(obj) { | |
return {}.toString.call(obj); | |
} | |
var asArray = function(v) { | |
return es5.isArray(v) ? v : null; | |
}; | |
if ("undefined" != typeof Symbol && Symbol.iterator) { | |
var ArrayFrom = "function" == typeof Array.from ? function(v) { | |
return Array.from(v); | |
} : function(v) { | |
for (var itResult, ret = [], it = v[Symbol.iterator](); !(itResult = it.next()).done; ) ret.push(itResult.value); | |
return ret; | |
}; | |
asArray = function(v) { | |
return es5.isArray(v) ? v : null != v && "function" == typeof v[Symbol.iterator] ? ArrayFrom(v) : null; | |
}; | |
} | |
var isNode = "undefined" != typeof process && "[object process]" === classString(process).toLowerCase(), hasEnvVariables = "undefined" != typeof process && void 0 !== process.env; | |
var version, ret = { | |
isClass: function(fn) { | |
try { | |
if ("function" == typeof fn) { | |
var keys = es5.names(fn.prototype), hasMethods = es5.isES5 && keys.length > 1, hasMethodsOtherThanConstructor = keys.length > 0 && !(1 === keys.length && "constructor" === keys[0]), hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; | |
if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) return !0; | |
} | |
return !1; | |
} catch (e) { | |
return !1; | |
} | |
}, | |
isIdentifier: function(str) { | |
return rident.test(str); | |
}, | |
inheritedDataKeys: inheritedDataKeys, | |
getDataPropertyOrDefault: function(obj, key, defaultValue) { | |
if (!es5.isES5) return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; | |
var desc = Object.getOwnPropertyDescriptor(obj, key); | |
return null != desc ? null == desc.get && null == desc.set ? desc.value : defaultValue : void 0; | |
}, | |
thrower: function(r) { | |
throw r; | |
}, | |
isArray: es5.isArray, | |
asArray: asArray, | |
notEnumerableProp: notEnumerableProp, | |
isPrimitive: isPrimitive, | |
isObject: function(value) { | |
return "function" == typeof value || "object" == typeof value && null !== value; | |
}, | |
isError: isError, | |
canEvaluate: canEvaluate, | |
errorObj: errorObj, | |
tryCatch: function(fn) { | |
return tryCatchTarget = fn, tryCatcher; | |
}, | |
inherits: function(Child, Parent) { | |
var hasProp = {}.hasOwnProperty; | |
function T() { | |
for (var propertyName in this.constructor = Child, this.constructor$ = Parent, Parent.prototype) hasProp.call(Parent.prototype, propertyName) && "$" !== propertyName.charAt(propertyName.length - 1) && (this[propertyName + "$"] = Parent.prototype[propertyName]); | |
} | |
return T.prototype = Parent.prototype, Child.prototype = new T, Child.prototype; | |
}, | |
withAppended: function(target, appendee) { | |
var i, len = target.length, ret = new Array(len + 1); | |
for (i = 0; i < len; ++i) ret[i] = target[i]; | |
return ret[i] = appendee, ret; | |
}, | |
maybeWrapAsError: function(maybeError) { | |
return isPrimitive(maybeError) ? new Error(safeToString(maybeError)) : maybeError; | |
}, | |
toFastProperties: function(obj) { | |
function FakeConstructor() {} | |
FakeConstructor.prototype = obj; | |
var receiver = new FakeConstructor; | |
function ic() { | |
return typeof receiver.foo; | |
} | |
return ic(), ic(), obj; | |
}, | |
filledRange: function(count, prefix, suffix) { | |
for (var ret = new Array(count), i = 0; i < count; ++i) ret[i] = prefix + i + suffix; | |
return ret; | |
}, | |
toString: safeToString, | |
canAttachTrace: canAttachTrace, | |
ensureErrorObject: ensureErrorObject, | |
originatesFromRejection: function(e) { | |
return null != e && (e instanceof Error.__BluebirdErrorTypes__.OperationalError || !0 === e.isOperational); | |
}, | |
markAsOriginatingFromRejection: function(e) { | |
try { | |
notEnumerableProp(e, "isOperational", !0); | |
} catch (ignore) {} | |
}, | |
classString: classString, | |
copyDescriptors: function(from, to, filter) { | |
for (var keys = es5.names(from), i = 0; i < keys.length; ++i) { | |
var key = keys[i]; | |
if (filter(key)) try { | |
es5.defineProperty(to, key, es5.getDescriptor(from, key)); | |
} catch (ignore) {} | |
} | |
}, | |
hasDevTools: "undefined" != typeof chrome && chrome && "function" == typeof chrome.loadTimes, | |
isNode: isNode, | |
hasEnvVariables: hasEnvVariables, | |
env: function(key) { | |
return hasEnvVariables ? process.env[key] : void 0; | |
}, | |
global: globalObject, | |
getNativePromise: function() { | |
if ("function" == typeof Promise) try { | |
var promise = new Promise((function() {})); | |
if ("[object Promise]" === {}.toString.call(promise)) return Promise; | |
} catch (e) {} | |
}, | |
domainBind: function(self, cb) { | |
return self.bind(cb); | |
} | |
}; | |
ret.isRecentNode = ret.isNode && (process.versions && process.versions.node ? version = process.versions.node.split(".").map(Number) : process.version && (version = process.version.split(".").map(Number)), | |
0 === version[0] && version[1] > 10 || version[0] > 0), ret.isNode && ret.toFastProperties(process); | |
try { | |
throw new Error; | |
} catch (e) { | |
ret.lastLineError = e; | |
} | |
module.exports = ret; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var tryCatchTarget, es5 = __webpack_require__(81), canEvaluate = "undefined" == typeof navigator, errorObj = { | |
e: {} | |
}, globalObject = "undefined" != typeof self ? self : "undefined" != typeof window ? window : "undefined" != typeof global ? global : void 0 !== this ? this : null; | |
function tryCatcher() { | |
try { | |
var target = tryCatchTarget; | |
return tryCatchTarget = null, target.apply(this, arguments); | |
} catch (e) { | |
return errorObj.e = e, errorObj; | |
} | |
} | |
function isPrimitive(val) { | |
return null == val || !0 === val || !1 === val || "string" == typeof val || "number" == typeof val; | |
} | |
function notEnumerableProp(obj, name, value) { | |
if (isPrimitive(obj)) return obj; | |
var descriptor = { | |
value: value, | |
configurable: !0, | |
enumerable: !1, | |
writable: !0 | |
}; | |
return es5.defineProperty(obj, name, descriptor), obj; | |
} | |
var inheritedDataKeys = (function() { | |
var excludedPrototypes = [ Array.prototype, Object.prototype, Function.prototype ], isExcludedProto = function(val) { | |
for (var i = 0; i < excludedPrototypes.length; ++i) if (excludedPrototypes[i] === val) return !0; | |
return !1; | |
}; | |
if (es5.isES5) { | |
var getKeys = Object.getOwnPropertyNames; | |
return function(obj) { | |
for (var ret = [], visitedKeys = Object.create(null); null != obj && !isExcludedProto(obj); ) { | |
var keys; | |
try { | |
keys = getKeys(obj); | |
} catch (e) { | |
return ret; | |
} | |
for (var i = 0; i < keys.length; ++i) { | |
var key = keys[i]; | |
if (!visitedKeys[key]) { | |
visitedKeys[key] = !0; | |
var desc = Object.getOwnPropertyDescriptor(obj, key); | |
null != desc && null == desc.get && null == desc.set && ret.push(key); | |
} | |
} | |
obj = es5.getPrototypeOf(obj); | |
} | |
return ret; | |
}; | |
} | |
var hasProp = {}.hasOwnProperty; | |
return function(obj) { | |
if (isExcludedProto(obj)) return []; | |
var ret = []; | |
enumeration: for (var key in obj) if (hasProp.call(obj, key)) ret.push(key); else { | |
for (var i = 0; i < excludedPrototypes.length; ++i) if (hasProp.call(excludedPrototypes[i], key)) continue enumeration; | |
ret.push(key); | |
} | |
return ret; | |
}; | |
})(), thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; | |
var rident = /^[a-z$_][a-z$_0-9]*$/i; | |
function safeToString(obj) { | |
try { | |
return obj + ""; | |
} catch (e) { | |
return "[no string representation]"; | |
} | |
} | |
function isError(obj) { | |
return null !== obj && "object" == typeof obj && "string" == typeof obj.message && "string" == typeof obj.name; | |
} | |
function canAttachTrace(obj) { | |
return isError(obj) && es5.propertyIsWritable(obj, "stack"); | |
} | |
var ensureErrorObject = "stack" in new Error ? function(value) { | |
return canAttachTrace(value) ? value : new Error(safeToString(value)); | |
} : function(value) { | |
if (canAttachTrace(value)) return value; | |
try { | |
throw new Error(safeToString(value)); | |
} catch (err) { | |
return err; | |
} | |
}; | |
function classString(obj) { | |
return {}.toString.call(obj); | |
} | |
var asArray = function(v) { | |
return es5.isArray(v) ? v : null; | |
}; | |
if ("undefined" != typeof Symbol && Symbol.iterator) { | |
var ArrayFrom = "function" == typeof Array.from ? function(v) { | |
return Array.from(v); | |
} : function(v) { | |
for (var itResult, ret = [], it = v[Symbol.iterator](); !(itResult = it.next()).done; ) ret.push(itResult.value); | |
return ret; | |
}; | |
asArray = function(v) { | |
return es5.isArray(v) ? v : null != v && "function" == typeof v[Symbol.iterator] ? ArrayFrom(v) : null; | |
}; | |
} | |
var isNode = "undefined" != typeof process && "[object process]" === classString(process).toLowerCase(), hasEnvVariables = "undefined" != typeof process && void 0 !== process.env; | |
var version, ret = { | |
isClass: function(fn) { | |
try { | |
if ("function" == typeof fn) { | |
var keys = es5.names(fn.prototype), hasMethods = es5.isES5 && keys.length > 1, hasMethodsOtherThanConstructor = keys.length > 0 && !(1 === keys.length && "constructor" === keys[0]), hasThisAssignmentAndStaticMethods = thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; | |
if (hasMethods || hasMethodsOtherThanConstructor || hasThisAssignmentAndStaticMethods) return !0; | |
} | |
return !1; | |
} catch (e) { | |
return !1; | |
} | |
}, | |
isIdentifier: function(str) { | |
return rident.test(str); | |
}, | |
inheritedDataKeys: inheritedDataKeys, | |
getDataPropertyOrDefault: function(obj, key, defaultValue) { | |
if (!es5.isES5) return {}.hasOwnProperty.call(obj, key) ? obj[key] : void 0; | |
var desc = Object.getOwnPropertyDescriptor(obj, key); | |
return null != desc ? null == desc.get && null == desc.set ? desc.value : defaultValue : void 0; | |
}, | |
thrower: function(r) { | |
throw r; | |
}, | |
isArray: es5.isArray, | |
asArray: asArray, | |
notEnumerableProp: notEnumerableProp, | |
isPrimitive: isPrimitive, | |
isObject: function(value) { | |
return "function" == typeof value || "object" == typeof value && null !== value; | |
}, | |
isError: isError, | |
canEvaluate: canEvaluate, | |
errorObj: errorObj, | |
tryCatch: function(fn) { | |
return tryCatchTarget = fn, tryCatcher; | |
}, | |
inherits: function(Child, Parent) { | |
var hasProp = {}.hasOwnProperty; | |
function T() { | |
for (var propertyName in this.constructor = Child, this.constructor$ = Parent, Parent.prototype) hasProp.call(Parent.prototype, propertyName) && "$" !== propertyName.charAt(propertyName.length - 1) && (this[propertyName + "$"] = Parent.prototype[propertyName]); | |
} | |
return T.prototype = Parent.prototype, Child.prototype = new T, Child.prototype; | |
}, | |
withAppended: function(target, appendee) { | |
var i, len = target.length, ret = new Array(len + 1); | |
for (i = 0; i < len; ++i) ret[i] = target[i]; | |
return ret[i] = appendee, ret; | |
}, | |
maybeWrapAsError: function(maybeError) { | |
return isPrimitive(maybeError) ? new Error(safeToString(maybeError)) : maybeError; | |
}, | |
toFastProperties: function(obj) { | |
function FakeConstructor() {} | |
FakeConstructor.prototype = obj; | |
for (var l = 8; l--; ) new FakeConstructor; | |
return obj; | |
}, | |
filledRange: function(count, prefix, suffix) { | |
for (var ret = new Array(count), i = 0; i < count; ++i) ret[i] = prefix + i + suffix; | |
return ret; | |
}, | |
toString: safeToString, | |
canAttachTrace: canAttachTrace, | |
ensureErrorObject: ensureErrorObject, | |
originatesFromRejection: function(e) { | |
return null != e && (e instanceof Error.__BluebirdErrorTypes__.OperationalError || !0 === e.isOperational); | |
}, | |
markAsOriginatingFromRejection: function(e) { | |
try { | |
notEnumerableProp(e, "isOperational", !0); | |
} catch (ignore) {} | |
}, | |
classString: classString, | |
copyDescriptors: function(from, to, filter) { | |
for (var keys = es5.names(from), i = 0; i < keys.length; ++i) { | |
var key = keys[i]; | |
if (filter(key)) try { | |
es5.defineProperty(to, key, es5.getDescriptor(from, key)); | |
} catch (ignore) {} | |
} | |
}, | |
hasDevTools: "undefined" != typeof chrome && chrome && "function" == typeof chrome.loadTimes, | |
isNode: isNode, | |
hasEnvVariables: hasEnvVariables, | |
env: function(key) { | |
return hasEnvVariables ? process.env[key] : void 0; | |
}, | |
global: globalObject, | |
getNativePromise: function() { | |
if ("function" == typeof Promise) try { | |
var promise = new Promise((function() {})); | |
if ("[object Promise]" === {}.toString.call(promise)) return Promise; | |
} catch (e) {} | |
}, | |
domainBind: function(self, cb) { | |
return self.bind(cb); | |
} | |
}; | |
ret.isRecentNode = ret.isNode && (0 === (version = process.versions.node.split(".").map(Number))[0] && version[1] > 10 || version[0] > 0), | |
ret.isNode && ret.toFastProperties(process); | |
try { | |
throw new Error; | |
} catch (e) { | |
ret.lastLineError = e; | |
} | |
module.exports = ret; | |
}, function(module, exports) { | |
module.exports = function(conf, csName, lang) { | |
this.confidence = conf, this.charsetName = csName, this.lang = lang; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var schema = __webpack_require__(13), tools = __webpack_require__(75); | |
module.exports = { | |
addAttribute: function(proto, ebmlName) { | |
var ebmlID = schema.byName[ebmlName]; | |
if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); | |
var schemaInfo = schema.byEbmlID[ebmlID], type = schemaInfo.type, name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); | |
ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { | |
iterable: !0, | |
get: function() { | |
var child = this.getFirstChildByName(ebmlID); | |
if (child) return "ebmlID" === schemaInfo.type2 ? child.getUInt() : child.getValue(); | |
}, | |
set: function(value) { | |
var child = this.getFirstChildByName(ebmlID); | |
if (child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child)), | |
"ebmlID" === schemaInfo.type2) child.setTargetEbmlID(value); else if (schemaInfo.position) child.setTargetPosition(value); else { | |
try { | |
value = tools.validType(type, value); | |
} catch (x) { | |
throw x; | |
} | |
child.setValue(value); | |
} | |
return this; | |
} | |
}), Object.defineProperty(proto, "$$" + name, { | |
iterable: !1, | |
get: function() { | |
return this.getFirstChildByName(ebmlID); | |
} | |
}), proto["get" + ebmlName] = function() { | |
var child = this.getFirstChildByName(ebmlID); | |
return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), | |
child); | |
}; | |
}, | |
addChild: function(proto, ebmlName) { | |
var ebmlID = schema.byName[ebmlName]; | |
if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); | |
var name = ebmlName; | |
(ret = /^([A-Z])([a-z].*)$/.exec(name)) && (name = ret[1].toLowerCase() + ret[2]); | |
var ret, names = name; | |
names = (ret = /(.*)y$/.exec(names)) ? ret[1] + "ies" : name + "s", Object.defineProperty(proto, names, { | |
iterable: !0, | |
get: function() { | |
return this.listChildrenByName(ebmlID); | |
} | |
}), Object.defineProperty(proto, name, { | |
iterable: !0, | |
get: function() { | |
return this.getFirstChildByName(ebmlID); | |
} | |
}), Object.defineProperty(proto, "$" + name, { | |
iterable: !0, | |
get: function() { | |
var child = this.getFirstChildByName(ebmlID); | |
return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), | |
child); | |
} | |
}), proto["new" + ebmlName] = function() { | |
var child = this.ownerDocument.createElement(ebmlID); | |
return this.appendChild(child), child; | |
}, proto["add" + ebmlName] = function(value) { | |
var child = this.ownerDocument.createElement(ebmlID); | |
return this.appendChild(child), child.setValue(value), child; | |
}; | |
}, | |
oneChild: function(proto, ebmlName) { | |
var ebmlID = schema.byName[ebmlName]; | |
if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); | |
var name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); | |
ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { | |
iterable: !0, | |
get: function() { | |
return this.getFirstChildByName(ebmlID); | |
} | |
}), Object.defineProperty(proto, "$" + name, { | |
iterable: !0, | |
get: function() { | |
var child = this.getFirstChildByName(ebmlID); | |
return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), | |
child); | |
} | |
}), proto["set" + ebmlName] = function() { | |
var old = this.getFirstChildByName(name); | |
old && old.remove(); | |
var child = this.ownerDocument.createElement(ebmlID); | |
return this.appendChild(child), child; | |
}; | |
} | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var schema = __webpack_require__(12), tools = __webpack_require__(72); | |
module.exports = { | |
addAttribute: function(proto, ebmlName) { | |
var ebmlID = schema.byName[ebmlName]; | |
if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); | |
var schemaInfo = schema.byEbmlID[ebmlID], type = schemaInfo.type, name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); | |
ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { | |
iterable: !0, | |
get: function() { | |
var child = this.getFirstChildByName(ebmlID); | |
if (child) return "ebmlID" === schemaInfo.type2 ? child.getUInt() : child.getValue(); | |
}, | |
set: function(value) { | |
var child = this.getFirstChildByName(ebmlID); | |
if (child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child)), | |
"ebmlID" === schemaInfo.type2) child.setTargetEbmlID(value); else if (schemaInfo.position) child.setTargetPosition(value); else { | |
try { | |
value = tools.validType(type, value); | |
} catch (x) { | |
throw console.error("Type of attribute=", schemaInfo, x), x; | |
} | |
child.setValue(value); | |
} | |
return this; | |
} | |
}), Object.defineProperty(proto, "$$" + name, { | |
iterable: !1, | |
get: function() { | |
return this.getFirstChildByName(ebmlID); | |
} | |
}), proto["get" + ebmlName] = function() { | |
var child = this.getFirstChildByName(ebmlID); | |
return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), | |
child); | |
}; | |
}, | |
addChild: function(proto, ebmlName) { | |
var ebmlID = schema.byName[ebmlName]; | |
if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); | |
var name = ebmlName; | |
(ret = /^([A-Z])([a-z].*)$/.exec(name)) && (name = ret[1].toLowerCase() + ret[2]); | |
var ret, names = name; | |
names = (ret = /(.*)y$/.exec(names)) ? ret[1] + "ies" : name + "s", Object.defineProperty(proto, names, { | |
iterable: !0, | |
get: function() { | |
return this.listChildrenByName(ebmlID); | |
} | |
}), Object.defineProperty(proto, name, { | |
iterable: !0, | |
get: function() { | |
return this.getFirstChildByName(ebmlID); | |
} | |
}), Object.defineProperty(proto, "$" + name, { | |
iterable: !0, | |
get: function() { | |
var child = this.getFirstChildByName(ebmlID); | |
return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), | |
child); | |
} | |
}), proto["new" + ebmlName] = function() { | |
var child = this.ownerDocument.createElement(ebmlID); | |
return this.appendChild(child), child; | |
}, proto["add" + ebmlName] = function(value) { | |
var child = this.ownerDocument.createElement(ebmlID); | |
return this.appendChild(child), child.setValue(value), child; | |
}; | |
}, | |
oneChild: function(proto, ebmlName) { | |
var ebmlID = schema.byName[ebmlName]; | |
if (!ebmlID) throw new Error("Invalid ebmlName '" + ebmlName + "'"); | |
var name = ebmlName, ret = /^([A-Z])([a-z].*)$/.exec(name); | |
ret && (name = ret[1].toLowerCase() + ret[2]), Object.defineProperty(proto, name, { | |
iterable: !0, | |
get: function() { | |
return this.getFirstChildByName(ebmlID); | |
} | |
}), Object.defineProperty(proto, "$" + name, { | |
iterable: !0, | |
get: function() { | |
var child = this.getFirstChildByName(ebmlID); | |
return child || (child = this.ownerDocument.createElement(ebmlID), this.appendChild(child), | |
child); | |
} | |
}), proto["set" + ebmlName] = function() { | |
var old = this.getFirstChildByName(name); | |
old && old.remove(); | |
var child = this.ownerDocument.createElement(ebmlID); | |
return this.appendChild(child), child; | |
}; | |
} | |
}; | |
}, function(module, exports) { | |
module.exports = require("os"); | |
}, function(module, exports) { | |
module.exports = require("https"); | |
}, function(module, exports, __webpack_require__) { | |
var buffer = __webpack_require__(10), Buffer = buffer.Buffer; | |
function copyProps(src, dst) { | |
for (var key in src) dst[key] = src[key]; | |
} | |
function SafeBuffer(arg, encodingOrOffset, length) { | |
return Buffer(arg, encodingOrOffset, length); | |
} | |
Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow ? module.exports = buffer : (copyProps(buffer, exports), | |
exports.Buffer = SafeBuffer), copyProps(Buffer, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) { | |
if ("number" == typeof arg) throw new TypeError("Argument must not be a number"); | |
return Buffer(arg, encodingOrOffset, length); | |
}, SafeBuffer.alloc = function(size, fill, encoding) { | |
if ("number" != typeof size) throw new TypeError("Argument must be a number"); | |
var buf = Buffer(size); | |
return void 0 !== fill ? "string" == typeof encoding ? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), | |
buf; | |
}, SafeBuffer.allocUnsafe = function(size) { | |
if ("number" != typeof size) throw new TypeError("Argument must be a number"); | |
return Buffer(size); | |
}, SafeBuffer.allocUnsafeSlow = function(size) { | |
if ("number" != typeof size) throw new TypeError("Argument must be a number"); | |
return buffer.SlowBuffer(size); | |
}; | |
}, function(module, exports) { | |
module.exports = require("assert"); | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Key; | |
var edCompat, assert = __webpack_require__(15), algs = __webpack_require__(30), crypto = __webpack_require__(9), Fingerprint = __webpack_require__(97), Signature = __webpack_require__(48), DiffieHellman = __webpack_require__(233).DiffieHellman, errs = __webpack_require__(44), utils = __webpack_require__(26), PrivateKey = __webpack_require__(27); | |
try { | |
edCompat = __webpack_require__(479); | |
} catch (e) {} | |
var InvalidAlgorithmError = errs.InvalidAlgorithmError, KeyParseError = errs.KeyParseError, formats = {}; | |
function Key(opts) { | |
assert.object(opts, "options"), assert.arrayOfObject(opts.parts, "options.parts"), | |
assert.string(opts.type, "options.type"), assert.optionalString(opts.comment, "options.comment"); | |
var algInfo = algs.info[opts.type]; | |
if ("object" != typeof algInfo) throw new InvalidAlgorithmError(opts.type); | |
for (var sz, partLookup = {}, i = 0; i < opts.parts.length; ++i) { | |
var part = opts.parts[i]; | |
partLookup[part.name] = part; | |
} | |
if (this.type = opts.type, this.parts = opts.parts, this.part = partLookup, this.comment = void 0, | |
this.source = opts.source, this._rfc4253Cache = opts._rfc4253Cache, this._hashCache = {}, | |
this.curve = void 0, "ecdsa" === this.type) { | |
var curve = this.part.curve.data.toString(); | |
this.curve = curve, sz = algs.curves[curve].size; | |
} else if ("ed25519" === this.type || "curve25519" === this.type) sz = 256, this.curve = "curve25519"; else { | |
var szPart = this.part[algInfo.sizePart]; | |
sz = 8 * (sz = szPart.data.length) - utils.countZeros(szPart.data); | |
} | |
this.size = sz; | |
} | |
formats.auto = __webpack_require__(480), formats.pem = __webpack_require__(56), | |
formats.pkcs1 = __webpack_require__(234), formats.pkcs8 = __webpack_require__(101), | |
formats.rfc4253 = __webpack_require__(57), formats.ssh = __webpack_require__(482), | |
formats["ssh-private"] = __webpack_require__(152), formats.openssh = formats["ssh-private"], | |
formats.dnssec = __webpack_require__(235), formats.putty = __webpack_require__(483), | |
formats.ppk = formats.putty, Key.formats = formats, Key.prototype.toBuffer = function(format, options) { | |
return void 0 === format && (format = "ssh"), assert.string(format, "format"), assert.object(formats[format], "formats[format]"), | |
assert.optionalObject(options, "options"), "rfc4253" === format ? (void 0 === this._rfc4253Cache && (this._rfc4253Cache = formats.rfc4253.write(this)), | |
this._rfc4253Cache) : formats[format].write(this, options); | |
}, Key.prototype.toString = function(format, options) { | |
return this.toBuffer(format, options).toString(); | |
}, Key.prototype.hash = function(algo, type) { | |
if (assert.string(algo, "algorithm"), assert.optionalString(type, "type"), void 0 === type && (type = "ssh"), | |
algo = algo.toLowerCase(), void 0 === algs.hashAlgs[algo]) throw new InvalidAlgorithmError(algo); | |
var buf, cacheKey = algo + "||" + type; | |
if (this._hashCache[cacheKey]) return this._hashCache[cacheKey]; | |
if ("ssh" === type) buf = this.toBuffer("rfc4253"); else { | |
if ("spki" !== type) throw new Error("Hash type " + type + " not supported"); | |
buf = formats.pkcs8.pkcs8ToBuffer(this); | |
} | |
var hash = crypto.createHash(algo).update(buf).digest(); | |
return this._hashCache[cacheKey] = hash, hash; | |
}, Key.prototype.fingerprint = function(algo, type) { | |
void 0 === algo && (algo = "sha256"), void 0 === type && (type = "ssh"), assert.string(algo, "algorithm"), | |
assert.string(type, "type"); | |
var opts = { | |
type: "key", | |
hash: this.hash(algo, type), | |
algorithm: algo, | |
hashType: type | |
}; | |
return new Fingerprint(opts); | |
}, Key.prototype.defaultHashAlgorithm = function() { | |
var hashAlgo = "sha1"; | |
return "rsa" === this.type && (hashAlgo = "sha256"), "dsa" === this.type && this.size > 1024 && (hashAlgo = "sha256"), | |
"ed25519" === this.type && (hashAlgo = "sha512"), "ecdsa" === this.type && (hashAlgo = this.size <= 256 ? "sha256" : this.size <= 384 ? "sha384" : "sha512"), | |
hashAlgo; | |
}, Key.prototype.createVerify = function(hashAlgo) { | |
if (void 0 === hashAlgo && (hashAlgo = this.defaultHashAlgorithm()), assert.string(hashAlgo, "hash algorithm"), | |
"ed25519" === this.type && void 0 !== edCompat) return new edCompat.Verifier(this, hashAlgo); | |
if ("curve25519" === this.type) throw new Error("Curve25519 keys are not suitable for signing or verification"); | |
var v, nm, err; | |
try { | |
nm = hashAlgo.toUpperCase(), v = crypto.createVerify(nm); | |
} catch (e) { | |
err = e; | |
} | |
(void 0 === v || err instanceof Error && err.message.match(/Unknown message digest/)) && (nm = "RSA-", | |
nm += hashAlgo.toUpperCase(), v = crypto.createVerify(nm)), assert.ok(v, "failed to create verifier"); | |
var oldVerify = v.verify.bind(v), key = this.toBuffer("pkcs8"), curve = this.curve, self = this; | |
return v.verify = function(signature, fmt) { | |
if (Signature.isSignature(signature, [ 2, 0 ])) return signature.type === self.type && (!signature.hashAlgorithm || signature.hashAlgorithm === hashAlgo) && (!signature.curve || "ecdsa" !== self.type || signature.curve === curve) && oldVerify(key, signature.toBuffer("asn1")); | |
if ("string" == typeof signature || Buffer.isBuffer(signature)) return oldVerify(key, signature, fmt); | |
throw Signature.isSignature(signature, [ 1, 0 ]) ? new Error("signature was created by too old a version of sshpk and cannot be verified") : new TypeError("signature must be a string, Buffer, or Signature object"); | |
}, v; | |
}, Key.prototype.createDiffieHellman = function() { | |
if ("rsa" === this.type) throw new Error("RSA keys do not support Diffie-Hellman"); | |
return new DiffieHellman(this); | |
}, Key.prototype.createDH = Key.prototype.createDiffieHellman, Key.parse = function(data, format, options) { | |
"string" != typeof data && assert.buffer(data, "data"), void 0 === format && (format = "auto"), | |
assert.string(format, "format"), "string" == typeof options && (options = { | |
filename: options | |
}), assert.optionalObject(options, "options"), void 0 === options && (options = {}), | |
assert.optionalString(options.filename, "options.filename"), void 0 === options.filename && (options.filename = "(unnamed)"), | |
assert.object(formats[format], "formats[format]"); | |
try { | |
var k = formats[format].read(data, options); | |
return k instanceof PrivateKey && (k = k.toPublic()), k.comment || (k.comment = options.filename), | |
k; | |
} catch (e) { | |
if ("KeyEncryptedError" === e.name) throw e; | |
throw new KeyParseError(options.filename, format, e); | |
} | |
}, Key.isKey = function(obj, ver) { | |
return utils.isCompatible(obj, Key, ver); | |
}, Key.prototype._sshpkApiVersion = [ 1, 7 ], Key._oldVersionDetect = function(obj) { | |
return assert.func(obj.toBuffer), assert.func(obj.fingerprint), obj.createDH ? [ 1, 4 ] : obj.defaultHashAlgorithm ? [ 1, 3 ] : obj.formats.auto ? [ 1, 2 ] : obj.formats.pkcs1 ? [ 1, 1 ] : [ 1, 0 ]; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = { | |
bufferSplit: function(buf, chr) { | |
assert.buffer(buf), assert.string(chr); | |
for (var parts = [], lastPart = 0, matches = 0, i = 0; i < buf.length; ++i) if (buf[i] === chr.charCodeAt(matches) ? ++matches : matches = buf[i] === chr.charCodeAt(0) ? 1 : 0, | |
matches >= chr.length) { | |
var newPart = i + 1; | |
parts.push(buf.slice(lastPart, newPart - matches)), lastPart = newPart, matches = 0; | |
} | |
return lastPart <= buf.length && parts.push(buf.slice(lastPart, buf.length)), parts; | |
}, | |
addRSAMissing: function(key) { | |
assert.object(key), assertCompatible(key, PrivateKey, [ 1, 1 ]); | |
var buf, d = new jsbn(key.part.d.data); | |
if (!key.part.dmodp) { | |
var p = new jsbn(key.part.p.data); | |
buf = bigintToMpBuf(d.mod(p.subtract(1))), key.part.dmodp = { | |
name: "dmodp", | |
data: buf | |
}, key.parts.push(key.part.dmodp); | |
} | |
if (!key.part.dmodq) { | |
var q = new jsbn(key.part.q.data); | |
buf = bigintToMpBuf(d.mod(q.subtract(1))), key.part.dmodq = { | |
name: "dmodq", | |
data: buf | |
}, key.parts.push(key.part.dmodq); | |
} | |
}, | |
calculateDSAPublic: function(g, p, x) { | |
return assert.buffer(g), assert.buffer(p), assert.buffer(x), g = new jsbn(g), p = new jsbn(p), | |
x = new jsbn(x), bigintToMpBuf(g.modPow(x, p)); | |
}, | |
calculateED25519Public: function(k) { | |
assert.buffer(k); | |
var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); | |
return Buffer.from(kp.publicKey); | |
}, | |
calculateX25519Public: function(k) { | |
assert.buffer(k); | |
var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); | |
return Buffer.from(kp.publicKey); | |
}, | |
mpNormalize: mpNormalize, | |
mpDenormalize: function(buf) { | |
for (assert.buffer(buf); buf.length > 1 && 0 === buf[0]; ) buf = buf.slice(1); | |
return buf; | |
}, | |
ecNormalize: function(buf, addZero) { | |
if (assert.buffer(buf), 0 === buf[0] && 4 === buf[1]) return addZero ? buf : buf.slice(1); | |
if (4 === buf[0]) { | |
if (!addZero) return buf; | |
} else { | |
for (;0 === buf[0]; ) buf = buf.slice(1); | |
if (2 === buf[0] || 3 === buf[0]) throw new Error("Compressed elliptic curve points are not supported"); | |
if (4 !== buf[0]) throw new Error("Not a valid elliptic curve point"); | |
if (!addZero) return buf; | |
} | |
var b = Buffer.alloc(buf.length + 1); | |
return b[0] = 0, buf.copy(b, 1), b; | |
}, | |
countZeros: function(buf) { | |
for (var o = 0, obit = 8; o < buf.length; ) { | |
var mask = 1 << obit; | |
if ((buf[o] & mask) === mask) break; | |
--obit < 0 && (o++, obit = 8); | |
} | |
return 8 * o + (8 - obit) - 1; | |
}, | |
assertCompatible: assertCompatible, | |
isCompatible: function(obj, klass, needVer) { | |
if (null === obj || "object" != typeof obj) return !1; | |
if (void 0 === needVer && (needVer = klass.prototype._sshpkApiVersion), obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0]) return !0; | |
for (var proto = Object.getPrototypeOf(obj), depth = 0; proto.constructor.name !== klass.name; ) if (!(proto = Object.getPrototypeOf(proto)) || ++depth > 3) return !1; | |
if (proto.constructor.name !== klass.name) return !1; | |
var ver = proto._sshpkApiVersion; | |
return void 0 === ver && (ver = klass._oldVersionDetect(obj)), !(ver[0] != needVer[0] || ver[1] < needVer[1]); | |
}, | |
opensslKeyDeriv: function(cipher, salt, passphrase, count) { | |
assert.buffer(salt, "salt"), assert.buffer(passphrase, "passphrase"), assert.number(count, "iteration count"); | |
var D, D_prev, bufs, clen = CIPHER_LEN[cipher]; | |
assert.object(clen, "supported cipher"), salt = salt.slice(0, 8); | |
for (var material = Buffer.alloc(0); material.length < clen.key + clen.iv; ) { | |
bufs = [], D_prev && bufs.push(D_prev), bufs.push(passphrase), bufs.push(salt), | |
D = Buffer.concat(bufs); | |
for (var j = 0; j < count; ++j) D = crypto.createHash("md5").update(D).digest(); | |
material = Buffer.concat([ material, D ]), D_prev = D; | |
} | |
return { | |
key: material.slice(0, clen.key), | |
iv: material.slice(clen.key, clen.key + clen.iv) | |
}; | |
}, | |
opensshCipherInfo: function(cipher) { | |
var inf = {}; | |
switch (cipher) { | |
case "3des-cbc": | |
inf.keySize = 24, inf.blockSize = 8, inf.opensslName = "des-ede3-cbc"; | |
break; | |
case "blowfish-cbc": | |
inf.keySize = 16, inf.blockSize = 8, inf.opensslName = "bf-cbc"; | |
break; | |
case "aes128-cbc": | |
case "aes128-ctr": | |
case "[email protected]": | |
inf.keySize = 16, inf.blockSize = 16, inf.opensslName = "aes-128-" + cipher.slice(7, 10); | |
break; | |
case "aes192-cbc": | |
case "aes192-ctr": | |
case "[email protected]": | |
inf.keySize = 24, inf.blockSize = 16, inf.opensslName = "aes-192-" + cipher.slice(7, 10); | |
break; | |
case "aes256-cbc": | |
case "aes256-ctr": | |
case "[email protected]": | |
inf.keySize = 32, inf.blockSize = 16, inf.opensslName = "aes-256-" + cipher.slice(7, 10); | |
break; | |
default: | |
throw new Error('Unsupported openssl cipher "' + cipher + '"'); | |
} | |
return inf; | |
}, | |
publicFromPrivateECDSA: function(curveName, priv) { | |
assert.string(curveName, "curveName"), assert.buffer(priv); | |
var params = algs.curves[curveName], p = new jsbn(params.p), a = new jsbn(params.a), b = new jsbn(params.b), curve = new ec.ECCurveFp(p, a, b), G = curve.decodePointHex(params.G.toString("hex")), d = new jsbn(mpNormalize(priv)), pub = G.multiply(d); | |
pub = Buffer.from(curve.encodePointHex(pub), "hex"); | |
var parts = []; | |
return parts.push({ | |
name: "curve", | |
data: Buffer.from(curveName) | |
}), parts.push({ | |
name: "Q", | |
data: pub | |
}), new Key({ | |
type: "ecdsa", | |
curve: curve, | |
parts: parts | |
}); | |
}, | |
zeroPadToLength: function(buf, len) { | |
for (assert.buffer(buf), assert.number(len); buf.length > len; ) assert.equal(buf[0], 0), | |
buf = buf.slice(1); | |
for (;buf.length < len; ) { | |
var b = Buffer.alloc(buf.length + 1); | |
b[0] = 0, buf.copy(b, 1), buf = b; | |
} | |
return buf; | |
}, | |
writeBitString: function(der, buf, tag) { | |
void 0 === tag && (tag = asn1.Ber.BitString); | |
var b = Buffer.alloc(buf.length + 1); | |
b[0] = 0, buf.copy(b, 1), der.writeBuffer(b, tag); | |
}, | |
readBitString: function(der, tag) { | |
void 0 === tag && (tag = asn1.Ber.BitString); | |
var buf = der.readString(tag, !0); | |
return assert.strictEqual(buf[0], 0, "bit strings with unused bits are not supported (0x" + buf[0].toString(16) + ")"), | |
buf.slice(1); | |
}, | |
pbkdf2: function(hashAlg, salt, iterations, size, passphrase) { | |
var hkey = Buffer.alloc(salt.length + 4); | |
salt.copy(hkey); | |
for (var gen = 0, ts = [], i = 1; gen < size; ) { | |
var t = T(i++); | |
gen += t.length, ts.push(t); | |
} | |
return Buffer.concat(ts).slice(0, size); | |
function T(I) { | |
hkey.writeUInt32BE(I, hkey.length - 4); | |
var hmac = crypto.createHmac(hashAlg, passphrase); | |
hmac.update(hkey); | |
for (var Ti = hmac.digest(), Uc = Ti, c = 1; c++ < iterations; ) { | |
(hmac = crypto.createHmac(hashAlg, passphrase)).update(Uc), Uc = hmac.digest(); | |
for (var x = 0; x < Ti.length; ++x) Ti[x] ^= Uc[x]; | |
} | |
return Ti; | |
} | |
} | |
}; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, PrivateKey = __webpack_require__(27), Key = __webpack_require__(25), crypto = __webpack_require__(9), algs = __webpack_require__(30), asn1 = __webpack_require__(49), ec = __webpack_require__(151), jsbn = __webpack_require__(98).BigInteger, nacl = __webpack_require__(99); | |
function assertCompatible(obj, klass, needVer, name) { | |
if (void 0 === name && (name = "object"), assert.ok(obj, name + " must not be null"), | |
assert.object(obj, name + " must be an object"), void 0 === needVer && (needVer = klass.prototype._sshpkApiVersion), | |
!(obj instanceof klass && klass.prototype._sshpkApiVersion[0] == needVer[0])) { | |
for (var proto = Object.getPrototypeOf(obj), depth = 0; proto.constructor.name !== klass.name; ) proto = Object.getPrototypeOf(proto), | |
assert.ok(proto && ++depth <= 3, name + " must be a " + klass.name + " instance"); | |
assert.strictEqual(proto.constructor.name, klass.name, name + " must be a " + klass.name + " instance"); | |
var ver = proto._sshpkApiVersion; | |
void 0 === ver && (ver = klass._oldVersionDetect(obj)), assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1], name + " must be compatible with " + klass.name + " klass version " + needVer[0] + "." + needVer[1]); | |
} | |
} | |
var CIPHER_LEN = { | |
"des-ede3-cbc": { | |
key: 24, | |
iv: 8 | |
}, | |
"aes-128-cbc": { | |
key: 16, | |
iv: 16 | |
}, | |
"aes-256-cbc": { | |
key: 32, | |
iv: 16 | |
} | |
}; | |
function mpNormalize(buf) { | |
for (assert.buffer(buf); buf.length > 1 && 0 === buf[0] && 0 == (128 & buf[1]); ) buf = buf.slice(1); | |
if (128 == (128 & buf[0])) { | |
var b = Buffer.alloc(buf.length + 1); | |
b[0] = 0, buf.copy(b, 1), buf = b; | |
} | |
return buf; | |
} | |
function bigintToMpBuf(bigint) { | |
var buf = Buffer.from(bigint.toByteArray()); | |
return mpNormalize(buf); | |
} | |
}, function(module, exports, __webpack_require__) { | |
module.exports = PrivateKey; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(30), crypto = __webpack_require__(9), Signature = (__webpack_require__(97), | |
__webpack_require__(48)), errs = __webpack_require__(44), util = __webpack_require__(0), utils = __webpack_require__(26), dhe = __webpack_require__(233), generateECDSA = dhe.generateECDSA, generateED25519 = dhe.generateED25519, edCompat = __webpack_require__(479), nacl = __webpack_require__(99), Key = __webpack_require__(25), KeyParseError = (errs.InvalidAlgorithmError, | |
errs.KeyParseError), formats = (errs.KeyEncryptedError, {}); | |
function PrivateKey(opts) { | |
assert.object(opts, "options"), Key.call(this, opts), this._pubCache = void 0; | |
} | |
formats.auto = __webpack_require__(480), formats.pem = __webpack_require__(56), | |
formats.pkcs1 = __webpack_require__(234), formats.pkcs8 = __webpack_require__(101), | |
formats.rfc4253 = __webpack_require__(57), formats["ssh-private"] = __webpack_require__(152), | |
formats.openssh = formats["ssh-private"], formats.ssh = formats["ssh-private"], | |
formats.dnssec = __webpack_require__(235), util.inherits(PrivateKey, Key), PrivateKey.formats = formats, | |
PrivateKey.prototype.toBuffer = function(format, options) { | |
return void 0 === format && (format = "pkcs1"), assert.string(format, "format"), | |
assert.object(formats[format], "formats[format]"), assert.optionalObject(options, "options"), | |
formats[format].write(this, options); | |
}, PrivateKey.prototype.hash = function(algo, type) { | |
return this.toPublic().hash(algo, type); | |
}, PrivateKey.prototype.fingerprint = function(algo, type) { | |
return this.toPublic().fingerprint(algo, type); | |
}, PrivateKey.prototype.toPublic = function() { | |
if (this._pubCache) return this._pubCache; | |
for (var algInfo = algs.info[this.type], pubParts = [], i = 0; i < algInfo.parts.length; ++i) { | |
var p = algInfo.parts[i]; | |
pubParts.push(this.part[p]); | |
} | |
return this._pubCache = new Key({ | |
type: this.type, | |
source: this, | |
parts: pubParts | |
}), this.comment && (this._pubCache.comment = this.comment), this._pubCache; | |
}, PrivateKey.prototype.derive = function(newType) { | |
var priv, pub, pair; | |
if (assert.string(newType, "type"), "ed25519" === this.type && "curve25519" === newType) return 0 === (priv = this.part.k.data)[0] && (priv = priv.slice(1)), | |
pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv)), pub = Buffer.from(pair.publicKey), | |
new PrivateKey({ | |
type: "curve25519", | |
parts: [ { | |
name: "A", | |
data: utils.mpNormalize(pub) | |
}, { | |
name: "k", | |
data: utils.mpNormalize(priv) | |
} ] | |
}); | |
if ("curve25519" === this.type && "ed25519" === newType) return 0 === (priv = this.part.k.data)[0] && (priv = priv.slice(1)), | |
pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv)), pub = Buffer.from(pair.publicKey), | |
new PrivateKey({ | |
type: "ed25519", | |
parts: [ { | |
name: "A", | |
data: utils.mpNormalize(pub) | |
}, { | |
name: "k", | |
data: utils.mpNormalize(priv) | |
} ] | |
}); | |
throw new Error("Key derivation not supported from " + this.type + " to " + newType); | |
}, PrivateKey.prototype.createVerify = function(hashAlgo) { | |
return this.toPublic().createVerify(hashAlgo); | |
}, PrivateKey.prototype.createSign = function(hashAlgo) { | |
if (void 0 === hashAlgo && (hashAlgo = this.defaultHashAlgorithm()), assert.string(hashAlgo, "hash algorithm"), | |
"ed25519" === this.type && void 0 !== edCompat) return new edCompat.Signer(this, hashAlgo); | |
if ("curve25519" === this.type) throw new Error("Curve25519 keys are not suitable for signing or verification"); | |
var v, nm, err; | |
try { | |
nm = hashAlgo.toUpperCase(), v = crypto.createSign(nm); | |
} catch (e) { | |
err = e; | |
} | |
(void 0 === v || err instanceof Error && err.message.match(/Unknown message digest/)) && (nm = "RSA-", | |
nm += hashAlgo.toUpperCase(), v = crypto.createSign(nm)), assert.ok(v, "failed to create verifier"); | |
var oldSign = v.sign.bind(v), key = this.toBuffer("pkcs1"), type = this.type, curve = this.curve; | |
return v.sign = function() { | |
var sig = oldSign(key); | |
return "string" == typeof sig && (sig = Buffer.from(sig, "binary")), (sig = Signature.parse(sig, type, "asn1")).hashAlgorithm = hashAlgo, | |
sig.curve = curve, sig; | |
}, v; | |
}, PrivateKey.parse = function(data, format, options) { | |
"string" != typeof data && assert.buffer(data, "data"), void 0 === format && (format = "auto"), | |
assert.string(format, "format"), "string" == typeof options && (options = { | |
filename: options | |
}), assert.optionalObject(options, "options"), void 0 === options && (options = {}), | |
assert.optionalString(options.filename, "options.filename"), void 0 === options.filename && (options.filename = "(unnamed)"), | |
assert.object(formats[format], "formats[format]"); | |
try { | |
var k = formats[format].read(data, options); | |
return assert.ok(k instanceof PrivateKey, "key is not a private key"), k.comment || (k.comment = options.filename), | |
k; | |
} catch (e) { | |
if ("KeyEncryptedError" === e.name) throw e; | |
throw new KeyParseError(options.filename, format, e); | |
} | |
}, PrivateKey.isPrivateKey = function(obj, ver) { | |
return utils.isCompatible(obj, PrivateKey, ver); | |
}, PrivateKey.generate = function(type, options) { | |
switch (void 0 === options && (options = {}), assert.object(options, "options"), | |
type) { | |
case "ecdsa": | |
return void 0 === options.curve && (options.curve = "nistp256"), assert.string(options.curve, "options.curve"), | |
generateECDSA(options.curve); | |
case "ed25519": | |
return generateED25519(); | |
default: | |
throw new Error('Key generation not supported with key type "' + type + '"'); | |
} | |
}, PrivateKey.prototype._sshpkApiVersion = [ 1, 6 ], PrivateKey._oldVersionDetect = function(obj) { | |
return assert.func(obj.toPublic), assert.func(obj.createSign), obj.derive ? [ 1, 3 ] : obj.defaultHashAlgorithm ? [ 1, 2 ] : obj.formats.auto ? [ 1, 1 ] : [ 1, 0 ]; | |
}; | |
}, function(module, exports) { | |
module.exports = require("querystring"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), Element1 = __webpack_require__(43), _proto = (__webpack_require__(13), | |
__webpack_require__(19)); | |
function MasterElement(doc, tagId, ebmlId, start, length) { | |
Element1.call(this, doc, tagId, ebmlId, start, length); | |
} | |
util.inherits(MasterElement, Element1), module.exports = MasterElement, _proto.oneChild(MasterElement.prototype, "CRC_32"); | |
}, function(module, exports, __webpack_require__) { | |
var Buffer = __webpack_require__(14).Buffer, algInfo = { | |
dsa: { | |
parts: [ "p", "q", "g", "y" ], | |
sizePart: "p" | |
}, | |
rsa: { | |
parts: [ "e", "n" ], | |
sizePart: "n" | |
}, | |
ecdsa: { | |
parts: [ "curve", "Q" ], | |
sizePart: "Q" | |
}, | |
ed25519: { | |
parts: [ "A" ], | |
sizePart: "A" | |
} | |
}; | |
algInfo.curve25519 = algInfo.ed25519; | |
var algPrivInfo = { | |
dsa: { | |
parts: [ "p", "q", "g", "y", "x" ] | |
}, | |
rsa: { | |
parts: [ "n", "e", "d", "iqmp", "p", "q" ] | |
}, | |
ecdsa: { | |
parts: [ "curve", "Q", "d" ] | |
}, | |
ed25519: { | |
parts: [ "A", "k" ] | |
} | |
}; | |
algPrivInfo.curve25519 = algPrivInfo.ed25519; | |
var curves = { | |
nistp256: { | |
size: 256, | |
pkcs8oid: "1.2.840.10045.3.1.7", | |
p: Buffer.from("00ffffffff 00000001 00000000 0000000000000000 ffffffff ffffffff ffffffff".replace(/ /g, ""), "hex"), | |
a: Buffer.from("00FFFFFFFF 00000001 00000000 0000000000000000 FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g, ""), "hex"), | |
b: Buffer.from("5ac635d8 aa3a93e7 b3ebbd55 769886bc651d06b0 cc53b0f6 3bce3c3e 27d2604b".replace(/ /g, ""), "hex"), | |
s: Buffer.from("00c49d3608 86e70493 6a6678e1 139d26b7819f7e90".replace(/ /g, ""), "hex"), | |
n: Buffer.from("00ffffffff 00000000 ffffffff ffffffffbce6faad a7179e84 f3b9cac2 fc632551".replace(/ /g, ""), "hex"), | |
G: Buffer.from("046b17d1f2 e12c4247 f8bce6e5 63a440f277037d81 2deb33a0 f4a13945 d898c2964fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e162bce3357 6b315ece cbb64068 37bf51f5".replace(/ /g, ""), "hex") | |
}, | |
nistp384: { | |
size: 384, | |
pkcs8oid: "1.3.132.0.34", | |
p: Buffer.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffeffffffff 00000000 00000000 ffffffff".replace(/ /g, ""), "hex"), | |
a: Buffer.from("00FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFEFFFFFFFF 00000000 00000000 FFFFFFFC".replace(/ /g, ""), "hex"), | |
b: Buffer.from("b3312fa7 e23ee7e4 988e056b e3f82d19181d9c6e fe814112 0314088f 5013875ac656398d 8a2ed19d 2a85c8ed d3ec2aef".replace(/ /g, ""), "hex"), | |
s: Buffer.from("00a335926a a319a27a 1d00896a 6773a4827acdac73".replace(/ /g, ""), "hex"), | |
n: Buffer.from("00ffffffff ffffffff ffffffff ffffffffffffffff ffffffff c7634d81 f4372ddf581a0db2 48b0a77a ecec196a ccc52973".replace(/ /g, ""), "hex"), | |
G: Buffer.from("04aa87ca22 be8b0537 8eb1c71e f320ad746e1d3b62 8ba79b98 59f741e0 82542a385502f25d bf55296c 3a545e38 72760ab73617de4a 96262c6f 5d9e98bf 9292dc29f8f41dbd 289a147c e9da3113 b5f0b8c00a60b1ce 1d7e819d 7a431d7c 90ea0e5f".replace(/ /g, ""), "hex") | |
}, | |
nistp521: { | |
size: 521, | |
pkcs8oid: "1.3.132.0.35", | |
p: Buffer.from("01ffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff ffffffffffff".replace(/ /g, ""), "hex"), | |
a: Buffer.from("01FFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC".replace(/ /g, ""), "hex"), | |
b: Buffer.from("51953eb961 8e1c9a1f 929a21a0 b68540eea2da725b 99b315f3 b8b48991 8ef109e156193951 ec7e937b 1652c0bd 3bb1bf073573df88 3d2c34f1 ef451fd4 6b503f00".replace(/ /g, ""), "hex"), | |
s: Buffer.from("00d09e8800 291cb853 96cc6717 393284aaa0da64ba".replace(/ /g, ""), "hex"), | |
n: Buffer.from("01ffffffffff ffffffff ffffffff ffffffffffffffff ffffffff ffffffff fffffffa51868783 bf2f966b 7fcc0148 f709a5d03bb5c9b8 899c47ae bb6fb71e 91386409".replace(/ /g, ""), "hex"), | |
G: Buffer.from("0400c6 858e06b7 0404e9cd 9e3ecb66 2395b4429c648139 053fb521 f828af60 6b4d3dbaa14b5e77 efe75928 fe1dc127 a2ffa8de3348b3c1 856a429b f97e7e31 c2e5bd660118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd998f54449 579b4468 17afbd17 273e662c97ee7299 5ef42640 c550b901 3fad0761353c7086 a272c240 88be9476 9fd16650".replace(/ /g, ""), "hex") | |
} | |
}; | |
module.exports = { | |
info: algInfo, | |
privInfo: algPrivInfo, | |
hashAlgs: { | |
md5: !0, | |
sha1: !0, | |
sha256: !0, | |
sha384: !0, | |
sha512: !0 | |
}, | |
curves: curves | |
}; | |
}, function(module, exports) { | |
module.exports = require("child_process"); | |
}, function(module, exports, __webpack_require__) { | |
function objectToString(o) { | |
return Object.prototype.toString.call(o); | |
} | |
exports.isArray = function(arg) { | |
return Array.isArray ? Array.isArray(arg) : "[object Array]" === objectToString(arg); | |
}, exports.isBoolean = function(arg) { | |
return "boolean" == typeof arg; | |
}, exports.isNull = function(arg) { | |
return null === arg; | |
}, exports.isNullOrUndefined = function(arg) { | |
return null == arg; | |
}, exports.isNumber = function(arg) { | |
return "number" == typeof arg; | |
}, exports.isString = function(arg) { | |
return "string" == typeof arg; | |
}, exports.isSymbol = function(arg) { | |
return "symbol" == typeof arg; | |
}, exports.isUndefined = function(arg) { | |
return void 0 === arg; | |
}, exports.isRegExp = function(re) { | |
return "[object RegExp]" === objectToString(re); | |
}, exports.isObject = function(arg) { | |
return "object" == typeof arg && null !== arg; | |
}, exports.isDate = function(d) { | |
return "[object Date]" === objectToString(d); | |
}, exports.isError = function(e) { | |
return "[object Error]" === objectToString(e) || e instanceof Error; | |
}, exports.isFunction = function(arg) { | |
return "function" == typeof arg; | |
}, exports.isPrimitive = function(arg) { | |
return null === arg || "boolean" == typeof arg || "number" == typeof arg || "string" == typeof arg || "symbol" == typeof arg || void 0 === arg; | |
}, exports.isBuffer = __webpack_require__(10).Buffer.isBuffer; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
function _interopDefault(ex) { | |
return ex && "object" == typeof ex && "default" in ex ? ex.default : ex; | |
} | |
Object.defineProperty(exports, "__esModule", { | |
value: !0 | |
}); | |
var Stream = _interopDefault(__webpack_require__(3)), http = _interopDefault(__webpack_require__(11)), Url = _interopDefault(__webpack_require__(7)), https = _interopDefault(__webpack_require__(22)), zlib = _interopDefault(__webpack_require__(45)); | |
const Readable = Stream.Readable, BUFFER = Symbol("buffer"), TYPE = Symbol("type"); | |
class Blob { | |
constructor() { | |
this[TYPE] = ""; | |
const blobParts = arguments[0], options = arguments[1], buffers = []; | |
let size = 0; | |
if (blobParts) { | |
const a = blobParts, length = Number(a.length); | |
for (let i = 0; i < length; i++) { | |
const element = a[i]; | |
let buffer; | |
buffer = element instanceof Buffer ? element : ArrayBuffer.isView(element) ? Buffer.from(element.buffer, element.byteOffset, element.byteLength) : element instanceof ArrayBuffer ? Buffer.from(element) : element instanceof Blob ? element[BUFFER] : Buffer.from("string" == typeof element ? element : String(element)), | |
size += buffer.length, buffers.push(buffer); | |
} | |
} | |
this[BUFFER] = Buffer.concat(buffers); | |
let type = options && void 0 !== options.type && String(options.type).toLowerCase(); | |
type && !/[^\u0020-\u007E]/.test(type) && (this[TYPE] = type); | |
} | |
get size() { | |
return this[BUFFER].length; | |
} | |
get type() { | |
return this[TYPE]; | |
} | |
text() { | |
return Promise.resolve(this[BUFFER].toString()); | |
} | |
arrayBuffer() { | |
const buf = this[BUFFER], ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); | |
return Promise.resolve(ab); | |
} | |
stream() { | |
const readable = new Readable; | |
return readable._read = function() {}, readable.push(this[BUFFER]), readable.push(null), | |
readable; | |
} | |
toString() { | |
return "[object Blob]"; | |
} | |
slice() { | |
const size = this.size, start = arguments[0], end = arguments[1]; | |
let relativeStart, relativeEnd; | |
relativeStart = void 0 === start ? 0 : start < 0 ? Math.max(size + start, 0) : Math.min(start, size), | |
relativeEnd = void 0 === end ? size : end < 0 ? Math.max(size + end, 0) : Math.min(end, size); | |
const span = Math.max(relativeEnd - relativeStart, 0), slicedBuffer = this[BUFFER].slice(relativeStart, relativeStart + span), blob = new Blob([], { | |
type: arguments[2] | |
}); | |
return blob[BUFFER] = slicedBuffer, blob; | |
} | |
} | |
function FetchError(message, type, systemError) { | |
Error.call(this, message), this.message = message, this.type = type, systemError && (this.code = this.errno = systemError.code), | |
Error.captureStackTrace(this, this.constructor); | |
} | |
let convert; | |
Object.defineProperties(Blob.prototype, { | |
size: { | |
enumerable: !0 | |
}, | |
type: { | |
enumerable: !0 | |
}, | |
slice: { | |
enumerable: !0 | |
} | |
}), Object.defineProperty(Blob.prototype, Symbol.toStringTag, { | |
value: "Blob", | |
writable: !1, | |
enumerable: !1, | |
configurable: !0 | |
}), FetchError.prototype = Object.create(Error.prototype), FetchError.prototype.constructor = FetchError, | |
FetchError.prototype.name = "FetchError"; | |
try { | |
convert = __webpack_require__(520).convert; | |
} catch (e) {} | |
const INTERNALS = Symbol("Body internals"), PassThrough = Stream.PassThrough; | |
function Body(body) { | |
var _this = this, _ref = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, _ref$size = _ref.size; | |
let size = void 0 === _ref$size ? 0 : _ref$size; | |
var _ref$timeout = _ref.timeout; | |
let timeout = void 0 === _ref$timeout ? 0 : _ref$timeout; | |
null == body ? body = null : isURLSearchParams(body) ? body = Buffer.from(body.toString()) : isBlob(body) || Buffer.isBuffer(body) || ("[object ArrayBuffer]" === Object.prototype.toString.call(body) ? body = Buffer.from(body) : ArrayBuffer.isView(body) ? body = Buffer.from(body.buffer, body.byteOffset, body.byteLength) : body instanceof Stream || (body = Buffer.from(String(body)))), | |
this[INTERNALS] = { | |
body: body, | |
disturbed: !1, | |
error: null | |
}, this.size = size, this.timeout = timeout, body instanceof Stream && body.on("error", (function(err) { | |
const error = "AbortError" === err.name ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, "system", err); | |
_this[INTERNALS].error = error; | |
})); | |
} | |
function consumeBody() { | |
var _this4 = this; | |
if (this[INTERNALS].disturbed) return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`)); | |
if (this[INTERNALS].disturbed = !0, this[INTERNALS].error) return Body.Promise.reject(this[INTERNALS].error); | |
let body = this.body; | |
if (null === body) return Body.Promise.resolve(Buffer.alloc(0)); | |
if (isBlob(body) && (body = body.stream()), Buffer.isBuffer(body)) return Body.Promise.resolve(body); | |
if (!(body instanceof Stream)) return Body.Promise.resolve(Buffer.alloc(0)); | |
let accum = [], accumBytes = 0, abort = !1; | |
return new Body.Promise((function(resolve, reject) { | |
let resTimeout; | |
_this4.timeout && (resTimeout = setTimeout((function() { | |
abort = !0, reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, "body-timeout")); | |
}), _this4.timeout)), body.on("error", (function(err) { | |
"AbortError" === err.name ? (abort = !0, reject(err)) : reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, "system", err)); | |
})), body.on("data", (function(chunk) { | |
if (!abort && null !== chunk) { | |
if (_this4.size && accumBytes + chunk.length > _this4.size) return abort = !0, void reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, "max-size")); | |
accumBytes += chunk.length, accum.push(chunk); | |
} | |
})), body.on("end", (function() { | |
if (!abort) { | |
clearTimeout(resTimeout); | |
try { | |
resolve(Buffer.concat(accum, accumBytes)); | |
} catch (err) { | |
reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, "system", err)); | |
} | |
} | |
})); | |
})); | |
} | |
function isURLSearchParams(obj) { | |
return "object" == typeof obj && "function" == typeof obj.append && "function" == typeof obj.delete && "function" == typeof obj.get && "function" == typeof obj.getAll && "function" == typeof obj.has && "function" == typeof obj.set && ("URLSearchParams" === obj.constructor.name || "[object URLSearchParams]" === Object.prototype.toString.call(obj) || "function" == typeof obj.sort); | |
} | |
function isBlob(obj) { | |
return "object" == typeof obj && "function" == typeof obj.arrayBuffer && "string" == typeof obj.type && "function" == typeof obj.stream && "function" == typeof obj.constructor && "string" == typeof obj.constructor.name && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]); | |
} | |
function clone(instance) { | |
let p1, p2, body = instance.body; | |
if (instance.bodyUsed) throw new Error("cannot clone body after it is used"); | |
return body instanceof Stream && "function" != typeof body.getBoundary && (p1 = new PassThrough, | |
p2 = new PassThrough, body.pipe(p1), body.pipe(p2), instance[INTERNALS].body = p1, | |
body = p2), body; | |
} | |
function extractContentType(body) { | |
return null === body ? null : "string" == typeof body ? "text/plain;charset=UTF-8" : isURLSearchParams(body) ? "application/x-www-form-urlencoded;charset=UTF-8" : isBlob(body) ? body.type || null : Buffer.isBuffer(body) || "[object ArrayBuffer]" === Object.prototype.toString.call(body) || ArrayBuffer.isView(body) ? null : "function" == typeof body.getBoundary ? `multipart/form-data;boundary=${body.getBoundary()}` : body instanceof Stream ? null : "text/plain;charset=UTF-8"; | |
} | |
function getTotalBytes(instance) { | |
const body = instance.body; | |
return null === body ? 0 : isBlob(body) ? body.size : Buffer.isBuffer(body) ? body.length : body && "function" == typeof body.getLengthSync && (body._lengthRetrievers && 0 == body._lengthRetrievers.length || body.hasKnownLength && body.hasKnownLength()) ? body.getLengthSync() : null; | |
} | |
Body.prototype = { | |
get body() { | |
return this[INTERNALS].body; | |
}, | |
get bodyUsed() { | |
return this[INTERNALS].disturbed; | |
}, | |
arrayBuffer() { | |
return consumeBody.call(this).then((function(buf) { | |
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength); | |
})); | |
}, | |
blob() { | |
let ct = this.headers && this.headers.get("content-type") || ""; | |
return consumeBody.call(this).then((function(buf) { | |
return Object.assign(new Blob([], { | |
type: ct.toLowerCase() | |
}), { | |
[BUFFER]: buf | |
}); | |
})); | |
}, | |
json() { | |
var _this2 = this; | |
return consumeBody.call(this).then((function(buffer) { | |
try { | |
return JSON.parse(buffer.toString()); | |
} catch (err) { | |
return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, "invalid-json")); | |
} | |
})); | |
}, | |
text() { | |
return consumeBody.call(this).then((function(buffer) { | |
return buffer.toString(); | |
})); | |
}, | |
buffer() { | |
return consumeBody.call(this); | |
}, | |
textConverted() { | |
var _this3 = this; | |
return consumeBody.call(this).then((function(buffer) { | |
return (function(buffer, headers) { | |
if ("function" != typeof convert) throw new Error("The package `encoding` must be installed to use the textConverted() function"); | |
const ct = headers.get("content-type"); | |
let res, str, charset = "utf-8"; | |
return ct && (res = /charset=([^;]*)/i.exec(ct)), str = buffer.slice(0, 1024).toString(), | |
!res && str && (res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str)), !res && str && (res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str), | |
res && (res = /charset=(.*)/i.exec(res.pop()))), !res && str && (res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str)), | |
res && (charset = res.pop(), "gb2312" !== charset && "gbk" !== charset || (charset = "gb18030")), | |
convert(buffer, "UTF-8", charset).toString(); | |
})(buffer, _this3.headers); | |
})); | |
} | |
}, Object.defineProperties(Body.prototype, { | |
body: { | |
enumerable: !0 | |
}, | |
bodyUsed: { | |
enumerable: !0 | |
}, | |
arrayBuffer: { | |
enumerable: !0 | |
}, | |
blob: { | |
enumerable: !0 | |
}, | |
json: { | |
enumerable: !0 | |
}, | |
text: { | |
enumerable: !0 | |
} | |
}), Body.mixIn = function(proto) { | |
for (const name of Object.getOwnPropertyNames(Body.prototype)) if (!(name in proto)) { | |
const desc = Object.getOwnPropertyDescriptor(Body.prototype, name); | |
Object.defineProperty(proto, name, desc); | |
} | |
}, Body.Promise = global.Promise; | |
const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/, invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/; | |
function validateName(name) { | |
if (name = `${name}`, invalidTokenRegex.test(name) || "" === name) throw new TypeError(`${name} is not a legal HTTP header name`); | |
} | |
function validateValue(value) { | |
if (value = `${value}`, invalidHeaderCharRegex.test(value)) throw new TypeError(`${value} is not a legal HTTP header value`); | |
} | |
function find(map, name) { | |
name = name.toLowerCase(); | |
for (const key in map) if (key.toLowerCase() === name) return key; | |
} | |
const MAP = Symbol("map"); | |
class Headers { | |
constructor() { | |
let init = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : void 0; | |
if (this[MAP] = Object.create(null), init instanceof Headers) { | |
const rawHeaders = init.raw(), headerNames = Object.keys(rawHeaders); | |
for (const headerName of headerNames) for (const value of rawHeaders[headerName]) this.append(headerName, value); | |
} else if (null == init) ; else { | |
if ("object" != typeof init) throw new TypeError("Provided initializer must be an object"); | |
{ | |
const method = init[Symbol.iterator]; | |
if (null != method) { | |
if ("function" != typeof method) throw new TypeError("Header pairs must be iterable"); | |
const pairs = []; | |
for (const pair of init) { | |
if ("object" != typeof pair || "function" != typeof pair[Symbol.iterator]) throw new TypeError("Each header pair must be iterable"); | |
pairs.push(Array.from(pair)); | |
} | |
for (const pair of pairs) { | |
if (2 !== pair.length) throw new TypeError("Each header pair must be a name/value tuple"); | |
this.append(pair[0], pair[1]); | |
} | |
} else for (const key of Object.keys(init)) { | |
const value = init[key]; | |
this.append(key, value); | |
} | |
} | |
} | |
} | |
get(name) { | |
validateName(name = `${name}`); | |
const key = find(this[MAP], name); | |
return void 0 === key ? null : this[MAP][key].join(", "); | |
} | |
forEach(callback) { | |
let thisArg = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : void 0, pairs = getHeaders(this), i = 0; | |
for (;i < pairs.length; ) { | |
var _pairs$i = pairs[i]; | |
const name = _pairs$i[0], value = _pairs$i[1]; | |
callback.call(thisArg, value, name, this), pairs = getHeaders(this), i++; | |
} | |
} | |
set(name, value) { | |
value = `${value}`, validateName(name = `${name}`), validateValue(value); | |
const key = find(this[MAP], name); | |
this[MAP][void 0 !== key ? key : name] = [ value ]; | |
} | |
append(name, value) { | |
value = `${value}`, validateName(name = `${name}`), validateValue(value); | |
const key = find(this[MAP], name); | |
void 0 !== key ? this[MAP][key].push(value) : this[MAP][name] = [ value ]; | |
} | |
has(name) { | |
return validateName(name = `${name}`), void 0 !== find(this[MAP], name); | |
} | |
delete(name) { | |
validateName(name = `${name}`); | |
const key = find(this[MAP], name); | |
void 0 !== key && delete this[MAP][key]; | |
} | |
raw() { | |
return this[MAP]; | |
} | |
keys() { | |
return createHeadersIterator(this, "key"); | |
} | |
values() { | |
return createHeadersIterator(this, "value"); | |
} | |
[Symbol.iterator]() { | |
return createHeadersIterator(this, "key+value"); | |
} | |
} | |
function getHeaders(headers) { | |
let kind = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "key+value"; | |
const keys = Object.keys(headers[MAP]).sort(); | |
return keys.map("key" === kind ? function(k) { | |
return k.toLowerCase(); | |
} : "value" === kind ? function(k) { | |
return headers[MAP][k].join(", "); | |
} : function(k) { | |
return [ k.toLowerCase(), headers[MAP][k].join(", ") ]; | |
}); | |
} | |
Headers.prototype.entries = Headers.prototype[Symbol.iterator], Object.defineProperty(Headers.prototype, Symbol.toStringTag, { | |
value: "Headers", | |
writable: !1, | |
enumerable: !1, | |
configurable: !0 | |
}), Object.defineProperties(Headers.prototype, { | |
get: { | |
enumerable: !0 | |
}, | |
forEach: { | |
enumerable: !0 | |
}, | |
set: { | |
enumerable: !0 | |
}, | |
append: { | |
enumerable: !0 | |
}, | |
has: { | |
enumerable: !0 | |
}, | |
delete: { | |
enumerable: !0 | |
}, | |
keys: { | |
enumerable: !0 | |
}, | |
values: { | |
enumerable: !0 | |
}, | |
entries: { | |
enumerable: !0 | |
} | |
}); | |
const INTERNAL = Symbol("internal"); | |
function createHeadersIterator(target, kind) { | |
const iterator = Object.create(HeadersIteratorPrototype); | |
return iterator[INTERNAL] = { | |
target: target, | |
kind: kind, | |
index: 0 | |
}, iterator; | |
} | |
const HeadersIteratorPrototype = Object.setPrototypeOf({ | |
next() { | |
if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) throw new TypeError("Value of `this` is not a HeadersIterator"); | |
var _INTERNAL = this[INTERNAL]; | |
const target = _INTERNAL.target, kind = _INTERNAL.kind, index = _INTERNAL.index, values = getHeaders(target, kind); | |
return index >= values.length ? { | |
value: void 0, | |
done: !0 | |
} : (this[INTERNAL].index = index + 1, { | |
value: values[index], | |
done: !1 | |
}); | |
} | |
}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))); | |
function exportNodeCompatibleHeaders(headers) { | |
const obj = Object.assign({ | |
__proto__: null | |
}, headers[MAP]), hostHeaderKey = find(headers[MAP], "Host"); | |
return void 0 !== hostHeaderKey && (obj[hostHeaderKey] = obj[hostHeaderKey][0]), | |
obj; | |
} | |
Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, { | |
value: "HeadersIterator", | |
writable: !1, | |
enumerable: !1, | |
configurable: !0 | |
}); | |
const INTERNALS$1 = Symbol("Response internals"), STATUS_CODES = http.STATUS_CODES; | |
class Response { | |
constructor() { | |
let body = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null, opts = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; | |
Body.call(this, body, opts); | |
const status = opts.status || 200, headers = new Headers(opts.headers); | |
if (null != body && !headers.has("Content-Type")) { | |
const contentType = extractContentType(body); | |
contentType && headers.append("Content-Type", contentType); | |
} | |
this[INTERNALS$1] = { | |
url: opts.url, | |
status: status, | |
statusText: opts.statusText || STATUS_CODES[status], | |
headers: headers, | |
counter: opts.counter | |
}; | |
} | |
get url() { | |
return this[INTERNALS$1].url || ""; | |
} | |
get status() { | |
return this[INTERNALS$1].status; | |
} | |
get ok() { | |
return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300; | |
} | |
get redirected() { | |
return this[INTERNALS$1].counter > 0; | |
} | |
get statusText() { | |
return this[INTERNALS$1].statusText; | |
} | |
get headers() { | |
return this[INTERNALS$1].headers; | |
} | |
clone() { | |
return new Response(clone(this), { | |
url: this.url, | |
status: this.status, | |
statusText: this.statusText, | |
headers: this.headers, | |
ok: this.ok, | |
redirected: this.redirected | |
}); | |
} | |
} | |
Body.mixIn(Response.prototype), Object.defineProperties(Response.prototype, { | |
url: { | |
enumerable: !0 | |
}, | |
status: { | |
enumerable: !0 | |
}, | |
ok: { | |
enumerable: !0 | |
}, | |
redirected: { | |
enumerable: !0 | |
}, | |
statusText: { | |
enumerable: !0 | |
}, | |
headers: { | |
enumerable: !0 | |
}, | |
clone: { | |
enumerable: !0 | |
} | |
}), Object.defineProperty(Response.prototype, Symbol.toStringTag, { | |
value: "Response", | |
writable: !1, | |
enumerable: !1, | |
configurable: !0 | |
}); | |
const INTERNALS$2 = Symbol("Request internals"), parse_url = Url.parse, format_url = Url.format, streamDestructionSupported = "destroy" in Stream.Readable.prototype; | |
function isRequest(input) { | |
return "object" == typeof input && "object" == typeof input[INTERNALS$2]; | |
} | |
class Request { | |
constructor(input) { | |
let parsedURL, init = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}; | |
isRequest(input) ? parsedURL = parse_url(input.url) : (parsedURL = input && input.href ? parse_url(input.href) : parse_url(`${input}`), | |
input = {}); | |
let method = init.method || input.method || "GET"; | |
if (method = method.toUpperCase(), (null != init.body || isRequest(input) && null !== input.body) && ("GET" === method || "HEAD" === method)) throw new TypeError("Request with GET/HEAD method cannot have body"); | |
let inputBody = null != init.body ? init.body : isRequest(input) && null !== input.body ? clone(input) : null; | |
Body.call(this, inputBody, { | |
timeout: init.timeout || input.timeout || 0, | |
size: init.size || input.size || 0 | |
}); | |
const headers = new Headers(init.headers || input.headers || {}); | |
if (null != inputBody && !headers.has("Content-Type")) { | |
const contentType = extractContentType(inputBody); | |
contentType && headers.append("Content-Type", contentType); | |
} | |
let signal = isRequest(input) ? input.signal : null; | |
if ("signal" in init && (signal = init.signal), null != signal && !(function(signal) { | |
const proto = signal && "object" == typeof signal && Object.getPrototypeOf(signal); | |
return !(!proto || "AbortSignal" !== proto.constructor.name); | |
})(signal)) throw new TypeError("Expected signal to be an instanceof AbortSignal"); | |
this[INTERNALS$2] = { | |
method: method, | |
redirect: init.redirect || input.redirect || "follow", | |
headers: headers, | |
parsedURL: parsedURL, | |
signal: signal | |
}, this.follow = void 0 !== init.follow ? init.follow : void 0 !== input.follow ? input.follow : 20, | |
this.compress = void 0 !== init.compress ? init.compress : void 0 === input.compress || input.compress, | |
this.counter = init.counter || input.counter || 0, this.agent = init.agent || input.agent; | |
} | |
get method() { | |
return this[INTERNALS$2].method; | |
} | |
get url() { | |
return format_url(this[INTERNALS$2].parsedURL); | |
} | |
get headers() { | |
return this[INTERNALS$2].headers; | |
} | |
get redirect() { | |
return this[INTERNALS$2].redirect; | |
} | |
get signal() { | |
return this[INTERNALS$2].signal; | |
} | |
clone() { | |
return new Request(this); | |
} | |
} | |
function AbortError(message) { | |
Error.call(this, message), this.type = "aborted", this.message = message, Error.captureStackTrace(this, this.constructor); | |
} | |
Body.mixIn(Request.prototype), Object.defineProperty(Request.prototype, Symbol.toStringTag, { | |
value: "Request", | |
writable: !1, | |
enumerable: !1, | |
configurable: !0 | |
}), Object.defineProperties(Request.prototype, { | |
method: { | |
enumerable: !0 | |
}, | |
url: { | |
enumerable: !0 | |
}, | |
headers: { | |
enumerable: !0 | |
}, | |
redirect: { | |
enumerable: !0 | |
}, | |
clone: { | |
enumerable: !0 | |
}, | |
signal: { | |
enumerable: !0 | |
} | |
}), AbortError.prototype = Object.create(Error.prototype), AbortError.prototype.constructor = AbortError, | |
AbortError.prototype.name = "AbortError"; | |
const PassThrough$1 = Stream.PassThrough, resolve_url = Url.resolve; | |
function fetch(url, opts) { | |
if (!fetch.Promise) throw new Error("native promise missing, set fetch.Promise to your favorite alternative"); | |
return Body.Promise = fetch.Promise, new fetch.Promise((function(resolve, reject) { | |
const request = new Request(url, opts), options = (function(request) { | |
const parsedURL = request[INTERNALS$2].parsedURL, headers = new Headers(request[INTERNALS$2].headers); | |
if (headers.has("Accept") || headers.set("Accept", "*/*"), !parsedURL.protocol || !parsedURL.hostname) throw new TypeError("Only absolute URLs are supported"); | |
if (!/^https?:$/.test(parsedURL.protocol)) throw new TypeError("Only HTTP(S) protocols are supported"); | |
if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) throw new Error("Cancellation of streamed requests with AbortSignal is not supported in node < 8"); | |
let contentLengthValue = null; | |
if (null == request.body && /^(POST|PUT)$/i.test(request.method) && (contentLengthValue = "0"), | |
null != request.body) { | |
const totalBytes = getTotalBytes(request); | |
"number" == typeof totalBytes && (contentLengthValue = String(totalBytes)); | |
} | |
contentLengthValue && headers.set("Content-Length", contentLengthValue), headers.has("User-Agent") || headers.set("User-Agent", "node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"), | |
request.compress && !headers.has("Accept-Encoding") && headers.set("Accept-Encoding", "gzip,deflate"); | |
let agent = request.agent; | |
return "function" == typeof agent && (agent = agent(parsedURL)), headers.has("Connection") || agent || headers.set("Connection", "close"), | |
Object.assign({}, parsedURL, { | |
method: request.method, | |
headers: exportNodeCompatibleHeaders(headers), | |
agent: agent | |
}); | |
})(request), send = ("https:" === options.protocol ? https : http).request, signal = request.signal; | |
let response = null; | |
const abort = function() { | |
let error = new AbortError("The user aborted a request."); | |
reject(error), request.body && request.body instanceof Stream.Readable && request.body.destroy(error), | |
response && response.body && response.body.emit("error", error); | |
}; | |
if (signal && signal.aborted) return void abort(); | |
const abortAndFinalize = function() { | |
abort(), finalize(); | |
}, req = send(options); | |
let reqTimeout; | |
function finalize() { | |
req.abort(), signal && signal.removeEventListener("abort", abortAndFinalize), clearTimeout(reqTimeout); | |
} | |
signal && signal.addEventListener("abort", abortAndFinalize), request.timeout && req.once("socket", (function(socket) { | |
reqTimeout = setTimeout((function() { | |
reject(new FetchError(`network timeout at: ${request.url}`, "request-timeout")), | |
finalize(); | |
}), request.timeout); | |
})), req.on("error", (function(err) { | |
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, "system", err)), | |
finalize(); | |
})), req.on("response", (function(res) { | |
clearTimeout(reqTimeout); | |
const headers = (function(obj) { | |
const headers = new Headers; | |
for (const name of Object.keys(obj)) if (!invalidTokenRegex.test(name)) if (Array.isArray(obj[name])) for (const val of obj[name]) invalidHeaderCharRegex.test(val) || (void 0 === headers[MAP][name] ? headers[MAP][name] = [ val ] : headers[MAP][name].push(val)); else invalidHeaderCharRegex.test(obj[name]) || (headers[MAP][name] = [ obj[name] ]); | |
return headers; | |
})(res.headers); | |
if (fetch.isRedirect(res.statusCode)) { | |
const location = headers.get("Location"), locationURL = null === location ? null : resolve_url(request.url, location); | |
switch (request.redirect) { | |
case "error": | |
return reject(new FetchError(`redirect mode is set to error: ${request.url}`, "no-redirect")), | |
void finalize(); | |
case "manual": | |
if (null !== locationURL) try { | |
headers.set("Location", locationURL); | |
} catch (err) { | |
reject(err); | |
} | |
break; | |
case "follow": | |
if (null === locationURL) break; | |
if (request.counter >= request.follow) return reject(new FetchError(`maximum redirect reached at: ${request.url}`, "max-redirect")), | |
void finalize(); | |
const requestOpts = { | |
headers: new Headers(request.headers), | |
follow: request.follow, | |
counter: request.counter + 1, | |
agent: request.agent, | |
compress: request.compress, | |
method: request.method, | |
body: request.body, | |
signal: request.signal, | |
timeout: request.timeout | |
}; | |
return 303 !== res.statusCode && request.body && null === getTotalBytes(request) ? (reject(new FetchError("Cannot follow redirect with body being a readable stream", "unsupported-redirect")), | |
void finalize()) : (303 !== res.statusCode && (301 !== res.statusCode && 302 !== res.statusCode || "POST" !== request.method) || (requestOpts.method = "GET", | |
requestOpts.body = void 0, requestOpts.headers.delete("content-length")), resolve(fetch(new Request(locationURL, requestOpts))), | |
void finalize()); | |
} | |
} | |
res.once("end", (function() { | |
signal && signal.removeEventListener("abort", abortAndFinalize); | |
})); | |
let body = res.pipe(new PassThrough$1); | |
const response_options = { | |
url: request.url, | |
status: res.statusCode, | |
statusText: res.statusMessage, | |
headers: headers, | |
size: request.size, | |
timeout: request.timeout, | |
counter: request.counter | |
}, codings = headers.get("Content-Encoding"); | |
if (!request.compress || "HEAD" === request.method || null === codings || 204 === res.statusCode || 304 === res.statusCode) return response = new Response(body, response_options), | |
void resolve(response); | |
const zlibOptions = { | |
flush: zlib.Z_SYNC_FLUSH, | |
finishFlush: zlib.Z_SYNC_FLUSH | |
}; | |
if ("gzip" == codings || "x-gzip" == codings) return body = body.pipe(zlib.createGunzip(zlibOptions)), | |
response = new Response(body, response_options), void resolve(response); | |
if ("deflate" != codings && "x-deflate" != codings) { | |
if ("br" == codings && "function" == typeof zlib.createBrotliDecompress) return body = body.pipe(zlib.createBrotliDecompress()), | |
response = new Response(body, response_options), void resolve(response); | |
response = new Response(body, response_options), resolve(response); | |
} else res.pipe(new PassThrough$1).once("data", (function(chunk) { | |
body = 8 == (15 & chunk[0]) ? body.pipe(zlib.createInflate()) : body.pipe(zlib.createInflateRaw()), | |
response = new Response(body, response_options), resolve(response); | |
})); | |
})), (function(dest, instance) { | |
const body = instance.body; | |
null === body ? dest.end() : isBlob(body) ? body.stream().pipe(dest) : Buffer.isBuffer(body) ? (dest.write(body), | |
dest.end()) : body.pipe(dest); | |
})(req, request); | |
})); | |
} | |
fetch.isRedirect = function(code) { | |
return 301 === code || 302 === code || 303 === code || 307 === code || 308 === code; | |
}, fetch.Promise = global.Promise, module.exports = exports = fetch, Object.defineProperty(exports, "__esModule", { | |
value: !0 | |
}), exports.default = exports, exports.Headers = Headers, exports.Request = Request, | |
exports.Response = Response, exports.FetchError = FetchError; | |
}, function(module, exports, __webpack_require__) { | |
var wrappy = __webpack_require__(252); | |
function once(fn) { | |
var f = function() { | |
return f.called ? f.value : (f.called = !0, f.value = fn.apply(this, arguments)); | |
}; | |
return f.called = !1, f; | |
} | |
function onceStrict(fn) { | |
var f = function() { | |
if (f.called) throw new Error(f.onceError); | |
return f.called = !0, f.value = fn.apply(this, arguments); | |
}, name = fn.name || "Function wrapped with `once`"; | |
return f.onceError = name + " shouldn't be called more than once", f.called = !1, | |
f; | |
} | |
module.exports = wrappy(once), module.exports.strict = wrappy(onceStrict), once.proto = once((function() { | |
Object.defineProperty(Function.prototype, "once", { | |
value: function() { | |
return once(this); | |
}, | |
configurable: !0 | |
}), Object.defineProperty(Function.prototype, "onceStrict", { | |
value: function() { | |
return onceStrict(this); | |
}, | |
configurable: !0 | |
}); | |
})); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), Element1 = __webpack_require__(64), _proto = (__webpack_require__(12), | |
__webpack_require__(20)); | |
function MasterElement(doc, tagId, ebmlId, start, length) { | |
Element1.call(this, doc, tagId, ebmlId, start, length); | |
} | |
util.inherits(MasterElement, Element1), module.exports = MasterElement, _proto.oneChild(MasterElement.prototype, "CRC_32"); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, isEmpty, isFunction, isObject, ref, hasProp = {}.hasOwnProperty; | |
ref = __webpack_require__(52), isObject = ref.isObject, isFunction = ref.isFunction, | |
isEmpty = ref.isEmpty, XMLElement = null, XMLCData = null, XMLComment = null, XMLDeclaration = null, | |
XMLDocType = null, XMLRaw = null, XMLText = null, XMLProcessingInstruction = null, | |
module.exports = (function() { | |
function XMLNode(parent) { | |
this.parent = parent, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), | |
this.children = [], XMLElement || (XMLElement = __webpack_require__(118), XMLCData = __webpack_require__(119), | |
XMLComment = __webpack_require__(120), XMLDeclaration = __webpack_require__(121), | |
XMLDocType = __webpack_require__(122), XMLRaw = __webpack_require__(127), XMLText = __webpack_require__(128), | |
XMLProcessingInstruction = __webpack_require__(129)); | |
} | |
return XMLNode.prototype.element = function(name, attributes, text) { | |
var childNode, item, j, k, key, lastChild, len, len1, ref1, val; | |
if (lastChild = null, null == attributes && (attributes = {}), attributes = attributes.valueOf(), | |
isObject(attributes) || (text = (ref1 = [ attributes, text ])[0], attributes = ref1[1]), | |
null != name && (name = name.valueOf()), Array.isArray(name)) for (j = 0, len = name.length; j < len; j++) item = name[j], | |
lastChild = this.element(item); else if (isFunction(name)) lastChild = this.element(name.apply()); else if (isObject(name)) { | |
for (key in name) if (hasProp.call(name, key)) if (val = name[key], isFunction(val) && (val = val.apply()), | |
isObject(val) && isEmpty(val) && (val = null), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === key.indexOf(this.stringify.convertAttKey)) lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val); else if (!this.options.separateArrayItems && Array.isArray(val)) for (k = 0, | |
len1 = val.length; k < len1; k++) item = val[k], (childNode = {})[key] = item, lastChild = this.element(childNode); else isObject(val) ? (lastChild = this.element(key)).element(val) : lastChild = this.element(key, val); | |
} else lastChild = !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === name.indexOf(this.stringify.convertTextKey) ? this.text(text) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === name.indexOf(this.stringify.convertCDataKey) ? this.cdata(text) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === name.indexOf(this.stringify.convertCommentKey) ? this.comment(text) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === name.indexOf(this.stringify.convertRawKey) ? this.raw(text) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === name.indexOf(this.stringify.convertPIKey) ? this.instruction(name.substr(this.stringify.convertPIKey.length), text) : this.node(name, attributes, text); | |
if (null == lastChild) throw new Error("Could not create any elements with: " + name); | |
return lastChild; | |
}, XMLNode.prototype.insertBefore = function(name, attributes, text) { | |
var child, i, removed; | |
if (this.isRoot) throw new Error("Cannot insert elements at root level"); | |
return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), | |
child = this.parent.element(name, attributes, text), Array.prototype.push.apply(this.parent.children, removed), | |
child; | |
}, XMLNode.prototype.insertAfter = function(name, attributes, text) { | |
var child, i, removed; | |
if (this.isRoot) throw new Error("Cannot insert elements at root level"); | |
return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), | |
child = this.parent.element(name, attributes, text), Array.prototype.push.apply(this.parent.children, removed), | |
child; | |
}, XMLNode.prototype.remove = function() { | |
var i; | |
if (this.isRoot) throw new Error("Cannot remove the root element"); | |
return i = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [ i, i - i + 1 ].concat([])), | |
this.parent; | |
}, XMLNode.prototype.node = function(name, attributes, text) { | |
var child, ref1; | |
return null != name && (name = name.valueOf()), attributes || (attributes = {}), | |
attributes = attributes.valueOf(), isObject(attributes) || (text = (ref1 = [ attributes, text ])[0], | |
attributes = ref1[1]), child = new XMLElement(this, name, attributes), null != text && child.text(text), | |
this.children.push(child), child; | |
}, XMLNode.prototype.text = function(value) { | |
var child; | |
return child = new XMLText(this, value), this.children.push(child), this; | |
}, XMLNode.prototype.cdata = function(value) { | |
var child; | |
return child = new XMLCData(this, value), this.children.push(child), this; | |
}, XMLNode.prototype.comment = function(value) { | |
var child; | |
return child = new XMLComment(this, value), this.children.push(child), this; | |
}, XMLNode.prototype.commentBefore = function(value) { | |
var i, removed; | |
return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), | |
this.parent.comment(value), Array.prototype.push.apply(this.parent.children, removed), | |
this; | |
}, XMLNode.prototype.commentAfter = function(value) { | |
var i, removed; | |
return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), | |
this.parent.comment(value), Array.prototype.push.apply(this.parent.children, removed), | |
this; | |
}, XMLNode.prototype.raw = function(value) { | |
var child; | |
return child = new XMLRaw(this, value), this.children.push(child), this; | |
}, XMLNode.prototype.instruction = function(target, value) { | |
var insTarget, insValue, instruction, j, len; | |
if (null != target && (target = target.valueOf()), null != value && (value = value.valueOf()), | |
Array.isArray(target)) for (j = 0, len = target.length; j < len; j++) insTarget = target[j], | |
this.instruction(insTarget); else if (isObject(target)) for (insTarget in target) hasProp.call(target, insTarget) && (insValue = target[insTarget], | |
this.instruction(insTarget, insValue)); else isFunction(value) && (value = value.apply()), | |
instruction = new XMLProcessingInstruction(this, target, value), this.children.push(instruction); | |
return this; | |
}, XMLNode.prototype.instructionBefore = function(target, value) { | |
var i, removed; | |
return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i), | |
this.parent.instruction(target, value), Array.prototype.push.apply(this.parent.children, removed), | |
this; | |
}, XMLNode.prototype.instructionAfter = function(target, value) { | |
var i, removed; | |
return i = this.parent.children.indexOf(this), removed = this.parent.children.splice(i + 1), | |
this.parent.instruction(target, value), Array.prototype.push.apply(this.parent.children, removed), | |
this; | |
}, XMLNode.prototype.declaration = function(version, encoding, standalone) { | |
var doc, xmldec; | |
return doc = this.document(), xmldec = new XMLDeclaration(doc, version, encoding, standalone), | |
doc.children[0] instanceof XMLDeclaration ? doc.children[0] = xmldec : doc.children.unshift(xmldec), | |
doc.root() || doc; | |
}, XMLNode.prototype.doctype = function(pubID, sysID) { | |
var doc, doctype, i, j, k, len, len1, ref1, ref2; | |
for (doc = this.document(), doctype = new XMLDocType(doc, pubID, sysID), i = j = 0, | |
len = (ref1 = doc.children).length; j < len; i = ++j) if (ref1[i] instanceof XMLDocType) return doc.children[i] = doctype, | |
doctype; | |
for (i = k = 0, len1 = (ref2 = doc.children).length; k < len1; i = ++k) if (ref2[i].isRoot) return doc.children.splice(i, 0, doctype), | |
doctype; | |
return doc.children.push(doctype), doctype; | |
}, XMLNode.prototype.up = function() { | |
if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object."); | |
return this.parent; | |
}, XMLNode.prototype.root = function() { | |
var node; | |
for (node = this; node; ) { | |
if (node.isDocument) return node.rootObject; | |
if (node.isRoot) return node; | |
node = node.parent; | |
} | |
}, XMLNode.prototype.document = function() { | |
var node; | |
for (node = this; node; ) { | |
if (node.isDocument) return node; | |
node = node.parent; | |
} | |
}, XMLNode.prototype.end = function(options) { | |
return this.document().end(options); | |
}, XMLNode.prototype.prev = function() { | |
var i; | |
if ((i = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node"); | |
return this.parent.children[i - 1]; | |
}, XMLNode.prototype.next = function() { | |
var i; | |
if (-1 === (i = this.parent.children.indexOf(this)) || i === this.parent.children.length - 1) throw new Error("Already at the last node"); | |
return this.parent.children[i + 1]; | |
}, XMLNode.prototype.importDocument = function(doc) { | |
var clonedRoot; | |
return (clonedRoot = doc.root().clone()).parent = this, clonedRoot.isRoot = !1, | |
this.children.push(clonedRoot), this; | |
}, XMLNode.prototype.ele = function(name, attributes, text) { | |
return this.element(name, attributes, text); | |
}, XMLNode.prototype.nod = function(name, attributes, text) { | |
return this.node(name, attributes, text); | |
}, XMLNode.prototype.txt = function(value) { | |
return this.text(value); | |
}, XMLNode.prototype.dat = function(value) { | |
return this.cdata(value); | |
}, XMLNode.prototype.com = function(value) { | |
return this.comment(value); | |
}, XMLNode.prototype.ins = function(target, value) { | |
return this.instruction(target, value); | |
}, XMLNode.prototype.doc = function() { | |
return this.document(); | |
}, XMLNode.prototype.dec = function(version, encoding, standalone) { | |
return this.declaration(version, encoding, standalone); | |
}, XMLNode.prototype.dtd = function(pubID, sysID) { | |
return this.doctype(pubID, sysID); | |
}, XMLNode.prototype.e = function(name, attributes, text) { | |
return this.element(name, attributes, text); | |
}, XMLNode.prototype.n = function(name, attributes, text) { | |
return this.node(name, attributes, text); | |
}, XMLNode.prototype.t = function(value) { | |
return this.text(value); | |
}, XMLNode.prototype.d = function(value) { | |
return this.cdata(value); | |
}, XMLNode.prototype.c = function(value) { | |
return this.comment(value); | |
}, XMLNode.prototype.r = function(value) { | |
return this.raw(value); | |
}, XMLNode.prototype.i = function(target, value) { | |
return this.instruction(target, value); | |
}, XMLNode.prototype.u = function() { | |
return this.up(); | |
}, XMLNode.prototype.importXMLBuilder = function(doc) { | |
return this.importDocument(doc); | |
}, XMLNode; | |
})(); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var Stream = function() { | |
this.init = function() { | |
var listeners = {}; | |
this.on = function(type, listener) { | |
listeners[type] || (listeners[type] = []), listeners[type] = listeners[type].concat(listener); | |
}, this.off = function(type, listener) { | |
var index; | |
return !!listeners[type] && (index = listeners[type].indexOf(listener), listeners[type] = listeners[type].slice(), | |
listeners[type].splice(index, 1), index > -1); | |
}, this.trigger = function(type) { | |
var callbacks, i, length, args; | |
if (callbacks = listeners[type]) if (2 === arguments.length) for (length = callbacks.length, | |
i = 0; i < length; ++i) callbacks[i].call(this, arguments[1]); else { | |
for (args = [], i = arguments.length, i = 1; i < arguments.length; ++i) args.push(arguments[i]); | |
for (length = callbacks.length, i = 0; i < length; ++i) callbacks[i].apply(this, args); | |
} | |
}, this.dispose = function() { | |
listeners = {}; | |
}; | |
}; | |
}; | |
Stream.prototype.pipe = function(destination) { | |
return this.on("data", (function(data) { | |
destination.push(data); | |
})), this.on("done", (function(flushSource) { | |
destination.flush(flushSource); | |
})), this.on("partialdone", (function(flushSource) { | |
destination.partialFlush(flushSource); | |
})), this.on("endedtimeline", (function(flushSource) { | |
destination.endTimeline(flushSource); | |
})), this.on("reset", (function(flushSource) { | |
destination.reset(flushSource); | |
})), destination; | |
}, Stream.prototype.push = function(data) { | |
this.trigger("data", data); | |
}, Stream.prototype.flush = function(flushSource) { | |
this.trigger("done", flushSource); | |
}, Stream.prototype.partialFlush = function(flushSource) { | |
this.trigger("partialdone", flushSource); | |
}, Stream.prototype.endTimeline = function(flushSource) { | |
this.trigger("endedtimeline", flushSource); | |
}, Stream.prototype.reset = function(flushSource) { | |
this.trigger("reset", flushSource); | |
}, module.exports = Stream; | |
}, function(module, exports, __webpack_require__) { | |
var __WEBPACK_AMD_DEFINE_RESULT__; | |
!(function() { | |
var previous_async, async = {}; | |
function noop() {} | |
function identity(v) { | |
return v; | |
} | |
function toBool(v) { | |
return !!v; | |
} | |
function notId(v) { | |
return !v; | |
} | |
var root = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || this; | |
function only_once(fn) { | |
return function() { | |
if (null === fn) throw new Error("Callback was already called."); | |
fn.apply(this, arguments), fn = null; | |
}; | |
} | |
function _once(fn) { | |
return function() { | |
null !== fn && (fn.apply(this, arguments), fn = null); | |
}; | |
} | |
null != root && (previous_async = root.async), async.noConflict = function() { | |
return root.async = previous_async, async; | |
}; | |
var _toString = Object.prototype.toString, _isArray = Array.isArray || function(obj) { | |
return "[object Array]" === _toString.call(obj); | |
}; | |
function _isArrayLike(arr) { | |
return _isArray(arr) || "number" == typeof arr.length && arr.length >= 0 && arr.length % 1 == 0; | |
} | |
function _arrayEach(arr, iterator) { | |
for (var index = -1, length = arr.length; ++index < length; ) iterator(arr[index], index, arr); | |
} | |
function _map(arr, iterator) { | |
for (var index = -1, length = arr.length, result = Array(length); ++index < length; ) result[index] = iterator(arr[index], index, arr); | |
return result; | |
} | |
function _range(count) { | |
return _map(Array(count), (function(v, i) { | |
return i; | |
})); | |
} | |
function _reduce(arr, iterator, memo) { | |
return _arrayEach(arr, (function(x, i, a) { | |
memo = iterator(memo, x, i, a); | |
})), memo; | |
} | |
function _forEachOf(object, iterator) { | |
_arrayEach(_keys(object), (function(key) { | |
iterator(object[key], key); | |
})); | |
} | |
function _indexOf(arr, item) { | |
for (var i = 0; i < arr.length; i++) if (arr[i] === item) return i; | |
return -1; | |
} | |
var _keys = Object.keys || function(obj) { | |
var keys = []; | |
for (var k in obj) obj.hasOwnProperty(k) && keys.push(k); | |
return keys; | |
}; | |
function _keyIterator(coll) { | |
var len, keys, i = -1; | |
return _isArrayLike(coll) ? (len = coll.length, function() { | |
return ++i < len ? i : null; | |
}) : (keys = _keys(coll), len = keys.length, function() { | |
return ++i < len ? keys[i] : null; | |
}); | |
} | |
function _restParam(func, startIndex) { | |
return startIndex = null == startIndex ? func.length - 1 : +startIndex, function() { | |
for (var length = Math.max(arguments.length - startIndex, 0), rest = Array(length), index = 0; index < length; index++) rest[index] = arguments[index + startIndex]; | |
switch (startIndex) { | |
case 0: | |
return func.call(this, rest); | |
case 1: | |
return func.call(this, arguments[0], rest); | |
} | |
}; | |
} | |
function _withoutIndex(iterator) { | |
return function(value, index, callback) { | |
return iterator(value, callback); | |
}; | |
} | |
var _setImmediate = "function" == typeof setImmediate && setImmediate, _delay = _setImmediate ? function(fn) { | |
_setImmediate(fn); | |
} : function(fn) { | |
setTimeout(fn, 0); | |
}; | |
function _eachOfLimit(limit) { | |
return function(obj, iterator, callback) { | |
callback = _once(callback || noop); | |
var nextKey = _keyIterator(obj = obj || []); | |
if (limit <= 0) return callback(null); | |
var done = !1, running = 0, errored = !1; | |
!(function replenish() { | |
if (done && running <= 0) return callback(null); | |
for (;running < limit && !errored; ) { | |
var key = nextKey(); | |
if (null === key) return done = !0, void (running <= 0 && callback(null)); | |
running += 1, iterator(obj[key], key, only_once((function(err) { | |
running -= 1, err ? (callback(err), errored = !0) : replenish(); | |
}))); | |
} | |
})(); | |
}; | |
} | |
function doParallel(fn) { | |
return function(obj, iterator, callback) { | |
return fn(async.eachOf, obj, iterator, callback); | |
}; | |
} | |
function doParallelLimit(fn) { | |
return function(obj, limit, iterator, callback) { | |
return fn(_eachOfLimit(limit), obj, iterator, callback); | |
}; | |
} | |
function doSeries(fn) { | |
return function(obj, iterator, callback) { | |
return fn(async.eachOfSeries, obj, iterator, callback); | |
}; | |
} | |
function _asyncMap(eachfn, arr, iterator, callback) { | |
callback = _once(callback || noop); | |
var results = _isArrayLike(arr = arr || []) ? [] : {}; | |
eachfn(arr, (function(value, index, callback) { | |
iterator(value, (function(err, v) { | |
results[index] = v, callback(err); | |
})); | |
}), (function(err) { | |
callback(err, results); | |
})); | |
} | |
function _filter(eachfn, arr, iterator, callback) { | |
var results = []; | |
eachfn(arr, (function(x, index, callback) { | |
iterator(x, (function(v) { | |
v && results.push({ | |
index: index, | |
value: x | |
}), callback(); | |
})); | |
}), (function() { | |
callback(_map(results.sort((function(a, b) { | |
return a.index - b.index; | |
})), (function(x) { | |
return x.value; | |
}))); | |
})); | |
} | |
function _reject(eachfn, arr, iterator, callback) { | |
_filter(eachfn, arr, (function(value, cb) { | |
iterator(value, (function(v) { | |
cb(!v); | |
})); | |
}), callback); | |
} | |
function _createTester(eachfn, check, getResult) { | |
return function(arr, limit, iterator, cb) { | |
function done() { | |
cb && cb(getResult(!1, void 0)); | |
} | |
function iteratee(x, _, callback) { | |
if (!cb) return callback(); | |
iterator(x, (function(v) { | |
cb && check(v) && (cb(getResult(!0, x)), cb = iterator = !1), callback(); | |
})); | |
} | |
arguments.length > 3 ? eachfn(arr, limit, iteratee, done) : (cb = iterator, iterator = limit, | |
eachfn(arr, iteratee, done)); | |
}; | |
} | |
function _findGetResult(v, x) { | |
return x; | |
} | |
function _parallel(eachfn, tasks, callback) { | |
callback = callback || noop; | |
var results = _isArrayLike(tasks) ? [] : {}; | |
eachfn(tasks, (function(task, key, callback) { | |
task(_restParam((function(err, args) { | |
args.length <= 1 && (args = args[0]), results[key] = args, callback(err); | |
}))); | |
}), (function(err) { | |
callback(err, results); | |
})); | |
} | |
function _concat(eachfn, arr, fn, callback) { | |
var result = []; | |
eachfn(arr, (function(x, index, cb) { | |
fn(x, (function(err, y) { | |
result = result.concat(y || []), cb(err); | |
})); | |
}), (function(err) { | |
callback(err, result); | |
})); | |
} | |
function _queue(worker, concurrency, payload) { | |
if (null == concurrency) concurrency = 1; else if (0 === concurrency) throw new Error("Concurrency must not be zero"); | |
function _insert(q, data, pos, callback) { | |
if (null != callback && "function" != typeof callback) throw new Error("task callback must be a function"); | |
if (q.started = !0, _isArray(data) || (data = [ data ]), 0 === data.length && q.idle()) return async.setImmediate((function() { | |
q.drain(); | |
})); | |
_arrayEach(data, (function(task) { | |
var item = { | |
data: task, | |
callback: callback || noop | |
}; | |
pos ? q.tasks.unshift(item) : q.tasks.push(item), q.tasks.length === q.concurrency && q.saturated(); | |
})), async.setImmediate(q.process); | |
} | |
function _next(q, tasks) { | |
return function() { | |
workers -= 1; | |
var removed = !1, args = arguments; | |
_arrayEach(tasks, (function(task) { | |
_arrayEach(workersList, (function(worker, index) { | |
worker !== task || removed || (workersList.splice(index, 1), removed = !0); | |
})), task.callback.apply(task, args); | |
})), q.tasks.length + workers === 0 && q.drain(), q.process(); | |
}; | |
} | |
var workers = 0, workersList = [], q = { | |
tasks: [], | |
concurrency: concurrency, | |
payload: payload, | |
saturated: noop, | |
empty: noop, | |
drain: noop, | |
started: !1, | |
paused: !1, | |
push: function(data, callback) { | |
_insert(q, data, !1, callback); | |
}, | |
kill: function() { | |
q.drain = noop, q.tasks = []; | |
}, | |
unshift: function(data, callback) { | |
_insert(q, data, !0, callback); | |
}, | |
process: function() { | |
for (;!q.paused && workers < q.concurrency && q.tasks.length; ) { | |
var tasks = q.payload ? q.tasks.splice(0, q.payload) : q.tasks.splice(0, q.tasks.length), data = _map(tasks, (function(task) { | |
return task.data; | |
})); | |
0 === q.tasks.length && q.empty(), workers += 1, workersList.push(tasks[0]); | |
var cb = only_once(_next(q, tasks)); | |
worker(data, cb); | |
} | |
}, | |
length: function() { | |
return q.tasks.length; | |
}, | |
running: function() { | |
return workers; | |
}, | |
workersList: function() { | |
return workersList; | |
}, | |
idle: function() { | |
return q.tasks.length + workers === 0; | |
}, | |
pause: function() { | |
q.paused = !0; | |
}, | |
resume: function() { | |
if (!1 !== q.paused) { | |
q.paused = !1; | |
for (var resumeCount = Math.min(q.concurrency, q.tasks.length), w = 1; w <= resumeCount; w++) async.setImmediate(q.process); | |
} | |
} | |
}; | |
return q; | |
} | |
function _console_fn(name) { | |
return _restParam((function(fn, args) { | |
fn.apply(null, args.concat([ _restParam((function(err, args) { | |
"object" == typeof console && (err ? console.error && console.error(err) : console[name] && _arrayEach(args, (function(x) { | |
console[name](x); | |
}))); | |
})) ])); | |
})); | |
} | |
function _times(mapper) { | |
return function(count, iterator, callback) { | |
mapper(_range(count), iterator, callback); | |
}; | |
} | |
function _applyEach(eachfn) { | |
return _restParam((function(fns, args) { | |
var go = _restParam((function(args) { | |
var that = this, callback = args.pop(); | |
return eachfn(fns, (function(fn, _, cb) { | |
fn.apply(that, args.concat([ cb ])); | |
}), callback); | |
})); | |
return args.length ? go.apply(this, args) : go; | |
})); | |
} | |
function ensureAsync(fn) { | |
return _restParam((function(args) { | |
var callback = args.pop(); | |
args.push((function() { | |
var innerArgs = arguments; | |
sync ? async.setImmediate((function() { | |
callback.apply(null, innerArgs); | |
})) : callback.apply(null, innerArgs); | |
})); | |
var sync = !0; | |
fn.apply(this, args), sync = !1; | |
})); | |
} | |
"object" == typeof process && "function" == typeof process.nextTick ? async.nextTick = process.nextTick : async.nextTick = _delay, | |
async.setImmediate = _setImmediate ? _delay : async.nextTick, async.forEach = async.each = function(arr, iterator, callback) { | |
return async.eachOf(arr, _withoutIndex(iterator), callback); | |
}, async.forEachSeries = async.eachSeries = function(arr, iterator, callback) { | |
return async.eachOfSeries(arr, _withoutIndex(iterator), callback); | |
}, async.forEachLimit = async.eachLimit = function(arr, limit, iterator, callback) { | |
return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback); | |
}, async.forEachOf = async.eachOf = function(object, iterator, callback) { | |
callback = _once(callback || noop); | |
for (var key, iter = _keyIterator(object = object || []), completed = 0; null != (key = iter()); ) completed += 1, | |
iterator(object[key], key, only_once(done)); | |
function done(err) { | |
completed--, err ? callback(err) : null === key && completed <= 0 && callback(null); | |
} | |
0 === completed && callback(null); | |
}, async.forEachOfSeries = async.eachOfSeries = function(obj, iterator, callback) { | |
callback = _once(callback || noop); | |
var nextKey = _keyIterator(obj = obj || []), key = nextKey(); | |
!(function iterate() { | |
var sync = !0; | |
if (null === key) return callback(null); | |
iterator(obj[key], key, only_once((function(err) { | |
if (err) callback(err); else { | |
if (null === (key = nextKey())) return callback(null); | |
sync ? async.setImmediate(iterate) : iterate(); | |
} | |
}))), sync = !1; | |
})(); | |
}, async.forEachOfLimit = async.eachOfLimit = function(obj, limit, iterator, callback) { | |
_eachOfLimit(limit)(obj, iterator, callback); | |
}, async.map = doParallel(_asyncMap), async.mapSeries = doSeries(_asyncMap), async.mapLimit = doParallelLimit(_asyncMap), | |
async.inject = async.foldl = async.reduce = function(arr, memo, iterator, callback) { | |
async.eachOfSeries(arr, (function(x, i, callback) { | |
iterator(memo, x, (function(err, v) { | |
memo = v, callback(err); | |
})); | |
}), (function(err) { | |
callback(err, memo); | |
})); | |
}, async.foldr = async.reduceRight = function(arr, memo, iterator, callback) { | |
var reversed = _map(arr, identity).reverse(); | |
async.reduce(reversed, memo, iterator, callback); | |
}, async.transform = function(arr, memo, iterator, callback) { | |
3 === arguments.length && (callback = iterator, iterator = memo, memo = _isArray(arr) ? [] : {}), | |
async.eachOf(arr, (function(v, k, cb) { | |
iterator(memo, v, k, cb); | |
}), (function(err) { | |
callback(err, memo); | |
})); | |
}, async.select = async.filter = doParallel(_filter), async.selectLimit = async.filterLimit = doParallelLimit(_filter), | |
async.selectSeries = async.filterSeries = doSeries(_filter), async.reject = doParallel(_reject), | |
async.rejectLimit = doParallelLimit(_reject), async.rejectSeries = doSeries(_reject), | |
async.any = async.some = _createTester(async.eachOf, toBool, identity), async.someLimit = _createTester(async.eachOfLimit, toBool, identity), | |
async.all = async.every = _createTester(async.eachOf, notId, notId), async.everyLimit = _createTester(async.eachOfLimit, notId, notId), | |
async.detect = _createTester(async.eachOf, identity, _findGetResult), async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult), | |
async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult), | |
async.sortBy = function(arr, iterator, callback) { | |
function comparator(left, right) { | |
var a = left.criteria, b = right.criteria; | |
return a < b ? -1 : a > b ? 1 : 0; | |
} | |
async.map(arr, (function(x, callback) { | |
iterator(x, (function(err, criteria) { | |
err ? callback(err) : callback(null, { | |
value: x, | |
criteria: criteria | |
}); | |
})); | |
}), (function(err, results) { | |
if (err) return callback(err); | |
callback(null, _map(results.sort(comparator), (function(x) { | |
return x.value; | |
}))); | |
})); | |
}, async.auto = function(tasks, concurrency, callback) { | |
"function" == typeof arguments[1] && (callback = concurrency, concurrency = null), | |
callback = _once(callback || noop); | |
var keys = _keys(tasks), remainingTasks = keys.length; | |
if (!remainingTasks) return callback(null); | |
concurrency || (concurrency = remainingTasks); | |
var results = {}, runningTasks = 0, hasError = !1, listeners = []; | |
function addListener(fn) { | |
listeners.unshift(fn); | |
} | |
function removeListener(fn) { | |
var idx = _indexOf(listeners, fn); | |
idx >= 0 && listeners.splice(idx, 1); | |
} | |
function taskComplete() { | |
remainingTasks--, _arrayEach(listeners.slice(0), (function(fn) { | |
fn(); | |
})); | |
} | |
addListener((function() { | |
remainingTasks || callback(null, results); | |
})), _arrayEach(keys, (function(k) { | |
if (!hasError) { | |
for (var dep, task = _isArray(tasks[k]) ? tasks[k] : [ tasks[k] ], taskCallback = _restParam((function(err, args) { | |
if (runningTasks--, args.length <= 1 && (args = args[0]), err) { | |
var safeResults = {}; | |
_forEachOf(results, (function(val, rkey) { | |
safeResults[rkey] = val; | |
})), safeResults[k] = args, hasError = !0, callback(err, safeResults); | |
} else results[k] = args, async.setImmediate(taskComplete); | |
})), requires = task.slice(0, task.length - 1), len = requires.length; len--; ) { | |
if (!(dep = tasks[requires[len]])) throw new Error("Has nonexistent dependency in " + requires.join(", ")); | |
if (_isArray(dep) && _indexOf(dep, k) >= 0) throw new Error("Has cyclic dependencies"); | |
} | |
ready() ? (runningTasks++, task[task.length - 1](taskCallback, results)) : addListener((function listener() { | |
ready() && (runningTasks++, removeListener(listener), task[task.length - 1](taskCallback, results)); | |
})); | |
} | |
function ready() { | |
return runningTasks < concurrency && _reduce(requires, (function(a, x) { | |
return a && results.hasOwnProperty(x); | |
}), !0) && !results.hasOwnProperty(k); | |
} | |
})); | |
}, async.retry = function(times, task, callback) { | |
var DEFAULT_TIMES = 5, DEFAULT_INTERVAL = 0, attempts = [], opts = { | |
times: DEFAULT_TIMES, | |
interval: DEFAULT_INTERVAL | |
}; | |
function parseTimes(acc, t) { | |
if ("number" == typeof t) acc.times = parseInt(t, 10) || DEFAULT_TIMES; else { | |
if ("object" != typeof t) throw new Error("Unsupported argument type for 'times': " + typeof t); | |
acc.times = parseInt(t.times, 10) || DEFAULT_TIMES, acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL; | |
} | |
} | |
var length = arguments.length; | |
if (length < 1 || length > 3) throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)"); | |
function wrappedTask(wrappedCallback, wrappedResults) { | |
function retryAttempt(task, finalAttempt) { | |
return function(seriesCallback) { | |
task((function(err, result) { | |
seriesCallback(!err || finalAttempt, { | |
err: err, | |
result: result | |
}); | |
}), wrappedResults); | |
}; | |
} | |
function retryInterval(interval) { | |
return function(seriesCallback) { | |
setTimeout((function() { | |
seriesCallback(null); | |
}), interval); | |
}; | |
} | |
for (;opts.times; ) { | |
var finalAttempt = !(opts.times -= 1); | |
attempts.push(retryAttempt(opts.task, finalAttempt)), !finalAttempt && opts.interval > 0 && attempts.push(retryInterval(opts.interval)); | |
} | |
async.series(attempts, (function(done, data) { | |
data = data[data.length - 1], (wrappedCallback || opts.callback)(data.err, data.result); | |
})); | |
} | |
return length <= 2 && "function" == typeof times && (callback = task, task = times), | |
"function" != typeof times && parseTimes(opts, times), opts.callback = callback, | |
opts.task = task, opts.callback ? wrappedTask() : wrappedTask; | |
}, async.waterfall = function(tasks, callback) { | |
if (callback = _once(callback || noop), !_isArray(tasks)) { | |
var err = new Error("First argument to waterfall must be an array of functions"); | |
return callback(err); | |
} | |
if (!tasks.length) return callback(); | |
!(function wrapIterator(iterator) { | |
return _restParam((function(err, args) { | |
if (err) callback.apply(null, [ err ].concat(args)); else { | |
var next = iterator.next(); | |
next ? args.push(wrapIterator(next)) : args.push(callback), ensureAsync(iterator).apply(null, args); | |
} | |
})); | |
})(async.iterator(tasks))(); | |
}, async.parallel = function(tasks, callback) { | |
_parallel(async.eachOf, tasks, callback); | |
}, async.parallelLimit = function(tasks, limit, callback) { | |
_parallel(_eachOfLimit(limit), tasks, callback); | |
}, async.series = function(tasks, callback) { | |
_parallel(async.eachOfSeries, tasks, callback); | |
}, async.iterator = function(tasks) { | |
return (function makeCallback(index) { | |
function fn() { | |
return tasks.length && tasks[index].apply(null, arguments), fn.next(); | |
} | |
return fn.next = function() { | |
return index < tasks.length - 1 ? makeCallback(index + 1) : null; | |
}, fn; | |
})(0); | |
}, async.apply = _restParam((function(fn, args) { | |
return _restParam((function(callArgs) { | |
return fn.apply(null, args.concat(callArgs)); | |
})); | |
})), async.concat = doParallel(_concat), async.concatSeries = doSeries(_concat), | |
async.whilst = function(test, iterator, callback) { | |
if (callback = callback || noop, test()) { | |
var next = _restParam((function(err, args) { | |
err ? callback(err) : test.apply(this, args) ? iterator(next) : callback.apply(null, [ null ].concat(args)); | |
})); | |
iterator(next); | |
} else callback(null); | |
}, async.doWhilst = function(iterator, test, callback) { | |
var calls = 0; | |
return async.whilst((function() { | |
return ++calls <= 1 || test.apply(this, arguments); | |
}), iterator, callback); | |
}, async.until = function(test, iterator, callback) { | |
return async.whilst((function() { | |
return !test.apply(this, arguments); | |
}), iterator, callback); | |
}, async.doUntil = function(iterator, test, callback) { | |
return async.doWhilst(iterator, (function() { | |
return !test.apply(this, arguments); | |
}), callback); | |
}, async.during = function(test, iterator, callback) { | |
callback = callback || noop; | |
var next = _restParam((function(err, args) { | |
err ? callback(err) : (args.push(check), test.apply(this, args)); | |
})), check = function(err, truth) { | |
err ? callback(err) : truth ? iterator(next) : callback(null); | |
}; | |
test(check); | |
}, async.doDuring = function(iterator, test, callback) { | |
var calls = 0; | |
async.during((function(next) { | |
calls++ < 1 ? next(null, !0) : test.apply(this, arguments); | |
}), iterator, callback); | |
}, async.queue = function(worker, concurrency) { | |
return _queue((function(items, cb) { | |
worker(items[0], cb); | |
}), concurrency, 1); | |
}, async.priorityQueue = function(worker, concurrency) { | |
function _compareTasks(a, b) { | |
return a.priority - b.priority; | |
} | |
var q = async.queue(worker, concurrency); | |
return q.push = function(data, priority, callback) { | |
!(function(q, data, priority, callback) { | |
if (null != callback && "function" != typeof callback) throw new Error("task callback must be a function"); | |
if (q.started = !0, _isArray(data) || (data = [ data ]), 0 === data.length) return async.setImmediate((function() { | |
q.drain(); | |
})); | |
_arrayEach(data, (function(task) { | |
var item = { | |
data: task, | |
priority: priority, | |
callback: "function" == typeof callback ? callback : noop | |
}; | |
q.tasks.splice((function(sequence, item, compare) { | |
for (var beg = -1, end = sequence.length - 1; beg < end; ) { | |
var mid = beg + (end - beg + 1 >>> 1); | |
compare(item, sequence[mid]) >= 0 ? beg = mid : end = mid - 1; | |
} | |
return beg; | |
})(q.tasks, item, _compareTasks) + 1, 0, item), q.tasks.length === q.concurrency && q.saturated(), | |
async.setImmediate(q.process); | |
})); | |
})(q, data, priority, callback); | |
}, delete q.unshift, q; | |
}, async.cargo = function(worker, payload) { | |
return _queue(worker, 1, payload); | |
}, async.log = _console_fn("log"), async.dir = _console_fn("dir"), async.memoize = function(fn, hasher) { | |
var memo = {}, queues = {}, has = Object.prototype.hasOwnProperty; | |
hasher = hasher || identity; | |
var memoized = _restParam((function(args) { | |
var callback = args.pop(), key = hasher.apply(null, args); | |
has.call(memo, key) ? async.setImmediate((function() { | |
callback.apply(null, memo[key]); | |
})) : has.call(queues, key) ? queues[key].push(callback) : (queues[key] = [ callback ], | |
fn.apply(null, args.concat([ _restParam((function(args) { | |
memo[key] = args; | |
var q = queues[key]; | |
delete queues[key]; | |
for (var i = 0, l = q.length; i < l; i++) q[i].apply(null, args); | |
})) ]))); | |
})); | |
return memoized.memo = memo, memoized.unmemoized = fn, memoized; | |
}, async.unmemoize = function(fn) { | |
return function() { | |
return (fn.unmemoized || fn).apply(null, arguments); | |
}; | |
}, async.times = _times(async.map), async.timesSeries = _times(async.mapSeries), | |
async.timesLimit = function(count, limit, iterator, callback) { | |
return async.mapLimit(_range(count), limit, iterator, callback); | |
}, async.seq = function() { | |
var fns = arguments; | |
return _restParam((function(args) { | |
var that = this, callback = args[args.length - 1]; | |
"function" == typeof callback ? args.pop() : callback = noop, async.reduce(fns, args, (function(newargs, fn, cb) { | |
fn.apply(that, newargs.concat([ _restParam((function(err, nextargs) { | |
cb(err, nextargs); | |
})) ])); | |
}), (function(err, results) { | |
callback.apply(that, [ err ].concat(results)); | |
})); | |
})); | |
}, async.compose = function() { | |
return async.seq.apply(null, Array.prototype.reverse.call(arguments)); | |
}, async.applyEach = _applyEach(async.eachOf), async.applyEachSeries = _applyEach(async.eachOfSeries), | |
async.forever = function(fn, callback) { | |
var done = only_once(callback || noop), task = ensureAsync(fn); | |
!(function next(err) { | |
if (err) return done(err); | |
task(next); | |
})(); | |
}, async.ensureAsync = ensureAsync, async.constant = _restParam((function(values) { | |
var args = [ null ].concat(values); | |
return function(callback) { | |
return callback.apply(this, args); | |
}; | |
})), async.wrapSync = async.asyncify = function(func) { | |
return _restParam((function(args) { | |
var result, obj, type, callback = args.pop(); | |
try { | |
result = func.apply(this, args); | |
} catch (e) { | |
return callback(e); | |
} | |
("function" == (type = typeof (obj = result)) || "object" === type && obj) && "function" == typeof result.then ? result.then((function(value) { | |
callback(null, value); | |
})).catch((function(err) { | |
callback(err.message ? err : new Error(err)); | |
})) : callback(null, result); | |
})); | |
}, module.exports ? module.exports = async : void 0 === (__WEBPACK_AMD_DEFINE_RESULT__ = function() { | |
return async; | |
}.apply(exports, [])) || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); | |
})(); | |
}, function(module, exports, __webpack_require__) { | |
var NGramParser = __webpack_require__(371), NGramParser_IBM420 = __webpack_require__(715); | |
module.exports.match = function(input, ngrams, byteMap, spaceChar) { | |
return spaceChar = spaceChar || 32, new NGramParser(ngrams, byteMap).parse(input, spaceChar); | |
}, module.exports.matchIBM420 = function(input, ngrams, byteMap, spaceChar) { | |
return spaceChar = spaceChar || 32, new NGramParser_IBM420(ngrams, byteMap).parse(input, spaceChar); | |
}, module.exports.NGramsPlusLang = function(la, ng) { | |
this.lang = la, this.ngrams = ng; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var tty = __webpack_require__(105); | |
module.exports = function(name) { | |
function disabled() {} | |
disabled.enabled = !1; | |
var match = skips.some((function(re) { | |
return re.test(name); | |
})); | |
if (match) return disabled; | |
if (!(match = names.some((function(re) { | |
return re.test(name); | |
})))) return disabled; | |
var c = colors[prevColor++ % colors.length]; | |
function colored(fmt) { | |
fmt = coerce(fmt); | |
var curr = new Date, ms = curr - (prev[name] || curr); | |
prev[name] = curr, fmt = " [9" + c + "m" + name + " [3" + c + "m[90m" + fmt + "[3" + c + "m +" + humanize(ms) + "[0m", | |
console.error.apply(this, arguments); | |
} | |
function plain(fmt) { | |
fmt = coerce(fmt), fmt = (new Date).toUTCString() + " " + name + " " + fmt, console.error.apply(this, arguments); | |
} | |
return colored.enabled = plain.enabled = !0, isatty || process.env.DEBUG_COLORS ? colored : plain; | |
}; | |
var names = [], skips = []; | |
(process.env.DEBUG || "").split(/[\s,]+/).forEach((function(name) { | |
"-" === (name = name.replace("*", ".*?"))[0] ? skips.push(new RegExp("^" + name.substr(1) + "$")) : names.push(new RegExp("^" + name + "$")); | |
})); | |
var colors = [ 6, 2, 3, 4, 5, 1 ], prev = {}, prevColor = 0, isatty = tty.isatty(2); | |
function humanize(ms) { | |
return ms >= 36e5 ? (ms / 36e5).toFixed(1) + "h" : ms >= 6e4 ? (ms / 6e4).toFixed(1) + "m" : ms >= 1e3 ? (ms / 1e3 | 0) + "s" : ms + "ms"; | |
} | |
function coerce(val) { | |
return val instanceof Error ? val.stack || val.message : val; | |
} | |
}, function(module, exports, __webpack_require__) { | |
"undefined" == typeof window ? module.exports = __webpack_require__(40) : module.exports = __webpack_require__(816); | |
}, function(module, exports) { | |
module.exports = require("net"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), Element = __webpack_require__(407); | |
function Element1(doc, tagId, ebmlId, start, length) { | |
Element.call(this, doc, tagId, ebmlId, start, length); | |
} | |
__webpack_require__(13), __webpack_require__(19), util.inherits(Element1, Element), | |
module.exports = Element1; | |
}, function(module, exports, __webpack_require__) { | |
__webpack_require__(15); | |
var util = __webpack_require__(0); | |
function FingerprintFormatError(fp, format) { | |
Error.captureStackTrace && Error.captureStackTrace(this, FingerprintFormatError), | |
this.name = "FingerprintFormatError", this.fingerprint = fp, this.format = format, | |
this.message = "Fingerprint format is not supported, or is invalid: ", void 0 !== fp && (this.message += " fingerprint = " + fp), | |
void 0 !== format && (this.message += " format = " + format); | |
} | |
function InvalidAlgorithmError(alg) { | |
Error.captureStackTrace && Error.captureStackTrace(this, InvalidAlgorithmError), | |
this.name = "InvalidAlgorithmError", this.algorithm = alg, this.message = 'Algorithm "' + alg + '" is not supported'; | |
} | |
function KeyParseError(name, format, innerErr) { | |
Error.captureStackTrace && Error.captureStackTrace(this, KeyParseError), this.name = "KeyParseError", | |
this.format = format, this.keyName = name, this.innerErr = innerErr, this.message = "Failed to parse " + name + " as a valid " + format + " format key: " + innerErr.message; | |
} | |
function SignatureParseError(type, format, innerErr) { | |
Error.captureStackTrace && Error.captureStackTrace(this, SignatureParseError), this.name = "SignatureParseError", | |
this.type = type, this.format = format, this.innerErr = innerErr, this.message = "Failed to parse the given data as a " + type + " signature in " + format + " format: " + innerErr.message; | |
} | |
function CertificateParseError(name, format, innerErr) { | |
Error.captureStackTrace && Error.captureStackTrace(this, CertificateParseError), | |
this.name = "CertificateParseError", this.format = format, this.certName = name, | |
this.innerErr = innerErr, this.message = "Failed to parse " + name + " as a valid " + format + " format certificate: " + innerErr.message; | |
} | |
function KeyEncryptedError(name, format) { | |
Error.captureStackTrace && Error.captureStackTrace(this, KeyEncryptedError), this.name = "KeyEncryptedError", | |
this.format = format, this.keyName = name, this.message = "The " + format + " format key " + name + " is encrypted (password-protected), and no passphrase was provided in `options`"; | |
} | |
util.inherits(FingerprintFormatError, Error), util.inherits(InvalidAlgorithmError, Error), | |
util.inherits(KeyParseError, Error), util.inherits(SignatureParseError, Error), | |
util.inherits(CertificateParseError, Error), util.inherits(KeyEncryptedError, Error), | |
module.exports = { | |
FingerprintFormatError: FingerprintFormatError, | |
InvalidAlgorithmError: InvalidAlgorithmError, | |
KeyParseError: KeyParseError, | |
SignatureParseError: SignatureParseError, | |
KeyEncryptedError: KeyEncryptedError, | |
CertificateParseError: CertificateParseError | |
}; | |
}, function(module, exports) { | |
module.exports = require("zlib"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var url = __webpack_require__(7), parse = url.parse, Url = url.Url; | |
function parseurl(req) { | |
var url = req.url; | |
if (void 0 !== url) { | |
var parsed = req._parsedUrl; | |
return fresh(url, parsed) ? parsed : ((parsed = fastparse(url))._raw = url, req._parsedUrl = parsed); | |
} | |
} | |
function fastparse(str) { | |
if ("string" != typeof str || 47 !== str.charCodeAt(0)) return parse(str); | |
for (var pathname = str, query = null, search = null, i = 1; i < str.length; i++) switch (str.charCodeAt(i)) { | |
case 63: | |
null === search && (pathname = str.substring(0, i), query = str.substring(i + 1), | |
search = str.substring(i)); | |
break; | |
case 9: | |
case 10: | |
case 12: | |
case 13: | |
case 32: | |
case 35: | |
case 160: | |
case 65279: | |
return parse(str); | |
} | |
var url = void 0 !== Url ? new Url : {}; | |
return url.path = str, url.href = str, url.pathname = pathname, null !== search && (url.query = query, | |
url.search = search), url; | |
} | |
function fresh(url, parsedUrl) { | |
return "object" == typeof parsedUrl && null !== parsedUrl && (void 0 === Url || parsedUrl instanceof Url) && parsedUrl._raw === url; | |
} | |
module.exports = parseurl, module.exports.original = function(req) { | |
var url = req.originalUrl; | |
if ("string" != typeof url) return parseurl(req); | |
var parsed = req._parsedOriginalUrl; | |
return fresh(url, parsed) ? parsed : ((parsed = fastparse(url))._raw = url, req._parsedOriginalUrl = parsed); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var callSiteToString = __webpack_require__(247).callSiteToString, eventListenerCount = __webpack_require__(247).eventListenerCount, relative = __webpack_require__(4).relative; | |
module.exports = depd; | |
var basePath = process.cwd(); | |
function containsNamespace(str, namespace) { | |
for (var vals = str.split(/[ ,]+/), ns = String(namespace).toLowerCase(), i = 0; i < vals.length; i++) { | |
var val = vals[i]; | |
if (val && ("*" === val || val.toLowerCase() === ns)) return !0; | |
} | |
return !1; | |
} | |
function convertDataDescriptorToAccessor(obj, prop, message) { | |
var descriptor = Object.getOwnPropertyDescriptor(obj, prop), value = descriptor.value; | |
return descriptor.get = function() { | |
return value; | |
}, descriptor.writable && (descriptor.set = function(val) { | |
return value = val; | |
}), delete descriptor.value, delete descriptor.writable, Object.defineProperty(obj, prop, descriptor), | |
descriptor; | |
} | |
function createArgumentsString(arity) { | |
for (var str = "", i = 0; i < arity; i++) str += ", arg" + i; | |
return str.substr(2); | |
} | |
function createStackString(stack) { | |
var str = this.name + ": " + this.namespace; | |
this.message && (str += " deprecated " + this.message); | |
for (var i = 0; i < stack.length; i++) str += "\n at " + callSiteToString(stack[i]); | |
return str; | |
} | |
function depd(namespace) { | |
if (!namespace) throw new TypeError("argument namespace is required"); | |
var file = callSiteLocation(getStack()[1])[0]; | |
function deprecate(message) { | |
log.call(deprecate, message); | |
} | |
return deprecate._file = file, deprecate._ignored = isignored(namespace), deprecate._namespace = namespace, | |
deprecate._traced = istraced(namespace), deprecate._warned = Object.create(null), | |
deprecate.function = wrapfunction, deprecate.property = wrapproperty, deprecate; | |
} | |
function isignored(namespace) { | |
return !!process.noDeprecation || containsNamespace(process.env.NO_DEPRECATION || "", namespace); | |
} | |
function istraced(namespace) { | |
return !!process.traceDeprecation || containsNamespace(process.env.TRACE_DEPRECATION || "", namespace); | |
} | |
function log(message, site) { | |
var haslisteners = 0 !== eventListenerCount(process, "deprecation"); | |
if (haslisteners || !this._ignored) { | |
var caller, callFile, callSite, depSite, i = 0, seen = !1, stack = getStack(), file = this._file; | |
for (site ? (depSite = site, (callSite = callSiteLocation(stack[1])).name = depSite.name, | |
file = callSite[0]) : callSite = depSite = callSiteLocation(stack[i = 2]); i < stack.length; i++) if ((callFile = (caller = callSiteLocation(stack[i]))[0]) === file) seen = !0; else if (callFile === this._file) file = this._file; else if (seen) break; | |
var key = caller ? depSite.join(":") + "__" + caller.join(":") : void 0; | |
if (void 0 === key || !(key in this._warned)) { | |
this._warned[key] = !0; | |
var msg = message; | |
if (msg || (msg = callSite !== depSite && callSite.name ? defaultMessage(callSite) : defaultMessage(depSite)), | |
haslisteners) { | |
var err = DeprecationError(this._namespace, msg, stack.slice(i)); | |
process.emit("deprecation", err); | |
} else { | |
var output = (process.stderr.isTTY ? formatColor : formatPlain).call(this, msg, caller, stack.slice(i)); | |
process.stderr.write(output + "\n", "utf8"); | |
} | |
} | |
} | |
} | |
function callSiteLocation(callSite) { | |
var file = callSite.getFileName() || "<anonymous>", line = callSite.getLineNumber(), colm = callSite.getColumnNumber(); | |
callSite.isEval() && (file = callSite.getEvalOrigin() + ", " + file); | |
var site = [ file, line, colm ]; | |
return site.callSite = callSite, site.name = callSite.getFunctionName(), site; | |
} | |
function defaultMessage(site) { | |
var callSite = site.callSite, funcName = site.name; | |
funcName || (funcName = "<anonymous@" + formatLocation(site) + ">"); | |
var context = callSite.getThis(), typeName = context && callSite.getTypeName(); | |
return "Object" === typeName && (typeName = void 0), "Function" === typeName && (typeName = context.name || typeName), | |
typeName && callSite.getMethodName() ? typeName + "." + funcName : funcName; | |
} | |
function formatPlain(msg, caller, stack) { | |
var formatted = (new Date).toUTCString() + " " + this._namespace + " deprecated " + msg; | |
if (this._traced) { | |
for (var i = 0; i < stack.length; i++) formatted += "\n at " + callSiteToString(stack[i]); | |
return formatted; | |
} | |
return caller && (formatted += " at " + formatLocation(caller)), formatted; | |
} | |
function formatColor(msg, caller, stack) { | |
var formatted = "[36;1m" + this._namespace + "[22;39m [33;1mdeprecated[22;39m [0m" + msg + "[39m"; | |
if (this._traced) { | |
for (var i = 0; i < stack.length; i++) formatted += "\n [36mat " + callSiteToString(stack[i]) + "[39m"; | |
return formatted; | |
} | |
return caller && (formatted += " [36m" + formatLocation(caller) + "[39m"), formatted; | |
} | |
function formatLocation(callSite) { | |
return relative(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2]; | |
} | |
function getStack() { | |
var limit = Error.stackTraceLimit, obj = {}, prep = Error.prepareStackTrace; | |
Error.prepareStackTrace = prepareObjectStackTrace, Error.stackTraceLimit = Math.max(10, limit), | |
Error.captureStackTrace(obj); | |
var stack = obj.stack.slice(1); | |
return Error.prepareStackTrace = prep, Error.stackTraceLimit = limit, stack; | |
} | |
function prepareObjectStackTrace(obj, stack) { | |
return stack; | |
} | |
function wrapfunction(fn, message) { | |
if ("function" != typeof fn) throw new TypeError("argument fn must be a function"); | |
var args = createArgumentsString(fn.length), deprecate = this, stack = getStack(), site = callSiteLocation(stack[1]); | |
site.name = fn.name; | |
var deprecatedfn = eval("(function (" + args + ') {\n"use strict"\nlog.call(deprecate, message, site)\nreturn fn.apply(this, arguments)\n})'); | |
return deprecatedfn; | |
} | |
function wrapproperty(obj, prop, message) { | |
if (!obj || "object" != typeof obj && "function" != typeof obj) throw new TypeError("argument obj must be object"); | |
var descriptor = Object.getOwnPropertyDescriptor(obj, prop); | |
if (!descriptor) throw new TypeError("must call property on owner object"); | |
if (!descriptor.configurable) throw new TypeError("property must be configurable"); | |
var deprecate = this, site = callSiteLocation(getStack()[1]); | |
site.name = prop, "value" in descriptor && (descriptor = convertDataDescriptorToAccessor(obj, prop, message)); | |
var get = descriptor.get, set = descriptor.set; | |
"function" == typeof get && (descriptor.get = function() { | |
return log.call(deprecate, message, site), get.apply(this, arguments); | |
}), "function" == typeof set && (descriptor.set = function() { | |
return log.call(deprecate, message, site), set.apply(this, arguments); | |
}), Object.defineProperty(obj, prop, descriptor); | |
} | |
function DeprecationError(namespace, message, stack) { | |
var stackString, error = new Error; | |
return Object.defineProperty(error, "constructor", { | |
value: DeprecationError | |
}), Object.defineProperty(error, "message", { | |
configurable: !0, | |
enumerable: !1, | |
value: message, | |
writable: !0 | |
}), Object.defineProperty(error, "name", { | |
enumerable: !1, | |
configurable: !0, | |
value: "DeprecationError", | |
writable: !0 | |
}), Object.defineProperty(error, "namespace", { | |
configurable: !0, | |
enumerable: !1, | |
value: namespace, | |
writable: !0 | |
}), Object.defineProperty(error, "stack", { | |
configurable: !0, | |
enumerable: !1, | |
get: function() { | |
return void 0 !== stackString ? stackString : stackString = createStackString.call(this, stack); | |
}, | |
set: function(val) { | |
stackString = val; | |
} | |
}), error; | |
} | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Signature; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, errs = (__webpack_require__(30), | |
__webpack_require__(9), __webpack_require__(44)), utils = __webpack_require__(26), asn1 = __webpack_require__(49), SSHBuffer = __webpack_require__(100), InvalidAlgorithmError = errs.InvalidAlgorithmError, SignatureParseError = errs.SignatureParseError; | |
function Signature(opts) { | |
assert.object(opts, "options"), assert.arrayOfObject(opts.parts, "options.parts"), | |
assert.string(opts.type, "options.type"); | |
for (var partLookup = {}, i = 0; i < opts.parts.length; ++i) { | |
var part = opts.parts[i]; | |
partLookup[part.name] = part; | |
} | |
this.type = opts.type, this.hashAlgorithm = opts.hashAlgo, this.curve = opts.curve, | |
this.parts = opts.parts, this.part = partLookup; | |
} | |
Signature.prototype.toBuffer = function(format) { | |
var buf; | |
void 0 === format && (format = "asn1"), assert.string(format, "format"); | |
var stype = "ssh-" + this.type; | |
switch (this.type) { | |
case "rsa": | |
switch (this.hashAlgorithm) { | |
case "sha256": | |
stype = "rsa-sha2-256"; | |
break; | |
case "sha512": | |
stype = "rsa-sha2-512"; | |
break; | |
case "sha1": | |
case void 0: | |
break; | |
default: | |
throw new Error("SSH signature format does not support hash algorithm " + this.hashAlgorithm); | |
} | |
return "ssh" === format ? ((buf = new SSHBuffer({})).writeString(stype), buf.writePart(this.part.sig), | |
buf.toBuffer()) : this.part.sig.data; | |
case "ed25519": | |
return "ssh" === format ? ((buf = new SSHBuffer({})).writeString(stype), buf.writePart(this.part.sig), | |
buf.toBuffer()) : this.part.sig.data; | |
case "dsa": | |
case "ecdsa": | |
var r, s; | |
if ("asn1" === format) { | |
var der = new asn1.BerWriter; | |
return der.startSequence(), r = utils.mpNormalize(this.part.r.data), s = utils.mpNormalize(this.part.s.data), | |
der.writeBuffer(r, asn1.Ber.Integer), der.writeBuffer(s, asn1.Ber.Integer), der.endSequence(), | |
der.buffer; | |
} | |
if ("ssh" === format && "dsa" === this.type) { | |
if ((buf = new SSHBuffer({})).writeString("ssh-dss"), (r = this.part.r.data).length > 20 && 0 === r[0] && (r = r.slice(1)), | |
(s = this.part.s.data).length > 20 && 0 === s[0] && (s = s.slice(1)), this.hashAlgorithm && "sha1" !== this.hashAlgorithm || r.length + s.length !== 40) throw new Error("OpenSSH only supports DSA signatures with SHA1 hash"); | |
return buf.writeBuffer(Buffer.concat([ r, s ])), buf.toBuffer(); | |
} | |
if ("ssh" === format && "ecdsa" === this.type) { | |
var curve, inner = new SSHBuffer({}); | |
r = this.part.r.data, inner.writeBuffer(r), inner.writePart(this.part.s), buf = new SSHBuffer({}), | |
0 === r[0] && (r = r.slice(1)); | |
var sz = 8 * r.length; | |
return 256 === sz ? curve = "nistp256" : 384 === sz ? curve = "nistp384" : 528 === sz && (curve = "nistp521"), | |
buf.writeString("ecdsa-sha2-" + curve), buf.writeBuffer(inner.toBuffer()), buf.toBuffer(); | |
} | |
throw new Error("Invalid signature format"); | |
default: | |
throw new Error("Invalid signature data"); | |
} | |
}, Signature.prototype.toString = function(format) { | |
return assert.optionalString(format, "format"), this.toBuffer(format).toString("base64"); | |
}, Signature.parse = function(data, type, format) { | |
"string" == typeof data && (data = Buffer.from(data, "base64")), assert.buffer(data, "data"), | |
assert.string(format, "format"), assert.string(type, "type"); | |
var opts = {}; | |
opts.type = type.toLowerCase(), opts.parts = []; | |
try { | |
switch (assert.ok(data.length > 0, "signature must not be empty"), opts.type) { | |
case "rsa": | |
case "ed25519": | |
return (function(data, type, format, opts) { | |
if ("ssh" === format) { | |
try { | |
var buf = new SSHBuffer({ | |
buffer: data | |
}), head = buf.readString(); | |
} catch (e) {} | |
if (void 0 !== buf) { | |
var msg = "SSH signature does not match expected type (expected " + type + ", got " + head + ")"; | |
switch (head) { | |
case "ssh-rsa": | |
assert.strictEqual(type, "rsa", msg), opts.hashAlgo = "sha1"; | |
break; | |
case "rsa-sha2-256": | |
assert.strictEqual(type, "rsa", msg), opts.hashAlgo = "sha256"; | |
break; | |
case "rsa-sha2-512": | |
assert.strictEqual(type, "rsa", msg), opts.hashAlgo = "sha512"; | |
break; | |
case "ssh-ed25519": | |
assert.strictEqual(type, "ed25519", msg), opts.hashAlgo = "sha512"; | |
break; | |
default: | |
throw new Error("Unknown SSH signature type: " + head); | |
} | |
var sig = buf.readPart(); | |
return assert.ok(buf.atEnd(), "extra trailing bytes"), sig.name = "sig", opts.parts.push(sig), | |
new Signature(opts); | |
} | |
} | |
return opts.parts.push({ | |
name: "sig", | |
data: data | |
}), new Signature(opts); | |
})(data, type, format, opts); | |
case "dsa": | |
case "ecdsa": | |
return "asn1" === format ? (function(data, type, format, opts) { | |
var der = new asn1.BerReader(data); | |
der.readSequence(); | |
var r = der.readString(asn1.Ber.Integer, !0), s = der.readString(asn1.Ber.Integer, !0); | |
return opts.parts.push({ | |
name: "r", | |
data: utils.mpNormalize(r) | |
}), opts.parts.push({ | |
name: "s", | |
data: utils.mpNormalize(s) | |
}), new Signature(opts); | |
})(data, 0, 0, opts) : "dsa" === opts.type ? (function(data, type, format, opts) { | |
if (40 != data.length) { | |
var buf = new SSHBuffer({ | |
buffer: data | |
}), d = buf.readBuffer(); | |
"ssh-dss" === d.toString("ascii") && (d = buf.readBuffer()), assert.ok(buf.atEnd(), "extra trailing bytes"), | |
assert.strictEqual(d.length, 40, "invalid inner length"), data = d; | |
} | |
return opts.parts.push({ | |
name: "r", | |
data: data.slice(0, 20) | |
}), opts.parts.push({ | |
name: "s", | |
data: data.slice(20, 40) | |
}), new Signature(opts); | |
})(data, 0, 0, opts) : (function(data, type, format, opts) { | |
var r, s, buf = new SSHBuffer({ | |
buffer: data | |
}), inner = buf.readBuffer(), stype = inner.toString("ascii"); | |
if ("ecdsa-" === stype.slice(0, 6)) { | |
var parts = stype.split("-"); | |
switch (assert.strictEqual(parts[0], "ecdsa"), assert.strictEqual(parts[1], "sha2"), | |
opts.curve = parts[2], opts.curve) { | |
case "nistp256": | |
opts.hashAlgo = "sha256"; | |
break; | |
case "nistp384": | |
opts.hashAlgo = "sha384"; | |
break; | |
case "nistp521": | |
opts.hashAlgo = "sha512"; | |
break; | |
default: | |
throw new Error("Unsupported ECDSA curve: " + opts.curve); | |
} | |
inner = buf.readBuffer(), assert.ok(buf.atEnd(), "extra trailing bytes on outer"), | |
r = (buf = new SSHBuffer({ | |
buffer: inner | |
})).readPart(); | |
} else r = { | |
data: inner | |
}; | |
return s = buf.readPart(), assert.ok(buf.atEnd(), "extra trailing bytes"), r.name = "r", | |
s.name = "s", opts.parts.push(r), opts.parts.push(s), new Signature(opts); | |
})(data, 0, 0, opts); | |
default: | |
throw new InvalidAlgorithmError(type); | |
} | |
} catch (e) { | |
if (e instanceof InvalidAlgorithmError) throw e; | |
throw new SignatureParseError(type, format, e); | |
} | |
}, Signature.isSignature = function(obj, ver) { | |
return utils.isCompatible(obj, Signature, ver); | |
}, Signature.prototype._sshpkApiVersion = [ 2, 1 ], Signature._oldVersionDetect = function(obj) { | |
return assert.func(obj.toBuffer), obj.hasOwnProperty("hashAlgorithm") ? [ 2, 0 ] : [ 1, 0 ]; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var Ber = __webpack_require__(1052); | |
module.exports = { | |
Ber: Ber, | |
BerReader: Ber.Reader, | |
BerWriter: Ber.Writer | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var extend = __webpack_require__(587); | |
exports.DEFAULT_ANNOUNCE_PEERS = 50, exports.MAX_ANNOUNCE_PEERS = 82, exports.binaryToHex = function(str) { | |
return new Buffer(str, "binary").toString("hex"); | |
}, exports.hexToBinary = function(str) { | |
return new Buffer(str, "hex").toString("binary"); | |
}, extend(exports, __webpack_require__(588)); | |
}, function(module, exports) { | |
module.exports = function(model, calc) { | |
var fn; | |
return (fn = function(buf, previous) { | |
return calc(buf, previous) >>> 0; | |
}).signed = calc, fn.unsigned = fn, fn.model = model, fn; | |
}; | |
}, function(module, exports) { | |
(function() { | |
var assign, isArray, isEmpty, isFunction, isObject, isPlainObject, slice = [].slice, hasProp = {}.hasOwnProperty; | |
assign = function() { | |
var i, key, len, source, sources, target; | |
if (target = arguments[0], sources = 2 <= arguments.length ? slice.call(arguments, 1) : [], | |
isFunction(Object.assign)) Object.assign.apply(null, arguments); else for (i = 0, | |
len = sources.length; i < len; i++) if (null != (source = sources[i])) for (key in source) hasProp.call(source, key) && (target[key] = source[key]); | |
return target; | |
}, isFunction = function(val) { | |
return !!val && "[object Function]" === Object.prototype.toString.call(val); | |
}, isObject = function(val) { | |
var ref; | |
return !!val && ("function" == (ref = typeof val) || "object" === ref); | |
}, isArray = function(val) { | |
return isFunction(Array.isArray) ? Array.isArray(val) : "[object Array]" === Object.prototype.toString.call(val); | |
}, isEmpty = function(val) { | |
var key; | |
if (isArray(val)) return !val.length; | |
for (key in val) if (hasProp.call(val, key)) return !1; | |
return !0; | |
}, isPlainObject = function(val) { | |
var ctor, proto; | |
return isObject(val) && (proto = Object.getPrototypeOf(val)) && (ctor = proto.constructor) && "function" == typeof ctor && ctor instanceof ctor && Function.prototype.toString.call(ctor) === Function.prototype.toString.call(Object); | |
}, module.exports.assign = assign, module.exports.isFunction = isFunction, module.exports.isObject = isObject, | |
module.exports.isArray = isArray, module.exports.isEmpty = isEmpty, module.exports.isPlainObject = isPlainObject; | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
"undefined" == typeof process || !process.version || 0 === process.version.indexOf("v0.") || 0 === process.version.indexOf("v1.") && 0 !== process.version.indexOf("v1.8.") ? module.exports = { | |
nextTick: function(fn, arg1, arg2, arg3) { | |
if ("function" != typeof fn) throw new TypeError('"callback" argument must be a function'); | |
var args, i, len = arguments.length; | |
switch (len) { | |
case 0: | |
case 1: | |
return process.nextTick(fn); | |
case 2: | |
return process.nextTick((function() { | |
fn.call(null, arg1); | |
})); | |
case 3: | |
return process.nextTick((function() { | |
fn.call(null, arg1, arg2); | |
})); | |
case 4: | |
return process.nextTick((function() { | |
fn.call(null, arg1, arg2, arg3); | |
})); | |
default: | |
for (args = new Array(len - 1), i = 0; i < args.length; ) args[i++] = arguments[i]; | |
return process.nextTick((function() { | |
fn.apply(null, args); | |
})); | |
} | |
} | |
} : module.exports = process; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var secondsToVideoTs, secondsToAudioTs, videoTsToSeconds, audioTsToSeconds, audioTsToVideoTs, videoTsToAudioTs, metadataTsToSeconds; | |
secondsToVideoTs = function(seconds) { | |
return 9e4 * seconds; | |
}, secondsToAudioTs = function(seconds, sampleRate) { | |
return seconds * sampleRate; | |
}, videoTsToSeconds = function(timestamp) { | |
return timestamp / 9e4; | |
}, audioTsToSeconds = function(timestamp, sampleRate) { | |
return timestamp / sampleRate; | |
}, audioTsToVideoTs = function(timestamp, sampleRate) { | |
return secondsToVideoTs(audioTsToSeconds(timestamp, sampleRate)); | |
}, videoTsToAudioTs = function(timestamp, sampleRate) { | |
return secondsToAudioTs(videoTsToSeconds(timestamp), sampleRate); | |
}, metadataTsToSeconds = function(timestamp, timelineStartPts, keepOriginalTimestamps) { | |
return videoTsToSeconds(keepOriginalTimestamps ? timestamp : timestamp - timelineStartPts); | |
}, module.exports = { | |
ONE_SECOND_IN_TS: 9e4, | |
secondsToVideoTs: secondsToVideoTs, | |
secondsToAudioTs: secondsToAudioTs, | |
videoTsToSeconds: videoTsToSeconds, | |
audioTsToSeconds: audioTsToSeconds, | |
audioTsToVideoTs: audioTsToVideoTs, | |
videoTsToAudioTs: videoTsToAudioTs, | |
metadataTsToSeconds: metadataTsToSeconds | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var _TypeError, _RangeError, es5 = __webpack_require__(66), Objectfreeze = es5.freeze, util = __webpack_require__(16), inherits = util.inherits, notEnumerableProp = util.notEnumerableProp; | |
function subError(nameProperty, defaultMessage) { | |
function SubError(message) { | |
if (!(this instanceof SubError)) return new SubError(message); | |
notEnumerableProp(this, "message", "string" == typeof message ? message : defaultMessage), | |
notEnumerableProp(this, "name", nameProperty), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : Error.call(this); | |
} | |
return inherits(SubError, Error), SubError; | |
} | |
var Warning = subError("Warning", "warning"), CancellationError = subError("CancellationError", "cancellation error"), TimeoutError = subError("TimeoutError", "timeout error"), AggregateError = subError("AggregateError", "aggregate error"); | |
try { | |
_TypeError = TypeError, _RangeError = RangeError; | |
} catch (e) { | |
_TypeError = subError("TypeError", "type error"), _RangeError = subError("RangeError", "range error"); | |
} | |
for (var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "), i = 0; i < methods.length; ++i) "function" == typeof Array.prototype[methods[i]] && (AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]); | |
es5.defineProperty(AggregateError.prototype, "length", { | |
value: 0, | |
configurable: !1, | |
writable: !0, | |
enumerable: !0 | |
}), AggregateError.prototype.isOperational = !0; | |
var level = 0; | |
function OperationalError(message) { | |
if (!(this instanceof OperationalError)) return new OperationalError(message); | |
notEnumerableProp(this, "name", "OperationalError"), notEnumerableProp(this, "message", message), | |
this.cause = message, this.isOperational = !0, message instanceof Error ? (notEnumerableProp(this, "message", message.message), | |
notEnumerableProp(this, "stack", message.stack)) : Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); | |
} | |
AggregateError.prototype.toString = function() { | |
var indent = Array(4 * level + 1).join(" "), ret = "\n" + indent + "AggregateError of:\n"; | |
level++, indent = Array(4 * level + 1).join(" "); | |
for (var i = 0; i < this.length; ++i) { | |
for (var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "", lines = str.split("\n"), j = 0; j < lines.length; ++j) lines[j] = indent + lines[j]; | |
ret += (str = lines.join("\n")) + "\n"; | |
} | |
return level--, ret; | |
}, inherits(OperationalError, Error); | |
var errorTypes = Error.__BluebirdErrorTypes__; | |
errorTypes || (errorTypes = Objectfreeze({ | |
CancellationError: CancellationError, | |
TimeoutError: TimeoutError, | |
OperationalError: OperationalError, | |
RejectionError: OperationalError, | |
AggregateError: AggregateError | |
}), es5.defineProperty(Error, "__BluebirdErrorTypes__", { | |
value: errorTypes, | |
writable: !1, | |
enumerable: !1, | |
configurable: !1 | |
})), module.exports = { | |
Error: Error, | |
TypeError: _TypeError, | |
RangeError: _RangeError, | |
CancellationError: errorTypes.CancellationError, | |
OperationalError: errorTypes.OperationalError, | |
TimeoutError: errorTypes.TimeoutError, | |
AggregateError: errorTypes.AggregateError, | |
Warning: Warning | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = { | |
read: function(buf, options, forceType) { | |
var input = buf; | |
"string" != typeof buf && (assert.buffer(buf, "buf"), buf = buf.toString("ascii")); | |
for (var m, m2, lines = buf.trim().split(/[\r\n]+/g), si = -1; !m && si < lines.length; ) m = lines[++si].match(/[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); | |
assert.ok(m, "invalid PEM header"); | |
for (var ei = lines.length; !m2 && ei > 0; ) m2 = lines[--ei].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/); | |
assert.ok(m2, "invalid PEM footer"), assert.equal(m[2], m2[2]); | |
var alg, type = m[2].toLowerCase(); | |
m[1] && (assert.equal(m[1], m2[1], "PEM header and footer mismatch"), alg = m[1].trim()), | |
lines = lines.slice(si, ei + 1); | |
for (var cipher, key, iv, headers = {}; m = (lines = lines.slice(1))[0].match(/^([A-Za-z0-9-]+): (.+)$/); ) headers[m[1].toLowerCase()] = m[2]; | |
if (lines = lines.slice(0, -1).join(""), buf = Buffer.from(lines, "base64"), headers["proc-type"]) { | |
var parts = headers["proc-type"].split(","); | |
if ("4" === parts[0] && "ENCRYPTED" === parts[1]) { | |
if ("string" == typeof options.passphrase && (options.passphrase = Buffer.from(options.passphrase, "utf-8")), | |
!Buffer.isBuffer(options.passphrase)) throw new errors.KeyEncryptedError(options.filename, "PEM"); | |
parts = headers["dek-info"].split(","), assert.ok(2 === parts.length), cipher = parts[0].toLowerCase(), | |
iv = Buffer.from(parts[1], "hex"), key = utils.opensslKeyDeriv(cipher, iv, options.passphrase, 1).key; | |
} | |
} | |
if (alg && "encrypted" === alg.toLowerCase()) { | |
var pbesEnd, eder = new asn1.BerReader(buf); | |
eder.readSequence(), eder.readSequence(), pbesEnd = eder.offset + eder.length; | |
var method = eder.readOID(); | |
if ("1.2.840.113549.1.5.13" !== method) throw new Error("Unsupported PEM/PKCS8 encryption scheme: " + method); | |
eder.readSequence(), eder.readSequence(); | |
var kdfEnd = eder.offset + eder.length, kdfOid = eder.readOID(); | |
if ("1.2.840.113549.1.5.12" !== kdfOid) throw new Error("Unsupported PBES2 KDF: " + kdfOid); | |
eder.readSequence(); | |
var salt = eder.readString(asn1.Ber.OctetString, !0), iterations = eder.readInt(), hashAlg = "sha1"; | |
if (eder.offset < kdfEnd) { | |
eder.readSequence(); | |
var hashAlgOid = eder.readOID(); | |
if (void 0 === (hashAlg = OID_TO_HASH[hashAlgOid])) throw new Error("Unsupported PBKDF2 hash: " + hashAlgOid); | |
} | |
eder._offset = kdfEnd, eder.readSequence(); | |
var cipherOid = eder.readOID(); | |
if (void 0 === (cipher = OID_TO_CIPHER[cipherOid])) throw new Error("Unsupported PBES2 cipher: " + cipherOid); | |
if (iv = eder.readString(asn1.Ber.OctetString, !0), eder._offset = pbesEnd, buf = eder.readString(asn1.Ber.OctetString, !0), | |
"string" == typeof options.passphrase && (options.passphrase = Buffer.from(options.passphrase, "utf-8")), | |
!Buffer.isBuffer(options.passphrase)) throw new errors.KeyEncryptedError(options.filename, "PEM"); | |
var cinfo = utils.opensshCipherInfo(cipher); | |
cipher = cinfo.opensslName, key = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize, options.passphrase), | |
alg = void 0; | |
} | |
if (cipher && key && iv) { | |
var chunk, cipherStream = crypto.createDecipheriv(cipher, key, iv), chunks = []; | |
for (cipherStream.once("error", (function(e) { | |
if (-1 !== e.toString().indexOf("bad decrypt")) throw new Error("Incorrect passphrase supplied, could not decrypt key"); | |
throw e; | |
})), cipherStream.write(buf), cipherStream.end(); null !== (chunk = cipherStream.read()); ) chunks.push(chunk); | |
buf = Buffer.concat(chunks); | |
} | |
if (alg && "openssh" === alg.toLowerCase()) return sshpriv.readSSHPrivate(type, buf, options); | |
if (alg && "ssh2" === alg.toLowerCase()) return rfc4253.readType(type, buf, options); | |
var der = new asn1.BerReader(buf); | |
return der.originalInput = input, der.readSequence(), alg ? (forceType && assert.strictEqual(forceType, "pkcs1"), | |
pkcs1.readPkcs1(alg, type, der)) : (forceType && assert.strictEqual(forceType, "pkcs8"), | |
pkcs8.readPkcs8(alg, type, der)); | |
}, | |
write: function(key, options, type) { | |
assert.object(key); | |
var header, alg = { | |
ecdsa: "EC", | |
rsa: "RSA", | |
dsa: "DSA", | |
ed25519: "EdDSA" | |
}[key.type], der = new asn1.BerWriter; | |
if (PrivateKey.isPrivateKey(key)) type && "pkcs8" === type ? (header = "PRIVATE KEY", | |
pkcs8.writePkcs8(der, key)) : (type && assert.strictEqual(type, "pkcs1"), header = alg + " PRIVATE KEY", | |
pkcs1.writePkcs1(der, key)); else { | |
if (!Key.isKey(key)) throw new Error("key is not a Key or PrivateKey"); | |
type && "pkcs1" === type ? (header = alg + " PUBLIC KEY", pkcs1.writePkcs1(der, key)) : (type && assert.strictEqual(type, "pkcs8"), | |
header = "PUBLIC KEY", pkcs8.writePkcs8(der, key)); | |
} | |
var tmp = der.buffer.toString("base64"), len = tmp.length + tmp.length / 64 + 18 + 16 + 2 * header.length + 10, buf = Buffer.alloc(len), o = 0; | |
o += buf.write("-----BEGIN " + header + "-----\n", o); | |
for (var i = 0; i < tmp.length; ) { | |
var limit = i + 64; | |
limit > tmp.length && (limit = tmp.length), o += buf.write(tmp.slice(i, limit), o), | |
buf[o++] = 10, i = limit; | |
} | |
return o += buf.write("-----END " + header + "-----\n", o), buf.slice(0, o); | |
} | |
}; | |
var assert = __webpack_require__(15), asn1 = __webpack_require__(49), crypto = __webpack_require__(9), Buffer = __webpack_require__(14).Buffer, utils = (__webpack_require__(30), | |
__webpack_require__(26)), Key = __webpack_require__(25), PrivateKey = __webpack_require__(27), pkcs1 = __webpack_require__(234), pkcs8 = __webpack_require__(101), sshpriv = __webpack_require__(152), rfc4253 = __webpack_require__(57), errors = __webpack_require__(44), OID_TO_CIPHER = { | |
"1.2.840.113549.3.7": "3des-cbc", | |
"2.16.840.1.101.3.4.1.2": "aes128-cbc", | |
"2.16.840.1.101.3.4.1.42": "aes256-cbc" | |
}, CIPHER_TO_OID = {}; | |
Object.keys(OID_TO_CIPHER).forEach((function(k) { | |
CIPHER_TO_OID[OID_TO_CIPHER[k]] = k; | |
})); | |
var OID_TO_HASH = { | |
"1.2.840.113549.2.7": "sha1", | |
"1.2.840.113549.2.9": "sha256", | |
"1.2.840.113549.2.11": "sha512" | |
}, HASH_TO_OID = {}; | |
Object.keys(OID_TO_HASH).forEach((function(k) { | |
HASH_TO_OID[OID_TO_HASH[k]] = k; | |
})); | |
}, function(module, exports, __webpack_require__) { | |
module.exports = { | |
read: read.bind(void 0, !1, void 0), | |
readType: read.bind(void 0, !1), | |
write: function(key, options) { | |
assert.object(key); | |
var i, alg = keyTypeToAlg(key), algInfo = algs.info[key.type]; | |
PrivateKey.isPrivateKey(key) && (algInfo = algs.privInfo[key.type]); | |
var parts = algInfo.parts, buf = new SSHBuffer({}); | |
for (buf.writeString(alg), i = 0; i < parts.length; ++i) { | |
var data = key.part[parts[i]].data; | |
!1 !== algInfo.normalize && (data = "ed25519" === key.type ? utils.zeroPadToLength(data, 32) : utils.mpNormalize(data)), | |
"ed25519" === key.type && "k" === parts[i] && (data = Buffer.concat([ data, key.part.A.data ])), | |
buf.writeBuffer(data); | |
} | |
return buf.toBuffer(); | |
}, | |
readPartial: read.bind(void 0, !0), | |
readInternal: read, | |
keyTypeToAlg: keyTypeToAlg, | |
algToKeyType: algToKeyType | |
}; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(30), utils = __webpack_require__(26), Key = __webpack_require__(25), PrivateKey = __webpack_require__(27), SSHBuffer = __webpack_require__(100); | |
function algToKeyType(alg) { | |
if (assert.string(alg), "ssh-dss" === alg) return "dsa"; | |
if ("ssh-rsa" === alg) return "rsa"; | |
if ("ssh-ed25519" === alg) return "ed25519"; | |
if ("ssh-curve25519" === alg) return "curve25519"; | |
if (alg.match(/^ecdsa-sha2-/)) return "ecdsa"; | |
throw new Error("Unknown algorithm " + alg); | |
} | |
function keyTypeToAlg(key) { | |
if (assert.object(key), "dsa" === key.type) return "ssh-dss"; | |
if ("rsa" === key.type) return "ssh-rsa"; | |
if ("ed25519" === key.type) return "ssh-ed25519"; | |
if ("curve25519" === key.type) return "ssh-curve25519"; | |
if ("ecdsa" === key.type) return "ecdsa-sha2-" + key.part.curve.data.toString(); | |
throw new Error("Unknown key type " + key.type); | |
} | |
function read(partial, type, buf, options) { | |
"string" == typeof buf && (buf = Buffer.from(buf)), assert.buffer(buf, "buf"); | |
var key = {}, parts = key.parts = [], sshbuf = new SSHBuffer({ | |
buffer: buf | |
}), alg = sshbuf.readString(); | |
assert.ok(!sshbuf.atEnd(), "key must have at least one part"), key.type = algToKeyType(alg); | |
var partCount = algs.info[key.type].parts.length; | |
for (type && "private" === type && (partCount = algs.privInfo[key.type].parts.length); !sshbuf.atEnd() && parts.length < partCount; ) parts.push(sshbuf.readPart()); | |
for (;!partial && !sshbuf.atEnd(); ) parts.push(sshbuf.readPart()); | |
assert.ok(parts.length >= 1, "key must have at least one part"), assert.ok(partial || sshbuf.atEnd(), "leftover bytes at end of key"); | |
var Constructor = Key, algInfo = algs.info[key.type]; | |
if ("private" !== type && algInfo.parts.length === parts.length || (algInfo = algs.privInfo[key.type], | |
Constructor = PrivateKey), assert.strictEqual(algInfo.parts.length, parts.length), | |
"ecdsa" === key.type) { | |
var res = /^ecdsa-sha2-(.+)$/.exec(alg); | |
assert.ok(null !== res), assert.strictEqual(res[1], parts[0].data.toString()); | |
} | |
for (var normalized = !0, i = 0; i < algInfo.parts.length; ++i) { | |
var nd, p = parts[i]; | |
p.name = algInfo.parts[i], "ed25519" === key.type && "k" === p.name && (p.data = p.data.slice(0, 32)), | |
"curve" !== p.name && !1 !== algInfo.normalize && (nd = "ed25519" === key.type ? utils.zeroPadToLength(p.data, 32) : utils.mpNormalize(p.data)).toString("binary") !== p.data.toString("binary") && (p.data = nd, | |
normalized = !1); | |
} | |
return normalized && (key._rfc4253Cache = sshbuf.toBuffer()), partial && "object" == typeof partial && (partial.remainder = sshbuf.remainder(), | |
partial.consumed = sshbuf._offset), new Constructor(key); | |
} | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var _TypeError, _RangeError, es5 = __webpack_require__(81), Objectfreeze = es5.freeze, util = __webpack_require__(17), inherits = util.inherits, notEnumerableProp = util.notEnumerableProp; | |
function subError(nameProperty, defaultMessage) { | |
function SubError(message) { | |
if (!(this instanceof SubError)) return new SubError(message); | |
notEnumerableProp(this, "message", "string" == typeof message ? message : defaultMessage), | |
notEnumerableProp(this, "name", nameProperty), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : Error.call(this); | |
} | |
return inherits(SubError, Error), SubError; | |
} | |
var Warning = subError("Warning", "warning"), CancellationError = subError("CancellationError", "cancellation error"), TimeoutError = subError("TimeoutError", "timeout error"), AggregateError = subError("AggregateError", "aggregate error"); | |
try { | |
_TypeError = TypeError, _RangeError = RangeError; | |
} catch (e) { | |
_TypeError = subError("TypeError", "type error"), _RangeError = subError("RangeError", "range error"); | |
} | |
for (var methods = "join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "), i = 0; i < methods.length; ++i) "function" == typeof Array.prototype[methods[i]] && (AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]); | |
es5.defineProperty(AggregateError.prototype, "length", { | |
value: 0, | |
configurable: !1, | |
writable: !0, | |
enumerable: !0 | |
}), AggregateError.prototype.isOperational = !0; | |
var level = 0; | |
function OperationalError(message) { | |
if (!(this instanceof OperationalError)) return new OperationalError(message); | |
notEnumerableProp(this, "name", "OperationalError"), notEnumerableProp(this, "message", message), | |
this.cause = message, this.isOperational = !0, message instanceof Error ? (notEnumerableProp(this, "message", message.message), | |
notEnumerableProp(this, "stack", message.stack)) : Error.captureStackTrace && Error.captureStackTrace(this, this.constructor); | |
} | |
AggregateError.prototype.toString = function() { | |
var indent = Array(4 * level + 1).join(" "), ret = "\n" + indent + "AggregateError of:\n"; | |
level++, indent = Array(4 * level + 1).join(" "); | |
for (var i = 0; i < this.length; ++i) { | |
for (var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "", lines = str.split("\n"), j = 0; j < lines.length; ++j) lines[j] = indent + lines[j]; | |
ret += (str = lines.join("\n")) + "\n"; | |
} | |
return level--, ret; | |
}, inherits(OperationalError, Error); | |
var errorTypes = Error.__BluebirdErrorTypes__; | |
errorTypes || (errorTypes = Objectfreeze({ | |
CancellationError: CancellationError, | |
TimeoutError: TimeoutError, | |
OperationalError: OperationalError, | |
RejectionError: OperationalError, | |
AggregateError: AggregateError | |
}), es5.defineProperty(Error, "__BluebirdErrorTypes__", { | |
value: errorTypes, | |
writable: !1, | |
enumerable: !1, | |
configurable: !1 | |
})), module.exports = { | |
Error: Error, | |
TypeError: _TypeError, | |
RangeError: _RangeError, | |
CancellationError: errorTypes.CancellationError, | |
OperationalError: errorTypes.OperationalError, | |
TimeoutError: errorTypes.TimeoutError, | |
AggregateError: errorTypes.AggregateError, | |
Warning: Warning | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var fs$close, fs$closeSync, fs = __webpack_require__(2), polyfills = __webpack_require__(1193), legacy = __webpack_require__(1195), clone = __webpack_require__(1196), queue = [], util = __webpack_require__(0), debug = function() {}; | |
function patch(fs) { | |
polyfills(fs), fs.gracefulify = patch, fs.FileReadStream = ReadStream, fs.FileWriteStream = WriteStream, | |
fs.createReadStream = function(path, options) { | |
return new ReadStream(path, options); | |
}, fs.createWriteStream = function(path, options) { | |
return new WriteStream(path, options); | |
}; | |
var fs$readFile = fs.readFile; | |
fs.readFile = function(path, options, cb) { | |
return "function" == typeof options && (cb = options, options = null), (function go$readFile(path, options, cb) { | |
return fs$readFile(path, options, (function(err) { | |
!err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), | |
retry()) : enqueue([ go$readFile, [ path, options, cb ] ]); | |
})); | |
})(path, options, cb); | |
}; | |
var fs$writeFile = fs.writeFile; | |
fs.writeFile = function(path, data, options, cb) { | |
return "function" == typeof options && (cb = options, options = null), (function go$writeFile(path, data, options, cb) { | |
return fs$writeFile(path, data, options, (function(err) { | |
!err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), | |
retry()) : enqueue([ go$writeFile, [ path, data, options, cb ] ]); | |
})); | |
})(path, data, options, cb); | |
}; | |
var fs$appendFile = fs.appendFile; | |
fs$appendFile && (fs.appendFile = function(path, data, options, cb) { | |
return "function" == typeof options && (cb = options, options = null), (function go$appendFile(path, data, options, cb) { | |
return fs$appendFile(path, data, options, (function(err) { | |
!err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), | |
retry()) : enqueue([ go$appendFile, [ path, data, options, cb ] ]); | |
})); | |
})(path, data, options, cb); | |
}); | |
var fs$readdir = fs.readdir; | |
function go$readdir(args) { | |
return fs$readdir.apply(fs, args); | |
} | |
if (fs.readdir = function(path, options, cb) { | |
var args = [ path ]; | |
return "function" != typeof options ? args.push(options) : cb = options, args.push((function(err, files) { | |
files && files.sort && files.sort(), !err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), | |
retry()) : enqueue([ go$readdir, [ args ] ]); | |
})), go$readdir(args); | |
}, "v0.8" === process.version.substr(0, 4)) { | |
var legStreams = legacy(fs); | |
ReadStream = legStreams.ReadStream, WriteStream = legStreams.WriteStream; | |
} | |
var fs$ReadStream = fs.ReadStream; | |
fs$ReadStream && (ReadStream.prototype = Object.create(fs$ReadStream.prototype), | |
ReadStream.prototype.open = function() { | |
var that = this; | |
open(that.path, that.flags, that.mode, (function(err, fd) { | |
err ? (that.autoClose && that.destroy(), that.emit("error", err)) : (that.fd = fd, | |
that.emit("open", fd), that.read()); | |
})); | |
}); | |
var fs$WriteStream = fs.WriteStream; | |
function ReadStream(path, options) { | |
return this instanceof ReadStream ? (fs$ReadStream.apply(this, arguments), this) : ReadStream.apply(Object.create(ReadStream.prototype), arguments); | |
} | |
function WriteStream(path, options) { | |
return this instanceof WriteStream ? (fs$WriteStream.apply(this, arguments), this) : WriteStream.apply(Object.create(WriteStream.prototype), arguments); | |
} | |
fs$WriteStream && (WriteStream.prototype = Object.create(fs$WriteStream.prototype), | |
WriteStream.prototype.open = function() { | |
var that = this; | |
open(that.path, that.flags, that.mode, (function(err, fd) { | |
err ? (that.destroy(), that.emit("error", err)) : (that.fd = fd, that.emit("open", fd)); | |
})); | |
}), fs.ReadStream = ReadStream, fs.WriteStream = WriteStream; | |
var fs$open = fs.open; | |
function open(path, flags, mode, cb) { | |
return "function" == typeof mode && (cb = mode, mode = null), (function go$open(path, flags, mode, cb) { | |
return fs$open(path, flags, mode, (function(err, fd) { | |
!err || "EMFILE" !== err.code && "ENFILE" !== err.code ? ("function" == typeof cb && cb.apply(this, arguments), | |
retry()) : enqueue([ go$open, [ path, flags, mode, cb ] ]); | |
})); | |
})(path, flags, mode, cb); | |
} | |
return fs.open = open, fs; | |
} | |
function enqueue(elem) { | |
debug("ENQUEUE", elem[0].name, elem[1]), queue.push(elem); | |
} | |
function retry() { | |
var elem = queue.shift(); | |
elem && (debug("RETRY", elem[0].name, elem[1]), elem[0].apply(null, elem[1])); | |
} | |
util.debuglog ? debug = util.debuglog("gfs4") : /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && (debug = function() { | |
var m = util.format.apply(util, arguments); | |
m = "GFS4: " + m.split(/\n/).join("\nGFS4: "), console.error(m); | |
}), /\bgfs4\b/i.test(process.env.NODE_DEBUG || "") && process.on("exit", (function() { | |
debug(queue), __webpack_require__(24).equal(queue.length, 0); | |
})), module.exports = patch(clone(fs)), process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched && (module.exports = patch(fs), | |
fs.__patched = !0), module.exports.close = (fs$close = fs.close, function(fd, cb) { | |
return fs$close.call(fs, fd, (function(err) { | |
err || retry(), "function" == typeof cb && cb.apply(this, arguments); | |
})); | |
}), module.exports.closeSync = (fs$closeSync = fs.closeSync, function(fd) { | |
var rval = fs$closeSync.apply(fs, arguments); | |
return retry(), rval; | |
}), /\bgraceful-fs\b/.test(fs.closeSync.toString()) || (fs.closeSync = module.exports.closeSync, | |
fs.close = module.exports.close); | |
}, function(module, exports) { | |
module.exports = function(a, b) { | |
if (a && b) for (var key in b) a[key] = b[key]; | |
return a; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var http = __webpack_require__(11); | |
module.exports = http.METHODS && http.METHODS.map((function(method) { | |
return method.toLowerCase(); | |
})) || [ "get", "post", "put", "head", "delete", "options", "trace", "copy", "lock", "mkcol", "move", "purge", "propfind", "proppatch", "unlock", "report", "mkactivity", "checkout", "merge", "m-search", "notify", "subscribe", "unsubscribe", "patch", "search", "connect" ]; | |
}, function(module, exports) { | |
module.exports = function(module) { | |
return module.webpackPolyfill || (module.deprecate = function() {}, module.paths = [], | |
module.children || (module.children = []), Object.defineProperty(module, "loaded", { | |
enumerable: !0, | |
get: function() { | |
return module.l; | |
} | |
}), Object.defineProperty(module, "id", { | |
enumerable: !0, | |
get: function() { | |
return module.i; | |
} | |
}), module.webpackPolyfill = 1), module; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
__webpack_require__(4); | |
var fs = __webpack_require__(2); | |
function Mime() { | |
this.types = Object.create(null), this.extensions = Object.create(null); | |
} | |
Mime.prototype.define = function(map) { | |
for (var type in map) { | |
for (var exts = map[type], i = 0; i < exts.length; i++) process.env.DEBUG_MIME && this.types[exts[i]] && console.warn((this._loading || "define()").replace(/.*\//, ""), 'changes "' + exts[i] + '" extension type from ' + this.types[exts[i]] + " to " + type), | |
this.types[exts[i]] = type; | |
this.extensions[type] || (this.extensions[type] = exts[0]); | |
} | |
}, Mime.prototype.load = function(file) { | |
this._loading = file; | |
var map = {}; | |
fs.readFileSync(file, "ascii").split(/[\r\n]+/).forEach((function(line) { | |
var fields = line.replace(/\s*#.*|^\s*|\s*$/g, "").split(/\s+/); | |
map[fields.shift()] = fields; | |
})), this.define(map), this._loading = null; | |
}, Mime.prototype.lookup = function(path, fallback) { | |
var ext = path.replace(/.*[\.\/\\]/, "").toLowerCase(); | |
return this.types[ext] || fallback || this.default_type; | |
}, Mime.prototype.extension = function(mimeType) { | |
var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase(); | |
return this.extensions[type]; | |
}; | |
var mime = new Mime; | |
mime.define(__webpack_require__(652)), mime.default_type = mime.lookup("bin"), mime.Mime = Mime, | |
mime.charsets = { | |
lookup: function(mimeType, fallback) { | |
return /^text\/|^application\/(javascript|json)/.test(mimeType) ? "UTF-8" : fallback; | |
} | |
}, module.exports = mime; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), Element = __webpack_require__(273); | |
function Element1(doc, tagId, ebmlId, start, length) { | |
Element.call(this, doc, tagId, ebmlId, start, length); | |
} | |
__webpack_require__(12), __webpack_require__(20), util.inherits(Element1, Element), | |
module.exports = Element1; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
const codes = {}; | |
function createErrorType(code, message, Base) { | |
Base || (Base = Error); | |
class NodeError extends Base { | |
constructor(arg1, arg2, arg3) { | |
super((function(arg1, arg2, arg3) { | |
return "string" == typeof message ? message : message(arg1, arg2, arg3); | |
})(arg1, arg2, arg3)); | |
} | |
} | |
NodeError.prototype.name = Base.name, NodeError.prototype.code = code, codes[code] = NodeError; | |
} | |
function oneOf(expected, thing) { | |
if (Array.isArray(expected)) { | |
const len = expected.length; | |
return expected = expected.map((i => String(i))), len > 2 ? `one of ${thing} ${expected.slice(0, len - 1).join(", ")}, or ` + expected[len - 1] : 2 === len ? `one of ${thing} ${expected[0]} or ${expected[1]}` : `of ${thing} ${expected[0]}`; | |
} | |
return `of ${thing} ${String(expected)}`; | |
} | |
createErrorType("ERR_INVALID_OPT_VALUE", (function(name, value) { | |
return 'The value "' + value + '" is invalid for option "' + name + '"'; | |
}), TypeError), createErrorType("ERR_INVALID_ARG_TYPE", (function(name, expected, actual) { | |
let determiner; | |
let msg; | |
if ("string" == typeof expected && ("not ", "not " === expected.substr(0, "not ".length)) ? (determiner = "must not be", | |
expected = expected.replace(/^not /, "")) : determiner = "must be", str = name, | |
(void 0 === this_len || this_len > str.length) && (this_len = str.length), " argument" === str.substring(this_len - " argument".length, this_len)) msg = `The ${name} ${determiner} ${oneOf(expected, "type")}`; else { | |
const type = (function(str, search, start) { | |
return "number" != typeof start && (start = 0), !(start + ".".length > str.length) && -1 !== str.indexOf(".", start); | |
})(name) ? "property" : "argument"; | |
msg = `The "${name}" ${type} ${determiner} ${oneOf(expected, "type")}`; | |
} | |
var str, this_len; | |
return msg += ". Received type " + typeof actual, msg; | |
}), TypeError), createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), | |
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", (function(name) { | |
return "The " + name + " method is not implemented"; | |
})), createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), createErrorType("ERR_STREAM_DESTROYED", (function(name) { | |
return "Cannot call " + name + " after a stream was destroyed"; | |
})), createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), | |
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), createErrorType("ERR_STREAM_WRITE_AFTER_END", "write after end"), | |
createErrorType("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), | |
createErrorType("ERR_UNKNOWN_ENCODING", (function(arg) { | |
return "Unknown encoding: " + arg; | |
}), TypeError), createErrorType("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), | |
module.exports.codes = codes; | |
}, function(module, exports) { | |
var isES5 = (function() { | |
"use strict"; | |
return void 0 === this; | |
})(); | |
if (isES5) module.exports = { | |
freeze: Object.freeze, | |
defineProperty: Object.defineProperty, | |
getDescriptor: Object.getOwnPropertyDescriptor, | |
keys: Object.keys, | |
names: Object.getOwnPropertyNames, | |
getPrototypeOf: Object.getPrototypeOf, | |
isArray: Array.isArray, | |
isES5: isES5, | |
propertyIsWritable: function(obj, prop) { | |
var descriptor = Object.getOwnPropertyDescriptor(obj, prop); | |
return !(descriptor && !descriptor.writable && !descriptor.set); | |
} | |
}; else { | |
var has = {}.hasOwnProperty, str = {}.toString, proto = {}.constructor.prototype, ObjectKeys = function(o) { | |
var ret = []; | |
for (var key in o) has.call(o, key) && ret.push(key); | |
return ret; | |
}; | |
module.exports = { | |
isArray: function(obj) { | |
try { | |
return "[object Array]" === str.call(obj); | |
} catch (e) { | |
return !1; | |
} | |
}, | |
keys: ObjectKeys, | |
names: ObjectKeys, | |
defineProperty: function(o, key, desc) { | |
return o[key] = desc.value, o; | |
}, | |
getDescriptor: function(o, key) { | |
return { | |
value: o[key] | |
}; | |
}, | |
freeze: function(obj) { | |
return obj; | |
}, | |
getPrototypeOf: function(obj) { | |
try { | |
return Object(obj).constructor.prototype; | |
} catch (e) { | |
return proto; | |
} | |
}, | |
isES5: isES5, | |
propertyIsWritable: function() { | |
return !0; | |
} | |
}; | |
} | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var Buffer = __webpack_require__(23).Buffer, contentDisposition = __webpack_require__(460), contentType = __webpack_require__(107), deprecate = __webpack_require__(47)("express"), flatten = __webpack_require__(149), mime = __webpack_require__(225).mime, etag = __webpack_require__(461), proxyaddr = __webpack_require__(463), qs = __webpack_require__(160), querystring = __webpack_require__(28); | |
function createETagGenerator(options) { | |
return function(body, encoding) { | |
var buf = Buffer.isBuffer(body) ? body : Buffer.from(body, encoding); | |
return etag(buf, options); | |
}; | |
} | |
function parseExtendedQueryString(str) { | |
return qs.parse(str, { | |
allowPrototypes: !0 | |
}); | |
} | |
function newObject() { | |
return {}; | |
} | |
exports.etag = createETagGenerator({ | |
weak: !1 | |
}), exports.wetag = createETagGenerator({ | |
weak: !0 | |
}), exports.isAbsolute = function(path) { | |
return "/" === path[0] || ":" === path[1] && ("\\" === path[2] || "/" === path[2]) || "\\\\" === path.substring(0, 2) || void 0; | |
}, exports.flatten = deprecate.function(flatten, "utils.flatten: use array-flatten npm module instead"), | |
exports.normalizeType = function(type) { | |
return ~type.indexOf("/") ? (function(str, index) { | |
for (var parts = str.split(/ *; */), ret = { | |
value: parts[0], | |
quality: 1, | |
params: {}, | |
originalIndex: void 0 | |
}, i = 1; i < parts.length; ++i) { | |
var pms = parts[i].split(/ *= */); | |
"q" === pms[0] ? ret.quality = parseFloat(pms[1]) : ret.params[pms[0]] = pms[1]; | |
} | |
return ret; | |
})(type) : { | |
value: mime.lookup(type), | |
params: {} | |
}; | |
}, exports.normalizeTypes = function(types) { | |
for (var ret = [], i = 0; i < types.length; ++i) ret.push(exports.normalizeType(types[i])); | |
return ret; | |
}, exports.contentDisposition = deprecate.function(contentDisposition, "utils.contentDisposition: use content-disposition npm module instead"), | |
exports.compileETag = function(val) { | |
var fn; | |
if ("function" == typeof val) return val; | |
switch (val) { | |
case !0: | |
fn = exports.wetag; | |
break; | |
case !1: | |
break; | |
case "strong": | |
fn = exports.etag; | |
break; | |
case "weak": | |
fn = exports.wetag; | |
break; | |
default: | |
throw new TypeError("unknown value for etag function: " + val); | |
} | |
return fn; | |
}, exports.compileQueryParser = function(val) { | |
var fn; | |
if ("function" == typeof val) return val; | |
switch (val) { | |
case !0: | |
fn = querystring.parse; | |
break; | |
case !1: | |
fn = newObject; | |
break; | |
case "extended": | |
fn = parseExtendedQueryString; | |
break; | |
case "simple": | |
fn = querystring.parse; | |
break; | |
default: | |
throw new TypeError("unknown value for query parser function: " + val); | |
} | |
return fn; | |
}, exports.compileTrust = function(val) { | |
return "function" == typeof val ? val : !0 === val ? function() { | |
return !0; | |
} : "number" == typeof val ? function(a, i) { | |
return i < val; | |
} : ("string" == typeof val && (val = val.split(/ *, */)), proxyaddr.compile(val || [])); | |
}, exports.setCharset = function(type, charset) { | |
if (!type || !charset) return type; | |
var parsed = contentType.parse(type); | |
return parsed.parameters.charset = charset, contentType.format(parsed); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var Buffer = __webpack_require__(14).Buffer, bomHandling = __webpack_require__(521), iconv = module.exports; | |
iconv.encodings = null, iconv.defaultCharUnicode = " ", iconv.defaultCharSingleByte = "?", | |
iconv.encode = function(str, encoding, options) { | |
str = "" + (str || ""); | |
var encoder = iconv.getEncoder(encoding, options), res = encoder.write(str), trail = encoder.end(); | |
return trail && trail.length > 0 ? Buffer.concat([ res, trail ]) : res; | |
}, iconv.decode = function(buf, encoding, options) { | |
"string" == typeof buf && (iconv.skipDecodeWarning || (console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"), | |
iconv.skipDecodeWarning = !0), buf = Buffer.from("" + (buf || ""), "binary")); | |
var decoder = iconv.getDecoder(encoding, options), res = decoder.write(buf), trail = decoder.end(); | |
return trail ? res + trail : res; | |
}, iconv.encodingExists = function(enc) { | |
try { | |
return iconv.getCodec(enc), !0; | |
} catch (e) { | |
return !1; | |
} | |
}, iconv.toEncoding = iconv.encode, iconv.fromEncoding = iconv.decode, iconv._codecDataCache = {}, | |
iconv.getCodec = function(encoding) { | |
iconv.encodings || (iconv.encodings = __webpack_require__(522)); | |
for (var enc = iconv._canonicalizeEncoding(encoding), codecOptions = {}; ;) { | |
var codec = iconv._codecDataCache[enc]; | |
if (codec) return codec; | |
var codecDef = iconv.encodings[enc]; | |
switch (typeof codecDef) { | |
case "string": | |
enc = codecDef; | |
break; | |
case "object": | |
for (var key in codecDef) codecOptions[key] = codecDef[key]; | |
codecOptions.encodingName || (codecOptions.encodingName = enc), enc = codecDef.type; | |
break; | |
case "function": | |
return codecOptions.encodingName || (codecOptions.encodingName = enc), codec = new codecDef(codecOptions, iconv), | |
iconv._codecDataCache[codecOptions.encodingName] = codec, codec; | |
default: | |
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '" + enc + "')"); | |
} | |
} | |
}, iconv._canonicalizeEncoding = function(encoding) { | |
return ("" + encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); | |
}, iconv.getEncoder = function(encoding, options) { | |
var codec = iconv.getCodec(encoding), encoder = new codec.encoder(options, codec); | |
return codec.bomAware && options && options.addBOM && (encoder = new bomHandling.PrependBOM(encoder, options)), | |
encoder; | |
}, iconv.getDecoder = function(encoding, options) { | |
var codec = iconv.getCodec(encoding), decoder = new codec.decoder(options, codec); | |
return !codec.bomAware || options && !1 === options.stripBOM || (decoder = new bomHandling.StripBOM(decoder, options)), | |
decoder; | |
}; | |
var nodeVer = "undefined" != typeof process && process.versions && process.versions.node; | |
if (nodeVer) { | |
var nodeVerArr = nodeVer.split(".").map(Number); | |
(nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) && __webpack_require__(536)(iconv), __webpack_require__(537)(iconv); | |
} | |
}, function(module, exports) { | |
module.exports = require("dgram"); | |
}, function(module, exports, __webpack_require__) { | |
var paths, common = module.exports, once = __webpack_require__(34), child = __webpack_require__(31), eos = __webpack_require__(163); | |
common.servePlaylist = function(lines, res) { | |
lines.push(""), lines = lines.join("\n"), res.setHeader("Content-Type", "application/vnd.apple.mpegurl"), | |
res.setHeader("Content-Length", new Buffer(lines).length), res.statusCode = 200, | |
res.write(lines), res.end(); | |
}, common.toSecs = function(ms) { | |
return (ms / 1e3).toFixed(3); | |
}, common.handleErr = function(err, res) { | |
res.setHeader("Cache-Control", "no-cache"), res.writeHead(err.httpCode || 500), | |
res.end(err.message || (err.toString ? err.toString() : "internal server error")); | |
}, common.pipeProcToResp = function(p, res, next) { | |
var procExited = !1, stdoutClosed = !1; | |
p.stdout.pipe(res, { | |
end: !1 | |
}), p.on("error", (function(err) { | |
console.error("ffsplit/ffmpeg error", err); | |
})), p.on("exit", (function(code) { | |
procExited = !0, 0 !== code && (res.statusCode = 500), stdoutClosed && procExited && res.end(); | |
})), eos(p.stdout, (function() { | |
(stdoutClosed = !0) && procExited && res.end(), next(); | |
})), eos(res, (function(err) { | |
stdoutClosed || p.stdout.destroy(), setTimeout((function() { | |
procExited || (console.log("process " + p.pid + " refuses to die"), p.kill("SIGKILL")); | |
}), 1e4), next(); | |
})); | |
}, common.serveFfmpeg = function(args, type, res) { | |
if (!paths.ffmpeg) return common.handleErr(new Error("no ffmpeg found"), res); | |
convertQueue.push((function(cb) { | |
var next = once(cb); | |
process.env.FFMPEG_DEBUG && console.log(args.join(" ")), res.setHeader("Content-Type", type); | |
var p = child.spawn(paths.ffmpeg, args); | |
common.pipeProcToResp(p, res, next), process.env.FFMPEG_DEBUG && p.stderr.pipe(process.stderr); | |
})); | |
}, common.streamShouldTransmux = function(stream, supportsHevc) { | |
var type = stream.codec_type, name = stream.codec_name.toLowerCase(); | |
return "video" == type ? -1 != name.indexOf("h264") || supportsHevc && name.indexOf("hevc") : "audio" == type ? -1 != name.indexOf("aac") : void 0; | |
}, common.estimateBitrate = function(w, h, fps) { | |
return h * w * fps * .11 / 1024; | |
}, common.hasFFsplit = function(p) { | |
return !!paths.ffsplit; | |
}, common.init = function(pathsParam, convertQueueParam) { | |
paths = pathsParam, convertQueue = convertQueueParam; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = { | |
crc1: __webpack_require__(643), | |
crc8: __webpack_require__(644), | |
crc81wire: __webpack_require__(645), | |
crc16: __webpack_require__(646), | |
crc16ccitt: __webpack_require__(647), | |
crc16modbus: __webpack_require__(648), | |
crc24: __webpack_require__(649), | |
crc32: __webpack_require__(650) | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), debug = __webpack_require__(40)("matroska:tools"), Schema = __webpack_require__(12), dateformat = __webpack_require__(274), CLASS_A_SIZE = Math.pow(2, 7), CLASS_B_SIZE = Math.pow(2, 14), CLASS_C_SIZE = Math.pow(2, 21), CLASS_D_SIZE = Math.pow(2, 28), CLASS_E_SIZE = Math.pow(2, 35), CLASS_F_SIZE = Math.pow(2, 42), CLASS_G_SIZE = Math.pow(2, 49), MAX_7BITS = (Math.pow(2, 56), | |
Math.pow(2, 7)), MAX_8BITS = Math.pow(2, 8), MAX_15BITS = Math.pow(2, 15), MAX_16BITS = Math.pow(2, 16), MAX_23BITS = Math.pow(2, 23), MAX_24BITS = Math.pow(2, 24), MAX_31BITS = Math.pow(2, 31), MAX_32BITS = Math.pow(2, 32), MAX_39BITS = Math.pow(2, 39), MAX_40BITS = Math.pow(2, 40), MAX_47BITS = Math.pow(2, 47), MAX_48BITS = Math.pow(2, 48), MAX_53BITS = (Math.pow(2, 52), | |
Math.pow(2, 53)), MAX_55BITS = Math.pow(2, 55), MAX_56BITS = Math.pow(2, 56), BITSn = [ 0, 256, Math.pow(2, 16), Math.pow(2, 24), Math.pow(2, 32), Math.pow(2, 40), Math.pow(2, 48), Math.pow(2, 56) ], BUFFS = [ new Buffer([ 0 ]), new Buffer([ 1 ]), new Buffer([ 2 ]), new Buffer([ 3 ]) ], BUFFSV = [ new Buffer([ 128 ]), new Buffer([ 129 ]) ], floatBuf = new Buffer(4), tools = { | |
readVInt: function(buffer, start, ret, keepMask) { | |
var bs = buffer[start = start || 0]; | |
if (!bs) throw (error = new Error("INVALID VINT format (value=0)")).code = "INVALID", | |
error; | |
var length = 8; | |
if (bs >= 128) length = 1; else if (bs >= 64) length = 2; else if (bs >= 32) length = 3; else if (bs >= 16) length = 4; else if (bs >= 8) length = 5; else if (bs >= 4) length = 6; else if (bs >= 2) length = 7; else { | |
if (!(bs >= 1)) throw (error = new Error("INVALID VINT format (length>7 bs=" + bs + ")")).code = "INVALID", | |
error; | |
length = 8; | |
} | |
if (start + length > buffer.length) return debug.enabled && debug("No enough bytes for VINT format " + start + "+" + length + ">" + buffer.length), | |
null; | |
ret || (ret = {}), ret.length = length; | |
var value = bs; | |
for (keepMask || (value &= (1 << 8 - length) - 1), length--, start++; length; ) { | |
var error, len = Math.min(length, 6), v = buffer.readUIntBE(start, len); | |
if (value = value * BITSn[len] + v, 7 === length && value >= MAX_40BITS) throw (error = new Error("INVALID VINT value too big (length>7 bs=" + bs + ")")).code = "INVALID", | |
error; | |
length -= len, start += len; | |
} | |
return ret.value = value, ret; | |
}, | |
writeVInt: function(value, buffer, offset) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
if (value < BUFFSV.length) return BUFFSV[value]; | |
var length = this.sizeVInt(value); | |
return buffer || (buffer = new Buffer(length), offset = 0), this.writeVIntBuffer(value, buffer, offset), | |
0 === offset && buffer.length === length ? buffer : buffer.slice(offset, length); | |
}, | |
writeVIntBuffer: function(value, buffer, offset) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
if (offset < 0 || isNaN(offset)) throw new Error("Invalid offset " + offset); | |
var length = this.sizeVInt(value); | |
if (length > 1) for (var l = length - 1, off = offset + l + 1; l; ) { | |
var len = Math.min(l, 6); | |
off -= len, buffer.writeUIntBE(value, off, len, !0), value /= BITSn[len], l -= len; | |
} | |
return buffer[offset] = value | 1 << 8 - length, length; | |
}, | |
readHInt: function(buffer, start, ret) { | |
return this.readVInt(buffer, start, ret, !0); | |
}, | |
sizeHInt: function(value) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
return this.sizeVInt(value / 2); | |
}, | |
sizeVInt: function(value) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
return value < CLASS_A_SIZE - 1 ? 1 : value < CLASS_B_SIZE - 1 ? 2 : value < CLASS_C_SIZE - 1 ? 3 : value < CLASS_D_SIZE - 1 ? 4 : value < CLASS_E_SIZE - 1 ? 5 : value < CLASS_F_SIZE - 1 ? 6 : value < CLASS_G_SIZE - 1 ? 7 : 8; | |
}, | |
sizeUInt: function(value) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
return value < MAX_8BITS ? 1 : value < MAX_16BITS ? 2 : value < MAX_24BITS ? 3 : value < MAX_32BITS ? 4 : value < MAX_40BITS ? 5 : value < MAX_48BITS ? 6 : value < MAX_56BITS ? 7 : 8; | |
}, | |
sizeInt: function(value) { | |
return value > -MAX_7BITS && value < MAX_7BITS ? 1 : value > -MAX_15BITS && value < MAX_15BITS ? 2 : value > -MAX_23BITS && value < MAX_23BITS ? 3 : value > -MAX_31BITS && value < MAX_31BITS ? 4 : value > -MAX_39BITS && value < MAX_39BITS ? 5 : value > -MAX_47BITS && value < MAX_47BITS ? 6 : value > -MAX_55BITS && value < MAX_55BITS ? 7 : 8; | |
}, | |
sizeFloat: function(value) { | |
return floatBuf.writeFloatBE(value, 0), floatBuf.readFloatBE(0) !== value ? 8 : 4; | |
}, | |
writeInt: function(newValue) { | |
var b, size = this.sizeInt(newValue); | |
if (1 === size) return newValue >= 0 && newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, | |
b); | |
if (size < 7) return (b = new Buffer(size)).writeIntBE(0, newValue, b.length), b; | |
if (newValue > -MAX_53BITS && newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, | |
b.writeUIntBE(newValue, 1, 6, !0), b; | |
throw new Error("Can not encode more than 52 bits"); | |
}, | |
writeUInt: function(newValue) { | |
var b, size = this.sizeUInt(newValue); | |
if (1 === size) return newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, | |
b); | |
if (size < 7) { | |
try { | |
(b = new Buffer(size)).writeUIntBE(newValue, 0, b.length); | |
} catch (x) { | |
throw new Error("newValue=" + newValue + " len=" + b.length + " " + x); | |
} | |
return b; | |
} | |
if (newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, | |
b.writeUIntBE(newValue, 1, 6, !0), b; | |
throw new Error("Can not encode more than 52 bits"); | |
}, | |
convertEbmlID: function(ebmlID) { | |
if ("number" == typeof ebmlID) return ebmlID; | |
if ("string" == typeof ebmlID) { | |
var desc = Schema.byName[ebmlID]; | |
if (!desc) throw new Error("Unknown ebmlID name '" + emblID + "'"); | |
return desc; | |
} | |
throw new Error("Invalid ebmlID parameter '" + ebmlID + "'"); | |
}, | |
writeCRC: function(crc) { | |
for (var data = new Buffer(4), i = 0; i < 4; i++) data[i] = crc, crc >>= 8; | |
return data; | |
}, | |
writeEbmlID: function(ebmlID) { | |
for (var data = new Buffer(8), i = data.length - 1; i >= 0; i--) if (data[i] = ebmlID, | |
!(ebmlID >>= 8)) return data.slice(i); | |
return data; | |
}, | |
readCRC: function(data) { | |
for (var len = data.length, crc = 0, i = 0; i < len; i++) crc <<= 8 + data[i]; | |
return crc; | |
}, | |
formatDate: function(date) { | |
return dateformat(date, "yyyy-mm-dd HH:MM:ss.l"); | |
}, | |
formatDay: function(date) { | |
return dateformat(date, "yyyy-mm-dd"); | |
}, | |
formatYear: function(date) { | |
return dateformat(date, "yyyy"); | |
}, | |
validType: function(type, value) { | |
switch (type) { | |
case "8": | |
case "s": | |
if ("string" == typeof value || null == value) return value; | |
break; | |
case "u": | |
case "i": | |
case "u": | |
case "i": | |
case "f": | |
if ("number" == typeof value || void 0 === value) return value; | |
break; | |
case "d": | |
if (util.isDate(value) || null == value) return value; | |
break; | |
case "b": | |
if (Buffer.isBuffer(value) || null == value) return value; | |
} | |
throw new Error("Invalid value '" + value + "' for type '" + type + "'"); | |
} | |
}; | |
module.exports = tools; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Duplex; | |
var objectKeys = Object.keys || function(obj) { | |
var keys = []; | |
for (var key in obj) keys.push(key); | |
return keys; | |
}, util = __webpack_require__(32); | |
util.inherits = __webpack_require__(6); | |
var Readable = __webpack_require__(383), Writable = __webpack_require__(384); | |
function Duplex(options) { | |
if (!(this instanceof Duplex)) return new Duplex(options); | |
Readable.call(this, options), Writable.call(this, options), options && !1 === options.readable && (this.readable = !1), | |
options && !1 === options.writable && (this.writable = !1), this.allowHalfOpen = !0, | |
options && !1 === options.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", onend); | |
} | |
function onend() { | |
this.allowHalfOpen || this._writableState.ended || process.nextTick(this.end.bind(this)); | |
} | |
util.inherits(Duplex, Readable), (function(xs, f) { | |
for (var i = 0, l = xs.length; i < l; i++) method = xs[i], Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); | |
var method; | |
})(objectKeys(Writable.prototype)); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var pna = __webpack_require__(53), objectKeys = Object.keys || function(obj) { | |
var keys = []; | |
for (var key in obj) keys.push(key); | |
return keys; | |
}; | |
module.exports = Duplex; | |
var util = Object.create(__webpack_require__(32)); | |
util.inherits = __webpack_require__(6); | |
var Readable = __webpack_require__(391), Writable = __webpack_require__(395); | |
util.inherits(Duplex, Readable); | |
for (var keys = objectKeys(Writable.prototype), v = 0; v < keys.length; v++) { | |
var method = keys[v]; | |
Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); | |
} | |
function Duplex(options) { | |
if (!(this instanceof Duplex)) return new Duplex(options); | |
Readable.call(this, options), Writable.call(this, options), options && !1 === options.readable && (this.readable = !1), | |
options && !1 === options.writable && (this.writable = !1), this.allowHalfOpen = !0, | |
options && !1 === options.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", onend); | |
} | |
function onend() { | |
this.allowHalfOpen || this._writableState.ended || pna.nextTick(onEndNT, this); | |
} | |
function onEndNT(self) { | |
self.end(); | |
} | |
Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { | |
enumerable: !1, | |
get: function() { | |
return this._writableState.highWaterMark; | |
} | |
}), Object.defineProperty(Duplex.prototype, "destroyed", { | |
get: function() { | |
return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; | |
}, | |
set: function(value) { | |
void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = value, | |
this._writableState.destroyed = value); | |
} | |
}), Duplex.prototype._destroy = function(err, cb) { | |
this.push(null), this.end(), pna.nextTick(cb, err); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), debug = __webpack_require__(41)("matroska:tools"), Schema = __webpack_require__(13), dateformat = __webpack_require__(274), CLASS_A_SIZE = Math.pow(2, 7), CLASS_B_SIZE = Math.pow(2, 14), CLASS_C_SIZE = Math.pow(2, 21), CLASS_D_SIZE = Math.pow(2, 28), CLASS_E_SIZE = Math.pow(2, 35), CLASS_F_SIZE = Math.pow(2, 42), CLASS_G_SIZE = Math.pow(2, 49), MAX_7BITS = (Math.pow(2, 56), | |
Math.pow(2, 7)), MAX_8BITS = Math.pow(2, 8), MAX_15BITS = Math.pow(2, 15), MAX_16BITS = Math.pow(2, 16), MAX_23BITS = Math.pow(2, 23), MAX_24BITS = Math.pow(2, 24), MAX_31BITS = Math.pow(2, 31), MAX_32BITS = Math.pow(2, 32), MAX_39BITS = Math.pow(2, 39), MAX_40BITS = Math.pow(2, 40), MAX_47BITS = Math.pow(2, 47), MAX_48BITS = Math.pow(2, 48), MAX_53BITS = (Math.pow(2, 52), | |
Math.pow(2, 53)), MAX_55BITS = Math.pow(2, 55), MAX_56BITS = Math.pow(2, 56), BITSn = [ 0, 256, Math.pow(2, 16), Math.pow(2, 24), Math.pow(2, 32), Math.pow(2, 40), Math.pow(2, 48), Math.pow(2, 56) ], BUFFS = [ new Buffer([ 0 ]), new Buffer([ 1 ]), new Buffer([ 2 ]), new Buffer([ 3 ]) ], BUFFSV = [ new Buffer([ 128 ]), new Buffer([ 129 ]) ], floatBuf = new Buffer(4), tools = { | |
readVInt: function(buffer, start, ret, keepMask) { | |
var bs = buffer[start = start || 0]; | |
if (!bs) throw (error = new Error("INVALID VINT format (value=0)")).code = "INVALID", | |
error; | |
var length = 8; | |
if (bs >= 128) length = 1; else if (bs >= 64) length = 2; else if (bs >= 32) length = 3; else if (bs >= 16) length = 4; else if (bs >= 8) length = 5; else if (bs >= 4) length = 6; else if (bs >= 2) length = 7; else { | |
if (!(bs >= 1)) throw (error = new Error("INVALID VINT format (length>7 bs=" + bs + ")")).code = "INVALID", | |
error; | |
length = 8; | |
} | |
if (start + length > buffer.length) return debug.enabled && debug("No enough bytes for VINT format " + start + "+" + length + ">" + buffer.length), | |
null; | |
ret || (ret = {}), ret.length = length; | |
var value = bs; | |
for (keepMask || (value &= (1 << 8 - length) - 1), length--, start++; length; ) { | |
var error, len = Math.min(length, 6), v = buffer.readUIntBE(start, len); | |
if (value = value * BITSn[len] + v, 7 === length && value >= MAX_40BITS) throw (error = new Error("INVALID VINT value too big (length>7 bs=" + bs + ")")).code = "INVALID", | |
error; | |
length -= len, start += len; | |
} | |
return ret.value = value, ret; | |
}, | |
writeVInt: function(value, buffer, offset) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
if (value < BUFFSV.length) return BUFFSV[value]; | |
var length = this.sizeVInt(value); | |
return buffer || (buffer = new Buffer(length), offset = 0), this.writeVIntBuffer(value, buffer, offset), | |
0 === offset && buffer.length === length ? buffer : buffer.slice(offset, length); | |
}, | |
writeVIntBuffer: function(value, buffer, offset) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
if (offset < 0 || isNaN(offset)) throw new Error("Invalid offset " + offset); | |
var length = this.sizeVInt(value); | |
if (length > 1) for (var l = length - 1, off = offset + l + 1; l; ) { | |
var len = Math.min(l, 6); | |
off -= len, buffer.writeUIntBE(value, off, len, !0), value /= BITSn[len], l -= len; | |
} | |
return buffer[offset] = value | 1 << 8 - length, length; | |
}, | |
readHInt: function(buffer, start, ret) { | |
return this.readVInt(buffer, start, ret, !0); | |
}, | |
sizeHInt: function(value) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
return this.sizeVInt(value / 2); | |
}, | |
sizeVInt: function(value) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
return value < CLASS_A_SIZE - 1 ? 1 : value < CLASS_B_SIZE - 1 ? 2 : value < CLASS_C_SIZE - 1 ? 3 : value < CLASS_D_SIZE - 1 ? 4 : value < CLASS_E_SIZE - 1 ? 5 : value < CLASS_F_SIZE - 1 ? 6 : value < CLASS_G_SIZE - 1 ? 7 : 8; | |
}, | |
sizeUInt: function(value) { | |
if (value < 0) throw new Error("Unrepresentable value: " + value); | |
return value < MAX_8BITS ? 1 : value < MAX_16BITS ? 2 : value < MAX_24BITS ? 3 : value < MAX_32BITS ? 4 : value < MAX_40BITS ? 5 : value < MAX_48BITS ? 6 : value < MAX_56BITS ? 7 : 8; | |
}, | |
sizeInt: function(value) { | |
return value > -MAX_7BITS && value < MAX_7BITS ? 1 : value > -MAX_15BITS && value < MAX_15BITS ? 2 : value > -MAX_23BITS && value < MAX_23BITS ? 3 : value > -MAX_31BITS && value < MAX_31BITS ? 4 : value > -MAX_39BITS && value < MAX_39BITS ? 5 : value > -MAX_47BITS && value < MAX_47BITS ? 6 : value > -MAX_55BITS && value < MAX_55BITS ? 7 : 8; | |
}, | |
sizeFloat: function(value) { | |
return floatBuf.writeFloatBE(value, 0), floatBuf.readFloatBE(0) !== value ? 8 : 4; | |
}, | |
writeInt: function(newValue) { | |
var b, size = this.sizeInt(newValue); | |
if (1 === size) return newValue >= 0 && newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, | |
b); | |
if (size < 7) return (b = new Buffer(size)).writeIntBE(0, newValue, b.length), b; | |
if (newValue > -MAX_53BITS && newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, | |
b.writeUIntBE(newValue, 1, 6, !0), b; | |
throw new Error("Can not encode more than 52 bits"); | |
}, | |
writeUInt: function(newValue) { | |
var b, size = this.sizeUInt(newValue); | |
if (1 === size) return newValue < BUFFS.length ? BUFFS[newValue] : ((b = new Buffer(1))[0] = newValue, | |
b); | |
if (size < 7) { | |
try { | |
(b = new Buffer(size)).writeUIntBE(newValue, 0, b.length); | |
} catch (x) { | |
throw new Error("newValue=" + newValue + " len=" + b.length + " " + x); | |
} | |
return b; | |
} | |
if (newValue < MAX_53BITS) return (b = new Buffer(7))[0] = newValue / MAX_48BITS, | |
b.writeUIntBE(newValue, 1, 6, !0), b; | |
throw new Error("Can not encode more than 52 bits"); | |
}, | |
convertEbmlID: function(ebmlID) { | |
if ("number" == typeof ebmlID) return ebmlID; | |
if ("string" == typeof ebmlID) { | |
var desc = Schema.byName[ebmlID]; | |
if (!desc) throw new Error("Unknown ebmlID name '" + emblID + "'"); | |
return desc; | |
} | |
throw new Error("Invalid ebmlID parameter '" + ebmlID + "'"); | |
}, | |
writeCRC: function(crc) { | |
for (var data = new Buffer(4), i = 0; i < 4; i++) data[i] = crc, crc >>= 8; | |
return data; | |
}, | |
writeEbmlID: function(ebmlID) { | |
for (var data = new Buffer(8), i = data.length - 1; i >= 0; i--) if (data[i] = ebmlID, | |
!(ebmlID >>= 8)) return data.slice(i); | |
return data; | |
}, | |
readCRC: function(data) { | |
for (var len = data.length, crc = 0, i = 0; i < len; i++) crc <<= 8 + data[i]; | |
return crc; | |
}, | |
formatDate: function(date) { | |
return dateformat(date, "yyyy-mm-dd HH:MM:ss.l"); | |
}, | |
formatDay: function(date) { | |
return dateformat(date, "yyyy-mm-dd"); | |
}, | |
formatYear: function(date) { | |
return dateformat(date, "yyyy"); | |
}, | |
validType: function(type, value) { | |
switch (type) { | |
case "8": | |
case "s": | |
if ("string" == typeof value || null == value) return value; | |
break; | |
case "u": | |
case "i": | |
case "u": | |
case "i": | |
case "f": | |
if ("number" == typeof value || void 0 === value) return value; | |
break; | |
case "d": | |
if (util.isDate(value) || null == value) return value; | |
break; | |
case "b": | |
if (Buffer.isBuffer(value) || null == value) return value; | |
} | |
throw new Error("Invalid value '" + value + "' for type '" + type + "'"); | |
} | |
}; | |
module.exports = tools; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var objectKeys = Object.keys || function(obj) { | |
var keys = []; | |
for (var key in obj) keys.push(key); | |
return keys; | |
}; | |
module.exports = Duplex; | |
var Readable = __webpack_require__(423), Writable = __webpack_require__(427); | |
__webpack_require__(6)(Duplex, Readable); | |
for (var keys = objectKeys(Writable.prototype), v = 0; v < keys.length; v++) { | |
var method = keys[v]; | |
Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); | |
} | |
function Duplex(options) { | |
if (!(this instanceof Duplex)) return new Duplex(options); | |
Readable.call(this, options), Writable.call(this, options), this.allowHalfOpen = !0, | |
options && (!1 === options.readable && (this.readable = !1), !1 === options.writable && (this.writable = !1), | |
!1 === options.allowHalfOpen && (this.allowHalfOpen = !1, this.once("end", onend))); | |
} | |
function onend() { | |
this._writableState.ended || process.nextTick(onEndNT, this); | |
} | |
function onEndNT(self) { | |
self.end(); | |
} | |
Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { | |
enumerable: !1, | |
get: function() { | |
return this._writableState.highWaterMark; | |
} | |
}), Object.defineProperty(Duplex.prototype, "writableBuffer", { | |
enumerable: !1, | |
get: function() { | |
return this._writableState && this._writableState.getBuffer(); | |
} | |
}), Object.defineProperty(Duplex.prototype, "writableLength", { | |
enumerable: !1, | |
get: function() { | |
return this._writableState.length; | |
} | |
}), Object.defineProperty(Duplex.prototype, "destroyed", { | |
enumerable: !1, | |
get: function() { | |
return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; | |
}, | |
set: function(value) { | |
void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = value, | |
this._writableState.destroyed = value); | |
} | |
}); | |
}, function(module, exports, __webpack_require__) { | |
var Stream = __webpack_require__(3); | |
"disable" === process.env.READABLE_STREAM && Stream ? (module.exports = Stream, | |
(exports = module.exports = Stream.Readable).Readable = Stream.Readable, exports.Writable = Stream.Writable, | |
exports.Duplex = Stream.Duplex, exports.Transform = Stream.Transform, exports.PassThrough = Stream.PassThrough, | |
exports.Stream = Stream) : ((exports = module.exports = __webpack_require__(450)).Stream = Stream || exports, | |
exports.Readable = exports, exports.Writable = __webpack_require__(453), exports.Duplex = __webpack_require__(78), | |
exports.Transform = __webpack_require__(455), exports.PassThrough = __webpack_require__(964)); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var pna = __webpack_require__(53), objectKeys = Object.keys || function(obj) { | |
var keys = []; | |
for (var key in obj) keys.push(key); | |
return keys; | |
}; | |
module.exports = Duplex; | |
var util = __webpack_require__(32); | |
util.inherits = __webpack_require__(96); | |
var Readable = __webpack_require__(450), Writable = __webpack_require__(453); | |
util.inherits(Duplex, Readable); | |
for (var keys = objectKeys(Writable.prototype), v = 0; v < keys.length; v++) { | |
var method = keys[v]; | |
Duplex.prototype[method] || (Duplex.prototype[method] = Writable.prototype[method]); | |
} | |
function Duplex(options) { | |
if (!(this instanceof Duplex)) return new Duplex(options); | |
Readable.call(this, options), Writable.call(this, options), options && !1 === options.readable && (this.readable = !1), | |
options && !1 === options.writable && (this.writable = !1), this.allowHalfOpen = !0, | |
options && !1 === options.allowHalfOpen && (this.allowHalfOpen = !1), this.once("end", onend); | |
} | |
function onend() { | |
this.allowHalfOpen || this._writableState.ended || pna.nextTick(onEndNT, this); | |
} | |
function onEndNT(self) { | |
self.end(); | |
} | |
Object.defineProperty(Duplex.prototype, "writableHighWaterMark", { | |
enumerable: !1, | |
get: function() { | |
return this._writableState.highWaterMark; | |
} | |
}), Object.defineProperty(Duplex.prototype, "destroyed", { | |
get: function() { | |
return void 0 !== this._readableState && void 0 !== this._writableState && this._readableState.destroyed && this._writableState.destroyed; | |
}, | |
set: function(value) { | |
void 0 !== this._readableState && void 0 !== this._writableState && (this._readableState.destroyed = value, | |
this._writableState.destroyed = value); | |
} | |
}), Duplex.prototype._destroy = function(err, cb) { | |
this.push(null), this.end(), pna.nextTick(cb, err); | |
}; | |
}, function(module, exports) { | |
module.exports = { | |
PREFIX_BT: "bt:", | |
PREFIX_LOCAL: "local:", | |
PREFIX_IMDB: "tt", | |
STREAM_LOCALFILE_SUBTITLE: "ADDON_STREAM_LOCALFILE", | |
CINEMETA_URL: "https://v3-cinemeta.strem.io", | |
METAHUB_URL: "https://images.metahub.space", | |
METAHUB_EPISODES_URL: "https://episodes.metahub.space", | |
INTERESTING_FILE: /.mkv$|.avi$|.mp4$|.wmv$|.vp8$|.mov$|.mpg$|.mp3$|.flac$/i, | |
INTERESTING_TYPE: [ "movie", "series" ], | |
MAX_INDEXED: 1e4 | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
function checkDataType(dataType, data, negate) { | |
var EQUAL = negate ? " !== " : " === ", AND = negate ? " || " : " && ", OK = negate ? "!" : "", NOT = negate ? "" : "!"; | |
switch (dataType) { | |
case "null": | |
return data + EQUAL + "null"; | |
case "array": | |
return OK + "Array.isArray(" + data + ")"; | |
case "object": | |
return "(" + OK + data + AND + "typeof " + data + EQUAL + '"object"' + AND + NOT + "Array.isArray(" + data + "))"; | |
case "integer": | |
return "(typeof " + data + EQUAL + '"number"' + AND + NOT + "(" + data + " % 1)" + AND + data + EQUAL + data + ")"; | |
default: | |
return "typeof " + data + EQUAL + '"' + dataType + '"'; | |
} | |
} | |
module.exports = { | |
copy: function(o, to) { | |
for (var key in to = to || {}, o) to[key] = o[key]; | |
return to; | |
}, | |
checkDataType: checkDataType, | |
checkDataTypes: function(dataTypes, data) { | |
if (1 === dataTypes.length) return checkDataType(dataTypes[0], data, !0); | |
var code = "", types = toHash(dataTypes); | |
for (var t in types.array && types.object && (code = types.null ? "(" : "(!" + data + " || ", | |
code += "typeof " + data + ' !== "object")', delete types.null, delete types.array, | |
delete types.object), types.number && delete types.integer, types) code += (code ? " && " : "") + checkDataType(t, data, !0); | |
return code; | |
}, | |
coerceToTypes: function(optionCoerceTypes, dataTypes) { | |
if (Array.isArray(dataTypes)) { | |
for (var types = [], i = 0; i < dataTypes.length; i++) { | |
var t = dataTypes[i]; | |
(COERCE_TO_TYPES[t] || "array" === optionCoerceTypes && "array" === t) && (types[types.length] = t); | |
} | |
if (types.length) return types; | |
} else { | |
if (COERCE_TO_TYPES[dataTypes]) return [ dataTypes ]; | |
if ("array" === optionCoerceTypes && "array" === dataTypes) return [ "array" ]; | |
} | |
}, | |
toHash: toHash, | |
getProperty: getProperty, | |
escapeQuotes: escapeQuotes, | |
equal: __webpack_require__(238), | |
ucs2length: __webpack_require__(1084), | |
varOccurences: function(str, dataVar) { | |
dataVar += "[^0-9]"; | |
var matches = str.match(new RegExp(dataVar, "g")); | |
return matches ? matches.length : 0; | |
}, | |
varReplace: function(str, dataVar, expr) { | |
return dataVar += "([^0-9])", expr = expr.replace(/\$/g, "$$$$"), str.replace(new RegExp(dataVar, "g"), expr + "$1"); | |
}, | |
cleanUpCode: function(out) { | |
return out.replace(EMPTY_ELSE, "").replace(EMPTY_IF_NO_ELSE, "").replace(EMPTY_IF_WITH_ELSE, "if (!($1))"); | |
}, | |
finalCleanUpCode: function(out, async) { | |
var matches = out.match(ERRORS_REGEXP); | |
return matches && 2 == matches.length && (out = async ? out.replace(REMOVE_ERRORS_ASYNC, "").replace(RETURN_ASYNC, "return data;") : out.replace(REMOVE_ERRORS, "").replace("return errors === 0;", "validate.errors = null; return true;")), | |
(matches = out.match(ROOTDATA_REGEXP)) && 3 === matches.length ? out.replace(REMOVE_ROOTDATA, "") : out; | |
}, | |
schemaHasRules: function(schema, rules) { | |
if ("boolean" == typeof schema) return !schema; | |
for (var key in schema) if (rules[key]) return !0; | |
}, | |
schemaHasRulesExcept: function(schema, rules, exceptKeyword) { | |
if ("boolean" == typeof schema) return !schema && "not" != exceptKeyword; | |
for (var key in schema) if (key != exceptKeyword && rules[key]) return !0; | |
}, | |
schemaUnknownRules: function(schema, rules) { | |
if ("boolean" != typeof schema) for (var key in schema) if (!rules[key]) return key; | |
}, | |
toQuotedString: toQuotedString, | |
getPathExpr: function(currentPath, expr, jsonPointers, isNumber) { | |
return joinPaths(currentPath, jsonPointers ? "'/' + " + expr + (isNumber ? "" : ".replace(/~/g, '~0').replace(/\\//g, '~1')") : isNumber ? "'[' + " + expr + " + ']'" : "'[\\'' + " + expr + " + '\\']'"); | |
}, | |
getPath: function(currentPath, prop, jsonPointers) { | |
return joinPaths(currentPath, toQuotedString(jsonPointers ? "/" + escapeJsonPointer(prop) : getProperty(prop))); | |
}, | |
getData: function($data, lvl, paths) { | |
var up, jsonPointer, data, matches; | |
if ("" === $data) return "rootData"; | |
if ("/" == $data[0]) { | |
if (!JSON_POINTER.test($data)) throw new Error("Invalid JSON-pointer: " + $data); | |
jsonPointer = $data, data = "rootData"; | |
} else { | |
if (!(matches = $data.match(RELATIVE_JSON_POINTER))) throw new Error("Invalid JSON-pointer: " + $data); | |
if (up = +matches[1], "#" == (jsonPointer = matches[2])) { | |
if (up >= lvl) throw new Error("Cannot access property/index " + up + " levels up, current level is " + lvl); | |
return paths[lvl - up]; | |
} | |
if (up > lvl) throw new Error("Cannot access data " + up + " levels up, current level is " + lvl); | |
if (data = "data" + (lvl - up || ""), !jsonPointer) return data; | |
} | |
for (var expr = data, segments = jsonPointer.split("/"), i = 0; i < segments.length; i++) { | |
var segment = segments[i]; | |
segment && (expr += " && " + (data += getProperty(unescapeJsonPointer(segment)))); | |
} | |
return expr; | |
}, | |
unescapeFragment: function(str) { | |
return unescapeJsonPointer(decodeURIComponent(str)); | |
}, | |
unescapeJsonPointer: unescapeJsonPointer, | |
escapeFragment: function(str) { | |
return encodeURIComponent(escapeJsonPointer(str)); | |
}, | |
escapeJsonPointer: escapeJsonPointer | |
}; | |
var COERCE_TO_TYPES = toHash([ "string", "number", "integer", "boolean", "null" ]); | |
function toHash(arr) { | |
for (var hash = {}, i = 0; i < arr.length; i++) hash[arr[i]] = !0; | |
return hash; | |
} | |
var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i, SINGLE_QUOTE = /'|\\/g; | |
function getProperty(key) { | |
return "number" == typeof key ? "[" + key + "]" : IDENTIFIER.test(key) ? "." + key : "['" + escapeQuotes(key) + "']"; | |
} | |
function escapeQuotes(str) { | |
return str.replace(SINGLE_QUOTE, "\\$&").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\f/g, "\\f").replace(/\t/g, "\\t"); | |
} | |
var EMPTY_ELSE = /else\s*{\s*}/g, EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g, EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g, ERRORS_REGEXP = /[^v.]errors/g, REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g, REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g, RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/, ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g, REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/; | |
function toQuotedString(str) { | |
return "'" + escapeQuotes(str) + "'"; | |
} | |
var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/, RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; | |
function joinPaths(a, b) { | |
return '""' == a ? b : (a + " + " + b).replace(/' \+ '/g, ""); | |
} | |
function escapeJsonPointer(str) { | |
return str.replace(/~/g, "~0").replace(/\//g, "~1"); | |
} | |
function unescapeJsonPointer(str) { | |
return str.replace(/~1/g, "/").replace(/~0/g, "~"); | |
} | |
}, function(module, exports) { | |
var isES5 = (function() { | |
"use strict"; | |
return void 0 === this; | |
})(); | |
if (isES5) module.exports = { | |
freeze: Object.freeze, | |
defineProperty: Object.defineProperty, | |
getDescriptor: Object.getOwnPropertyDescriptor, | |
keys: Object.keys, | |
names: Object.getOwnPropertyNames, | |
getPrototypeOf: Object.getPrototypeOf, | |
isArray: Array.isArray, | |
isES5: isES5, | |
propertyIsWritable: function(obj, prop) { | |
var descriptor = Object.getOwnPropertyDescriptor(obj, prop); | |
return !(descriptor && !descriptor.writable && !descriptor.set); | |
} | |
}; else { | |
var has = {}.hasOwnProperty, str = {}.toString, proto = {}.constructor.prototype, ObjectKeys = function(o) { | |
var ret = []; | |
for (var key in o) has.call(o, key) && ret.push(key); | |
return ret; | |
}; | |
module.exports = { | |
isArray: function(obj) { | |
try { | |
return "[object Array]" === str.call(obj); | |
} catch (e) { | |
return !1; | |
} | |
}, | |
keys: ObjectKeys, | |
names: ObjectKeys, | |
defineProperty: function(o, key, desc) { | |
return o[key] = desc.value, o; | |
}, | |
getDescriptor: function(o, key) { | |
return { | |
value: o[key] | |
}; | |
}, | |
freeze: function(obj) { | |
return obj; | |
}, | |
getPrototypeOf: function(obj) { | |
try { | |
return Object(obj).constructor.prototype; | |
} catch (e) { | |
return proto; | |
} | |
}, | |
isES5: isES5, | |
propertyIsWritable: function() { | |
return !0; | |
} | |
}; | |
} | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Reader; | |
var fs = __webpack_require__(59), Stream = __webpack_require__(3).Stream, inherits = __webpack_require__(6), path = __webpack_require__(4), getType = __webpack_require__(154), hardLinks = Reader.hardLinks = {}, Abstract = __webpack_require__(242); | |
inherits(Reader, Abstract); | |
var LinkReader = __webpack_require__(509); | |
function Reader(props, currentStat) { | |
var type, ClassType; | |
if (!(this instanceof Reader)) return new Reader(props, currentStat); | |
switch ("string" == typeof props && (props = { | |
path: props | |
}), props.type && "function" == typeof props.type ? ClassType = type = props.type : (type = getType(props), | |
ClassType = Reader), currentStat && !type && (props[type = getType(currentStat)] = !0, | |
props.type = type), type) { | |
case "Directory": | |
ClassType = __webpack_require__(510); | |
break; | |
case "Link": | |
case "File": | |
ClassType = __webpack_require__(511); | |
break; | |
case "SymbolicLink": | |
ClassType = LinkReader; | |
break; | |
case "Socket": | |
ClassType = __webpack_require__(1197); | |
break; | |
case null: | |
ClassType = __webpack_require__(512); | |
} | |
if (!(this instanceof ClassType)) return new ClassType(props); | |
Abstract.call(this), props.path || this.error("Must provide a path", null, !0), | |
this.readable = !0, this.writable = !1, this.type = type, this.props = props, this.depth = props.depth = props.depth || 0, | |
this.parent = props.parent || null, this.root = props.root || props.parent && props.parent.root || this, | |
this._path = this.path = path.resolve(props.path), "win32" === process.platform && (this.path = this._path = this.path.replace(/\?/g, "_"), | |
this._path.length >= 260 && (this._swallowErrors = !0, this._path = "\\\\?\\" + this.path.replace(/\//g, "\\"))), | |
this.basename = props.basename = path.basename(this.path), this.dirname = props.dirname = path.dirname(this.path), | |
props.parent = props.root = null, this.size = props.size, this.filter = "function" == typeof props.filter ? props.filter : null, | |
"alpha" === props.sort && (props.sort = alphasort), this._stat(currentStat); | |
} | |
function alphasort(a, b) { | |
return a === b ? 0 : a.toLowerCase() > b.toLowerCase() ? 1 : a.toLowerCase() < b.toLowerCase() ? -1 : a > b ? 1 : -1; | |
} | |
Reader.prototype._stat = function(currentStat) { | |
var self = this, props = self.props, stat = props.follow ? "stat" : "lstat"; | |
function statCb(er, props_) { | |
if (er) return self.error(er); | |
if (Object.keys(props_).forEach((function(k) { | |
props[k] = props_[k]; | |
})), void 0 !== self.size && props.size !== self.size) return self.error("incorrect size"); | |
self.size = props.size; | |
var type = getType(props); | |
if (!1 !== props.hardlinks && "Directory" !== type && props.nlink && props.nlink > 1) { | |
var k = props.dev + ":" + props.ino; | |
hardLinks[k] !== self._path && hardLinks[k] ? (type = self.type = self.props.type = "Link", | |
self.Link = self.props.Link = !0, self.linkpath = self.props.linkpath = hardLinks[k], | |
self._stat = self._read = LinkReader.prototype._read) : hardLinks[k] = self._path; | |
} | |
if (self.type && self.type !== type && self.error("Unexpected type: " + type), self.filter) { | |
var who = self._proxy || self; | |
if (!self.filter.call(who, who, props)) return void (self._disowned || (self.abort(), | |
self.emit("end"), self.emit("close"))); | |
} | |
var events = [ "_stat", "stat", "ready" ], e = 0; | |
!(function go() { | |
if (self._aborted) return self.emit("end"), void self.emit("close"); | |
if (self._paused && "Directory" !== self.type) self.once("resume", go); else { | |
var ev = events[e++]; | |
if (!ev) return self._read(); | |
self.emit(ev, props), go(); | |
} | |
})(); | |
} | |
currentStat ? process.nextTick(statCb.bind(null, null, currentStat)) : fs[stat](self._path, statCb); | |
}, Reader.prototype.pipe = function(dest) { | |
var self = this; | |
return "function" == typeof dest.add && self.on("entry", (function(entry) { | |
!1 === dest.add(entry) && self.pause(); | |
})), Stream.prototype.pipe.apply(this, arguments); | |
}, Reader.prototype.pause = function(who) { | |
this._paused = !0, who = who || this, this.emit("pause", who), this._stream && this._stream.pause(who); | |
}, Reader.prototype.resume = function(who) { | |
this._paused = !1, who = who || this, this.emit("resume", who), this._stream && this._stream.resume(who), | |
this._read(); | |
}, Reader.prototype._read = function() { | |
this.error("Cannot read unknown type: " + this.type); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = function(url) { | |
return String(url).replace(UNMATCHED_SURROGATE_PAIR_REGEXP, "$1 $2").replace(ENCODE_CHARS_REGEXP, encodeURI); | |
}; | |
var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g, UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var matchHtmlRegExp = /["'&<>]/; | |
module.exports = function(string) { | |
var escape, str = "" + string, match = matchHtmlRegExp.exec(str); | |
if (!match) return str; | |
var html = "", index = 0, lastIndex = 0; | |
for (index = match.index; index < str.length; index++) { | |
switch (str.charCodeAt(index)) { | |
case 34: | |
escape = """; | |
break; | |
case 38: | |
escape = "&"; | |
break; | |
case 39: | |
escape = "'"; | |
break; | |
case 60: | |
escape = "<"; | |
break; | |
case 62: | |
escape = ">"; | |
break; | |
default: | |
continue; | |
} | |
lastIndex !== index && (html += str.substring(lastIndex, index)), lastIndex = index + 1, | |
html += escape; | |
} | |
return lastIndex !== index ? html + str.substring(lastIndex, index) : html; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = function(msg, listener) { | |
return !1 !== isFinished(msg) ? (defer(listener, null, msg), msg) : ((function(msg, listener) { | |
var attached = msg.__onFinished; | |
attached && attached.queue || (attached = msg.__onFinished = (function(msg) { | |
function listener(err) { | |
if (msg.__onFinished === listener && (msg.__onFinished = null), listener.queue) { | |
var queue = listener.queue; | |
listener.queue = null; | |
for (var i = 0; i < queue.length; i++) queue[i](err, msg); | |
} | |
} | |
return listener.queue = [], listener; | |
})(msg), (function(msg, callback) { | |
var eeMsg, eeSocket, finished = !1; | |
function onFinish(error) { | |
eeMsg.cancel(), eeSocket.cancel(), finished = !0, callback(error); | |
} | |
function onSocket(socket) { | |
msg.removeListener("socket", onSocket), finished || eeMsg === eeSocket && (eeSocket = first([ [ socket, "error", "close" ] ], onFinish)); | |
} | |
eeMsg = eeSocket = first([ [ msg, "end", "finish" ] ], onFinish), msg.socket ? onSocket(msg.socket) : (msg.on("socket", onSocket), | |
void 0 === msg.socket && (function(res, callback) { | |
var assignSocket = res.assignSocket; | |
"function" == typeof assignSocket && (res.assignSocket = function(socket) { | |
assignSocket.call(this, socket), callback(socket); | |
}); | |
})(msg, onSocket)); | |
})(msg, attached)), attached.queue.push(listener); | |
})(msg, listener), msg); | |
}, module.exports.isFinished = isFinished; | |
var first = __webpack_require__(545), defer = "function" == typeof setImmediate ? setImmediate : function(fn) { | |
process.nextTick(fn.bind.apply(fn, arguments)); | |
}; | |
function isFinished(msg) { | |
var socket = msg.socket; | |
return "boolean" == typeof msg.finished ? Boolean(msg.finished || socket && !socket.writable) : "boolean" == typeof msg.complete ? Boolean(msg.upgrade || !socket || !socket.readable || msg.complete && !msg.readable) : void 0; | |
} | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = function(value, options) { | |
return "string" == typeof value ? parse(value) : "number" == typeof value ? format(value, options) : null; | |
}, module.exports.format = format, module.exports.parse = parse; | |
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g, formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/, map = { | |
b: 1, | |
kb: 1024, | |
mb: 1 << 20, | |
gb: 1 << 30, | |
tb: Math.pow(1024, 4), | |
pb: Math.pow(1024, 5) | |
}, parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i; | |
function format(value, options) { | |
if (!Number.isFinite(value)) return null; | |
var mag = Math.abs(value), thousandsSeparator = options && options.thousandsSeparator || "", unitSeparator = options && options.unitSeparator || "", decimalPlaces = options && void 0 !== options.decimalPlaces ? options.decimalPlaces : 2, fixedDecimals = Boolean(options && options.fixedDecimals), unit = options && options.unit || ""; | |
unit && map[unit.toLowerCase()] || (unit = mag >= map.pb ? "PB" : mag >= map.tb ? "TB" : mag >= map.gb ? "GB" : mag >= map.mb ? "MB" : mag >= map.kb ? "KB" : "B"); | |
var str = (value / map[unit.toLowerCase()]).toFixed(decimalPlaces); | |
return fixedDecimals || (str = str.replace(formatDecimalsRegExp, "$1")), thousandsSeparator && (str = str.replace(formatThousandsRegExp, thousandsSeparator)), | |
str + unitSeparator + unit; | |
} | |
function parse(val) { | |
if ("number" == typeof val && !isNaN(val)) return val; | |
if ("string" != typeof val) return null; | |
var floatValue, results = parseRegExp.exec(val), unit = "b"; | |
return results ? (floatValue = parseFloat(results[1]), unit = results[4].toLowerCase()) : (floatValue = parseInt(val, 10), | |
unit = "b"), Math.floor(map[unit] * floatValue); | |
} | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var deprecate = __webpack_require__(47)("http-errors"), setPrototypeOf = __webpack_require__(108), statuses = __webpack_require__(109), inherits = __webpack_require__(6), toIdentifier = __webpack_require__(553); | |
function codeClass(status) { | |
return Number(String(status).charAt(0) + "00"); | |
} | |
function nameFunc(func, name) { | |
var desc = Object.getOwnPropertyDescriptor(func, "name"); | |
desc && desc.configurable && (desc.value = name, Object.defineProperty(func, "name", desc)); | |
} | |
module.exports = function createError() { | |
for (var err, msg, status = 500, props = {}, i = 0; i < arguments.length; i++) { | |
var arg = arguments[i]; | |
if (arg instanceof Error) status = (err = arg).status || err.statusCode || status; else switch (typeof arg) { | |
case "string": | |
msg = arg; | |
break; | |
case "number": | |
status = arg, 0 !== i && deprecate("non-first-argument status code; replace with createError(" + arg + ", ...)"); | |
break; | |
case "object": | |
props = arg; | |
} | |
} | |
"number" == typeof status && (status < 400 || status >= 600) && deprecate("non-error status code; use only 4xx or 5xx status codes"), | |
("number" != typeof status || !statuses[status] && (status < 400 || status >= 600)) && (status = 500); | |
var HttpError = createError[status] || createError[codeClass(status)]; | |
for (var key in err || (err = HttpError ? new HttpError(msg) : new Error(msg || statuses[status]), | |
Error.captureStackTrace(err, createError)), HttpError && err instanceof HttpError && err.status === status || (err.expose = status < 500, | |
err.status = err.statusCode = status), props) "status" !== key && "statusCode" !== key && (err[key] = props[key]); | |
return err; | |
}, module.exports.HttpError = (function() { | |
function HttpError() { | |
throw new TypeError("cannot construct abstract class"); | |
} | |
return inherits(HttpError, Error), HttpError; | |
})(), (function(exports, codes, HttpError) { | |
codes.forEach((function(code) { | |
var CodeError, name = toIdentifier(statuses[code]); | |
switch (codeClass(code)) { | |
case 400: | |
CodeError = (function(HttpError, name, code) { | |
var className = name.match(/Error$/) ? name : name + "Error"; | |
function ClientError(message) { | |
var msg = null != message ? message : statuses[code], err = new Error(msg); | |
return Error.captureStackTrace(err, ClientError), setPrototypeOf(err, ClientError.prototype), | |
Object.defineProperty(err, "message", { | |
enumerable: !0, | |
configurable: !0, | |
value: msg, | |
writable: !0 | |
}), Object.defineProperty(err, "name", { | |
enumerable: !1, | |
configurable: !0, | |
value: className, | |
writable: !0 | |
}), err; | |
} | |
return inherits(ClientError, HttpError), nameFunc(ClientError, className), ClientError.prototype.status = code, | |
ClientError.prototype.statusCode = code, ClientError.prototype.expose = !0, ClientError; | |
})(HttpError, name, code); | |
break; | |
case 500: | |
CodeError = (function(HttpError, name, code) { | |
var className = name.match(/Error$/) ? name : name + "Error"; | |
function ServerError(message) { | |
var msg = null != message ? message : statuses[code], err = new Error(msg); | |
return Error.captureStackTrace(err, ServerError), setPrototypeOf(err, ServerError.prototype), | |
Object.defineProperty(err, "message", { | |
enumerable: !0, | |
configurable: !0, | |
value: msg, | |
writable: !0 | |
}), Object.defineProperty(err, "name", { | |
enumerable: !1, | |
configurable: !0, | |
value: className, | |
writable: !0 | |
}), err; | |
} | |
return inherits(ServerError, HttpError), nameFunc(ServerError, className), ServerError.prototype.status = code, | |
ServerError.prototype.statusCode = code, ServerError.prototype.expose = !1, ServerError; | |
})(HttpError, name, code); | |
} | |
CodeError && (exports[code] = CodeError, exports[name] = CodeError); | |
})), exports["I'mateapot"] = deprecate.function(exports.ImATeapot, '"I\'mateapot"; use "ImATeapot" instead'); | |
})(module.exports, statuses.codes, module.exports.HttpError); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var typer = __webpack_require__(555), mime = __webpack_require__(89); | |
function typeis(value, types_) { | |
var i, type, types = types_, val = tryNormalizeType(value); | |
if (!val) return !1; | |
if (types && !Array.isArray(types)) for (types = new Array(arguments.length - 1), | |
i = 0; i < types.length; i++) types[i] = arguments[i + 1]; | |
if (!types || !types.length) return val; | |
for (i = 0; i < types.length; i++) if (mimeMatch(normalize(type = types[i]), val)) return "+" === type[0] || -1 !== type.indexOf("*") ? val : type; | |
return !1; | |
} | |
function hasbody(req) { | |
return void 0 !== req.headers["transfer-encoding"] || !isNaN(req.headers["content-length"]); | |
} | |
function normalize(type) { | |
if ("string" != typeof type) return !1; | |
switch (type) { | |
case "urlencoded": | |
return "application/x-www-form-urlencoded"; | |
case "multipart": | |
return "multipart/*"; | |
} | |
return "+" === type[0] ? "*/*" + type : -1 === type.indexOf("/") ? mime.lookup(type) : type; | |
} | |
function mimeMatch(expected, actual) { | |
if (!1 === expected) return !1; | |
var actualParts = actual.split("/"), expectedParts = expected.split("/"); | |
return 2 === actualParts.length && 2 === expectedParts.length && ("*" === expectedParts[0] || expectedParts[0] === actualParts[0]) && ("*+" === expectedParts[1].substr(0, 2) ? expectedParts[1].length <= actualParts[1].length + 1 && expectedParts[1].substr(1) === actualParts[1].substr(1 - expectedParts[1].length) : "*" === expectedParts[1] || expectedParts[1] === actualParts[1]); | |
} | |
function tryNormalizeType(value) { | |
if (!value) return null; | |
try { | |
return (function(value) { | |
var type = typer.parse(value); | |
return type.parameters = void 0, typer.format(type); | |
})(value); | |
} catch (err) { | |
return null; | |
} | |
} | |
module.exports = function(req, types_) { | |
var types = types_; | |
if (!hasbody(req)) return null; | |
if (arguments.length > 2) { | |
types = new Array(arguments.length - 1); | |
for (var i = 0; i < types.length; i++) types[i] = arguments[i + 1]; | |
} | |
var value = req.headers["content-type"]; | |
return typeis(value, types); | |
}, module.exports.is = typeis, module.exports.hasBody = hasbody, module.exports.normalize = normalize, | |
module.exports.match = mimeMatch; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var extensions, types, preference, db = __webpack_require__(556), extname = __webpack_require__(4).extname, EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/, TEXT_TYPE_REGEXP = /^text\//i; | |
function charset(type) { | |
if (!type || "string" != typeof type) return !1; | |
var match = EXTRACT_TYPE_REGEXP.exec(type), mime = match && db[match[1].toLowerCase()]; | |
return mime && mime.charset ? mime.charset : !(!match || !TEXT_TYPE_REGEXP.test(match[1])) && "UTF-8"; | |
} | |
exports.charset = charset, exports.charsets = { | |
lookup: charset | |
}, exports.contentType = function(str) { | |
if (!str || "string" != typeof str) return !1; | |
var mime = -1 === str.indexOf("/") ? exports.lookup(str) : str; | |
if (!mime) return !1; | |
if (-1 === mime.indexOf("charset")) { | |
var charset = exports.charset(mime); | |
charset && (mime += "; charset=" + charset.toLowerCase()); | |
} | |
return mime; | |
}, exports.extension = function(type) { | |
if (!type || "string" != typeof type) return !1; | |
var match = EXTRACT_TYPE_REGEXP.exec(type), exts = match && exports.extensions[match[1].toLowerCase()]; | |
return !(!exts || !exts.length) && exts[0]; | |
}, exports.extensions = Object.create(null), exports.lookup = function(path) { | |
if (!path || "string" != typeof path) return !1; | |
var extension = extname("x." + path).toLowerCase().substr(1); | |
return extension && exports.types[extension] || !1; | |
}, exports.types = Object.create(null), extensions = exports.extensions, types = exports.types, | |
preference = [ "nginx", "apache", void 0, "iana" ], Object.keys(db).forEach((function(type) { | |
var mime = db[type], exts = mime.extensions; | |
if (exts && exts.length) { | |
extensions[type] = exts; | |
for (var i = 0; i < exts.length; i++) { | |
var extension = exts[i]; | |
if (types[extension]) { | |
var from = preference.indexOf(db[types[extension]].source), to = preference.indexOf(mime.source); | |
if ("application/octet-stream" !== types[extension] && (from > to || from === to && "application/" === types[extension].substr(0, 12))) continue; | |
} | |
types[extension] = type; | |
} | |
} | |
})); | |
}, function(module, exports, __webpack_require__) { | |
var buffer = __webpack_require__(10), Buffer = buffer.Buffer; | |
function copyProps(src, dst) { | |
for (var key in src) dst[key] = src[key]; | |
} | |
function SafeBuffer(arg, encodingOrOffset, length) { | |
return Buffer(arg, encodingOrOffset, length); | |
} | |
Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow ? module.exports = buffer : (copyProps(buffer, exports), | |
exports.Buffer = SafeBuffer), SafeBuffer.prototype = Object.create(Buffer.prototype), | |
copyProps(Buffer, SafeBuffer), SafeBuffer.from = function(arg, encodingOrOffset, length) { | |
if ("number" == typeof arg) throw new TypeError("Argument must not be a number"); | |
return Buffer(arg, encodingOrOffset, length); | |
}, SafeBuffer.alloc = function(size, fill, encoding) { | |
if ("number" != typeof size) throw new TypeError("Argument must be a number"); | |
var buf = Buffer(size); | |
return void 0 !== fill ? "string" == typeof encoding ? buf.fill(fill, encoding) : buf.fill(fill) : buf.fill(0), | |
buf; | |
}, SafeBuffer.allocUnsafe = function(size) { | |
if ("number" != typeof size) throw new TypeError("Argument must be a number"); | |
return Buffer(size); | |
}, SafeBuffer.allocUnsafeSlow = function(size) { | |
if ("number" != typeof size) throw new TypeError("Argument must be a number"); | |
return buffer.SlowBuffer(size); | |
}; | |
}, function(module, exports) { | |
var hat = module.exports = function(bits, base) { | |
if (base || (base = 16), void 0 === bits && (bits = 128), bits <= 0) return "0"; | |
for (var digits = Math.log(Math.pow(2, bits)) / Math.log(base), i = 2; digits === 1 / 0; i *= 2) digits = Math.log(Math.pow(2, bits / i)) / Math.log(base) * i; | |
var rem = digits - Math.floor(digits), res = ""; | |
for (i = 0; i < Math.floor(digits); i++) res = Math.floor(Math.random() * base).toString(base) + res; | |
if (rem) { | |
var b = Math.pow(base, rem); | |
res = Math.floor(Math.random() * b).toString(base) + res; | |
} | |
var parsed = parseInt(res, base); | |
return parsed !== 1 / 0 && parsed >= Math.pow(2, bits) ? hat(bits, base) : res; | |
}; | |
hat.rack = function(bits, base, expandBy) { | |
var fn = function(data) { | |
var iters = 0; | |
do { | |
if (iters++ > 10) { | |
if (!expandBy) throw new Error("too many ID collisions, use more bits"); | |
bits += expandBy; | |
} | |
var id = hat(bits, base); | |
} while (Object.hasOwnProperty.call(hats, id)); | |
return hats[id] = data, id; | |
}, hats = fn.hats = {}; | |
return fn.get = function(id) { | |
return fn.hats[id]; | |
}, fn.set = function(id, value) { | |
return fn.hats[id] = value, fn; | |
}, fn.bits = bits || 128, fn.base = base || 16, fn; | |
}; | |
}, function(module, exports) { | |
module.exports = require("tls"); | |
}, function(module, exports, __webpack_require__) { | |
var stream = __webpack_require__(3), util = __webpack_require__(0), timers = __webpack_require__(117); | |
function createLineStream(readStream, options) { | |
if (!readStream) throw new Error("expected readStream"); | |
if (!readStream.readable) throw new Error("readStream must be readable"); | |
var ls = new LineStream(options); | |
return readStream.pipe(ls), ls; | |
} | |
function LineStream(options) { | |
stream.Transform.call(this, options), options = options || {}, this._readableState.objectMode = !0, | |
this._lineBuffer = [], this._keepEmptyLines = options.keepEmptyLines || !1, this._lastChunkEndedWithCR = !1; | |
var self = this; | |
this.on("pipe", (function(src) { | |
self.encoding || src instanceof stream.Readable && (self.encoding = src._readableState.encoding); | |
})); | |
} | |
module.exports = function(readStream, options) { | |
return module.exports.createStream(readStream, options); | |
}, module.exports.createStream = function(readStream, options) { | |
return readStream ? createLineStream(readStream, options) : new LineStream(options); | |
}, module.exports.createLineStream = function(readStream) { | |
return console.log("WARNING: byline#createLineStream is deprecated and will be removed soon"), | |
createLineStream(readStream); | |
}, module.exports.LineStream = LineStream, util.inherits(LineStream, stream.Transform), | |
LineStream.prototype._transform = function(chunk, encoding, done) { | |
encoding = encoding || "utf8", Buffer.isBuffer(chunk) && ("buffer" == encoding ? (chunk = chunk.toString(), | |
encoding = "utf8") : chunk = chunk.toString(encoding)), this._chunkEncoding = encoding; | |
var lines = chunk.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/g); | |
this._lastChunkEndedWithCR && "\n" == chunk[0] && lines.shift(), this._lineBuffer.length > 0 && (this._lineBuffer[this._lineBuffer.length - 1] += lines[0], | |
lines.shift()), this._lastChunkEndedWithCR = "\r" == chunk[chunk.length - 1], this._lineBuffer = this._lineBuffer.concat(lines), | |
this._pushBuffer(encoding, 1, done); | |
}, LineStream.prototype._pushBuffer = function(encoding, keep, done) { | |
for (;this._lineBuffer.length > keep; ) { | |
var line = this._lineBuffer.shift(); | |
if ((this._keepEmptyLines || line.length > 0) && !this.push(this._reencode(line, encoding))) { | |
var self = this; | |
return void timers.setImmediate((function() { | |
self._pushBuffer(encoding, keep, done); | |
})); | |
} | |
} | |
done(); | |
}, LineStream.prototype._flush = function(done) { | |
this._pushBuffer(this._chunkEncoding, 0, done); | |
}, LineStream.prototype._reencode = function(line, chunkEncoding) { | |
return this.encoding && this.encoding != chunkEncoding ? new Buffer(line, chunkEncoding).toString(this.encoding) : this.encoding ? line : new Buffer(line, chunkEncoding); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var util = __webpack_require__(0), fs = __webpack_require__(2), path = __webpack_require__(4), pkg = __webpack_require__(378), isPositiveInteger = __webpack_require__(368), appPath = __webpack_require__(379); | |
module.exports = (function(appPath, args) { | |
var self = { | |
get serverVersion() { | |
return pkg.version; | |
}, | |
set serverVersion(_) {} | |
}; | |
util._extend(self, void 0); | |
var p = path.join(appPath, "server-settings.json"); | |
return self.extend = function(opts) { | |
util._extend(self, opts); | |
}, self.save = function(cb) { | |
fs.writeFile(p, JSON.stringify(self, null, 4), cb); | |
}, self.load = function() { | |
try { | |
Object.assign(self, JSON.parse(fs.readFileSync(p).toString())), self.save((function() {})); | |
} catch (e) { | |
console.error("Cannot update settings", e.message); | |
} | |
}, self.appPath = appPath, self.cacheRoot = self.hasOwnProperty("cacheRoot") ? self.cacheRoot : appPath, | |
self.cacheSize = process.env.DISABLE_CACHING ? 0 : self.hasOwnProperty("cacheSize") ? self.cacheSize : "android" === process.platform ? 0 : 2147483648, | |
self.btMaxConnections = isPositiveInteger(self.btMaxConnections) ? self.btMaxConnections : 55, | |
self.btHandshakeTimeout = isPositiveInteger(self.btHandshakeTimeout) ? self.btHandshakeTimeout : 2e4, | |
self.btRequestTimeout = isPositiveInteger(self.btRequestTimeout || self.btConnectionTimeout) ? self.btRequestTimeout : 4e3, | |
self.btDownloadSpeedSoftLimit = isPositiveInteger(self.btDownloadSpeedSoftLimit) ? self.btDownloadSpeedSoftLimit : 2621440, | |
self.btDownloadSpeedHardLimit = isPositiveInteger(self.btDownloadSpeedHardLimit) ? self.btDownloadSpeedHardLimit : 3670016, | |
self.btMinPeersForStable = isPositiveInteger(self.btMinPeersForStable) ? self.btMinPeersForStable : 5, | |
self.remoteHttps = "string" == typeof self.remoteHttps ? self.remoteHttps : "", | |
self.localAddonEnabled = !!self.hasOwnProperty("localAddonEnabled") && self.localAddonEnabled, | |
self.transcodeHorsepower = self.transcodeHorsepower ? self.transcodeHorsepower : .75, | |
self.transcodeMaxBitRate = isPositiveInteger(self.transcodeMaxBitRate) ? self.transcodeMaxBitRate : 0, | |
self.transcodeConcurrency = isPositiveInteger(self.transcodeConcurrency) ? self.transcodeConcurrency : 1, | |
self.transcodeTrackConcurrency = isPositiveInteger(self.transcodeTrackConcurrency) ? self.transcodeTrackConcurrency : 1, | |
self.transcodeHardwareAccel = !self.hasOwnProperty("transcodeHardwareAccel") || self.transcodeHardwareAccel, | |
self.transcodeProfile = self.hasOwnProperty("transcodeProfile") ? self.transcodeProfile : null, | |
self.allTranscodeProfiles = [], self.transcodeMaxWidth = self.hasOwnProperty("transcodeMaxWidth") ? self.transcodeMaxWidth : 1920, | |
self.load(), self; | |
})(appPath); | |
}, function(module, exports, __webpack_require__) { | |
const miniget = __webpack_require__(146); | |
exports.between = (haystack, left, right) => { | |
let pos; | |
if (left instanceof RegExp) { | |
const match = haystack.match(left); | |
if (!match) return ""; | |
pos = match.index + match[0].length; | |
} else { | |
if (pos = haystack.indexOf(left), -1 === pos) return ""; | |
pos += left.length; | |
} | |
return pos = (haystack = haystack.slice(pos)).indexOf(right), -1 === pos ? "" : haystack = haystack.slice(0, pos); | |
}, exports.parseAbbreviatedNumber = string => { | |
const match = string.replace(",", ".").replace(" ", "").match(/([\d,.]+)([MK]?)/); | |
if (match) { | |
let [, num, multi] = match; | |
return num = parseFloat(num), Math.round("M" === multi ? 1e6 * num : "K" === multi ? 1e3 * num : num); | |
} | |
return null; | |
}, exports.cutAfterJSON = mixedJson => { | |
let open, close; | |
if ("[" === mixedJson[0] ? (open = "[", close = "]") : "{" === mixedJson[0] && (open = "{", | |
close = "}"), !open) throw new Error(`Can't cut unsupported JSON (need to begin with [ or { ) but got: ${mixedJson[0]}`); | |
let i, isString = !1, isEscaped = !1, counter = 0; | |
for (i = 0; i < mixedJson.length; i++) if ('"' !== mixedJson[i] || isEscaped) { | |
if (isEscaped = "\\" === mixedJson[i] && !isEscaped, !isString && (mixedJson[i] === open ? counter++ : mixedJson[i] === close && counter--, | |
0 === counter)) return mixedJson.substr(0, i + 1); | |
} else isString = !isString; | |
throw Error("Can't cut unsupported JSON (no matching closing bracket found)"); | |
}, exports.playError = (player_response, statuses, ErrorType = Error) => { | |
let playability = player_response && player_response.playabilityStatus; | |
return playability && statuses.includes(playability.status) ? new ErrorType(playability.reason || playability.messages && playability.messages[0]) : null; | |
}, exports.exposedMiniget = (url, options = {}, requestOptionsOverwrite) => { | |
const req = miniget(url, requestOptionsOverwrite || options.requestOptions); | |
return "function" == typeof options.requestCallback && options.requestCallback(req), | |
req; | |
}, exports.deprecate = (obj, prop, value, oldPath, newPath) => { | |
Object.defineProperty(obj, prop, { | |
get: () => (console.warn(`\`${oldPath}\` will be removed in a near future release, use \`${newPath}\` instead.`), | |
value) | |
}); | |
}; | |
const pkg = __webpack_require__(434); | |
exports.lastUpdateCheck = 0, exports.checkForUpdates = () => !process.env.YTDL_NO_UPDATE && !pkg.version.startsWith("0.0.0-") && Date.now() - exports.lastUpdateCheck >= 432e5 ? (exports.lastUpdateCheck = Date.now(), | |
miniget("https://api.github.com/repos/fent/node-ytdl-core/releases/latest", { | |
headers: { | |
"User-Agent": "ytdl-core" | |
} | |
}).text().then((response => { | |
JSON.parse(response).tag_name !== `v${pkg.version}` && console.warn('[33mWARNING:[0m ytdl-core is out of date! Update with "npm install ytdl-core@latest".'); | |
}), (err => { | |
console.warn("Error checking for updates:", err.message), console.warn("You can disable this check by setting the `YTDL_NO_UPDATE` env variable."); | |
}))) : null; | |
}, function(module, exports, __webpack_require__) { | |
try { | |
var util = __webpack_require__(0); | |
if ("function" != typeof util.inherits) throw ""; | |
module.exports = util.inherits; | |
} catch (e) { | |
module.exports = __webpack_require__(962); | |
} | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Fingerprint; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(30), crypto = __webpack_require__(9), errs = __webpack_require__(44), Key = __webpack_require__(25), PrivateKey = __webpack_require__(27), Certificate = __webpack_require__(102), utils = __webpack_require__(26), FingerprintFormatError = errs.FingerprintFormatError, InvalidAlgorithmError = errs.InvalidAlgorithmError; | |
function Fingerprint(opts) { | |
if (assert.object(opts, "options"), assert.string(opts.type, "options.type"), assert.buffer(opts.hash, "options.hash"), | |
assert.string(opts.algorithm, "options.algorithm"), this.algorithm = opts.algorithm.toLowerCase(), | |
!0 !== algs.hashAlgs[this.algorithm]) throw new InvalidAlgorithmError(this.algorithm); | |
this.hash = opts.hash, this.type = opts.type, this.hashType = opts.hashType; | |
} | |
Fingerprint.prototype.toString = function(format) { | |
switch (void 0 === format && (format = "md5" === this.algorithm || "spki" === this.hashType ? "hex" : "base64"), | |
assert.string(format), format) { | |
case "hex": | |
return "spki" === this.hashType ? this.hash.toString("hex") : this.hash.toString("hex").replace(/(.{2})(?=.)/g, "$1:"); | |
case "base64": | |
return "spki" === this.hashType ? this.hash.toString("base64") : (alg = this.algorithm, | |
h = this.hash.toString("base64"), alg.toUpperCase() + ":" + h.replace(/=*$/, "")); | |
default: | |
throw new FingerprintFormatError(void 0, format); | |
} | |
var alg, h; | |
}, Fingerprint.prototype.matches = function(other) { | |
assert.object(other, "key or certificate"), "key" === this.type && "ssh" !== this.hashType ? (utils.assertCompatible(other, Key, [ 1, 7 ], "key with spki"), | |
PrivateKey.isPrivateKey(other) && utils.assertCompatible(other, PrivateKey, [ 1, 6 ], "privatekey with spki support")) : "key" === this.type ? utils.assertCompatible(other, Key, [ 1, 0 ], "key") : utils.assertCompatible(other, Certificate, [ 1, 0 ], "certificate"); | |
var theirHash = other.hash(this.algorithm, this.hashType), theirHash2 = crypto.createHash(this.algorithm).update(theirHash).digest("base64"); | |
return void 0 === this.hash2 && (this.hash2 = crypto.createHash(this.algorithm).update(this.hash).digest("base64")), | |
this.hash2 === theirHash2; | |
}; | |
var base64RE = /^[A-Za-z0-9+\/=]+$/, hexRE = /^[a-fA-F0-9]+$/; | |
Fingerprint.parse = function(fp, options) { | |
var alg, hash, enAlgs; | |
assert.string(fp, "fingerprint"), Array.isArray(options) && (enAlgs = options, options = {}), | |
assert.optionalObject(options, "options"), void 0 === options && (options = {}), | |
void 0 !== options.enAlgs && (enAlgs = options.enAlgs), void 0 !== options.algorithms && (enAlgs = options.algorithms), | |
assert.optionalArrayOfString(enAlgs, "algorithms"); | |
var hashType = "ssh"; | |
void 0 !== options.hashType && (hashType = options.hashType), assert.string(hashType, "options.hashType"); | |
var parts = fp.split(":"); | |
if (2 == parts.length) { | |
if (alg = parts[0].toLowerCase(), !base64RE.test(parts[1])) throw new FingerprintFormatError(fp); | |
try { | |
hash = Buffer.from(parts[1], "base64"); | |
} catch (e) { | |
throw new FingerprintFormatError(fp); | |
} | |
} else if (parts.length > 2) { | |
if (alg = "md5", "md5" === parts[0].toLowerCase() && (parts = parts.slice(1)), parts = (parts = parts.map((function(p) { | |
for (;p.length < 2; ) p = "0" + p; | |
if (p.length > 2) throw new FingerprintFormatError(fp); | |
return p; | |
}))).join(""), !hexRE.test(parts) || parts.length % 2 != 0) throw new FingerprintFormatError(fp); | |
try { | |
hash = Buffer.from(parts, "hex"); | |
} catch (e) { | |
throw new FingerprintFormatError(fp); | |
} | |
} else { | |
if (hexRE.test(fp)) hash = Buffer.from(fp, "hex"); else { | |
if (!base64RE.test(fp)) throw new FingerprintFormatError(fp); | |
hash = Buffer.from(fp, "base64"); | |
} | |
switch (hash.length) { | |
case 32: | |
alg = "sha256"; | |
break; | |
case 16: | |
alg = "md5"; | |
break; | |
case 20: | |
alg = "sha1"; | |
break; | |
case 64: | |
alg = "sha512"; | |
break; | |
default: | |
throw new FingerprintFormatError(fp); | |
} | |
void 0 === options.hashType && (hashType = "spki"); | |
} | |
if (void 0 === alg) throw new FingerprintFormatError(fp); | |
if (void 0 === algs.hashAlgs[alg]) throw new InvalidAlgorithmError(alg); | |
if (void 0 !== enAlgs && -1 === (enAlgs = enAlgs.map((function(a) { | |
return a.toLowerCase(); | |
}))).indexOf(alg)) throw new InvalidAlgorithmError(alg); | |
return new Fingerprint({ | |
algorithm: alg, | |
hash: hash, | |
type: options.type || "key", | |
hashType: hashType | |
}); | |
}, Fingerprint.isFingerprint = function(obj, ver) { | |
return utils.isCompatible(obj, Fingerprint, ver); | |
}, Fingerprint.prototype._sshpkApiVersion = [ 1, 2 ], Fingerprint._oldVersionDetect = function(obj) { | |
return assert.func(obj.toString), assert.func(obj.matches), [ 1, 0 ]; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var dbits; | |
function BigInteger(a, b, c) { | |
null != a && ("number" == typeof a ? this.fromNumber(a, b, c) : null == b && "string" != typeof a ? this.fromString(a, 256) : this.fromString(a, b)); | |
} | |
function nbi() { | |
return new BigInteger(null); | |
} | |
var inBrowser = "undefined" != typeof navigator; | |
inBrowser && "Microsoft Internet Explorer" == navigator.appName ? (BigInteger.prototype.am = function(i, x, w, j, c, n) { | |
for (var xl = 32767 & x, xh = x >> 15; --n >= 0; ) { | |
var l = 32767 & this[i], h = this[i++] >> 15, m = xh * l + h * xl; | |
c = ((l = xl * l + ((32767 & m) << 15) + w[j] + (1073741823 & c)) >>> 30) + (m >>> 15) + xh * h + (c >>> 30), | |
w[j++] = 1073741823 & l; | |
} | |
return c; | |
}, dbits = 30) : inBrowser && "Netscape" != navigator.appName ? (BigInteger.prototype.am = function(i, x, w, j, c, n) { | |
for (;--n >= 0; ) { | |
var v = x * this[i++] + w[j] + c; | |
c = Math.floor(v / 67108864), w[j++] = 67108863 & v; | |
} | |
return c; | |
}, dbits = 26) : (BigInteger.prototype.am = function(i, x, w, j, c, n) { | |
for (var xl = 16383 & x, xh = x >> 14; --n >= 0; ) { | |
var l = 16383 & this[i], h = this[i++] >> 14, m = xh * l + h * xl; | |
c = ((l = xl * l + ((16383 & m) << 14) + w[j] + c) >> 28) + (m >> 14) + xh * h, | |
w[j++] = 268435455 & l; | |
} | |
return c; | |
}, dbits = 28), BigInteger.prototype.DB = dbits, BigInteger.prototype.DM = (1 << dbits) - 1, | |
BigInteger.prototype.DV = 1 << dbits, BigInteger.prototype.FV = Math.pow(2, 52), | |
BigInteger.prototype.F1 = 52 - dbits, BigInteger.prototype.F2 = 2 * dbits - 52; | |
var rr, vv, BI_RC = new Array; | |
for (rr = "0".charCodeAt(0), vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv; | |
for (rr = "a".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; | |
for (rr = "A".charCodeAt(0), vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv; | |
function int2char(n) { | |
return "0123456789abcdefghijklmnopqrstuvwxyz".charAt(n); | |
} | |
function intAt(s, i) { | |
var c = BI_RC[s.charCodeAt(i)]; | |
return null == c ? -1 : c; | |
} | |
function nbv(i) { | |
var r = nbi(); | |
return r.fromInt(i), r; | |
} | |
function nbits(x) { | |
var t, r = 1; | |
return 0 != (t = x >>> 16) && (x = t, r += 16), 0 != (t = x >> 8) && (x = t, r += 8), | |
0 != (t = x >> 4) && (x = t, r += 4), 0 != (t = x >> 2) && (x = t, r += 2), 0 != (t = x >> 1) && (x = t, | |
r += 1), r; | |
} | |
function Classic(m) { | |
this.m = m; | |
} | |
function Montgomery(m) { | |
this.m = m, this.mp = m.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, | |
this.um = (1 << m.DB - 15) - 1, this.mt2 = 2 * m.t; | |
} | |
function op_and(x, y) { | |
return x & y; | |
} | |
function op_or(x, y) { | |
return x | y; | |
} | |
function op_xor(x, y) { | |
return x ^ y; | |
} | |
function op_andnot(x, y) { | |
return x & ~y; | |
} | |
function lbit(x) { | |
if (0 == x) return -1; | |
var r = 0; | |
return 0 == (65535 & x) && (x >>= 16, r += 16), 0 == (255 & x) && (x >>= 8, r += 8), | |
0 == (15 & x) && (x >>= 4, r += 4), 0 == (3 & x) && (x >>= 2, r += 2), 0 == (1 & x) && ++r, | |
r; | |
} | |
function cbit(x) { | |
for (var r = 0; 0 != x; ) x &= x - 1, ++r; | |
return r; | |
} | |
function NullExp() {} | |
function nNop(x) { | |
return x; | |
} | |
function Barrett(m) { | |
this.r2 = nbi(), this.q3 = nbi(), BigInteger.ONE.dlShiftTo(2 * m.t, this.r2), this.mu = this.r2.divide(m), | |
this.m = m; | |
} | |
Classic.prototype.convert = function(x) { | |
return x.s < 0 || x.compareTo(this.m) >= 0 ? x.mod(this.m) : x; | |
}, Classic.prototype.revert = function(x) { | |
return x; | |
}, Classic.prototype.reduce = function(x) { | |
x.divRemTo(this.m, null, x); | |
}, Classic.prototype.mulTo = function(x, y, r) { | |
x.multiplyTo(y, r), this.reduce(r); | |
}, Classic.prototype.sqrTo = function(x, r) { | |
x.squareTo(r), this.reduce(r); | |
}, Montgomery.prototype.convert = function(x) { | |
var r = nbi(); | |
return x.abs().dlShiftTo(this.m.t, r), r.divRemTo(this.m, null, r), x.s < 0 && r.compareTo(BigInteger.ZERO) > 0 && this.m.subTo(r, r), | |
r; | |
}, Montgomery.prototype.revert = function(x) { | |
var r = nbi(); | |
return x.copyTo(r), this.reduce(r), r; | |
}, Montgomery.prototype.reduce = function(x) { | |
for (;x.t <= this.mt2; ) x[x.t++] = 0; | |
for (var i = 0; i < this.m.t; ++i) { | |
var j = 32767 & x[i], u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM; | |
for (x[j = i + this.m.t] += this.m.am(0, u0, x, i, 0, this.m.t); x[j] >= x.DV; ) x[j] -= x.DV, | |
x[++j]++; | |
} | |
x.clamp(), x.drShiftTo(this.m.t, x), x.compareTo(this.m) >= 0 && x.subTo(this.m, x); | |
}, Montgomery.prototype.mulTo = function(x, y, r) { | |
x.multiplyTo(y, r), this.reduce(r); | |
}, Montgomery.prototype.sqrTo = function(x, r) { | |
x.squareTo(r), this.reduce(r); | |
}, BigInteger.prototype.copyTo = function(r) { | |
for (var i = this.t - 1; i >= 0; --i) r[i] = this[i]; | |
r.t = this.t, r.s = this.s; | |
}, BigInteger.prototype.fromInt = function(x) { | |
this.t = 1, this.s = x < 0 ? -1 : 0, x > 0 ? this[0] = x : x < -1 ? this[0] = x + this.DV : this.t = 0; | |
}, BigInteger.prototype.fromString = function(s, b) { | |
var k; | |
if (16 == b) k = 4; else if (8 == b) k = 3; else if (256 == b) k = 8; else if (2 == b) k = 1; else if (32 == b) k = 5; else { | |
if (4 != b) return void this.fromRadix(s, b); | |
k = 2; | |
} | |
this.t = 0, this.s = 0; | |
for (var i = s.length, mi = !1, sh = 0; --i >= 0; ) { | |
var x = 8 == k ? 255 & s[i] : intAt(s, i); | |
x < 0 ? "-" == s.charAt(i) && (mi = !0) : (mi = !1, 0 == sh ? this[this.t++] = x : sh + k > this.DB ? (this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh, | |
this[this.t++] = x >> this.DB - sh) : this[this.t - 1] |= x << sh, (sh += k) >= this.DB && (sh -= this.DB)); | |
} | |
8 == k && 0 != (128 & s[0]) && (this.s = -1, sh > 0 && (this[this.t - 1] |= (1 << this.DB - sh) - 1 << sh)), | |
this.clamp(), mi && BigInteger.ZERO.subTo(this, this); | |
}, BigInteger.prototype.clamp = function() { | |
for (var c = this.s & this.DM; this.t > 0 && this[this.t - 1] == c; ) --this.t; | |
}, BigInteger.prototype.dlShiftTo = function(n, r) { | |
var i; | |
for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i]; | |
for (i = n - 1; i >= 0; --i) r[i] = 0; | |
r.t = this.t + n, r.s = this.s; | |
}, BigInteger.prototype.drShiftTo = function(n, r) { | |
for (var i = n; i < this.t; ++i) r[i - n] = this[i]; | |
r.t = Math.max(this.t - n, 0), r.s = this.s; | |
}, BigInteger.prototype.lShiftTo = function(n, r) { | |
var i, bs = n % this.DB, cbs = this.DB - bs, bm = (1 << cbs) - 1, ds = Math.floor(n / this.DB), c = this.s << bs & this.DM; | |
for (i = this.t - 1; i >= 0; --i) r[i + ds + 1] = this[i] >> cbs | c, c = (this[i] & bm) << bs; | |
for (i = ds - 1; i >= 0; --i) r[i] = 0; | |
r[ds] = c, r.t = this.t + ds + 1, r.s = this.s, r.clamp(); | |
}, BigInteger.prototype.rShiftTo = function(n, r) { | |
r.s = this.s; | |
var ds = Math.floor(n / this.DB); | |
if (ds >= this.t) r.t = 0; else { | |
var bs = n % this.DB, cbs = this.DB - bs, bm = (1 << bs) - 1; | |
r[0] = this[ds] >> bs; | |
for (var i = ds + 1; i < this.t; ++i) r[i - ds - 1] |= (this[i] & bm) << cbs, r[i - ds] = this[i] >> bs; | |
bs > 0 && (r[this.t - ds - 1] |= (this.s & bm) << cbs), r.t = this.t - ds, r.clamp(); | |
} | |
}, BigInteger.prototype.subTo = function(a, r) { | |
for (var i = 0, c = 0, m = Math.min(a.t, this.t); i < m; ) c += this[i] - a[i], | |
r[i++] = c & this.DM, c >>= this.DB; | |
if (a.t < this.t) { | |
for (c -= a.s; i < this.t; ) c += this[i], r[i++] = c & this.DM, c >>= this.DB; | |
c += this.s; | |
} else { | |
for (c += this.s; i < a.t; ) c -= a[i], r[i++] = c & this.DM, c >>= this.DB; | |
c -= a.s; | |
} | |
r.s = c < 0 ? -1 : 0, c < -1 ? r[i++] = this.DV + c : c > 0 && (r[i++] = c), r.t = i, | |
r.clamp(); | |
}, BigInteger.prototype.multiplyTo = function(a, r) { | |
var x = this.abs(), y = a.abs(), i = x.t; | |
for (r.t = i + y.t; --i >= 0; ) r[i] = 0; | |
for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t); | |
r.s = 0, r.clamp(), this.s != a.s && BigInteger.ZERO.subTo(r, r); | |
}, BigInteger.prototype.squareTo = function(r) { | |
for (var x = this.abs(), i = r.t = 2 * x.t; --i >= 0; ) r[i] = 0; | |
for (i = 0; i < x.t - 1; ++i) { | |
var c = x.am(i, x[i], r, 2 * i, 0, 1); | |
(r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV && (r[i + x.t] -= x.DV, | |
r[i + x.t + 1] = 1); | |
} | |
r.t > 0 && (r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1)), r.s = 0, r.clamp(); | |
}, BigInteger.prototype.divRemTo = function(m, q, r) { | |
var pm = m.abs(); | |
if (!(pm.t <= 0)) { | |
var pt = this.abs(); | |
if (pt.t < pm.t) return null != q && q.fromInt(0), void (null != r && this.copyTo(r)); | |
null == r && (r = nbi()); | |
var y = nbi(), ts = this.s, ms = m.s, nsh = this.DB - nbits(pm[pm.t - 1]); | |
nsh > 0 ? (pm.lShiftTo(nsh, y), pt.lShiftTo(nsh, r)) : (pm.copyTo(y), pt.copyTo(r)); | |
var ys = y.t, y0 = y[ys - 1]; | |
if (0 != y0) { | |
var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0), d1 = this.FV / yt, d2 = (1 << this.F1) / yt, e = 1 << this.F2, i = r.t, j = i - ys, t = null == q ? nbi() : q; | |
for (y.dlShiftTo(j, t), r.compareTo(t) >= 0 && (r[r.t++] = 1, r.subTo(t, r)), BigInteger.ONE.dlShiftTo(ys, t), | |
t.subTo(y, y); y.t < ys; ) y[y.t++] = 0; | |
for (;--j >= 0; ) { | |
var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2); | |
if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) for (y.dlShiftTo(j, t), r.subTo(t, r); r[i] < --qd; ) r.subTo(t, r); | |
} | |
null != q && (r.drShiftTo(ys, q), ts != ms && BigInteger.ZERO.subTo(q, q)), r.t = ys, | |
r.clamp(), nsh > 0 && r.rShiftTo(nsh, r), ts < 0 && BigInteger.ZERO.subTo(r, r); | |
} | |
} | |
}, BigInteger.prototype.invDigit = function() { | |
if (this.t < 1) return 0; | |
var x = this[0]; | |
if (0 == (1 & x)) return 0; | |
var y = 3 & x; | |
return (y = (y = (y = (y = y * (2 - (15 & x) * y) & 15) * (2 - (255 & x) * y) & 255) * (2 - ((65535 & x) * y & 65535)) & 65535) * (2 - x * y % this.DV) % this.DV) > 0 ? this.DV - y : -y; | |
}, BigInteger.prototype.isEven = function() { | |
return 0 == (this.t > 0 ? 1 & this[0] : this.s); | |
}, BigInteger.prototype.exp = function(e, z) { | |
if (e > 4294967295 || e < 1) return BigInteger.ONE; | |
var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e) - 1; | |
for (g.copyTo(r); --i >= 0; ) if (z.sqrTo(r, r2), (e & 1 << i) > 0) z.mulTo(r2, g, r); else { | |
var t = r; | |
r = r2, r2 = t; | |
} | |
return z.revert(r); | |
}, BigInteger.prototype.toString = function(b) { | |
if (this.s < 0) return "-" + this.negate().toString(b); | |
var k; | |
if (16 == b) k = 4; else if (8 == b) k = 3; else if (2 == b) k = 1; else if (32 == b) k = 5; else { | |
if (4 != b) return this.toRadix(b); | |
k = 2; | |
} | |
var d, km = (1 << k) - 1, m = !1, r = "", i = this.t, p = this.DB - i * this.DB % k; | |
if (i-- > 0) for (p < this.DB && (d = this[i] >> p) > 0 && (m = !0, r = int2char(d)); i >= 0; ) p < k ? (d = (this[i] & (1 << p) - 1) << k - p, | |
d |= this[--i] >> (p += this.DB - k)) : (d = this[i] >> (p -= k) & km, p <= 0 && (p += this.DB, | |
--i)), d > 0 && (m = !0), m && (r += int2char(d)); | |
return m ? r : "0"; | |
}, BigInteger.prototype.negate = function() { | |
var r = nbi(); | |
return BigInteger.ZERO.subTo(this, r), r; | |
}, BigInteger.prototype.abs = function() { | |
return this.s < 0 ? this.negate() : this; | |
}, BigInteger.prototype.compareTo = function(a) { | |
var r = this.s - a.s; | |
if (0 != r) return r; | |
var i = this.t; | |
if (0 != (r = i - a.t)) return this.s < 0 ? -r : r; | |
for (;--i >= 0; ) if (0 != (r = this[i] - a[i])) return r; | |
return 0; | |
}, BigInteger.prototype.bitLength = function() { | |
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM); | |
}, BigInteger.prototype.mod = function(a) { | |
var r = nbi(); | |
return this.abs().divRemTo(a, null, r), this.s < 0 && r.compareTo(BigInteger.ZERO) > 0 && a.subTo(r, r), | |
r; | |
}, BigInteger.prototype.modPowInt = function(e, m) { | |
var z; | |
return z = e < 256 || m.isEven() ? new Classic(m) : new Montgomery(m), this.exp(e, z); | |
}, BigInteger.ZERO = nbv(0), BigInteger.ONE = nbv(1), NullExp.prototype.convert = nNop, | |
NullExp.prototype.revert = nNop, NullExp.prototype.mulTo = function(x, y, r) { | |
x.multiplyTo(y, r); | |
}, NullExp.prototype.sqrTo = function(x, r) { | |
x.squareTo(r); | |
}, Barrett.prototype.convert = function(x) { | |
if (x.s < 0 || x.t > 2 * this.m.t) return x.mod(this.m); | |
if (x.compareTo(this.m) < 0) return x; | |
var r = nbi(); | |
return x.copyTo(r), this.reduce(r), r; | |
}, Barrett.prototype.revert = function(x) { | |
return x; | |
}, Barrett.prototype.reduce = function(x) { | |
for (x.drShiftTo(this.m.t - 1, this.r2), x.t > this.m.t + 1 && (x.t = this.m.t + 1, | |
x.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); x.compareTo(this.r2) < 0; ) x.dAddOffset(1, this.m.t + 1); | |
for (x.subTo(this.r2, x); x.compareTo(this.m) >= 0; ) x.subTo(this.m, x); | |
}, Barrett.prototype.mulTo = function(x, y, r) { | |
x.multiplyTo(y, r), this.reduce(r); | |
}, Barrett.prototype.sqrTo = function(x, r) { | |
x.squareTo(r), this.reduce(r); | |
}; | |
var rng_state, rng_pool, rng_pptr, lowprimes = [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997 ], lplim = (1 << 26) / lowprimes[lowprimes.length - 1]; | |
function rng_seed_time() { | |
var x; | |
x = (new Date).getTime(), rng_pool[rng_pptr++] ^= 255 & x, rng_pool[rng_pptr++] ^= x >> 8 & 255, | |
rng_pool[rng_pptr++] ^= x >> 16 & 255, rng_pool[rng_pptr++] ^= x >> 24 & 255, rng_pptr >= rng_psize && (rng_pptr -= rng_psize); | |
} | |
if (BigInteger.prototype.chunkSize = function(r) { | |
return Math.floor(Math.LN2 * this.DB / Math.log(r)); | |
}, BigInteger.prototype.toRadix = function(b) { | |
if (null == b && (b = 10), 0 == this.signum() || b < 2 || b > 36) return "0"; | |
var cs = this.chunkSize(b), a = Math.pow(b, cs), d = nbv(a), y = nbi(), z = nbi(), r = ""; | |
for (this.divRemTo(d, y, z); y.signum() > 0; ) r = (a + z.intValue()).toString(b).substr(1) + r, | |
y.divRemTo(d, y, z); | |
return z.intValue().toString(b) + r; | |
}, BigInteger.prototype.fromRadix = function(s, b) { | |
this.fromInt(0), null == b && (b = 10); | |
for (var cs = this.chunkSize(b), d = Math.pow(b, cs), mi = !1, j = 0, w = 0, i = 0; i < s.length; ++i) { | |
var x = intAt(s, i); | |
x < 0 ? "-" == s.charAt(i) && 0 == this.signum() && (mi = !0) : (w = b * w + x, | |
++j >= cs && (this.dMultiply(d), this.dAddOffset(w, 0), j = 0, w = 0)); | |
} | |
j > 0 && (this.dMultiply(Math.pow(b, j)), this.dAddOffset(w, 0)), mi && BigInteger.ZERO.subTo(this, this); | |
}, BigInteger.prototype.fromNumber = function(a, b, c) { | |
if ("number" == typeof b) if (a < 2) this.fromInt(1); else for (this.fromNumber(a, c), | |
this.testBit(a - 1) || this.bitwiseTo(BigInteger.ONE.shiftLeft(a - 1), op_or, this), | |
this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(b); ) this.dAddOffset(2, 0), | |
this.bitLength() > a && this.subTo(BigInteger.ONE.shiftLeft(a - 1), this); else { | |
var x = new Array, t = 7 & a; | |
x.length = 1 + (a >> 3), b.nextBytes(x), t > 0 ? x[0] &= (1 << t) - 1 : x[0] = 0, | |
this.fromString(x, 256); | |
} | |
}, BigInteger.prototype.bitwiseTo = function(a, op, r) { | |
var i, f, m = Math.min(a.t, this.t); | |
for (i = 0; i < m; ++i) r[i] = op(this[i], a[i]); | |
if (a.t < this.t) { | |
for (f = a.s & this.DM, i = m; i < this.t; ++i) r[i] = op(this[i], f); | |
r.t = this.t; | |
} else { | |
for (f = this.s & this.DM, i = m; i < a.t; ++i) r[i] = op(f, a[i]); | |
r.t = a.t; | |
} | |
r.s = op(this.s, a.s), r.clamp(); | |
}, BigInteger.prototype.changeBit = function(n, op) { | |
var r = BigInteger.ONE.shiftLeft(n); | |
return this.bitwiseTo(r, op, r), r; | |
}, BigInteger.prototype.addTo = function(a, r) { | |
for (var i = 0, c = 0, m = Math.min(a.t, this.t); i < m; ) c += this[i] + a[i], | |
r[i++] = c & this.DM, c >>= this.DB; | |
if (a.t < this.t) { | |
for (c += a.s; i < this.t; ) c += this[i], r[i++] = c & this.DM, c >>= this.DB; | |
c += this.s; | |
} else { | |
for (c += this.s; i < a.t; ) c += a[i], r[i++] = c & this.DM, c >>= this.DB; | |
c += a.s; | |
} | |
r.s = c < 0 ? -1 : 0, c > 0 ? r[i++] = c : c < -1 && (r[i++] = this.DV + c), r.t = i, | |
r.clamp(); | |
}, BigInteger.prototype.dMultiply = function(n) { | |
this[this.t] = this.am(0, n - 1, this, 0, 0, this.t), ++this.t, this.clamp(); | |
}, BigInteger.prototype.dAddOffset = function(n, w) { | |
if (0 != n) { | |
for (;this.t <= w; ) this[this.t++] = 0; | |
for (this[w] += n; this[w] >= this.DV; ) this[w] -= this.DV, ++w >= this.t && (this[this.t++] = 0), | |
++this[w]; | |
} | |
}, BigInteger.prototype.multiplyLowerTo = function(a, n, r) { | |
var j, i = Math.min(this.t + a.t, n); | |
for (r.s = 0, r.t = i; i > 0; ) r[--i] = 0; | |
for (j = r.t - this.t; i < j; ++i) r[i + this.t] = this.am(0, a[i], r, i, 0, this.t); | |
for (j = Math.min(a.t, n); i < j; ++i) this.am(0, a[i], r, i, 0, n - i); | |
r.clamp(); | |
}, BigInteger.prototype.multiplyUpperTo = function(a, n, r) { | |
--n; | |
var i = r.t = this.t + a.t - n; | |
for (r.s = 0; --i >= 0; ) r[i] = 0; | |
for (i = Math.max(n - this.t, 0); i < a.t; ++i) r[this.t + i - n] = this.am(n - i, a[i], r, 0, 0, this.t + i - n); | |
r.clamp(), r.drShiftTo(1, r); | |
}, BigInteger.prototype.modInt = function(n) { | |
if (n <= 0) return 0; | |
var d = this.DV % n, r = this.s < 0 ? n - 1 : 0; | |
if (this.t > 0) if (0 == d) r = this[0] % n; else for (var i = this.t - 1; i >= 0; --i) r = (d * r + this[i]) % n; | |
return r; | |
}, BigInteger.prototype.millerRabin = function(t) { | |
var n1 = this.subtract(BigInteger.ONE), k = n1.getLowestSetBit(); | |
if (k <= 0) return !1; | |
var r = n1.shiftRight(k); | |
(t = t + 1 >> 1) > lowprimes.length && (t = lowprimes.length); | |
for (var a = nbi(), i = 0; i < t; ++i) { | |
a.fromInt(lowprimes[Math.floor(Math.random() * lowprimes.length)]); | |
var y = a.modPow(r, this); | |
if (0 != y.compareTo(BigInteger.ONE) && 0 != y.compareTo(n1)) { | |
for (var j = 1; j++ < k && 0 != y.compareTo(n1); ) if (0 == (y = y.modPowInt(2, this)).compareTo(BigInteger.ONE)) return !1; | |
if (0 != y.compareTo(n1)) return !1; | |
} | |
} | |
return !0; | |
}, BigInteger.prototype.clone = function() { | |
var r = nbi(); | |
return this.copyTo(r), r; | |
}, BigInteger.prototype.intValue = function() { | |
if (this.s < 0) { | |
if (1 == this.t) return this[0] - this.DV; | |
if (0 == this.t) return -1; | |
} else { | |
if (1 == this.t) return this[0]; | |
if (0 == this.t) return 0; | |
} | |
return (this[1] & (1 << 32 - this.DB) - 1) << this.DB | this[0]; | |
}, BigInteger.prototype.byteValue = function() { | |
return 0 == this.t ? this.s : this[0] << 24 >> 24; | |
}, BigInteger.prototype.shortValue = function() { | |
return 0 == this.t ? this.s : this[0] << 16 >> 16; | |
}, BigInteger.prototype.signum = function() { | |
return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this[0] <= 0 ? 0 : 1; | |
}, BigInteger.prototype.toByteArray = function() { | |
var i = this.t, r = new Array; | |
r[0] = this.s; | |
var d, p = this.DB - i * this.DB % 8, k = 0; | |
if (i-- > 0) for (p < this.DB && (d = this[i] >> p) != (this.s & this.DM) >> p && (r[k++] = d | this.s << this.DB - p); i >= 0; ) p < 8 ? (d = (this[i] & (1 << p) - 1) << 8 - p, | |
d |= this[--i] >> (p += this.DB - 8)) : (d = this[i] >> (p -= 8) & 255, p <= 0 && (p += this.DB, | |
--i)), 0 != (128 & d) && (d |= -256), 0 == k && (128 & this.s) != (128 & d) && ++k, | |
(k > 0 || d != this.s) && (r[k++] = d); | |
return r; | |
}, BigInteger.prototype.equals = function(a) { | |
return 0 == this.compareTo(a); | |
}, BigInteger.prototype.min = function(a) { | |
return this.compareTo(a) < 0 ? this : a; | |
}, BigInteger.prototype.max = function(a) { | |
return this.compareTo(a) > 0 ? this : a; | |
}, BigInteger.prototype.and = function(a) { | |
var r = nbi(); | |
return this.bitwiseTo(a, op_and, r), r; | |
}, BigInteger.prototype.or = function(a) { | |
var r = nbi(); | |
return this.bitwiseTo(a, op_or, r), r; | |
}, BigInteger.prototype.xor = function(a) { | |
var r = nbi(); | |
return this.bitwiseTo(a, op_xor, r), r; | |
}, BigInteger.prototype.andNot = function(a) { | |
var r = nbi(); | |
return this.bitwiseTo(a, op_andnot, r), r; | |
}, BigInteger.prototype.not = function() { | |
for (var r = nbi(), i = 0; i < this.t; ++i) r[i] = this.DM & ~this[i]; | |
return r.t = this.t, r.s = ~this.s, r; | |
}, BigInteger.prototype.shiftLeft = function(n) { | |
var r = nbi(); | |
return n < 0 ? this.rShiftTo(-n, r) : this.lShiftTo(n, r), r; | |
}, BigInteger.prototype.shiftRight = function(n) { | |
var r = nbi(); | |
return n < 0 ? this.lShiftTo(-n, r) : this.rShiftTo(n, r), r; | |
}, BigInteger.prototype.getLowestSetBit = function() { | |
for (var i = 0; i < this.t; ++i) if (0 != this[i]) return i * this.DB + lbit(this[i]); | |
return this.s < 0 ? this.t * this.DB : -1; | |
}, BigInteger.prototype.bitCount = function() { | |
for (var r = 0, x = this.s & this.DM, i = 0; i < this.t; ++i) r += cbit(this[i] ^ x); | |
return r; | |
}, BigInteger.prototype.testBit = function(n) { | |
var j = Math.floor(n / this.DB); | |
return j >= this.t ? 0 != this.s : 0 != (this[j] & 1 << n % this.DB); | |
}, BigInteger.prototype.setBit = function(n) { | |
return this.changeBit(n, op_or); | |
}, BigInteger.prototype.clearBit = function(n) { | |
return this.changeBit(n, op_andnot); | |
}, BigInteger.prototype.flipBit = function(n) { | |
return this.changeBit(n, op_xor); | |
}, BigInteger.prototype.add = function(a) { | |
var r = nbi(); | |
return this.addTo(a, r), r; | |
}, BigInteger.prototype.subtract = function(a) { | |
var r = nbi(); | |
return this.subTo(a, r), r; | |
}, BigInteger.prototype.multiply = function(a) { | |
var r = nbi(); | |
return this.multiplyTo(a, r), r; | |
}, BigInteger.prototype.divide = function(a) { | |
var r = nbi(); | |
return this.divRemTo(a, r, null), r; | |
}, BigInteger.prototype.remainder = function(a) { | |
var r = nbi(); | |
return this.divRemTo(a, null, r), r; | |
}, BigInteger.prototype.divideAndRemainder = function(a) { | |
var q = nbi(), r = nbi(); | |
return this.divRemTo(a, q, r), new Array(q, r); | |
}, BigInteger.prototype.modPow = function(e, m) { | |
var k, z, i = e.bitLength(), r = nbv(1); | |
if (i <= 0) return r; | |
k = i < 18 ? 1 : i < 48 ? 3 : i < 144 ? 4 : i < 768 ? 5 : 6, z = i < 8 ? new Classic(m) : m.isEven() ? new Barrett(m) : new Montgomery(m); | |
var g = new Array, n = 3, k1 = k - 1, km = (1 << k) - 1; | |
if (g[1] = z.convert(this), k > 1) { | |
var g2 = nbi(); | |
for (z.sqrTo(g[1], g2); n <= km; ) g[n] = nbi(), z.mulTo(g2, g[n - 2], g[n]), n += 2; | |
} | |
var w, t, j = e.t - 1, is1 = !0, r2 = nbi(); | |
for (i = nbits(e[j]) - 1; j >= 0; ) { | |
for (i >= k1 ? w = e[j] >> i - k1 & km : (w = (e[j] & (1 << i + 1) - 1) << k1 - i, | |
j > 0 && (w |= e[j - 1] >> this.DB + i - k1)), n = k; 0 == (1 & w); ) w >>= 1, --n; | |
if ((i -= n) < 0 && (i += this.DB, --j), is1) g[w].copyTo(r), is1 = !1; else { | |
for (;n > 1; ) z.sqrTo(r, r2), z.sqrTo(r2, r), n -= 2; | |
n > 0 ? z.sqrTo(r, r2) : (t = r, r = r2, r2 = t), z.mulTo(r2, g[w], r); | |
} | |
for (;j >= 0 && 0 == (e[j] & 1 << i); ) z.sqrTo(r, r2), t = r, r = r2, r2 = t, --i < 0 && (i = this.DB - 1, | |
--j); | |
} | |
return z.revert(r); | |
}, BigInteger.prototype.modInverse = function(m) { | |
var ac = m.isEven(); | |
if (this.isEven() && ac || 0 == m.signum()) return BigInteger.ZERO; | |
for (var u = m.clone(), v = this.clone(), a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1); 0 != u.signum(); ) { | |
for (;u.isEven(); ) u.rShiftTo(1, u), ac ? (a.isEven() && b.isEven() || (a.addTo(this, a), | |
b.subTo(m, b)), a.rShiftTo(1, a)) : b.isEven() || b.subTo(m, b), b.rShiftTo(1, b); | |
for (;v.isEven(); ) v.rShiftTo(1, v), ac ? (c.isEven() && d.isEven() || (c.addTo(this, c), | |
d.subTo(m, d)), c.rShiftTo(1, c)) : d.isEven() || d.subTo(m, d), d.rShiftTo(1, d); | |
u.compareTo(v) >= 0 ? (u.subTo(v, u), ac && a.subTo(c, a), b.subTo(d, b)) : (v.subTo(u, v), | |
ac && c.subTo(a, c), d.subTo(b, d)); | |
} | |
return 0 != v.compareTo(BigInteger.ONE) ? BigInteger.ZERO : d.compareTo(m) >= 0 ? d.subtract(m) : d.signum() < 0 ? (d.addTo(m, d), | |
d.signum() < 0 ? d.add(m) : d) : d; | |
}, BigInteger.prototype.pow = function(e) { | |
return this.exp(e, new NullExp); | |
}, BigInteger.prototype.gcd = function(a) { | |
var x = this.s < 0 ? this.negate() : this.clone(), y = a.s < 0 ? a.negate() : a.clone(); | |
if (x.compareTo(y) < 0) { | |
var t = x; | |
x = y, y = t; | |
} | |
var i = x.getLowestSetBit(), g = y.getLowestSetBit(); | |
if (g < 0) return x; | |
for (i < g && (g = i), g > 0 && (x.rShiftTo(g, x), y.rShiftTo(g, y)); x.signum() > 0; ) (i = x.getLowestSetBit()) > 0 && x.rShiftTo(i, x), | |
(i = y.getLowestSetBit()) > 0 && y.rShiftTo(i, y), x.compareTo(y) >= 0 ? (x.subTo(y, x), | |
x.rShiftTo(1, x)) : (y.subTo(x, y), y.rShiftTo(1, y)); | |
return g > 0 && y.lShiftTo(g, y), y; | |
}, BigInteger.prototype.isProbablePrime = function(t) { | |
var i, x = this.abs(); | |
if (1 == x.t && x[0] <= lowprimes[lowprimes.length - 1]) { | |
for (i = 0; i < lowprimes.length; ++i) if (x[0] == lowprimes[i]) return !0; | |
return !1; | |
} | |
if (x.isEven()) return !1; | |
for (i = 1; i < lowprimes.length; ) { | |
for (var m = lowprimes[i], j = i + 1; j < lowprimes.length && m < lplim; ) m *= lowprimes[j++]; | |
for (m = x.modInt(m); i < j; ) if (m % lowprimes[i++] == 0) return !1; | |
} | |
return x.millerRabin(t); | |
}, BigInteger.prototype.square = function() { | |
var r = nbi(); | |
return this.squareTo(r), r; | |
}, BigInteger.prototype.Barrett = Barrett, null == rng_pool) { | |
var t; | |
if (rng_pool = new Array, rng_pptr = 0, "undefined" != typeof window && window.crypto) if (window.crypto.getRandomValues) { | |
var ua = new Uint8Array(32); | |
for (window.crypto.getRandomValues(ua), t = 0; t < 32; ++t) rng_pool[rng_pptr++] = ua[t]; | |
} else if ("Netscape" == navigator.appName && navigator.appVersion < "5") { | |
var z = window.crypto.random(32); | |
for (t = 0; t < z.length; ++t) rng_pool[rng_pptr++] = 255 & z.charCodeAt(t); | |
} | |
for (;rng_pptr < rng_psize; ) t = Math.floor(65536 * Math.random()), rng_pool[rng_pptr++] = t >>> 8, | |
rng_pool[rng_pptr++] = 255 & t; | |
rng_pptr = 0, rng_seed_time(); | |
} | |
function rng_get_byte() { | |
if (null == rng_state) { | |
for (rng_seed_time(), (rng_state = new Arcfour).init(rng_pool), rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr) rng_pool[rng_pptr] = 0; | |
rng_pptr = 0; | |
} | |
return rng_state.next(); | |
} | |
function SecureRandom() {} | |
function Arcfour() { | |
this.i = 0, this.j = 0, this.S = new Array; | |
} | |
SecureRandom.prototype.nextBytes = function(ba) { | |
var i; | |
for (i = 0; i < ba.length; ++i) ba[i] = rng_get_byte(); | |
}, Arcfour.prototype.init = function(key) { | |
var i, j, t; | |
for (i = 0; i < 256; ++i) this.S[i] = i; | |
for (j = 0, i = 0; i < 256; ++i) j = j + this.S[i] + key[i % key.length] & 255, | |
t = this.S[i], this.S[i] = this.S[j], this.S[j] = t; | |
this.i = 0, this.j = 0; | |
}, Arcfour.prototype.next = function() { | |
var t; | |
return this.i = this.i + 1 & 255, this.j = this.j + this.S[this.i] & 255, t = this.S[this.i], | |
this.S[this.i] = this.S[this.j], this.S[this.j] = t, this.S[t + this.S[this.i] & 255]; | |
}; | |
var rng_psize = 256; | |
BigInteger.SecureRandom = SecureRandom, BigInteger.BigInteger = BigInteger, module.exports = BigInteger; | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
!(function(nacl) { | |
"use strict"; | |
var gf = function(init) { | |
var i, r = new Float64Array(16); | |
if (init) for (i = 0; i < init.length; i++) r[i] = init[i]; | |
return r; | |
}, randombytes = function() { | |
throw new Error("no PRNG"); | |
}, _0 = new Uint8Array(16), _9 = new Uint8Array(32); | |
_9[0] = 9; | |
var gf0 = gf(), gf1 = gf([ 1 ]), _121665 = gf([ 56129, 1 ]), D = gf([ 30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995 ]), D2 = gf([ 61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222 ]), X = gf([ 54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553 ]), Y = gf([ 26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214 ]), I = gf([ 41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139 ]); | |
function ts64(x, i, h, l) { | |
x[i] = h >> 24 & 255, x[i + 1] = h >> 16 & 255, x[i + 2] = h >> 8 & 255, x[i + 3] = 255 & h, | |
x[i + 4] = l >> 24 & 255, x[i + 5] = l >> 16 & 255, x[i + 6] = l >> 8 & 255, x[i + 7] = 255 & l; | |
} | |
function vn(x, xi, y, yi, n) { | |
var i, d = 0; | |
for (i = 0; i < n; i++) d |= x[xi + i] ^ y[yi + i]; | |
return (1 & d - 1 >>> 8) - 1; | |
} | |
function crypto_verify_16(x, xi, y, yi) { | |
return vn(x, xi, y, yi, 16); | |
} | |
function crypto_verify_32(x, xi, y, yi) { | |
return vn(x, xi, y, yi, 32); | |
} | |
function crypto_core_salsa20(out, inp, k, c) { | |
!(function(o, p, k, c) { | |
for (var u, j0 = 255 & c[0] | (255 & c[1]) << 8 | (255 & c[2]) << 16 | (255 & c[3]) << 24, j1 = 255 & k[0] | (255 & k[1]) << 8 | (255 & k[2]) << 16 | (255 & k[3]) << 24, j2 = 255 & k[4] | (255 & k[5]) << 8 | (255 & k[6]) << 16 | (255 & k[7]) << 24, j3 = 255 & k[8] | (255 & k[9]) << 8 | (255 & k[10]) << 16 | (255 & k[11]) << 24, j4 = 255 & k[12] | (255 & k[13]) << 8 | (255 & k[14]) << 16 | (255 & k[15]) << 24, j5 = 255 & c[4] | (255 & c[5]) << 8 | (255 & c[6]) << 16 | (255 & c[7]) << 24, j6 = 255 & p[0] | (255 & p[1]) << 8 | (255 & p[2]) << 16 | (255 & p[3]) << 24, j7 = 255 & p[4] | (255 & p[5]) << 8 | (255 & p[6]) << 16 | (255 & p[7]) << 24, j8 = 255 & p[8] | (255 & p[9]) << 8 | (255 & p[10]) << 16 | (255 & p[11]) << 24, j9 = 255 & p[12] | (255 & p[13]) << 8 | (255 & p[14]) << 16 | (255 & p[15]) << 24, j10 = 255 & c[8] | (255 & c[9]) << 8 | (255 & c[10]) << 16 | (255 & c[11]) << 24, j11 = 255 & k[16] | (255 & k[17]) << 8 | (255 & k[18]) << 16 | (255 & k[19]) << 24, j12 = 255 & k[20] | (255 & k[21]) << 8 | (255 & k[22]) << 16 | (255 & k[23]) << 24, j13 = 255 & k[24] | (255 & k[25]) << 8 | (255 & k[26]) << 16 | (255 & k[27]) << 24, j14 = 255 & k[28] | (255 & k[29]) << 8 | (255 & k[30]) << 16 | (255 & k[31]) << 24, j15 = 255 & c[12] | (255 & c[13]) << 8 | (255 & c[14]) << 16 | (255 & c[15]) << 24, x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7, x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14, x15 = j15, i = 0; i < 20; i += 2) x0 ^= (u = (x12 ^= (u = (x8 ^= (u = (x4 ^= (u = x0 + x12 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x4 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, | |
x5 ^= (u = (x1 ^= (u = (x13 ^= (u = (x9 ^= (u = x5 + x1 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x9 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14, | |
x10 ^= (u = (x6 ^= (u = (x2 ^= (u = (x14 ^= (u = x10 + x6 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x14 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, | |
x15 ^= (u = (x11 ^= (u = (x7 ^= (u = (x3 ^= (u = x15 + x11 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x3 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, | |
x0 ^= (u = (x3 ^= (u = (x2 ^= (u = (x1 ^= (u = x0 + x3 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x1 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, | |
x5 ^= (u = (x4 ^= (u = (x7 ^= (u = (x6 ^= (u = x5 + x4 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x6 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, | |
x10 ^= (u = (x9 ^= (u = (x8 ^= (u = (x11 ^= (u = x10 + x9 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x11 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, | |
x15 ^= (u = (x14 ^= (u = (x13 ^= (u = (x12 ^= (u = x15 + x14 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x12 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14; | |
x0 = x0 + j0 | 0, x1 = x1 + j1 | 0, x2 = x2 + j2 | 0, x3 = x3 + j3 | 0, x4 = x4 + j4 | 0, | |
x5 = x5 + j5 | 0, x6 = x6 + j6 | 0, x7 = x7 + j7 | 0, x8 = x8 + j8 | 0, x9 = x9 + j9 | 0, | |
x10 = x10 + j10 | 0, x11 = x11 + j11 | 0, x12 = x12 + j12 | 0, x13 = x13 + j13 | 0, | |
x14 = x14 + j14 | 0, x15 = x15 + j15 | 0, o[0] = x0 >>> 0 & 255, o[1] = x0 >>> 8 & 255, | |
o[2] = x0 >>> 16 & 255, o[3] = x0 >>> 24 & 255, o[4] = x1 >>> 0 & 255, o[5] = x1 >>> 8 & 255, | |
o[6] = x1 >>> 16 & 255, o[7] = x1 >>> 24 & 255, o[8] = x2 >>> 0 & 255, o[9] = x2 >>> 8 & 255, | |
o[10] = x2 >>> 16 & 255, o[11] = x2 >>> 24 & 255, o[12] = x3 >>> 0 & 255, o[13] = x3 >>> 8 & 255, | |
o[14] = x3 >>> 16 & 255, o[15] = x3 >>> 24 & 255, o[16] = x4 >>> 0 & 255, o[17] = x4 >>> 8 & 255, | |
o[18] = x4 >>> 16 & 255, o[19] = x4 >>> 24 & 255, o[20] = x5 >>> 0 & 255, o[21] = x5 >>> 8 & 255, | |
o[22] = x5 >>> 16 & 255, o[23] = x5 >>> 24 & 255, o[24] = x6 >>> 0 & 255, o[25] = x6 >>> 8 & 255, | |
o[26] = x6 >>> 16 & 255, o[27] = x6 >>> 24 & 255, o[28] = x7 >>> 0 & 255, o[29] = x7 >>> 8 & 255, | |
o[30] = x7 >>> 16 & 255, o[31] = x7 >>> 24 & 255, o[32] = x8 >>> 0 & 255, o[33] = x8 >>> 8 & 255, | |
o[34] = x8 >>> 16 & 255, o[35] = x8 >>> 24 & 255, o[36] = x9 >>> 0 & 255, o[37] = x9 >>> 8 & 255, | |
o[38] = x9 >>> 16 & 255, o[39] = x9 >>> 24 & 255, o[40] = x10 >>> 0 & 255, o[41] = x10 >>> 8 & 255, | |
o[42] = x10 >>> 16 & 255, o[43] = x10 >>> 24 & 255, o[44] = x11 >>> 0 & 255, o[45] = x11 >>> 8 & 255, | |
o[46] = x11 >>> 16 & 255, o[47] = x11 >>> 24 & 255, o[48] = x12 >>> 0 & 255, o[49] = x12 >>> 8 & 255, | |
o[50] = x12 >>> 16 & 255, o[51] = x12 >>> 24 & 255, o[52] = x13 >>> 0 & 255, o[53] = x13 >>> 8 & 255, | |
o[54] = x13 >>> 16 & 255, o[55] = x13 >>> 24 & 255, o[56] = x14 >>> 0 & 255, o[57] = x14 >>> 8 & 255, | |
o[58] = x14 >>> 16 & 255, o[59] = x14 >>> 24 & 255, o[60] = x15 >>> 0 & 255, o[61] = x15 >>> 8 & 255, | |
o[62] = x15 >>> 16 & 255, o[63] = x15 >>> 24 & 255; | |
})(out, inp, k, c); | |
} | |
function crypto_core_hsalsa20(out, inp, k, c) { | |
!(function(o, p, k, c) { | |
for (var u, x0 = 255 & c[0] | (255 & c[1]) << 8 | (255 & c[2]) << 16 | (255 & c[3]) << 24, x1 = 255 & k[0] | (255 & k[1]) << 8 | (255 & k[2]) << 16 | (255 & k[3]) << 24, x2 = 255 & k[4] | (255 & k[5]) << 8 | (255 & k[6]) << 16 | (255 & k[7]) << 24, x3 = 255 & k[8] | (255 & k[9]) << 8 | (255 & k[10]) << 16 | (255 & k[11]) << 24, x4 = 255 & k[12] | (255 & k[13]) << 8 | (255 & k[14]) << 16 | (255 & k[15]) << 24, x5 = 255 & c[4] | (255 & c[5]) << 8 | (255 & c[6]) << 16 | (255 & c[7]) << 24, x6 = 255 & p[0] | (255 & p[1]) << 8 | (255 & p[2]) << 16 | (255 & p[3]) << 24, x7 = 255 & p[4] | (255 & p[5]) << 8 | (255 & p[6]) << 16 | (255 & p[7]) << 24, x8 = 255 & p[8] | (255 & p[9]) << 8 | (255 & p[10]) << 16 | (255 & p[11]) << 24, x9 = 255 & p[12] | (255 & p[13]) << 8 | (255 & p[14]) << 16 | (255 & p[15]) << 24, x10 = 255 & c[8] | (255 & c[9]) << 8 | (255 & c[10]) << 16 | (255 & c[11]) << 24, x11 = 255 & k[16] | (255 & k[17]) << 8 | (255 & k[18]) << 16 | (255 & k[19]) << 24, x12 = 255 & k[20] | (255 & k[21]) << 8 | (255 & k[22]) << 16 | (255 & k[23]) << 24, x13 = 255 & k[24] | (255 & k[25]) << 8 | (255 & k[26]) << 16 | (255 & k[27]) << 24, x14 = 255 & k[28] | (255 & k[29]) << 8 | (255 & k[30]) << 16 | (255 & k[31]) << 24, x15 = 255 & c[12] | (255 & c[13]) << 8 | (255 & c[14]) << 16 | (255 & c[15]) << 24, i = 0; i < 20; i += 2) x0 ^= (u = (x12 ^= (u = (x8 ^= (u = (x4 ^= (u = x0 + x12 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x4 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, | |
x5 ^= (u = (x1 ^= (u = (x13 ^= (u = (x9 ^= (u = x5 + x1 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x9 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14, | |
x10 ^= (u = (x6 ^= (u = (x2 ^= (u = (x14 ^= (u = x10 + x6 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x14 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, | |
x15 ^= (u = (x11 ^= (u = (x7 ^= (u = (x3 ^= (u = x15 + x11 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x3 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, | |
x0 ^= (u = (x3 ^= (u = (x2 ^= (u = (x1 ^= (u = x0 + x3 | 0) << 7 | u >>> 25) + x0 | 0) << 9 | u >>> 23) + x1 | 0) << 13 | u >>> 19) + x2 | 0) << 18 | u >>> 14, | |
x5 ^= (u = (x4 ^= (u = (x7 ^= (u = (x6 ^= (u = x5 + x4 | 0) << 7 | u >>> 25) + x5 | 0) << 9 | u >>> 23) + x6 | 0) << 13 | u >>> 19) + x7 | 0) << 18 | u >>> 14, | |
x10 ^= (u = (x9 ^= (u = (x8 ^= (u = (x11 ^= (u = x10 + x9 | 0) << 7 | u >>> 25) + x10 | 0) << 9 | u >>> 23) + x11 | 0) << 13 | u >>> 19) + x8 | 0) << 18 | u >>> 14, | |
x15 ^= (u = (x14 ^= (u = (x13 ^= (u = (x12 ^= (u = x15 + x14 | 0) << 7 | u >>> 25) + x15 | 0) << 9 | u >>> 23) + x12 | 0) << 13 | u >>> 19) + x13 | 0) << 18 | u >>> 14; | |
o[0] = x0 >>> 0 & 255, o[1] = x0 >>> 8 & 255, o[2] = x0 >>> 16 & 255, o[3] = x0 >>> 24 & 255, | |
o[4] = x5 >>> 0 & 255, o[5] = x5 >>> 8 & 255, o[6] = x5 >>> 16 & 255, o[7] = x5 >>> 24 & 255, | |
o[8] = x10 >>> 0 & 255, o[9] = x10 >>> 8 & 255, o[10] = x10 >>> 16 & 255, o[11] = x10 >>> 24 & 255, | |
o[12] = x15 >>> 0 & 255, o[13] = x15 >>> 8 & 255, o[14] = x15 >>> 16 & 255, o[15] = x15 >>> 24 & 255, | |
o[16] = x6 >>> 0 & 255, o[17] = x6 >>> 8 & 255, o[18] = x6 >>> 16 & 255, o[19] = x6 >>> 24 & 255, | |
o[20] = x7 >>> 0 & 255, o[21] = x7 >>> 8 & 255, o[22] = x7 >>> 16 & 255, o[23] = x7 >>> 24 & 255, | |
o[24] = x8 >>> 0 & 255, o[25] = x8 >>> 8 & 255, o[26] = x8 >>> 16 & 255, o[27] = x8 >>> 24 & 255, | |
o[28] = x9 >>> 0 & 255, o[29] = x9 >>> 8 & 255, o[30] = x9 >>> 16 & 255, o[31] = x9 >>> 24 & 255; | |
})(out, inp, k, c); | |
} | |
var sigma = new Uint8Array([ 101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107 ]); | |
function crypto_stream_salsa20_xor(c, cpos, m, mpos, b, n, k) { | |
var u, i, z = new Uint8Array(16), x = new Uint8Array(64); | |
for (i = 0; i < 16; i++) z[i] = 0; | |
for (i = 0; i < 8; i++) z[i] = n[i]; | |
for (;b >= 64; ) { | |
for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < 64; i++) c[cpos + i] = m[mpos + i] ^ x[i]; | |
for (u = 1, i = 8; i < 16; i++) u = u + (255 & z[i]) | 0, z[i] = 255 & u, u >>>= 8; | |
b -= 64, cpos += 64, mpos += 64; | |
} | |
if (b > 0) for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < b; i++) c[cpos + i] = m[mpos + i] ^ x[i]; | |
return 0; | |
} | |
function crypto_stream_salsa20(c, cpos, b, n, k) { | |
var u, i, z = new Uint8Array(16), x = new Uint8Array(64); | |
for (i = 0; i < 16; i++) z[i] = 0; | |
for (i = 0; i < 8; i++) z[i] = n[i]; | |
for (;b >= 64; ) { | |
for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < 64; i++) c[cpos + i] = x[i]; | |
for (u = 1, i = 8; i < 16; i++) u = u + (255 & z[i]) | 0, z[i] = 255 & u, u >>>= 8; | |
b -= 64, cpos += 64; | |
} | |
if (b > 0) for (crypto_core_salsa20(x, z, k, sigma), i = 0; i < b; i++) c[cpos + i] = x[i]; | |
return 0; | |
} | |
function crypto_stream(c, cpos, d, n, k) { | |
var s = new Uint8Array(32); | |
crypto_core_hsalsa20(s, n, k, sigma); | |
for (var sn = new Uint8Array(8), i = 0; i < 8; i++) sn[i] = n[i + 16]; | |
return crypto_stream_salsa20(c, cpos, d, sn, s); | |
} | |
function crypto_stream_xor(c, cpos, m, mpos, d, n, k) { | |
var s = new Uint8Array(32); | |
crypto_core_hsalsa20(s, n, k, sigma); | |
for (var sn = new Uint8Array(8), i = 0; i < 8; i++) sn[i] = n[i + 16]; | |
return crypto_stream_salsa20_xor(c, cpos, m, mpos, d, sn, s); | |
} | |
var poly1305 = function(key) { | |
var t0, t1, t2, t3, t4, t5, t6, t7; | |
this.buffer = new Uint8Array(16), this.r = new Uint16Array(10), this.h = new Uint16Array(10), | |
this.pad = new Uint16Array(8), this.leftover = 0, this.fin = 0, t0 = 255 & key[0] | (255 & key[1]) << 8, | |
this.r[0] = 8191 & t0, t1 = 255 & key[2] | (255 & key[3]) << 8, this.r[1] = 8191 & (t0 >>> 13 | t1 << 3), | |
t2 = 255 & key[4] | (255 & key[5]) << 8, this.r[2] = 7939 & (t1 >>> 10 | t2 << 6), | |
t3 = 255 & key[6] | (255 & key[7]) << 8, this.r[3] = 8191 & (t2 >>> 7 | t3 << 9), | |
t4 = 255 & key[8] | (255 & key[9]) << 8, this.r[4] = 255 & (t3 >>> 4 | t4 << 12), | |
this.r[5] = t4 >>> 1 & 8190, t5 = 255 & key[10] | (255 & key[11]) << 8, this.r[6] = 8191 & (t4 >>> 14 | t5 << 2), | |
t6 = 255 & key[12] | (255 & key[13]) << 8, this.r[7] = 8065 & (t5 >>> 11 | t6 << 5), | |
t7 = 255 & key[14] | (255 & key[15]) << 8, this.r[8] = 8191 & (t6 >>> 8 | t7 << 8), | |
this.r[9] = t7 >>> 5 & 127, this.pad[0] = 255 & key[16] | (255 & key[17]) << 8, | |
this.pad[1] = 255 & key[18] | (255 & key[19]) << 8, this.pad[2] = 255 & key[20] | (255 & key[21]) << 8, | |
this.pad[3] = 255 & key[22] | (255 & key[23]) << 8, this.pad[4] = 255 & key[24] | (255 & key[25]) << 8, | |
this.pad[5] = 255 & key[26] | (255 & key[27]) << 8, this.pad[6] = 255 & key[28] | (255 & key[29]) << 8, | |
this.pad[7] = 255 & key[30] | (255 & key[31]) << 8; | |
}; | |
function crypto_onetimeauth(out, outpos, m, mpos, n, k) { | |
var s = new poly1305(k); | |
return s.update(m, mpos, n), s.finish(out, outpos), 0; | |
} | |
function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) { | |
var x = new Uint8Array(16); | |
return crypto_onetimeauth(x, 0, m, mpos, n, k), crypto_verify_16(h, hpos, x, 0); | |
} | |
function crypto_secretbox(c, m, d, n, k) { | |
var i; | |
if (d < 32) return -1; | |
for (crypto_stream_xor(c, 0, m, 0, d, n, k), crypto_onetimeauth(c, 16, c, 32, d - 32, c), | |
i = 0; i < 16; i++) c[i] = 0; | |
return 0; | |
} | |
function crypto_secretbox_open(m, c, d, n, k) { | |
var i, x = new Uint8Array(32); | |
if (d < 32) return -1; | |
if (crypto_stream(x, 0, 32, n, k), 0 !== crypto_onetimeauth_verify(c, 16, c, 32, d - 32, x)) return -1; | |
for (crypto_stream_xor(m, 0, c, 0, d, n, k), i = 0; i < 32; i++) m[i] = 0; | |
return 0; | |
} | |
function set25519(r, a) { | |
var i; | |
for (i = 0; i < 16; i++) r[i] = 0 | a[i]; | |
} | |
function car25519(o) { | |
var i, v, c = 1; | |
for (i = 0; i < 16; i++) v = o[i] + c + 65535, c = Math.floor(v / 65536), o[i] = v - 65536 * c; | |
o[0] += c - 1 + 37 * (c - 1); | |
} | |
function sel25519(p, q, b) { | |
for (var t, c = ~(b - 1), i = 0; i < 16; i++) t = c & (p[i] ^ q[i]), p[i] ^= t, | |
q[i] ^= t; | |
} | |
function pack25519(o, n) { | |
var i, j, b, m = gf(), t = gf(); | |
for (i = 0; i < 16; i++) t[i] = n[i]; | |
for (car25519(t), car25519(t), car25519(t), j = 0; j < 2; j++) { | |
for (m[0] = t[0] - 65517, i = 1; i < 15; i++) m[i] = t[i] - 65535 - (m[i - 1] >> 16 & 1), | |
m[i - 1] &= 65535; | |
m[15] = t[15] - 32767 - (m[14] >> 16 & 1), b = m[15] >> 16 & 1, m[14] &= 65535, | |
sel25519(t, m, 1 - b); | |
} | |
for (i = 0; i < 16; i++) o[2 * i] = 255 & t[i], o[2 * i + 1] = t[i] >> 8; | |
} | |
function neq25519(a, b) { | |
var c = new Uint8Array(32), d = new Uint8Array(32); | |
return pack25519(c, a), pack25519(d, b), crypto_verify_32(c, 0, d, 0); | |
} | |
function par25519(a) { | |
var d = new Uint8Array(32); | |
return pack25519(d, a), 1 & d[0]; | |
} | |
function unpack25519(o, n) { | |
var i; | |
for (i = 0; i < 16; i++) o[i] = n[2 * i] + (n[2 * i + 1] << 8); | |
o[15] &= 32767; | |
} | |
function A(o, a, b) { | |
for (var i = 0; i < 16; i++) o[i] = a[i] + b[i]; | |
} | |
function Z(o, a, b) { | |
for (var i = 0; i < 16; i++) o[i] = a[i] - b[i]; | |
} | |
function M(o, a, b) { | |
var v, c, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0, t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0, t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0, b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11], b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; | |
t0 += (v = a[0]) * b0, t1 += v * b1, t2 += v * b2, t3 += v * b3, t4 += v * b4, t5 += v * b5, | |
t6 += v * b6, t7 += v * b7, t8 += v * b8, t9 += v * b9, t10 += v * b10, t11 += v * b11, | |
t12 += v * b12, t13 += v * b13, t14 += v * b14, t15 += v * b15, t1 += (v = a[1]) * b0, | |
t2 += v * b1, t3 += v * b2, t4 += v * b3, t5 += v * b4, t6 += v * b5, t7 += v * b6, | |
t8 += v * b7, t9 += v * b8, t10 += v * b9, t11 += v * b10, t12 += v * b11, t13 += v * b12, | |
t14 += v * b13, t15 += v * b14, t16 += v * b15, t2 += (v = a[2]) * b0, t3 += v * b1, | |
t4 += v * b2, t5 += v * b3, t6 += v * b4, t7 += v * b5, t8 += v * b6, t9 += v * b7, | |
t10 += v * b8, t11 += v * b9, t12 += v * b10, t13 += v * b11, t14 += v * b12, t15 += v * b13, | |
t16 += v * b14, t17 += v * b15, t3 += (v = a[3]) * b0, t4 += v * b1, t5 += v * b2, | |
t6 += v * b3, t7 += v * b4, t8 += v * b5, t9 += v * b6, t10 += v * b7, t11 += v * b8, | |
t12 += v * b9, t13 += v * b10, t14 += v * b11, t15 += v * b12, t16 += v * b13, t17 += v * b14, | |
t18 += v * b15, t4 += (v = a[4]) * b0, t5 += v * b1, t6 += v * b2, t7 += v * b3, | |
t8 += v * b4, t9 += v * b5, t10 += v * b6, t11 += v * b7, t12 += v * b8, t13 += v * b9, | |
t14 += v * b10, t15 += v * b11, t16 += v * b12, t17 += v * b13, t18 += v * b14, | |
t19 += v * b15, t5 += (v = a[5]) * b0, t6 += v * b1, t7 += v * b2, t8 += v * b3, | |
t9 += v * b4, t10 += v * b5, t11 += v * b6, t12 += v * b7, t13 += v * b8, t14 += v * b9, | |
t15 += v * b10, t16 += v * b11, t17 += v * b12, t18 += v * b13, t19 += v * b14, | |
t20 += v * b15, t6 += (v = a[6]) * b0, t7 += v * b1, t8 += v * b2, t9 += v * b3, | |
t10 += v * b4, t11 += v * b5, t12 += v * b6, t13 += v * b7, t14 += v * b8, t15 += v * b9, | |
t16 += v * b10, t17 += v * b11, t18 += v * b12, t19 += v * b13, t20 += v * b14, | |
t21 += v * b15, t7 += (v = a[7]) * b0, t8 += v * b1, t9 += v * b2, t10 += v * b3, | |
t11 += v * b4, t12 += v * b5, t13 += v * b6, t14 += v * b7, t15 += v * b8, t16 += v * b9, | |
t17 += v * b10, t18 += v * b11, t19 += v * b12, t20 += v * b13, t21 += v * b14, | |
t22 += v * b15, t8 += (v = a[8]) * b0, t9 += v * b1, t10 += v * b2, t11 += v * b3, | |
t12 += v * b4, t13 += v * b5, t14 += v * b6, t15 += v * b7, t16 += v * b8, t17 += v * b9, | |
t18 += v * b10, t19 += v * b11, t20 += v * b12, t21 += v * b13, t22 += v * b14, | |
t23 += v * b15, t9 += (v = a[9]) * b0, t10 += v * b1, t11 += v * b2, t12 += v * b3, | |
t13 += v * b4, t14 += v * b5, t15 += v * b6, t16 += v * b7, t17 += v * b8, t18 += v * b9, | |
t19 += v * b10, t20 += v * b11, t21 += v * b12, t22 += v * b13, t23 += v * b14, | |
t24 += v * b15, t10 += (v = a[10]) * b0, t11 += v * b1, t12 += v * b2, t13 += v * b3, | |
t14 += v * b4, t15 += v * b5, t16 += v * b6, t17 += v * b7, t18 += v * b8, t19 += v * b9, | |
t20 += v * b10, t21 += v * b11, t22 += v * b12, t23 += v * b13, t24 += v * b14, | |
t25 += v * b15, t11 += (v = a[11]) * b0, t12 += v * b1, t13 += v * b2, t14 += v * b3, | |
t15 += v * b4, t16 += v * b5, t17 += v * b6, t18 += v * b7, t19 += v * b8, t20 += v * b9, | |
t21 += v * b10, t22 += v * b11, t23 += v * b12, t24 += v * b13, t25 += v * b14, | |
t26 += v * b15, t12 += (v = a[12]) * b0, t13 += v * b1, t14 += v * b2, t15 += v * b3, | |
t16 += v * b4, t17 += v * b5, t18 += v * b6, t19 += v * b7, t20 += v * b8, t21 += v * b9, | |
t22 += v * b10, t23 += v * b11, t24 += v * b12, t25 += v * b13, t26 += v * b14, | |
t27 += v * b15, t13 += (v = a[13]) * b0, t14 += v * b1, t15 += v * b2, t16 += v * b3, | |
t17 += v * b4, t18 += v * b5, t19 += v * b6, t20 += v * b7, t21 += v * b8, t22 += v * b9, | |
t23 += v * b10, t24 += v * b11, t25 += v * b12, t26 += v * b13, t27 += v * b14, | |
t28 += v * b15, t14 += (v = a[14]) * b0, t15 += v * b1, t16 += v * b2, t17 += v * b3, | |
t18 += v * b4, t19 += v * b5, t20 += v * b6, t21 += v * b7, t22 += v * b8, t23 += v * b9, | |
t24 += v * b10, t25 += v * b11, t26 += v * b12, t27 += v * b13, t28 += v * b14, | |
t29 += v * b15, t15 += (v = a[15]) * b0, t1 += 38 * (t17 += v * b2), t2 += 38 * (t18 += v * b3), | |
t3 += 38 * (t19 += v * b4), t4 += 38 * (t20 += v * b5), t5 += 38 * (t21 += v * b6), | |
t6 += 38 * (t22 += v * b7), t7 += 38 * (t23 += v * b8), t8 += 38 * (t24 += v * b9), | |
t9 += 38 * (t25 += v * b10), t10 += 38 * (t26 += v * b11), t11 += 38 * (t27 += v * b12), | |
t12 += 38 * (t28 += v * b13), t13 += 38 * (t29 += v * b14), t14 += 38 * (t30 += v * b15), | |
t0 = (v = (t0 += 38 * (t16 += v * b1)) + (c = 1) + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t1 = (v = t1 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t2 = (v = t2 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t3 = (v = t3 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t4 = (v = t4 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t5 = (v = t5 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t6 = (v = t6 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t7 = (v = t7 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t8 = (v = t8 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t9 = (v = t9 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t10 = (v = t10 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t11 = (v = t11 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t12 = (v = t12 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t13 = (v = t13 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t14 = (v = t14 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t15 = (v = t15 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t0 = (v = (t0 += c - 1 + 37 * (c - 1)) + (c = 1) + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t1 = (v = t1 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t2 = (v = t2 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t3 = (v = t3 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t4 = (v = t4 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t5 = (v = t5 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t6 = (v = t6 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t7 = (v = t7 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t8 = (v = t8 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t9 = (v = t9 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t10 = (v = t10 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t11 = (v = t11 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t12 = (v = t12 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t13 = (v = t13 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t14 = (v = t14 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), | |
t15 = (v = t15 + c + 65535) - 65536 * (c = Math.floor(v / 65536)), t0 += c - 1 + 37 * (c - 1), | |
o[0] = t0, o[1] = t1, o[2] = t2, o[3] = t3, o[4] = t4, o[5] = t5, o[6] = t6, o[7] = t7, | |
o[8] = t8, o[9] = t9, o[10] = t10, o[11] = t11, o[12] = t12, o[13] = t13, o[14] = t14, | |
o[15] = t15; | |
} | |
function S(o, a) { | |
M(o, a, a); | |
} | |
function inv25519(o, i) { | |
var a, c = gf(); | |
for (a = 0; a < 16; a++) c[a] = i[a]; | |
for (a = 253; a >= 0; a--) S(c, c), 2 !== a && 4 !== a && M(c, c, i); | |
for (a = 0; a < 16; a++) o[a] = c[a]; | |
} | |
function crypto_scalarmult(q, n, p) { | |
var r, i, z = new Uint8Array(32), x = new Float64Array(80), a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(); | |
for (i = 0; i < 31; i++) z[i] = n[i]; | |
for (z[31] = 127 & n[31] | 64, z[0] &= 248, unpack25519(x, p), i = 0; i < 16; i++) b[i] = x[i], | |
d[i] = a[i] = c[i] = 0; | |
for (a[0] = d[0] = 1, i = 254; i >= 0; --i) sel25519(a, b, r = z[i >>> 3] >>> (7 & i) & 1), | |
sel25519(c, d, r), A(e, a, c), Z(a, a, c), A(c, b, d), Z(b, b, d), S(d, e), S(f, a), | |
M(a, c, a), M(c, b, e), A(e, a, c), Z(a, a, c), S(b, a), Z(c, d, f), M(a, c, _121665), | |
A(a, a, d), M(c, c, a), M(a, d, f), M(d, b, x), S(b, e), sel25519(a, b, r), sel25519(c, d, r); | |
for (i = 0; i < 16; i++) x[i + 16] = a[i], x[i + 32] = c[i], x[i + 48] = b[i], x[i + 64] = d[i]; | |
var x32 = x.subarray(32), x16 = x.subarray(16); | |
return inv25519(x32, x32), M(x16, x16, x32), pack25519(q, x16), 0; | |
} | |
function crypto_scalarmult_base(q, n) { | |
return crypto_scalarmult(q, n, _9); | |
} | |
function crypto_box_keypair(y, x) { | |
return randombytes(x, 32), crypto_scalarmult_base(y, x); | |
} | |
function crypto_box_beforenm(k, y, x) { | |
var s = new Uint8Array(32); | |
return crypto_scalarmult(s, x, y), crypto_core_hsalsa20(k, _0, s, sigma); | |
} | |
poly1305.prototype.blocks = function(m, mpos, bytes) { | |
for (var t0, t1, t2, t3, t4, t5, t6, t7, c, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, hibit = this.fin ? 0 : 2048, h0 = this.h[0], h1 = this.h[1], h2 = this.h[2], h3 = this.h[3], h4 = this.h[4], h5 = this.h[5], h6 = this.h[6], h7 = this.h[7], h8 = this.h[8], h9 = this.h[9], r0 = this.r[0], r1 = this.r[1], r2 = this.r[2], r3 = this.r[3], r4 = this.r[4], r5 = this.r[5], r6 = this.r[6], r7 = this.r[7], r8 = this.r[8], r9 = this.r[9]; bytes >= 16; ) d0 = c = 0, | |
d0 += (h0 += 8191 & (t0 = 255 & m[mpos + 0] | (255 & m[mpos + 1]) << 8)) * r0, d0 += (h1 += 8191 & (t0 >>> 13 | (t1 = 255 & m[mpos + 2] | (255 & m[mpos + 3]) << 8) << 3)) * (5 * r9), | |
d0 += (h2 += 8191 & (t1 >>> 10 | (t2 = 255 & m[mpos + 4] | (255 & m[mpos + 5]) << 8) << 6)) * (5 * r8), | |
d0 += (h3 += 8191 & (t2 >>> 7 | (t3 = 255 & m[mpos + 6] | (255 & m[mpos + 7]) << 8) << 9)) * (5 * r7), | |
c = (d0 += (h4 += 8191 & (t3 >>> 4 | (t4 = 255 & m[mpos + 8] | (255 & m[mpos + 9]) << 8) << 12)) * (5 * r6)) >>> 13, | |
d0 &= 8191, d0 += (h5 += t4 >>> 1 & 8191) * (5 * r5), d0 += (h6 += 8191 & (t4 >>> 14 | (t5 = 255 & m[mpos + 10] | (255 & m[mpos + 11]) << 8) << 2)) * (5 * r4), | |
d0 += (h7 += 8191 & (t5 >>> 11 | (t6 = 255 & m[mpos + 12] | (255 & m[mpos + 13]) << 8) << 5)) * (5 * r3), | |
d0 += (h8 += 8191 & (t6 >>> 8 | (t7 = 255 & m[mpos + 14] | (255 & m[mpos + 15]) << 8) << 8)) * (5 * r2), | |
d1 = c += (d0 += (h9 += t7 >>> 5 | hibit) * (5 * r1)) >>> 13, d1 += h0 * r1, d1 += h1 * r0, | |
d1 += h2 * (5 * r9), d1 += h3 * (5 * r8), c = (d1 += h4 * (5 * r7)) >>> 13, d1 &= 8191, | |
d1 += h5 * (5 * r6), d1 += h6 * (5 * r5), d1 += h7 * (5 * r4), d1 += h8 * (5 * r3), | |
c += (d1 += h9 * (5 * r2)) >>> 13, d1 &= 8191, d2 = c, d2 += h0 * r2, d2 += h1 * r1, | |
d2 += h2 * r0, d2 += h3 * (5 * r9), c = (d2 += h4 * (5 * r8)) >>> 13, d2 &= 8191, | |
d2 += h5 * (5 * r7), d2 += h6 * (5 * r6), d2 += h7 * (5 * r5), d2 += h8 * (5 * r4), | |
d3 = c += (d2 += h9 * (5 * r3)) >>> 13, d3 += h0 * r3, d3 += h1 * r2, d3 += h2 * r1, | |
d3 += h3 * r0, c = (d3 += h4 * (5 * r9)) >>> 13, d3 &= 8191, d3 += h5 * (5 * r8), | |
d3 += h6 * (5 * r7), d3 += h7 * (5 * r6), d3 += h8 * (5 * r5), d4 = c += (d3 += h9 * (5 * r4)) >>> 13, | |
d4 += h0 * r4, d4 += h1 * r3, d4 += h2 * r2, d4 += h3 * r1, c = (d4 += h4 * r0) >>> 13, | |
d4 &= 8191, d4 += h5 * (5 * r9), d4 += h6 * (5 * r8), d4 += h7 * (5 * r7), d4 += h8 * (5 * r6), | |
d5 = c += (d4 += h9 * (5 * r5)) >>> 13, d5 += h0 * r5, d5 += h1 * r4, d5 += h2 * r3, | |
d5 += h3 * r2, c = (d5 += h4 * r1) >>> 13, d5 &= 8191, d5 += h5 * r0, d5 += h6 * (5 * r9), | |
d5 += h7 * (5 * r8), d5 += h8 * (5 * r7), d6 = c += (d5 += h9 * (5 * r6)) >>> 13, | |
d6 += h0 * r6, d6 += h1 * r5, d6 += h2 * r4, d6 += h3 * r3, c = (d6 += h4 * r2) >>> 13, | |
d6 &= 8191, d6 += h5 * r1, d6 += h6 * r0, d6 += h7 * (5 * r9), d6 += h8 * (5 * r8), | |
d7 = c += (d6 += h9 * (5 * r7)) >>> 13, d7 += h0 * r7, d7 += h1 * r6, d7 += h2 * r5, | |
d7 += h3 * r4, c = (d7 += h4 * r3) >>> 13, d7 &= 8191, d7 += h5 * r2, d7 += h6 * r1, | |
d7 += h7 * r0, d7 += h8 * (5 * r9), d8 = c += (d7 += h9 * (5 * r8)) >>> 13, d8 += h0 * r8, | |
d8 += h1 * r7, d8 += h2 * r6, d8 += h3 * r5, c = (d8 += h4 * r4) >>> 13, d8 &= 8191, | |
d8 += h5 * r3, d8 += h6 * r2, d8 += h7 * r1, d8 += h8 * r0, d9 = c += (d8 += h9 * (5 * r9)) >>> 13, | |
d9 += h0 * r9, d9 += h1 * r8, d9 += h2 * r7, d9 += h3 * r6, c = (d9 += h4 * r5) >>> 13, | |
d9 &= 8191, d9 += h5 * r4, d9 += h6 * r3, d9 += h7 * r2, d9 += h8 * r1, h0 = d0 = 8191 & (c = (c = ((c += (d9 += h9 * r0) >>> 13) << 2) + c | 0) + (d0 &= 8191) | 0), | |
h1 = d1 += c >>>= 13, h2 = d2 &= 8191, h3 = d3 &= 8191, h4 = d4 &= 8191, h5 = d5 &= 8191, | |
h6 = d6 &= 8191, h7 = d7 &= 8191, h8 = d8 &= 8191, h9 = d9 &= 8191, mpos += 16, | |
bytes -= 16; | |
this.h[0] = h0, this.h[1] = h1, this.h[2] = h2, this.h[3] = h3, this.h[4] = h4, | |
this.h[5] = h5, this.h[6] = h6, this.h[7] = h7, this.h[8] = h8, this.h[9] = h9; | |
}, poly1305.prototype.finish = function(mac, macpos) { | |
var c, mask, f, i, g = new Uint16Array(10); | |
if (this.leftover) { | |
for (i = this.leftover, this.buffer[i++] = 1; i < 16; i++) this.buffer[i] = 0; | |
this.fin = 1, this.blocks(this.buffer, 0, 16); | |
} | |
for (c = this.h[1] >>> 13, this.h[1] &= 8191, i = 2; i < 10; i++) this.h[i] += c, | |
c = this.h[i] >>> 13, this.h[i] &= 8191; | |
for (this.h[0] += 5 * c, c = this.h[0] >>> 13, this.h[0] &= 8191, this.h[1] += c, | |
c = this.h[1] >>> 13, this.h[1] &= 8191, this.h[2] += c, g[0] = this.h[0] + 5, c = g[0] >>> 13, | |
g[0] &= 8191, i = 1; i < 10; i++) g[i] = this.h[i] + c, c = g[i] >>> 13, g[i] &= 8191; | |
for (g[9] -= 8192, mask = (1 ^ c) - 1, i = 0; i < 10; i++) g[i] &= mask; | |
for (mask = ~mask, i = 0; i < 10; i++) this.h[i] = this.h[i] & mask | g[i]; | |
for (this.h[0] = 65535 & (this.h[0] | this.h[1] << 13), this.h[1] = 65535 & (this.h[1] >>> 3 | this.h[2] << 10), | |
this.h[2] = 65535 & (this.h[2] >>> 6 | this.h[3] << 7), this.h[3] = 65535 & (this.h[3] >>> 9 | this.h[4] << 4), | |
this.h[4] = 65535 & (this.h[4] >>> 12 | this.h[5] << 1 | this.h[6] << 14), this.h[5] = 65535 & (this.h[6] >>> 2 | this.h[7] << 11), | |
this.h[6] = 65535 & (this.h[7] >>> 5 | this.h[8] << 8), this.h[7] = 65535 & (this.h[8] >>> 8 | this.h[9] << 5), | |
f = this.h[0] + this.pad[0], this.h[0] = 65535 & f, i = 1; i < 8; i++) f = (this.h[i] + this.pad[i] | 0) + (f >>> 16) | 0, | |
this.h[i] = 65535 & f; | |
mac[macpos + 0] = this.h[0] >>> 0 & 255, mac[macpos + 1] = this.h[0] >>> 8 & 255, | |
mac[macpos + 2] = this.h[1] >>> 0 & 255, mac[macpos + 3] = this.h[1] >>> 8 & 255, | |
mac[macpos + 4] = this.h[2] >>> 0 & 255, mac[macpos + 5] = this.h[2] >>> 8 & 255, | |
mac[macpos + 6] = this.h[3] >>> 0 & 255, mac[macpos + 7] = this.h[3] >>> 8 & 255, | |
mac[macpos + 8] = this.h[4] >>> 0 & 255, mac[macpos + 9] = this.h[4] >>> 8 & 255, | |
mac[macpos + 10] = this.h[5] >>> 0 & 255, mac[macpos + 11] = this.h[5] >>> 8 & 255, | |
mac[macpos + 12] = this.h[6] >>> 0 & 255, mac[macpos + 13] = this.h[6] >>> 8 & 255, | |
mac[macpos + 14] = this.h[7] >>> 0 & 255, mac[macpos + 15] = this.h[7] >>> 8 & 255; | |
}, poly1305.prototype.update = function(m, mpos, bytes) { | |
var i, want; | |
if (this.leftover) { | |
for ((want = 16 - this.leftover) > bytes && (want = bytes), i = 0; i < want; i++) this.buffer[this.leftover + i] = m[mpos + i]; | |
if (bytes -= want, mpos += want, this.leftover += want, this.leftover < 16) return; | |
this.blocks(this.buffer, 0, 16), this.leftover = 0; | |
} | |
if (bytes >= 16 && (want = bytes - bytes % 16, this.blocks(m, mpos, want), mpos += want, | |
bytes -= want), bytes) { | |
for (i = 0; i < bytes; i++) this.buffer[this.leftover + i] = m[mpos + i]; | |
this.leftover += bytes; | |
} | |
}; | |
var crypto_box_afternm = crypto_secretbox, crypto_box_open_afternm = crypto_secretbox_open, K = [ 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 ]; | |
function crypto_hashblocks_hl(hh, hl, m, n) { | |
for (var bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7, bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7, th, tl, i, j, h, l, a, b, c, d, wh = new Int32Array(16), wl = new Int32Array(16), ah0 = hh[0], ah1 = hh[1], ah2 = hh[2], ah3 = hh[3], ah4 = hh[4], ah5 = hh[5], ah6 = hh[6], ah7 = hh[7], al0 = hl[0], al1 = hl[1], al2 = hl[2], al3 = hl[3], al4 = hl[4], al5 = hl[5], al6 = hl[6], al7 = hl[7], pos = 0; n >= 128; ) { | |
for (i = 0; i < 16; i++) j = 8 * i + pos, wh[i] = m[j + 0] << 24 | m[j + 1] << 16 | m[j + 2] << 8 | m[j + 3], | |
wl[i] = m[j + 4] << 24 | m[j + 5] << 16 | m[j + 6] << 8 | m[j + 7]; | |
for (i = 0; i < 80; i++) if (bh0 = ah0, bh1 = ah1, bh2 = ah2, bh3 = ah3, bh4 = ah4, | |
bh5 = ah5, bh6 = ah6, bl0 = al0, bl1 = al1, bl2 = al2, bl3 = al3, bl4 = al4, bl5 = al5, | |
bl6 = al6, a = 65535 & (l = al7), b = l >>> 16, c = 65535 & (h = ah7), d = h >>> 16, | |
a += 65535 & (l = (al4 >>> 14 | ah4 << 18) ^ (al4 >>> 18 | ah4 << 14) ^ (ah4 >>> 9 | al4 << 23)), | |
b += l >>> 16, c += 65535 & (h = (ah4 >>> 14 | al4 << 18) ^ (ah4 >>> 18 | al4 << 14) ^ (al4 >>> 9 | ah4 << 23)), | |
d += h >>> 16, a += 65535 & (l = al4 & al5 ^ ~al4 & al6), b += l >>> 16, c += 65535 & (h = ah4 & ah5 ^ ~ah4 & ah6), | |
d += h >>> 16, a += 65535 & (l = K[2 * i + 1]), b += l >>> 16, c += 65535 & (h = K[2 * i]), | |
d += h >>> 16, h = wh[i % 16], b += (l = wl[i % 16]) >>> 16, c += 65535 & h, d += h >>> 16, | |
c += (b += (a += 65535 & l) >>> 16) >>> 16, a = 65535 & (l = tl = 65535 & a | b << 16), | |
b = l >>> 16, c = 65535 & (h = th = 65535 & c | (d += c >>> 16) << 16), d = h >>> 16, | |
a += 65535 & (l = (al0 >>> 28 | ah0 << 4) ^ (ah0 >>> 2 | al0 << 30) ^ (ah0 >>> 7 | al0 << 25)), | |
b += l >>> 16, c += 65535 & (h = (ah0 >>> 28 | al0 << 4) ^ (al0 >>> 2 | ah0 << 30) ^ (al0 >>> 7 | ah0 << 25)), | |
d += h >>> 16, b += (l = al0 & al1 ^ al0 & al2 ^ al1 & al2) >>> 16, c += 65535 & (h = ah0 & ah1 ^ ah0 & ah2 ^ ah1 & ah2), | |
d += h >>> 16, bh7 = 65535 & (c += (b += (a += 65535 & l) >>> 16) >>> 16) | (d += c >>> 16) << 16, | |
bl7 = 65535 & a | b << 16, a = 65535 & (l = bl3), b = l >>> 16, c = 65535 & (h = bh3), | |
d = h >>> 16, b += (l = tl) >>> 16, c += 65535 & (h = th), d += h >>> 16, ah1 = bh0, | |
ah2 = bh1, ah3 = bh2, ah4 = bh3 = 65535 & (c += (b += (a += 65535 & l) >>> 16) >>> 16) | (d += c >>> 16) << 16, | |
ah5 = bh4, ah6 = bh5, ah7 = bh6, ah0 = bh7, al1 = bl0, al2 = bl1, al3 = bl2, al4 = bl3 = 65535 & a | b << 16, | |
al5 = bl4, al6 = bl5, al7 = bl6, al0 = bl7, i % 16 == 15) for (j = 0; j < 16; j++) h = wh[j], | |
a = 65535 & (l = wl[j]), b = l >>> 16, c = 65535 & h, d = h >>> 16, h = wh[(j + 9) % 16], | |
a += 65535 & (l = wl[(j + 9) % 16]), b += l >>> 16, c += 65535 & h, d += h >>> 16, | |
th = wh[(j + 1) % 16], a += 65535 & (l = ((tl = wl[(j + 1) % 16]) >>> 1 | th << 31) ^ (tl >>> 8 | th << 24) ^ (tl >>> 7 | th << 25)), | |
b += l >>> 16, c += 65535 & (h = (th >>> 1 | tl << 31) ^ (th >>> 8 | tl << 24) ^ th >>> 7), | |
d += h >>> 16, th = wh[(j + 14) % 16], b += (l = ((tl = wl[(j + 14) % 16]) >>> 19 | th << 13) ^ (th >>> 29 | tl << 3) ^ (tl >>> 6 | th << 26)) >>> 16, | |
c += 65535 & (h = (th >>> 19 | tl << 13) ^ (tl >>> 29 | th << 3) ^ th >>> 6), d += h >>> 16, | |
d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, wh[j] = 65535 & c | d << 16, | |
wl[j] = 65535 & a | b << 16; | |
a = 65535 & (l = al0), b = l >>> 16, c = 65535 & (h = ah0), d = h >>> 16, h = hh[0], | |
b += (l = hl[0]) >>> 16, c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[0] = ah0 = 65535 & c | d << 16, hl[0] = al0 = 65535 & a | b << 16, a = 65535 & (l = al1), | |
b = l >>> 16, c = 65535 & (h = ah1), d = h >>> 16, h = hh[1], b += (l = hl[1]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[1] = ah1 = 65535 & c | d << 16, hl[1] = al1 = 65535 & a | b << 16, a = 65535 & (l = al2), | |
b = l >>> 16, c = 65535 & (h = ah2), d = h >>> 16, h = hh[2], b += (l = hl[2]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[2] = ah2 = 65535 & c | d << 16, hl[2] = al2 = 65535 & a | b << 16, a = 65535 & (l = al3), | |
b = l >>> 16, c = 65535 & (h = ah3), d = h >>> 16, h = hh[3], b += (l = hl[3]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[3] = ah3 = 65535 & c | d << 16, hl[3] = al3 = 65535 & a | b << 16, a = 65535 & (l = al4), | |
b = l >>> 16, c = 65535 & (h = ah4), d = h >>> 16, h = hh[4], b += (l = hl[4]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[4] = ah4 = 65535 & c | d << 16, hl[4] = al4 = 65535 & a | b << 16, a = 65535 & (l = al5), | |
b = l >>> 16, c = 65535 & (h = ah5), d = h >>> 16, h = hh[5], b += (l = hl[5]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[5] = ah5 = 65535 & c | d << 16, hl[5] = al5 = 65535 & a | b << 16, a = 65535 & (l = al6), | |
b = l >>> 16, c = 65535 & (h = ah6), d = h >>> 16, h = hh[6], b += (l = hl[6]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[6] = ah6 = 65535 & c | d << 16, hl[6] = al6 = 65535 & a | b << 16, a = 65535 & (l = al7), | |
b = l >>> 16, c = 65535 & (h = ah7), d = h >>> 16, h = hh[7], b += (l = hl[7]) >>> 16, | |
c += 65535 & h, d += h >>> 16, d += (c += (b += (a += 65535 & l) >>> 16) >>> 16) >>> 16, | |
hh[7] = ah7 = 65535 & c | d << 16, hl[7] = al7 = 65535 & a | b << 16, pos += 128, | |
n -= 128; | |
} | |
return n; | |
} | |
function crypto_hash(out, m, n) { | |
var i, hh = new Int32Array(8), hl = new Int32Array(8), x = new Uint8Array(256), b = n; | |
for (hh[0] = 1779033703, hh[1] = 3144134277, hh[2] = 1013904242, hh[3] = 2773480762, | |
hh[4] = 1359893119, hh[5] = 2600822924, hh[6] = 528734635, hh[7] = 1541459225, hl[0] = 4089235720, | |
hl[1] = 2227873595, hl[2] = 4271175723, hl[3] = 1595750129, hl[4] = 2917565137, | |
hl[5] = 725511199, hl[6] = 4215389547, hl[7] = 327033209, crypto_hashblocks_hl(hh, hl, m, n), | |
n %= 128, i = 0; i < n; i++) x[i] = m[b - n + i]; | |
for (x[n] = 128, x[(n = 256 - 128 * (n < 112 ? 1 : 0)) - 9] = 0, ts64(x, n - 8, b / 536870912 | 0, b << 3), | |
crypto_hashblocks_hl(hh, hl, x, n), i = 0; i < 8; i++) ts64(out, 8 * i, hh[i], hl[i]); | |
return 0; | |
} | |
function add(p, q) { | |
var a = gf(), b = gf(), c = gf(), d = gf(), e = gf(), f = gf(), g = gf(), h = gf(), t = gf(); | |
Z(a, p[1], p[0]), Z(t, q[1], q[0]), M(a, a, t), A(b, p[0], p[1]), A(t, q[0], q[1]), | |
M(b, b, t), M(c, p[3], q[3]), M(c, c, D2), M(d, p[2], q[2]), A(d, d, d), Z(e, b, a), | |
Z(f, d, c), A(g, d, c), A(h, b, a), M(p[0], e, f), M(p[1], h, g), M(p[2], g, f), | |
M(p[3], e, h); | |
} | |
function cswap(p, q, b) { | |
var i; | |
for (i = 0; i < 4; i++) sel25519(p[i], q[i], b); | |
} | |
function pack(r, p) { | |
var tx = gf(), ty = gf(), zi = gf(); | |
inv25519(zi, p[2]), M(tx, p[0], zi), M(ty, p[1], zi), pack25519(r, ty), r[31] ^= par25519(tx) << 7; | |
} | |
function scalarmult(p, q, s) { | |
var b, i; | |
for (set25519(p[0], gf0), set25519(p[1], gf1), set25519(p[2], gf1), set25519(p[3], gf0), | |
i = 255; i >= 0; --i) cswap(p, q, b = s[i / 8 | 0] >> (7 & i) & 1), add(q, p), add(p, p), | |
cswap(p, q, b); | |
} | |
function scalarbase(p, s) { | |
var q = [ gf(), gf(), gf(), gf() ]; | |
set25519(q[0], X), set25519(q[1], Y), set25519(q[2], gf1), M(q[3], X, Y), scalarmult(p, q, s); | |
} | |
function crypto_sign_keypair(pk, sk, seeded) { | |
var i, d = new Uint8Array(64), p = [ gf(), gf(), gf(), gf() ]; | |
for (seeded || randombytes(sk, 32), crypto_hash(d, sk, 32), d[0] &= 248, d[31] &= 127, | |
d[31] |= 64, scalarbase(p, d), pack(pk, p), i = 0; i < 32; i++) sk[i + 32] = pk[i]; | |
return 0; | |
} | |
var crypto, L = new Float64Array([ 237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16 ]); | |
function modL(r, x) { | |
var carry, i, j, k; | |
for (i = 63; i >= 32; --i) { | |
for (carry = 0, j = i - 32, k = i - 12; j < k; ++j) x[j] += carry - 16 * x[i] * L[j - (i - 32)], | |
carry = x[j] + 128 >> 8, x[j] -= 256 * carry; | |
x[j] += carry, x[i] = 0; | |
} | |
for (carry = 0, j = 0; j < 32; j++) x[j] += carry - (x[31] >> 4) * L[j], carry = x[j] >> 8, | |
x[j] &= 255; | |
for (j = 0; j < 32; j++) x[j] -= carry * L[j]; | |
for (i = 0; i < 32; i++) x[i + 1] += x[i] >> 8, r[i] = 255 & x[i]; | |
} | |
function reduce(r) { | |
var i, x = new Float64Array(64); | |
for (i = 0; i < 64; i++) x[i] = r[i]; | |
for (i = 0; i < 64; i++) r[i] = 0; | |
modL(r, x); | |
} | |
function crypto_sign(sm, m, n, sk) { | |
var i, j, d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64), x = new Float64Array(64), p = [ gf(), gf(), gf(), gf() ]; | |
crypto_hash(d, sk, 32), d[0] &= 248, d[31] &= 127, d[31] |= 64; | |
var smlen = n + 64; | |
for (i = 0; i < n; i++) sm[64 + i] = m[i]; | |
for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i]; | |
for (crypto_hash(r, sm.subarray(32), n + 32), reduce(r), scalarbase(p, r), pack(sm, p), | |
i = 32; i < 64; i++) sm[i] = sk[i]; | |
for (crypto_hash(h, sm, n + 64), reduce(h), i = 0; i < 64; i++) x[i] = 0; | |
for (i = 0; i < 32; i++) x[i] = r[i]; | |
for (i = 0; i < 32; i++) for (j = 0; j < 32; j++) x[i + j] += h[i] * d[j]; | |
return modL(sm.subarray(32), x), smlen; | |
} | |
function crypto_sign_open(m, sm, n, pk) { | |
var i, t = new Uint8Array(32), h = new Uint8Array(64), p = [ gf(), gf(), gf(), gf() ], q = [ gf(), gf(), gf(), gf() ]; | |
if (n < 64) return -1; | |
if ((function(r, p) { | |
var t = gf(), chk = gf(), num = gf(), den = gf(), den2 = gf(), den4 = gf(), den6 = gf(); | |
return set25519(r[2], gf1), unpack25519(r[1], p), S(num, r[1]), M(den, num, D), | |
Z(num, num, r[2]), A(den, r[2], den), S(den2, den), S(den4, den2), M(den6, den4, den2), | |
M(t, den6, num), M(t, t, den), (function(o, i) { | |
var a, c = gf(); | |
for (a = 0; a < 16; a++) c[a] = i[a]; | |
for (a = 250; a >= 0; a--) S(c, c), 1 !== a && M(c, c, i); | |
for (a = 0; a < 16; a++) o[a] = c[a]; | |
})(t, t), M(t, t, num), M(t, t, den), M(t, t, den), M(r[0], t, den), S(chk, r[0]), | |
M(chk, chk, den), neq25519(chk, num) && M(r[0], r[0], I), S(chk, r[0]), M(chk, chk, den), | |
neq25519(chk, num) ? -1 : (par25519(r[0]) === p[31] >> 7 && Z(r[0], gf0, r[0]), | |
M(r[3], r[0], r[1]), 0); | |
})(q, pk)) return -1; | |
for (i = 0; i < n; i++) m[i] = sm[i]; | |
for (i = 0; i < 32; i++) m[i + 32] = pk[i]; | |
if (crypto_hash(h, m, n), reduce(h), scalarmult(p, q, h), scalarbase(q, sm.subarray(32)), | |
add(p, q), pack(t, p), n -= 64, crypto_verify_32(sm, 0, t, 0)) { | |
for (i = 0; i < n; i++) m[i] = 0; | |
return -1; | |
} | |
for (i = 0; i < n; i++) m[i] = sm[i + 64]; | |
return n; | |
} | |
function checkLengths(k, n) { | |
if (32 !== k.length) throw new Error("bad key size"); | |
if (24 !== n.length) throw new Error("bad nonce size"); | |
} | |
function checkArrayTypes() { | |
var t, i; | |
for (i = 0; i < arguments.length; i++) if ("[object Uint8Array]" !== (t = Object.prototype.toString.call(arguments[i]))) throw new TypeError("unexpected type " + t + ", use Uint8Array"); | |
} | |
function cleanup(arr) { | |
for (var i = 0; i < arr.length; i++) arr[i] = 0; | |
} | |
nacl.lowlevel = { | |
crypto_core_hsalsa20: crypto_core_hsalsa20, | |
crypto_stream_xor: crypto_stream_xor, | |
crypto_stream: crypto_stream, | |
crypto_stream_salsa20_xor: crypto_stream_salsa20_xor, | |
crypto_stream_salsa20: crypto_stream_salsa20, | |
crypto_onetimeauth: crypto_onetimeauth, | |
crypto_onetimeauth_verify: crypto_onetimeauth_verify, | |
crypto_verify_16: crypto_verify_16, | |
crypto_verify_32: crypto_verify_32, | |
crypto_secretbox: crypto_secretbox, | |
crypto_secretbox_open: crypto_secretbox_open, | |
crypto_scalarmult: crypto_scalarmult, | |
crypto_scalarmult_base: crypto_scalarmult_base, | |
crypto_box_beforenm: crypto_box_beforenm, | |
crypto_box_afternm: crypto_box_afternm, | |
crypto_box: function(c, m, d, n, y, x) { | |
var k = new Uint8Array(32); | |
return crypto_box_beforenm(k, y, x), crypto_box_afternm(c, m, d, n, k); | |
}, | |
crypto_box_open: function(m, c, d, n, y, x) { | |
var k = new Uint8Array(32); | |
return crypto_box_beforenm(k, y, x), crypto_box_open_afternm(m, c, d, n, k); | |
}, | |
crypto_box_keypair: crypto_box_keypair, | |
crypto_hash: crypto_hash, | |
crypto_sign: crypto_sign, | |
crypto_sign_keypair: crypto_sign_keypair, | |
crypto_sign_open: crypto_sign_open, | |
crypto_secretbox_KEYBYTES: 32, | |
crypto_secretbox_NONCEBYTES: 24, | |
crypto_secretbox_ZEROBYTES: 32, | |
crypto_secretbox_BOXZEROBYTES: 16, | |
crypto_scalarmult_BYTES: 32, | |
crypto_scalarmult_SCALARBYTES: 32, | |
crypto_box_PUBLICKEYBYTES: 32, | |
crypto_box_SECRETKEYBYTES: 32, | |
crypto_box_BEFORENMBYTES: 32, | |
crypto_box_NONCEBYTES: 24, | |
crypto_box_ZEROBYTES: 32, | |
crypto_box_BOXZEROBYTES: 16, | |
crypto_sign_BYTES: 64, | |
crypto_sign_PUBLICKEYBYTES: 32, | |
crypto_sign_SECRETKEYBYTES: 64, | |
crypto_sign_SEEDBYTES: 32, | |
crypto_hash_BYTES: 64 | |
}, nacl.util || (nacl.util = {}, nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { | |
throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js"); | |
}), nacl.randomBytes = function(n) { | |
var b = new Uint8Array(n); | |
return randombytes(b, n), b; | |
}, nacl.secretbox = function(msg, nonce, key) { | |
checkArrayTypes(msg, nonce, key), checkLengths(key, nonce); | |
for (var m = new Uint8Array(32 + msg.length), c = new Uint8Array(m.length), i = 0; i < msg.length; i++) m[i + 32] = msg[i]; | |
return crypto_secretbox(c, m, m.length, nonce, key), c.subarray(16); | |
}, nacl.secretbox.open = function(box, nonce, key) { | |
checkArrayTypes(box, nonce, key), checkLengths(key, nonce); | |
for (var c = new Uint8Array(16 + box.length), m = new Uint8Array(c.length), i = 0; i < box.length; i++) c[i + 16] = box[i]; | |
return !(c.length < 32) && 0 === crypto_secretbox_open(m, c, c.length, nonce, key) && m.subarray(32); | |
}, nacl.secretbox.keyLength = 32, nacl.secretbox.nonceLength = 24, nacl.secretbox.overheadLength = 16, | |
nacl.scalarMult = function(n, p) { | |
if (checkArrayTypes(n, p), 32 !== n.length) throw new Error("bad n size"); | |
if (32 !== p.length) throw new Error("bad p size"); | |
var q = new Uint8Array(32); | |
return crypto_scalarmult(q, n, p), q; | |
}, nacl.scalarMult.base = function(n) { | |
if (checkArrayTypes(n), 32 !== n.length) throw new Error("bad n size"); | |
var q = new Uint8Array(32); | |
return crypto_scalarmult_base(q, n), q; | |
}, nacl.scalarMult.scalarLength = 32, nacl.scalarMult.groupElementLength = 32, nacl.box = function(msg, nonce, publicKey, secretKey) { | |
var k = nacl.box.before(publicKey, secretKey); | |
return nacl.secretbox(msg, nonce, k); | |
}, nacl.box.before = function(publicKey, secretKey) { | |
checkArrayTypes(publicKey, secretKey), (function(pk, sk) { | |
if (32 !== pk.length) throw new Error("bad public key size"); | |
if (32 !== sk.length) throw new Error("bad secret key size"); | |
})(publicKey, secretKey); | |
var k = new Uint8Array(32); | |
return crypto_box_beforenm(k, publicKey, secretKey), k; | |
}, nacl.box.after = nacl.secretbox, nacl.box.open = function(msg, nonce, publicKey, secretKey) { | |
var k = nacl.box.before(publicKey, secretKey); | |
return nacl.secretbox.open(msg, nonce, k); | |
}, nacl.box.open.after = nacl.secretbox.open, nacl.box.keyPair = function() { | |
var pk = new Uint8Array(32), sk = new Uint8Array(32); | |
return crypto_box_keypair(pk, sk), { | |
publicKey: pk, | |
secretKey: sk | |
}; | |
}, nacl.box.keyPair.fromSecretKey = function(secretKey) { | |
if (checkArrayTypes(secretKey), 32 !== secretKey.length) throw new Error("bad secret key size"); | |
var pk = new Uint8Array(32); | |
return crypto_scalarmult_base(pk, secretKey), { | |
publicKey: pk, | |
secretKey: new Uint8Array(secretKey) | |
}; | |
}, nacl.box.publicKeyLength = 32, nacl.box.secretKeyLength = 32, nacl.box.sharedKeyLength = 32, | |
nacl.box.nonceLength = 24, nacl.box.overheadLength = nacl.secretbox.overheadLength, | |
nacl.sign = function(msg, secretKey) { | |
if (checkArrayTypes(msg, secretKey), 64 !== secretKey.length) throw new Error("bad secret key size"); | |
var signedMsg = new Uint8Array(64 + msg.length); | |
return crypto_sign(signedMsg, msg, msg.length, secretKey), signedMsg; | |
}, nacl.sign.open = function(signedMsg, publicKey) { | |
if (2 !== arguments.length) throw new Error("nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?"); | |
if (checkArrayTypes(signedMsg, publicKey), 32 !== publicKey.length) throw new Error("bad public key size"); | |
var tmp = new Uint8Array(signedMsg.length), mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey); | |
if (mlen < 0) return null; | |
for (var m = new Uint8Array(mlen), i = 0; i < m.length; i++) m[i] = tmp[i]; | |
return m; | |
}, nacl.sign.detached = function(msg, secretKey) { | |
for (var signedMsg = nacl.sign(msg, secretKey), sig = new Uint8Array(64), i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; | |
return sig; | |
}, nacl.sign.detached.verify = function(msg, sig, publicKey) { | |
if (checkArrayTypes(msg, sig, publicKey), 64 !== sig.length) throw new Error("bad signature size"); | |
if (32 !== publicKey.length) throw new Error("bad public key size"); | |
var i, sm = new Uint8Array(64 + msg.length), m = new Uint8Array(64 + msg.length); | |
for (i = 0; i < 64; i++) sm[i] = sig[i]; | |
for (i = 0; i < msg.length; i++) sm[i + 64] = msg[i]; | |
return crypto_sign_open(m, sm, sm.length, publicKey) >= 0; | |
}, nacl.sign.keyPair = function() { | |
var pk = new Uint8Array(32), sk = new Uint8Array(64); | |
return crypto_sign_keypair(pk, sk), { | |
publicKey: pk, | |
secretKey: sk | |
}; | |
}, nacl.sign.keyPair.fromSecretKey = function(secretKey) { | |
if (checkArrayTypes(secretKey), 64 !== secretKey.length) throw new Error("bad secret key size"); | |
for (var pk = new Uint8Array(32), i = 0; i < pk.length; i++) pk[i] = secretKey[32 + i]; | |
return { | |
publicKey: pk, | |
secretKey: new Uint8Array(secretKey) | |
}; | |
}, nacl.sign.keyPair.fromSeed = function(seed) { | |
if (checkArrayTypes(seed), 32 !== seed.length) throw new Error("bad seed size"); | |
for (var pk = new Uint8Array(32), sk = new Uint8Array(64), i = 0; i < 32; i++) sk[i] = seed[i]; | |
return crypto_sign_keypair(pk, sk, !0), { | |
publicKey: pk, | |
secretKey: sk | |
}; | |
}, nacl.sign.publicKeyLength = 32, nacl.sign.secretKeyLength = 64, nacl.sign.seedLength = 32, | |
nacl.sign.signatureLength = 64, nacl.hash = function(msg) { | |
checkArrayTypes(msg); | |
var h = new Uint8Array(64); | |
return crypto_hash(h, msg, msg.length), h; | |
}, nacl.hash.hashLength = 64, nacl.verify = function(x, y) { | |
return checkArrayTypes(x, y), 0 !== x.length && 0 !== y.length && x.length === y.length && 0 === vn(x, 0, y, 0, x.length); | |
}, nacl.setPRNG = function(fn) { | |
randombytes = fn; | |
}, (crypto = "undefined" != typeof self ? self.crypto || self.msCrypto : null) && crypto.getRandomValues ? nacl.setPRNG((function(x, n) { | |
var i, v = new Uint8Array(n); | |
for (i = 0; i < n; i += 65536) crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, 65536))); | |
for (i = 0; i < n; i++) x[i] = v[i]; | |
cleanup(v); | |
})) : (crypto = __webpack_require__(9)) && crypto.randomBytes && nacl.setPRNG((function(x, n) { | |
var i, v = crypto.randomBytes(n); | |
for (i = 0; i < n; i++) x[i] = v[i]; | |
cleanup(v); | |
})); | |
})(module.exports ? module.exports : self.nacl = self.nacl || {}); | |
}, function(module, exports, __webpack_require__) { | |
module.exports = SSHBuffer; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer; | |
function SSHBuffer(opts) { | |
assert.object(opts, "options"), void 0 !== opts.buffer && assert.buffer(opts.buffer, "options.buffer"), | |
this._size = opts.buffer ? opts.buffer.length : 1024, this._buffer = opts.buffer || Buffer.alloc(this._size), | |
this._offset = 0; | |
} | |
SSHBuffer.prototype.toBuffer = function() { | |
return this._buffer.slice(0, this._offset); | |
}, SSHBuffer.prototype.atEnd = function() { | |
return this._offset >= this._buffer.length; | |
}, SSHBuffer.prototype.remainder = function() { | |
return this._buffer.slice(this._offset); | |
}, SSHBuffer.prototype.skip = function(n) { | |
this._offset += n; | |
}, SSHBuffer.prototype.expand = function() { | |
this._size *= 2; | |
var buf = Buffer.alloc(this._size); | |
this._buffer.copy(buf, 0), this._buffer = buf; | |
}, SSHBuffer.prototype.readPart = function() { | |
return { | |
data: this.readBuffer() | |
}; | |
}, SSHBuffer.prototype.readBuffer = function() { | |
var len = this._buffer.readUInt32BE(this._offset); | |
this._offset += 4, assert.ok(this._offset + len <= this._buffer.length, "length out of bounds at +0x" + this._offset.toString(16) + " (data truncated?)"); | |
var buf = this._buffer.slice(this._offset, this._offset + len); | |
return this._offset += len, buf; | |
}, SSHBuffer.prototype.readString = function() { | |
return this.readBuffer().toString(); | |
}, SSHBuffer.prototype.readCString = function() { | |
for (var offset = this._offset; offset < this._buffer.length && 0 !== this._buffer[offset]; ) offset++; | |
assert.ok(offset < this._buffer.length, "c string does not terminate"); | |
var str = this._buffer.slice(this._offset, offset).toString(); | |
return this._offset = offset + 1, str; | |
}, SSHBuffer.prototype.readInt = function() { | |
var v = this._buffer.readUInt32BE(this._offset); | |
return this._offset += 4, v; | |
}, SSHBuffer.prototype.readInt64 = function() { | |
assert.ok(this._offset + 8 < this._buffer.length, "buffer not long enough to read Int64"); | |
var v = this._buffer.slice(this._offset, this._offset + 8); | |
return this._offset += 8, v; | |
}, SSHBuffer.prototype.readChar = function() { | |
return this._buffer[this._offset++]; | |
}, SSHBuffer.prototype.writeBuffer = function(buf) { | |
for (;this._offset + 4 + buf.length > this._size; ) this.expand(); | |
this._buffer.writeUInt32BE(buf.length, this._offset), this._offset += 4, buf.copy(this._buffer, this._offset), | |
this._offset += buf.length; | |
}, SSHBuffer.prototype.writeString = function(str) { | |
this.writeBuffer(Buffer.from(str, "utf8")); | |
}, SSHBuffer.prototype.writeCString = function(str) { | |
for (;this._offset + 1 + str.length > this._size; ) this.expand(); | |
this._buffer.write(str, this._offset), this._offset += str.length, this._buffer[this._offset++] = 0; | |
}, SSHBuffer.prototype.writeInt = function(v) { | |
for (;this._offset + 4 > this._size; ) this.expand(); | |
this._buffer.writeUInt32BE(v, this._offset), this._offset += 4; | |
}, SSHBuffer.prototype.writeInt64 = function(v) { | |
if (assert.buffer(v, "value"), v.length > 8) { | |
for (var lead = v.slice(0, v.length - 8), i = 0; i < lead.length; ++i) assert.strictEqual(lead[i], 0, "must fit in 64 bits of precision"); | |
v = v.slice(v.length - 8, v.length); | |
} | |
for (;this._offset + 8 > this._size; ) this.expand(); | |
v.copy(this._buffer, this._offset), this._offset += 8; | |
}, SSHBuffer.prototype.writeChar = function(v) { | |
for (;this._offset + 1 > this._size; ) this.expand(); | |
this._buffer[this._offset++] = v; | |
}, SSHBuffer.prototype.writePart = function(p) { | |
this.writeBuffer(p.data); | |
}, SSHBuffer.prototype.write = function(buf) { | |
for (;this._offset + buf.length > this._size; ) this.expand(); | |
buf.copy(this._buffer, this._offset), this._offset += buf.length; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = { | |
read: function(buf, options) { | |
return pem.read(buf, options, "pkcs8"); | |
}, | |
readPkcs8: function(alg, type, der) { | |
der.peek() === asn1.Ber.Integer && (assert.strictEqual(type, "private", "unexpected Integer at start of public key"), | |
der.readString(asn1.Ber.Integer, !0)), der.readSequence(); | |
var next = der.offset + der.length, oid = der.readOID(); | |
switch (oid) { | |
case "1.2.840.113549.1.1.1": | |
return der._offset = next, "public" === type ? (function(der) { | |
der.readSequence(asn1.Ber.BitString), der.readByte(), der.readSequence(); | |
var n = readMPInt(der, "modulus"), e = readMPInt(der, "exponent"), key = { | |
type: "rsa", | |
source: der.originalInput, | |
parts: [ { | |
name: "e", | |
data: e | |
}, { | |
name: "n", | |
data: n | |
} ] | |
}; | |
return new Key(key); | |
})(der) : (function(der) { | |
der.readSequence(asn1.Ber.OctetString), der.readSequence(); | |
var ver = readMPInt(der, "version"); | |
assert.equal(ver[0], 0, "unknown RSA private key version"); | |
var n = readMPInt(der, "modulus"), e = readMPInt(der, "public exponent"), d = readMPInt(der, "private exponent"), p = readMPInt(der, "prime1"), q = readMPInt(der, "prime2"), dmodp = readMPInt(der, "exponent1"), dmodq = readMPInt(der, "exponent2"), iqmp = readMPInt(der, "iqmp"); | |
return new PrivateKey({ | |
type: "rsa", | |
parts: [ { | |
name: "n", | |
data: n | |
}, { | |
name: "e", | |
data: e | |
}, { | |
name: "d", | |
data: d | |
}, { | |
name: "iqmp", | |
data: iqmp | |
}, { | |
name: "p", | |
data: p | |
}, { | |
name: "q", | |
data: q | |
}, { | |
name: "dmodp", | |
data: dmodp | |
}, { | |
name: "dmodq", | |
data: dmodq | |
} ] | |
}); | |
})(der); | |
case "1.2.840.10040.4.1": | |
return "public" === type ? (function(der) { | |
der.readSequence(); | |
var p = readMPInt(der, "p"), q = readMPInt(der, "q"), g = readMPInt(der, "g"); | |
der.readSequence(asn1.Ber.BitString), der.readByte(); | |
var y = readMPInt(der, "y"); | |
return new Key({ | |
type: "dsa", | |
parts: [ { | |
name: "p", | |
data: p | |
}, { | |
name: "q", | |
data: q | |
}, { | |
name: "g", | |
data: g | |
}, { | |
name: "y", | |
data: y | |
} ] | |
}); | |
})(der) : (function(der) { | |
der.readSequence(); | |
var p = readMPInt(der, "p"), q = readMPInt(der, "q"), g = readMPInt(der, "g"); | |
der.readSequence(asn1.Ber.OctetString); | |
var x = readMPInt(der, "x"), y = utils.calculateDSAPublic(g, p, x); | |
return new PrivateKey({ | |
type: "dsa", | |
parts: [ { | |
name: "p", | |
data: p | |
}, { | |
name: "q", | |
data: q | |
}, { | |
name: "g", | |
data: g | |
}, { | |
name: "y", | |
data: y | |
}, { | |
name: "x", | |
data: x | |
} ] | |
}); | |
})(der); | |
case "1.2.840.10045.2.1": | |
return "public" === type ? (function(der) { | |
var curveName = readECDSACurve(der); | |
assert.string(curveName, "a known elliptic curve"); | |
var Q = der.readString(asn1.Ber.BitString, !0); | |
Q = utils.ecNormalize(Q); | |
var key = { | |
type: "ecdsa", | |
parts: [ { | |
name: "curve", | |
data: Buffer.from(curveName) | |
}, { | |
name: "Q", | |
data: Q | |
} ] | |
}; | |
return new Key(key); | |
})(der) : (function(der) { | |
var curveName = readECDSACurve(der); | |
assert.string(curveName, "a known elliptic curve"), der.readSequence(asn1.Ber.OctetString), | |
der.readSequence(); | |
var version = readMPInt(der, "version"); | |
assert.equal(version[0], 1, "unknown version of ECDSA key"); | |
var Q, d = der.readString(asn1.Ber.OctetString, !0); | |
160 == der.peek() && (der.readSequence(160), der._offset += der.length), 161 == der.peek() && (der.readSequence(161), | |
Q = der.readString(asn1.Ber.BitString, !0), Q = utils.ecNormalize(Q)), void 0 === Q && (Q = utils.publicFromPrivateECDSA(curveName, d).part.Q.data); | |
var key = { | |
type: "ecdsa", | |
parts: [ { | |
name: "curve", | |
data: Buffer.from(curveName) | |
}, { | |
name: "Q", | |
data: Q | |
}, { | |
name: "d", | |
data: d | |
} ] | |
}; | |
return new PrivateKey(key); | |
})(der); | |
case "1.3.101.112": | |
return "public" === type ? (function(der) { | |
0 === der.peek() && der.readByte(); | |
var A = utils.readBitString(der), key = { | |
type: "ed25519", | |
parts: [ { | |
name: "A", | |
data: utils.zeroPadToLength(A, 32) | |
} ] | |
}; | |
return new Key(key); | |
})(der) : (function(der) { | |
0 === der.peek() && der.readByte(), der.readSequence(asn1.Ber.OctetString); | |
var A, k = der.readString(asn1.Ber.OctetString, !0); | |
k = utils.zeroPadToLength(k, 32), der.peek() === asn1.Ber.BitString ? (A = utils.readBitString(der), | |
A = utils.zeroPadToLength(A, 32)) : A = utils.calculateED25519Public(k); | |
var key = { | |
type: "ed25519", | |
parts: [ { | |
name: "A", | |
data: utils.zeroPadToLength(A, 32) | |
}, { | |
name: "k", | |
data: utils.zeroPadToLength(k, 32) | |
} ] | |
}; | |
return new PrivateKey(key); | |
})(der); | |
case "1.3.101.110": | |
return "public" === type ? (function(der) { | |
var A = utils.readBitString(der), key = { | |
type: "curve25519", | |
parts: [ { | |
name: "A", | |
data: utils.zeroPadToLength(A, 32) | |
} ] | |
}; | |
return new Key(key); | |
})(der) : (function(der) { | |
0 === der.peek() && der.readByte(), der.readSequence(asn1.Ber.OctetString); | |
var k = der.readString(asn1.Ber.OctetString, !0); | |
k = utils.zeroPadToLength(k, 32); | |
var A = utils.calculateX25519Public(k), key = { | |
type: "curve25519", | |
parts: [ { | |
name: "A", | |
data: utils.zeroPadToLength(A, 32) | |
}, { | |
name: "k", | |
data: utils.zeroPadToLength(k, 32) | |
} ] | |
}; | |
return new PrivateKey(key); | |
})(der); | |
default: | |
throw new Error("Unknown key type OID " + oid); | |
} | |
}, | |
write: function(key, options) { | |
return pem.write(key, options, "pkcs8"); | |
}, | |
writePkcs8: writePkcs8, | |
pkcs8ToBuffer: function(key) { | |
var der = new asn1.BerWriter; | |
return writePkcs8(der, key), der.buffer; | |
}, | |
readECDSACurve: readECDSACurve, | |
writeECDSACurve: writeECDSACurve | |
}; | |
var assert = __webpack_require__(15), asn1 = __webpack_require__(49), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(30), utils = __webpack_require__(26), Key = __webpack_require__(25), PrivateKey = __webpack_require__(27), pem = __webpack_require__(56); | |
function readMPInt(der, nm) { | |
return assert.strictEqual(der.peek(), asn1.Ber.Integer, nm + " is not an Integer"), | |
utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)); | |
} | |
function readECDSACurve(der) { | |
var curveName, curveNames, j, c, cd; | |
if (der.peek() === asn1.Ber.OID) { | |
var oid = der.readOID(); | |
for (curveNames = Object.keys(algs.curves), j = 0; j < curveNames.length; ++j) if (c = curveNames[j], | |
(cd = algs.curves[c]).pkcs8oid === oid) { | |
curveName = c; | |
break; | |
} | |
} else { | |
der.readSequence(); | |
var version = der.readString(asn1.Ber.Integer, !0); | |
assert.strictEqual(version[0], 1, "ECDSA key not version 1"); | |
var curve = {}; | |
der.readSequence(); | |
var fieldTypeOid = der.readOID(); | |
assert.strictEqual(fieldTypeOid, "1.2.840.10045.1.1", "ECDSA key is not from a prime-field"); | |
var p = curve.p = utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)); | |
curve.size = 8 * p.length - utils.countZeros(p), der.readSequence(), curve.a = utils.mpNormalize(der.readString(asn1.Ber.OctetString, !0)), | |
curve.b = utils.mpNormalize(der.readString(asn1.Ber.OctetString, !0)), der.peek() === asn1.Ber.BitString && (curve.s = der.readString(asn1.Ber.BitString, !0)), | |
curve.G = der.readString(asn1.Ber.OctetString, !0), assert.strictEqual(curve.G[0], 4, "uncompressed G is required"), | |
curve.n = utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)), curve.h = utils.mpNormalize(der.readString(asn1.Ber.Integer, !0)), | |
assert.strictEqual(curve.h[0], 1, "a cofactor=1 curve is required"), curveNames = Object.keys(algs.curves); | |
var ks = Object.keys(curve); | |
for (j = 0; j < curveNames.length; ++j) { | |
c = curveNames[j], cd = algs.curves[c]; | |
for (var equal = !0, i = 0; i < ks.length; ++i) { | |
var k = ks[i]; | |
if (void 0 !== cd[k]) if ("object" == typeof cd[k] && void 0 !== cd[k].equals) { | |
if (!cd[k].equals(curve[k])) { | |
equal = !1; | |
break; | |
} | |
} else if (Buffer.isBuffer(cd[k])) { | |
if (cd[k].toString("binary") !== curve[k].toString("binary")) { | |
equal = !1; | |
break; | |
} | |
} else if (cd[k] !== curve[k]) { | |
equal = !1; | |
break; | |
} | |
} | |
if (equal) { | |
curveName = c; | |
break; | |
} | |
} | |
} | |
return curveName; | |
} | |
function writePkcs8(der, key) { | |
if (der.startSequence(), PrivateKey.isPrivateKey(key)) { | |
var sillyInt = Buffer.from([ 0 ]); | |
der.writeBuffer(sillyInt, asn1.Ber.Integer); | |
} | |
switch (der.startSequence(), key.type) { | |
case "rsa": | |
der.writeOID("1.2.840.113549.1.1.1"), PrivateKey.isPrivateKey(key) ? (function(key, der) { | |
der.writeNull(), der.endSequence(), der.startSequence(asn1.Ber.OctetString), der.startSequence(); | |
var version = Buffer.from([ 0 ]); | |
der.writeBuffer(version, asn1.Ber.Integer), der.writeBuffer(key.part.n.data, asn1.Ber.Integer), | |
der.writeBuffer(key.part.e.data, asn1.Ber.Integer), der.writeBuffer(key.part.d.data, asn1.Ber.Integer), | |
der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), | |
key.part.dmodp && key.part.dmodq || utils.addRSAMissing(key), der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer), | |
der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer), der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer), | |
der.endSequence(), der.endSequence(); | |
})(key, der) : (function(key, der) { | |
der.writeNull(), der.endSequence(), der.startSequence(asn1.Ber.BitString), der.writeByte(0), | |
der.startSequence(), der.writeBuffer(key.part.n.data, asn1.Ber.Integer), der.writeBuffer(key.part.e.data, asn1.Ber.Integer), | |
der.endSequence(), der.endSequence(); | |
})(key, der); | |
break; | |
case "dsa": | |
der.writeOID("1.2.840.10040.4.1"), PrivateKey.isPrivateKey(key) ? (function(key, der) { | |
der.startSequence(), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), | |
der.writeBuffer(key.part.g.data, asn1.Ber.Integer), der.endSequence(), der.endSequence(), | |
der.startSequence(asn1.Ber.OctetString), der.writeBuffer(key.part.x.data, asn1.Ber.Integer), | |
der.endSequence(); | |
})(key, der) : (function(key, der) { | |
der.startSequence(), der.writeBuffer(key.part.p.data, asn1.Ber.Integer), der.writeBuffer(key.part.q.data, asn1.Ber.Integer), | |
der.writeBuffer(key.part.g.data, asn1.Ber.Integer), der.endSequence(), der.endSequence(), | |
der.startSequence(asn1.Ber.BitString), der.writeByte(0), der.writeBuffer(key.part.y.data, asn1.Ber.Integer), | |
der.endSequence(); | |
})(key, der); | |
break; | |
case "ecdsa": | |
der.writeOID("1.2.840.10045.2.1"), PrivateKey.isPrivateKey(key) ? (function(key, der) { | |
writeECDSACurve(key, der), der.endSequence(), der.startSequence(asn1.Ber.OctetString), | |
der.startSequence(); | |
var version = Buffer.from([ 1 ]); | |
der.writeBuffer(version, asn1.Ber.Integer), der.writeBuffer(key.part.d.data, asn1.Ber.OctetString), | |
der.startSequence(161); | |
var Q = utils.ecNormalize(key.part.Q.data, !0); | |
der.writeBuffer(Q, asn1.Ber.BitString), der.endSequence(), der.endSequence(), der.endSequence(); | |
})(key, der) : (function(key, der) { | |
writeECDSACurve(key, der), der.endSequence(); | |
var Q = utils.ecNormalize(key.part.Q.data, !0); | |
der.writeBuffer(Q, asn1.Ber.BitString); | |
})(key, der); | |
break; | |
case "ed25519": | |
if (der.writeOID("1.3.101.112"), PrivateKey.isPrivateKey(key)) throw new Error("Ed25519 private keys in pkcs8 format are not supported"); | |
!(function(key, der) { | |
der.endSequence(), utils.writeBitString(der, key.part.A.data); | |
})(key, der); | |
break; | |
default: | |
throw new Error("Unsupported key type: " + key.type); | |
} | |
der.endSequence(); | |
} | |
function writeECDSACurve(key, der) { | |
var curve = algs.curves[key.curve]; | |
if (curve.pkcs8oid) der.writeOID(curve.pkcs8oid); else { | |
der.startSequence(); | |
var version = Buffer.from([ 1 ]); | |
der.writeBuffer(version, asn1.Ber.Integer), der.startSequence(), der.writeOID("1.2.840.10045.1.1"), | |
der.writeBuffer(curve.p, asn1.Ber.Integer), der.endSequence(), der.startSequence(); | |
var a = curve.p; | |
0 === a[0] && (a = a.slice(1)), der.writeBuffer(a, asn1.Ber.OctetString), der.writeBuffer(curve.b, asn1.Ber.OctetString), | |
der.writeBuffer(curve.s, asn1.Ber.BitString), der.endSequence(), der.writeBuffer(curve.G, asn1.Ber.OctetString), | |
der.writeBuffer(curve.n, asn1.Ber.Integer); | |
var h = curve.h; | |
h || (h = Buffer.from([ 1 ])), der.writeBuffer(h, asn1.Ber.Integer), der.endSequence(); | |
} | |
} | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Certificate; | |
var assert = __webpack_require__(15), Buffer = __webpack_require__(14).Buffer, algs = __webpack_require__(30), crypto = __webpack_require__(9), Fingerprint = __webpack_require__(97), errs = (__webpack_require__(48), | |
__webpack_require__(44)), utils = (__webpack_require__(0), __webpack_require__(26)), Key = __webpack_require__(25), PrivateKey = __webpack_require__(27), Identity = __webpack_require__(103), formats = {}; | |
formats.openssh = __webpack_require__(1057), formats.x509 = __webpack_require__(484), | |
formats.pem = __webpack_require__(1058); | |
var CertificateParseError = errs.CertificateParseError, InvalidAlgorithmError = errs.InvalidAlgorithmError; | |
function Certificate(opts) { | |
assert.object(opts, "options"), assert.arrayOfObject(opts.subjects, "options.subjects"), | |
utils.assertCompatible(opts.subjects[0], Identity, [ 1, 0 ], "options.subjects"), | |
utils.assertCompatible(opts.subjectKey, Key, [ 1, 0 ], "options.subjectKey"), utils.assertCompatible(opts.issuer, Identity, [ 1, 0 ], "options.issuer"), | |
void 0 !== opts.issuerKey && utils.assertCompatible(opts.issuerKey, Key, [ 1, 0 ], "options.issuerKey"), | |
assert.object(opts.signatures, "options.signatures"), assert.buffer(opts.serial, "options.serial"), | |
assert.date(opts.validFrom, "options.validFrom"), assert.date(opts.validUntil, "optons.validUntil"), | |
assert.optionalArrayOfString(opts.purposes, "options.purposes"), this._hashCache = {}, | |
this.subjects = opts.subjects, this.issuer = opts.issuer, this.subjectKey = opts.subjectKey, | |
this.issuerKey = opts.issuerKey, this.signatures = opts.signatures, this.serial = opts.serial, | |
this.validFrom = opts.validFrom, this.validUntil = opts.validUntil, this.purposes = opts.purposes; | |
} | |
Certificate.formats = formats, Certificate.prototype.toBuffer = function(format, options) { | |
return void 0 === format && (format = "x509"), assert.string(format, "format"), | |
assert.object(formats[format], "formats[format]"), assert.optionalObject(options, "options"), | |
formats[format].write(this, options); | |
}, Certificate.prototype.toString = function(format, options) { | |
return void 0 === format && (format = "pem"), this.toBuffer(format, options).toString(); | |
}, Certificate.prototype.fingerprint = function(algo) { | |
void 0 === algo && (algo = "sha256"), assert.string(algo, "algorithm"); | |
var opts = { | |
type: "certificate", | |
hash: this.hash(algo), | |
algorithm: algo | |
}; | |
return new Fingerprint(opts); | |
}, Certificate.prototype.hash = function(algo) { | |
if (assert.string(algo, "algorithm"), algo = algo.toLowerCase(), void 0 === algs.hashAlgs[algo]) throw new InvalidAlgorithmError(algo); | |
if (this._hashCache[algo]) return this._hashCache[algo]; | |
var hash = crypto.createHash(algo).update(this.toBuffer("x509")).digest(); | |
return this._hashCache[algo] = hash, hash; | |
}, Certificate.prototype.isExpired = function(when) { | |
return void 0 === when && (when = new Date), !(when.getTime() >= this.validFrom.getTime() && when.getTime() < this.validUntil.getTime()); | |
}, Certificate.prototype.isSignedBy = function(issuerCert) { | |
return utils.assertCompatible(issuerCert, Certificate, [ 1, 0 ], "issuer"), !!this.issuer.equals(issuerCert.subjects[0]) && !(this.issuer.purposes && this.issuer.purposes.length > 0 && -1 === this.issuer.purposes.indexOf("ca")) && this.isSignedByKey(issuerCert.subjectKey); | |
}, Certificate.prototype.getExtension = function(keyOrOid) { | |
return assert.string(keyOrOid, "keyOrOid"), this.getExtensions().filter((function(maybeExt) { | |
return "x509" === maybeExt.format ? maybeExt.oid === keyOrOid : "openssh" === maybeExt.format && maybeExt.name === keyOrOid; | |
}))[0]; | |
}, Certificate.prototype.getExtensions = function() { | |
var exts = [], x509 = this.signatures.x509; | |
x509 && x509.extras && x509.extras.exts && x509.extras.exts.forEach((function(ext) { | |
ext.format = "x509", exts.push(ext); | |
})); | |
var openssh = this.signatures.openssh; | |
return openssh && openssh.exts && openssh.exts.forEach((function(ext) { | |
ext.format = "openssh", exts.push(ext); | |
})), exts; | |
}, Certificate.prototype.isSignedByKey = function(issuerKey) { | |
if (utils.assertCompatible(issuerKey, Key, [ 1, 2 ], "issuerKey"), void 0 !== this.issuerKey) return this.issuerKey.fingerprint("sha512").matches(issuerKey); | |
var fmt = Object.keys(this.signatures)[0], valid = formats[fmt].verify(this, issuerKey); | |
return valid && (this.issuerKey = issuerKey), valid; | |
}, Certificate.prototype.signWith = function(key) { | |
utils.assertCompatible(key, PrivateKey, [ 1, 2 ], "key"); | |
for (var fmts = Object.keys(formats), didOne = !1, i = 0; i < fmts.length; ++i) "pem" !== fmts[i] && !0 === formats[fmts[i]].sign(this, key) && (didOne = !0); | |
if (!didOne) throw new Error("Failed to sign the certificate for any available certificate formats"); | |
}, Certificate.createSelfSigned = function(subjectOrSubjects, key, options) { | |
var subjects; | |
subjects = Array.isArray(subjectOrSubjects) ? subjectOrSubjects : [ subjectOrSubjects ], | |
assert.arrayOfObject(subjects), subjects.forEach((function(subject) { | |
utils.assertCompatible(subject, Identity, [ 1, 0 ], "subject"); | |
})), utils.assertCompatible(key, PrivateKey, [ 1, 2 ], "private key"), assert.optionalObject(options, "options"), | |
void 0 === options && (options = {}), assert.optionalObject(options.validFrom, "options.validFrom"), | |
assert.optionalObject(options.validUntil, "options.validUntil"); | |
var validFrom = options.validFrom, validUntil = options.validUntil; | |
if (void 0 === validFrom && (validFrom = new Date), void 0 === validUntil) { | |
assert.optionalNumber(options.lifetime, "options.lifetime"); | |
var lifetime = options.lifetime; | |
void 0 === lifetime && (lifetime = 31536e4), (validUntil = new Date).setTime(validUntil.getTime() + 1e3 * lifetime); | |
} | |
assert.optionalBuffer(options.serial, "options.serial"); | |
var serial = options.serial; | |
void 0 === serial && (serial = Buffer.from("0000000000000001", "hex")); | |
var purposes = options.purposes; | |
if (void 0 === purposes && (purposes = []), -1 === purposes.indexOf("signature") && purposes.push("signature"), | |
-1 === purposes.indexOf("ca") && purposes.push("ca"), -1 === purposes.indexOf("crl") && purposes.push("crl"), | |
purposes.length <= 3) { | |
var hostSubjects = subjects.filter((function(subject) { | |
return "host" === subject.type; | |
})), userSubjects = subjects.filter((function(subject) { | |
return "user" === subject.type; | |
})); | |
hostSubjects.length > 0 && -1 === purposes.indexOf("serverAuth") && purposes.push("serverAuth"), | |
userSubjects.length > 0 && -1 === purposes.indexOf("clientAuth") && purposes.push("clientAuth"), | |
(userSubjects.length > 0 || hostSubjects.length > 0) && (-1 === purposes.indexOf("keyAgreement") && purposes.push("keyAgreement"), | |
"rsa" === key.type && -1 === purposes.indexOf("encryption") && purposes.push("encryption")); | |
} | |
var cert = new Certificate({ | |
subjects: subjects, | |
issuer: subjects[0], | |
subjectKey: key.toPublic(), | |
issuerKey: key.toPublic(), | |
signatures: {}, | |
serial: serial, | |
validFrom: validFrom, | |
validUntil: validUntil, | |
purposes: purposes | |
}); | |
return cert.signWith(key), cert; | |
}, Certificate.create = function(subjectOrSubjects, key, issuer, issuerKey, options) { | |
var subjects; | |
subjects = Array.isArray(subjectOrSubjects) ? subjectOrSubjects : [ subjectOrSubjects ], | |
assert.arrayOfObject(subjects), subjects.forEach((function(subject) { | |
utils.assertCompatible(subject, Identity, [ 1, 0 ], "subject"); | |
})), utils.assertCompatible(key, Key, [ 1, 0 ], "key"), PrivateKey.isPrivateKey(key) && (key = key.toPublic()), | |
utils.assertCompatible(issuer, Identity, [ 1, 0 ], "issuer"), utils.assertCompatible(issuerKey, PrivateKey, [ 1, 2 ], "issuer key"), | |
assert.optionalObject(options, "options"), void 0 === options && (options = {}), | |
assert.optionalObject(options.validFrom, "options.validFrom"), assert.optionalObject(options.validUntil, "options.validUntil"); | |
var validFrom = options.validFrom, validUntil = options.validUntil; | |
if (void 0 === validFrom && (validFrom = new Date), void 0 === validUntil) { | |
assert.optionalNumber(options.lifetime, "options.lifetime"); | |
var lifetime = options.lifetime; | |
void 0 === lifetime && (lifetime = 31536e4), (validUntil = new Date).setTime(validUntil.getTime() + 1e3 * lifetime); | |
} | |
assert.optionalBuffer(options.serial, "options.serial"); | |
var serial = options.serial; | |
void 0 === serial && (serial = Buffer.from("0000000000000001", "hex")); | |
var purposes = options.purposes; | |
void 0 === purposes && (purposes = []), -1 === purposes.indexOf("signature") && purposes.push("signature"), | |
!0 === options.ca && (-1 === purposes.indexOf("ca") && purposes.push("ca"), -1 === purposes.indexOf("crl") && purposes.push("crl")); | |
var hostSubjects = subjects.filter((function(subject) { | |
return "host" === subject.type; | |
})), userSubjects = subjects.filter((function(subject) { | |
return "user" === subject.type; | |
})); | |
hostSubjects.length > 0 && -1 === purposes.indexOf("serverAuth") && purposes.push("serverAuth"), | |
userSubjects.length > 0 && -1 === purposes.indexOf("clientAuth") && purposes.push("clientAuth"), | |
(userSubjects.length > 0 || hostSubjects.length > 0) && (-1 === purposes.indexOf("keyAgreement") && purposes.push("keyAgreement"), | |
"rsa" === key.type && -1 === purposes.indexOf("encryption") && purposes.push("encryption")); | |
var cert = new Certificate({ | |
subjects: subjects, | |
issuer: issuer, | |
subjectKey: key, | |
issuerKey: issuerKey.toPublic(), | |
signatures: {}, | |
serial: serial, | |
validFrom: validFrom, | |
validUntil: validUntil, | |
purposes: purposes | |
}); | |
return cert.signWith(issuerKey), cert; | |
}, Certificate.parse = function(data, format, options) { | |
"string" != typeof data && assert.buffer(data, "data"), void 0 === format && (format = "auto"), | |
assert.string(format, "format"), "string" == typeof options && (options = { | |
filename: options | |
}), assert.optionalObject(options, "options"), void 0 === options && (options = {}), | |
assert.optionalString(options.filename, "options.filename"), void 0 === options.filename && (options.filename = "(unnamed)"), | |
assert.object(formats[format], "formats[format]"); | |
try { | |
return formats[format].read(data, options); | |
} catch (e) { | |
throw new CertificateParseError(options.filename, format, e); | |
} | |
}, Certificate.isCertificate = function(obj, ver) { | |
return utils.isCompatible(obj, Certificate, ver); | |
}, Certificate.prototype._sshpkApiVersion = [ 1, 1 ], Certificate._oldVersionDetect = function(obj) { | |
return [ 1, 0 ]; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Identity; | |
var assert = __webpack_require__(15), utils = (__webpack_require__(30), __webpack_require__(9), | |
__webpack_require__(97), __webpack_require__(48), __webpack_require__(44), __webpack_require__(0), | |
__webpack_require__(26)), asn1 = __webpack_require__(49), Buffer = __webpack_require__(14).Buffer, DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i, oids = { | |
cn: "2.5.4.3", | |
o: "2.5.4.10", | |
ou: "2.5.4.11", | |
l: "2.5.4.7", | |
s: "2.5.4.8", | |
c: "2.5.4.6", | |
sn: "2.5.4.4", | |
postalCode: "2.5.4.17", | |
serialNumber: "2.5.4.5", | |
street: "2.5.4.9", | |
x500UniqueIdentifier: "2.5.4.45", | |
role: "2.5.4.72", | |
telephoneNumber: "2.5.4.20", | |
description: "2.5.4.13", | |
dc: "0.9.2342.19200300.100.1.25", | |
uid: "0.9.2342.19200300.100.1.1", | |
mail: "0.9.2342.19200300.100.1.3", | |
title: "2.5.4.12", | |
gn: "2.5.4.42", | |
initials: "2.5.4.43", | |
pseudonym: "2.5.4.65", | |
emailAddress: "1.2.840.113549.1.9.1" | |
}, unoids = {}; | |
function Identity(opts) { | |
var self = this; | |
if (assert.object(opts, "options"), assert.arrayOfObject(opts.components, "options.components"), | |
this.components = opts.components, this.componentLookup = {}, this.components.forEach((function(c) { | |
c.name && !c.oid && (c.oid = oids[c.name]), c.oid && !c.name && (c.name = unoids[c.oid]), | |
void 0 === self.componentLookup[c.name] && (self.componentLookup[c.name] = []), | |
self.componentLookup[c.name].push(c); | |
})), this.componentLookup.cn && this.componentLookup.cn.length > 0 && (this.cn = this.componentLookup.cn[0].value), | |
assert.optionalString(opts.type, "options.type"), void 0 === opts.type) 1 === this.components.length && this.componentLookup.cn && 1 === this.componentLookup.cn.length && this.componentLookup.cn[0].value.match(DNS_NAME_RE) ? (this.type = "host", | |
this.hostname = this.componentLookup.cn[0].value) : this.componentLookup.dc && this.components.length === this.componentLookup.dc.length ? (this.type = "host", | |
this.hostname = this.componentLookup.dc.map((function(c) { | |
return c.value; | |
})).join(".")) : this.componentLookup.uid && this.components.length === this.componentLookup.uid.length ? (this.type = "user", | |
this.uid = this.componentLookup.uid[0].value) : this.componentLookup.cn && 1 === this.componentLookup.cn.length && this.componentLookup.cn[0].value.match(DNS_NAME_RE) ? (this.type = "host", | |
this.hostname = this.componentLookup.cn[0].value) : this.componentLookup.uid && 1 === this.componentLookup.uid.length ? (this.type = "user", | |
this.uid = this.componentLookup.uid[0].value) : this.componentLookup.mail && 1 === this.componentLookup.mail.length ? (this.type = "email", | |
this.email = this.componentLookup.mail[0].value) : this.componentLookup.cn && 1 === this.componentLookup.cn.length ? (this.type = "user", | |
this.uid = this.componentLookup.cn[0].value) : this.type = "unknown"; else if (this.type = opts.type, | |
"host" === this.type) this.hostname = opts.hostname; else if ("user" === this.type) this.uid = opts.uid; else { | |
if ("email" !== this.type) throw new Error("Unknown type " + this.type); | |
this.email = opts.email; | |
} | |
} | |
Object.keys(oids).forEach((function(k) { | |
unoids[oids[k]] = k; | |
})), Identity.prototype.toString = function() { | |
return this.components.map((function(c) { | |
var n = c.name.toUpperCase(); | |
n = n.replace(/=/g, "\\="); | |
var v = c.value; | |
return n + "=" + v.replace(/,/g, "\\,"); | |
})).join(", "); | |
}, Identity.prototype.get = function(name, asArray) { | |
assert.string(name, "name"); | |
var arr = this.componentLookup[name]; | |
if (void 0 !== arr && 0 !== arr.length) { | |
if (!asArray && arr.length > 1) throw new Error("Multiple values for attribute " + name); | |
return asArray ? arr.map((function(c) { | |
return c.value; | |
})) : arr[0].value; | |
} | |
}, Identity.prototype.toArray = function(idx) { | |
return this.components.map((function(c) { | |
return { | |
name: c.name, | |
value: c.value | |
}; | |
})); | |
}; | |
var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/, NOT_IA5 = /[^\x00-\x7f]/; | |
function globMatch(a, b) { | |
if ("**" === a || "**" === b) return !0; | |
var aParts = a.split("."), bParts = b.split("."); | |
if (aParts.length !== bParts.length) return !1; | |
for (var i = 0; i < aParts.length; ++i) if ("*" !== aParts[i] && "*" !== bParts[i] && aParts[i] !== bParts[i]) return !1; | |
return !0; | |
} | |
Identity.prototype.toAsn1 = function(der, tag) { | |
der.startSequence(tag), this.components.forEach((function(c) { | |
if (der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set), der.startSequence(), | |
der.writeOID(c.oid), c.asn1type === asn1.Ber.Utf8String || c.value.match(NOT_IA5)) { | |
var v = Buffer.from(c.value, "utf8"); | |
der.writeBuffer(v, asn1.Ber.Utf8String); | |
} else if (c.asn1type === asn1.Ber.IA5String || c.value.match(NOT_PRINTABLE)) der.writeString(c.value, asn1.Ber.IA5String); else { | |
var type = asn1.Ber.PrintableString; | |
void 0 !== c.asn1type && (type = c.asn1type), der.writeString(c.value, type); | |
} | |
der.endSequence(), der.endSequence(); | |
})), der.endSequence(); | |
}, Identity.prototype.equals = function(other) { | |
if (!Identity.isIdentity(other, [ 1, 0 ])) return !1; | |
if (other.components.length !== this.components.length) return !1; | |
for (var i = 0; i < this.components.length; ++i) { | |
if (this.components[i].oid !== other.components[i].oid) return !1; | |
if (!globMatch(this.components[i].value, other.components[i].value)) return !1; | |
} | |
return !0; | |
}, Identity.forHost = function(hostname) { | |
return assert.string(hostname, "hostname"), new Identity({ | |
type: "host", | |
hostname: hostname, | |
components: [ { | |
name: "cn", | |
value: hostname | |
} ] | |
}); | |
}, Identity.forUser = function(uid) { | |
return assert.string(uid, "uid"), new Identity({ | |
type: "user", | |
uid: uid, | |
components: [ { | |
name: "uid", | |
value: uid | |
} ] | |
}); | |
}, Identity.forEmail = function(email) { | |
return assert.string(email, "email"), new Identity({ | |
type: "email", | |
email: email, | |
components: [ { | |
name: "mail", | |
value: email | |
} ] | |
}); | |
}, Identity.parseDN = function(dn) { | |
assert.string(dn, "dn"); | |
for (var parts = [ "" ], idx = 0, rem = dn; rem.length > 0; ) { | |
var m; | |
if (null !== (m = /^,/.exec(rem))) parts[++idx] = "", rem = rem.slice(m[0].length); else if (null !== (m = /^\\,/.exec(rem))) parts[idx] += ",", | |
rem = rem.slice(m[0].length); else if (null !== (m = /^\\./.exec(rem))) parts[idx] += m[0], | |
rem = rem.slice(m[0].length); else { | |
if (null === (m = /^[^\\,]+/.exec(rem))) throw new Error("Failed to parse DN"); | |
parts[idx] += m[0], rem = rem.slice(m[0].length); | |
} | |
} | |
return new Identity({ | |
components: parts.map((function(c) { | |
for (var eqPos = (c = c.trim()).indexOf("="); eqPos > 0 && "\\" === c.charAt(eqPos - 1); ) eqPos = c.indexOf("=", eqPos + 1); | |
if (-1 === eqPos) throw new Error("Failed to parse DN"); | |
return { | |
name: c.slice(0, eqPos).toLowerCase().replace(/\\=/g, "="), | |
value: c.slice(eqPos + 1) | |
}; | |
})) | |
}); | |
}, Identity.fromArray = function(components) { | |
return assert.arrayOfObject(components, "components"), components.forEach((function(cmp) { | |
if (assert.object(cmp, "component"), assert.string(cmp.name, "component.name"), | |
!Buffer.isBuffer(cmp.value) && "string" != typeof cmp.value) throw new Error("Invalid component value"); | |
})), new Identity({ | |
components: components | |
}); | |
}, Identity.parseAsn1 = function(der, top) { | |
var components = []; | |
der.readSequence(top); | |
for (var end = der.offset + der.length; der.offset < end; ) { | |
der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); | |
var after = der.offset + der.length; | |
der.readSequence(); | |
var value, oid = der.readOID(), type = der.peek(); | |
switch (type) { | |
case asn1.Ber.PrintableString: | |
case asn1.Ber.IA5String: | |
case asn1.Ber.OctetString: | |
case asn1.Ber.T61String: | |
value = der.readString(type); | |
break; | |
case asn1.Ber.Utf8String: | |
value = (value = der.readString(type, !0)).toString("utf8"); | |
break; | |
case asn1.Ber.CharacterString: | |
case asn1.Ber.BMPString: | |
value = (value = der.readString(type, !0)).toString("utf16le"); | |
break; | |
default: | |
throw new Error("Unknown asn1 type " + type); | |
} | |
components.push({ | |
oid: oid, | |
asn1type: type, | |
value: value | |
}), der._offset = after; | |
} | |
return der._offset = end, new Identity({ | |
components: components | |
}); | |
}, Identity.isIdentity = function(obj, ver) { | |
return utils.isCompatible(obj, Identity, ver); | |
}, Identity.prototype._sshpkApiVersion = [ 1, 0 ], Identity._oldVersionDetect = function(obj) { | |
return [ 1, 0 ]; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = Writer; | |
var fs = __webpack_require__(59), inherits = __webpack_require__(6), rimraf = __webpack_require__(513), mkdir = __webpack_require__(170), path = __webpack_require__(4), umask = "win32" === process.platform ? 0 : process.umask(), getType = __webpack_require__(154), Abstract = __webpack_require__(242); | |
inherits(Writer, Abstract), Writer.dirmode = parseInt("0777", 8) & ~umask, Writer.filemode = parseInt("0666", 8) & ~umask; | |
var DirWriter = __webpack_require__(514), LinkWriter = __webpack_require__(515), FileWriter = __webpack_require__(516), ProxyWriter = __webpack_require__(517); | |
function Writer(props, current) { | |
"string" == typeof props && (props = { | |
path: props | |
}); | |
var ClassType = Writer; | |
switch (getType(props)) { | |
case "Directory": | |
ClassType = DirWriter; | |
break; | |
case "File": | |
ClassType = FileWriter; | |
break; | |
case "Link": | |
case "SymbolicLink": | |
ClassType = LinkWriter; | |
break; | |
default: | |
ClassType = ProxyWriter; | |
} | |
if (!(this instanceof ClassType)) return new ClassType(props); | |
Abstract.call(this), props.path || this.error("Must provide a path", null, !0), | |
this.type = props.type, this.props = props, this.depth = props.depth || 0, this.clobber = !1 !== props.clobber || props.clobber, | |
this.parent = props.parent || null, this.root = props.root || props.parent && props.parent.root || this, | |
this._path = this.path = path.resolve(props.path), "win32" === process.platform && (this.path = this._path = this.path.replace(/\?/g, "_"), | |
this._path.length >= 260 && (this._swallowErrors = !0, this._path = "\\\\?\\" + this.path.replace(/\//g, "\\"))), | |
this.basename = path.basename(props.path), this.dirname = path.dirname(props.path), | |
this.linkpath = props.linkpath || null, props.parent = props.root = null, this.size = props.size, | |
"string" == typeof props.mode && (props.mode = parseInt(props.mode, 8)), this.readable = !1, | |
this.writable = !0, this._buffer = [], this.ready = !1, this.filter = "function" == typeof props.filter ? props.filter : null, | |
this._stat(current); | |
} | |
function create(self) { | |
mkdir(path.dirname(self._path), Writer.dirmode, (function(er, made) { | |
return er ? self.error(er) : (self._madeDir = made, self._create()); | |
})); | |
} | |
function endChmod(self, want, current, path, cb) { | |
var wantMode = want.mode, chmod = want.follow || "SymbolicLink" !== self.type ? "chmod" : "lchmod"; | |
if (!fs[chmod]) return cb(); | |
if ("number" != typeof wantMode) return cb(); | |
var curMode = current.mode & parseInt("0777", 8); | |
if ((wantMode &= parseInt("0777", 8)) === curMode) return cb(); | |
fs[chmod](path, wantMode, cb); | |
} | |
function endChown(self, want, current, path, cb) { | |
if ("win32" === process.platform) return cb(); | |
if (!process.getuid || 0 !== process.getuid()) return cb(); | |
if ("number" != typeof want.uid && "number" != typeof want.gid) return cb(); | |
if (current.uid === want.uid && current.gid === want.gid) return cb(); | |
var chown = self.props.follow || "SymbolicLink" !== self.type ? "chown" : "lchown"; | |
if (!fs[chown]) return cb(); | |
"number" != typeof want.uid && (want.uid = current.uid), "number" != typeof want.gid && (want.gid = current.gid), | |
fs[chown](path, want.uid, want.gid, cb); | |
} | |
function endUtimes(self, want, current, path, cb) { | |
if (!fs.utimes || "win32" === process.platform) return cb(); | |
var utimes = want.follow || "SymbolicLink" !== self.type ? "utimes" : "lutimes"; | |
if ("lutimes" !== utimes || fs[utimes] || (utimes = "utimes"), !fs[utimes]) return cb(); | |
var curA = current.atime, curM = current.mtime, meA = want.atime, meM = want.mtime; | |
if (void 0 === meA && (meA = curA), void 0 === meM && (meM = curM), isDate(meA) || (meA = new Date(meA)), | |
isDate(meM) || (meA = new Date(meM)), meA.getTime() === curA.getTime() && meM.getTime() === curM.getTime()) return cb(); | |
fs[utimes](path, meA, meM, cb); | |
} | |
function endMadeDir(self, p, cb) { | |
var made = self._madeDir, d = path.dirname(p); | |
!(function(self, p, cb) { | |
var dirProps = {}; | |
Object.keys(self.props).forEach((function(k) { | |
dirProps[k] = self.props[k], "mode" === k && "Directory" !== self.type && (dirProps[k] = dirProps[k] | parseInt("0111", 8)); | |
})); | |
var todo = 3, errState = null; | |
function next(er) { | |
if (!errState) return er ? cb(errState = er) : 0 == --todo ? cb() : void 0; | |
} | |
fs.stat(p, (function(er, current) { | |
if (er) return cb(errState = er); | |
endChmod(self, dirProps, current, p, next), endChown(self, dirProps, current, p, next), | |
endUtimes(self, dirProps, current, p, next); | |
})); | |
})(self, d, (function(er) { | |
return er ? cb(er) : d === made ? cb() : void endMadeDir(self, d, cb); | |
})); | |
} | |
function isDate(d) { | |
return "object" == typeof d && "[object Date]" === (function(d) { | |
return Object.prototype.toString.call(d); | |
})(d); | |
} | |
Writer.prototype._create = function() { | |
var self = this; | |
fs[self.props.follow ? "stat" : "lstat"](self._path, (function(er) { | |
if (er) return self.warn("Cannot create " + self._path + "\nUnsupported type: " + self.type, "ENOTSUP"); | |
self._finish(); | |
})); | |
}, Writer.prototype._stat = function(current) { | |
var self = this, stat = self.props.follow ? "stat" : "lstat", who = self._proxy || self; | |
function statCb(er, current) { | |
return self.filter && !self.filter.call(who, who, current) ? (self._aborted = !0, | |
self.emit("end"), void self.emit("close")) : er || !current ? create(self) : (self._old = current, | |
getType(current) !== self.type || "File" === self.type && current.nlink > 1 ? rimraf(self._path, (function(er) { | |
if (er) return self.error(er); | |
self._old = null, create(self); | |
})) : void create(self)); | |
} | |
current ? statCb(null, current) : fs[stat](self._path, statCb); | |
}, Writer.prototype._finish = function() { | |
var self = this; | |
if (self._finishing) ; else { | |
self._finishing = !0; | |
var todo = 0, errState = null, done = !1; | |
if (self._old) self._old.atime = new Date(0), self._old.mtime = new Date(0), setProps(self._old); else { | |
var stat = self.props.follow ? "stat" : "lstat"; | |
fs[stat](self._path, (function(er, current) { | |
if (er) return "ENOENT" !== er.code || "Link" !== self.type && "SymbolicLink" !== self.type || "win32" !== process.platform ? self.error(er) : (self.ready = !0, | |
self.emit("ready"), self.emit("end"), self.emit("close"), void (self.end = self._finish = function() {})); | |
setProps(self._old = current); | |
})); | |
} | |
} | |
function setProps(current) { | |
todo += 3, endChmod(self, self.props, current, self._path, next("chmod")), endChown(self, self.props, current, self._path, next("chown")), | |
endUtimes(self, self.props, current, self._path, next("utimes")); | |
} | |
function next(what) { | |
return function(er) { | |
if (!errState) { | |
if (er) return er.fstream_finish_call = what, self.error(errState = er); | |
if (!(--todo > 0 || done)) { | |
if (done = !0, !self._madeDir) return end(); | |
endMadeDir(self, self._path, end); | |
} | |
} | |
function end(er) { | |
if (er) return er.fstream_finish_call = "setupMadeDir", self.error(er); | |
self.emit("end"), self.emit("close"); | |
} | |
}; | |
} | |
}, Writer.prototype.pipe = function() { | |
this.error("Can't pipe from writable stream"); | |
}, Writer.prototype.add = function() { | |
this.error("Can't add to non-Directory type"); | |
}, Writer.prototype.write = function() { | |
return !0; | |
}; | |
}, function(module, exports) { | |
module.exports = require("tty"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var deprecate = __webpack_require__(47)("body-parser"), parsers = Object.create(null); | |
function createParserGetter(name) { | |
return function() { | |
return (function(parserName) { | |
var parser = parsers[parserName]; | |
if (void 0 !== parser) return parser; | |
switch (parserName) { | |
case "json": | |
parser = __webpack_require__(550); | |
break; | |
case "raw": | |
parser = __webpack_require__(558); | |
break; | |
case "text": | |
parser = __webpack_require__(559); | |
break; | |
case "urlencoded": | |
parser = __webpack_require__(560); | |
} | |
return parsers[parserName] = parser; | |
})(name); | |
}; | |
} | |
exports = module.exports = deprecate.function((function(options) { | |
var opts = {}; | |
if (options) for (var prop in options) "type" !== prop && (opts[prop] = options[prop]); | |
var _urlencoded = exports.urlencoded(opts), _json = exports.json(opts); | |
return function(req, res, next) { | |
_json(req, res, (function(err) { | |
if (err) return next(err); | |
_urlencoded(req, res, next); | |
})); | |
}; | |
}), "bodyParser: use individual json/urlencoded middlewares"), Object.defineProperty(exports, "json", { | |
configurable: !0, | |
enumerable: !0, | |
get: createParserGetter("json") | |
}), Object.defineProperty(exports, "raw", { | |
configurable: !0, | |
enumerable: !0, | |
get: createParserGetter("raw") | |
}), Object.defineProperty(exports, "text", { | |
configurable: !0, | |
enumerable: !0, | |
get: createParserGetter("text") | |
}), Object.defineProperty(exports, "urlencoded", { | |
configurable: !0, | |
enumerable: !0, | |
get: createParserGetter("urlencoded") | |
}); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var PARAM_REGEXP = /; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g, TEXT_REGEXP = /^[\u000b\u0020-\u007e\u0080-\u00ff]+$/, TOKEN_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/, QESC_REGEXP = /\\([\u000b\u0020-\u00ff])/g, QUOTE_REGEXP = /([\\"])/g, TYPE_REGEXP = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/; | |
function qstring(val) { | |
var str = String(val); | |
if (TOKEN_REGEXP.test(str)) return str; | |
if (str.length > 0 && !TEXT_REGEXP.test(str)) throw new TypeError("invalid parameter value"); | |
return '"' + str.replace(QUOTE_REGEXP, "\\$1") + '"'; | |
} | |
function ContentType(type) { | |
this.parameters = Object.create(null), this.type = type; | |
} | |
exports.format = function(obj) { | |
if (!obj || "object" != typeof obj) throw new TypeError("argument obj is required"); | |
var parameters = obj.parameters, type = obj.type; | |
if (!type || !TYPE_REGEXP.test(type)) throw new TypeError("invalid type"); | |
var string = type; | |
if (parameters && "object" == typeof parameters) for (var param, params = Object.keys(parameters).sort(), i = 0; i < params.length; i++) { | |
if (param = params[i], !TOKEN_REGEXP.test(param)) throw new TypeError("invalid parameter name"); | |
string += "; " + param + "=" + qstring(parameters[param]); | |
} | |
return string; | |
}, exports.parse = function(string) { | |
if (!string) throw new TypeError("argument string is required"); | |
var header = "object" == typeof string ? (function(obj) { | |
var header; | |
if ("function" == typeof obj.getHeader ? header = obj.getHeader("content-type") : "object" == typeof obj.headers && (header = obj.headers && obj.headers["content-type"]), | |
"string" != typeof header) throw new TypeError("content-type header is missing from object"); | |
return header; | |
})(string) : string; | |
if ("string" != typeof header) throw new TypeError("argument string is required to be a string"); | |
var index = header.indexOf(";"), type = -1 !== index ? header.substr(0, index).trim() : header.trim(); | |
if (!TYPE_REGEXP.test(type)) throw new TypeError("invalid media type"); | |
var obj = new ContentType(type.toLowerCase()); | |
if (-1 !== index) { | |
var key, match, value; | |
for (PARAM_REGEXP.lastIndex = index; match = PARAM_REGEXP.exec(header); ) { | |
if (match.index !== index) throw new TypeError("invalid parameter format"); | |
index += match[0].length, key = match[1].toLowerCase(), '"' === (value = match[2])[0] && (value = value.substr(1, value.length - 2).replace(QESC_REGEXP, "$1")), | |
obj.parameters[key] = value; | |
} | |
if (index !== header.length) throw new TypeError("invalid parameter format"); | |
} | |
return obj; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = Object.setPrototypeOf || ({ | |
__proto__: [] | |
} instanceof Array ? function(obj, proto) { | |
return obj.__proto__ = proto, obj; | |
} : function(obj, proto) { | |
for (var prop in proto) obj.hasOwnProperty(prop) || (obj[prop] = proto[prop]); | |
return obj; | |
}); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var codes = __webpack_require__(551); | |
function status(code) { | |
if ("number" == typeof code) { | |
if (!status[code]) throw new Error("invalid status code: " + code); | |
return code; | |
} | |
if ("string" != typeof code) throw new TypeError("code must be a number or string"); | |
var n = parseInt(code, 10); | |
if (!isNaN(n)) { | |
if (!status[n]) throw new Error("invalid status code: " + n); | |
return n; | |
} | |
if (!(n = status[code.toLowerCase()])) throw new Error('invalid status message: "' + code + '"'); | |
return n; | |
} | |
module.exports = status, status.STATUS_CODES = codes, status.codes = (function(statuses, codes) { | |
var arr = []; | |
return Object.keys(codes).forEach((function(code) { | |
var message = codes[code], status = Number(code); | |
statuses[status] = message, statuses[message] = status, statuses[message.toLowerCase()] = status, | |
arr.push(status); | |
})), arr; | |
})(status, codes), status.redirect = { | |
300: !0, | |
301: !0, | |
302: !0, | |
303: !0, | |
305: !0, | |
307: !0, | |
308: !0 | |
}, status.empty = { | |
204: !0, | |
205: !0, | |
304: !0 | |
}, status.retry = { | |
502: !0, | |
503: !0, | |
504: !0 | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var createError = __webpack_require__(87), getBody = __webpack_require__(554), iconv = __webpack_require__(68), onFinished = __webpack_require__(85), zlib = __webpack_require__(45); | |
module.exports = function(req, res, next, parse, debug, options) { | |
var length, stream, opts = options; | |
req._body = !0; | |
var encoding = null !== opts.encoding ? opts.encoding : null, verify = opts.verify; | |
try { | |
stream = (function(req, debug, inflate) { | |
var stream, encoding = (req.headers["content-encoding"] || "identity").toLowerCase(), length = req.headers["content-length"]; | |
if (debug('content-encoding "%s"', encoding), !1 === inflate && "identity" !== encoding) throw createError(415, "content encoding unsupported", { | |
encoding: encoding, | |
type: "encoding.unsupported" | |
}); | |
switch (encoding) { | |
case "deflate": | |
stream = zlib.createInflate(), debug("inflate body"), req.pipe(stream); | |
break; | |
case "gzip": | |
stream = zlib.createGunzip(), debug("gunzip body"), req.pipe(stream); | |
break; | |
case "identity": | |
(stream = req).length = length; | |
break; | |
default: | |
throw createError(415, 'unsupported content encoding "' + encoding + '"', { | |
encoding: encoding, | |
type: "encoding.unsupported" | |
}); | |
} | |
return stream; | |
})(req, debug, opts.inflate), length = stream.length, stream.length = void 0; | |
} catch (err) { | |
return next(err); | |
} | |
if (opts.length = length, opts.encoding = verify ? null : encoding, null === opts.encoding && null !== encoding && !iconv.encodingExists(encoding)) return next(createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { | |
charset: encoding.toLowerCase(), | |
type: "charset.unsupported" | |
})); | |
debug("read body"), getBody(stream, opts, (function(error, body) { | |
var _error; | |
if (error) return _error = "encoding.unsupported" === error.type ? createError(415, 'unsupported charset "' + encoding.toUpperCase() + '"', { | |
charset: encoding.toLowerCase(), | |
type: "charset.unsupported" | |
}) : createError(400, error), stream.resume(), void onFinished(req, (function() { | |
next(createError(400, _error)); | |
})); | |
if (verify) try { | |
debug("verify body"), verify(req, res, body, encoding); | |
} catch (err) { | |
return void next(createError(403, err, { | |
body: body, | |
type: err.type || "entity.verify.failed" | |
})); | |
} | |
var str = body; | |
try { | |
debug("parse body"), str = "string" != typeof body && null !== encoding ? iconv.decode(body, encoding) : body, | |
req.body = parse(str); | |
} catch (err) { | |
return void next(createError(400, err, { | |
body: str, | |
type: err.type || "entity.parse.failed" | |
})); | |
} | |
next(); | |
})); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var debug = __webpack_require__(8)("router"), flatten = __webpack_require__(250), Layer = __webpack_require__(251), methods = __webpack_require__(61), mixin = __webpack_require__(60), parseUrl = __webpack_require__(46), Route = __webpack_require__(563), setPrototypeOf = __webpack_require__(564), slice = Array.prototype.slice, defer = "function" == typeof setImmediate ? setImmediate : function(fn) { | |
process.nextTick(fn.bind.apply(fn, arguments)); | |
}; | |
function Router(options) { | |
if (!(this instanceof Router)) return new Router(options); | |
var opts = options || {}; | |
function router(req, res, next) { | |
router.handle(req, res, next); | |
} | |
return setPrototypeOf(router, this), router.caseSensitive = opts.caseSensitive, | |
router.mergeParams = opts.mergeParams, router.params = {}, router.strict = opts.strict, | |
router.stack = [], router; | |
} | |
function matchLayer(layer, path) { | |
try { | |
return layer.match(path); | |
} catch (err) { | |
return err; | |
} | |
} | |
module.exports = Router, module.exports.Route = Route, Router.prototype = function() {}, | |
Router.prototype.param = function(name, fn) { | |
if (!name) throw new TypeError("argument name is required"); | |
if ("string" != typeof name) throw new TypeError("argument name must be a string"); | |
if (!fn) throw new TypeError("argument fn is required"); | |
if ("function" != typeof fn) throw new TypeError("argument fn must be a function"); | |
var params = this.params[name]; | |
return params || (params = this.params[name] = []), params.push(fn), this; | |
}, Router.prototype.handle = function(req, res, callback) { | |
if (!callback) throw new TypeError("argument callback is required"); | |
debug("dispatching %s %s", req.method, req.url); | |
var methods, old, fn, idx = 0, protohost = (function(url) { | |
if ("string" == typeof url && 0 !== url.length && "/" !== url[0]) { | |
var searchIndex = url.indexOf("?"), pathLength = -1 !== searchIndex ? searchIndex : url.length, fqdnIndex = url.substr(0, pathLength).indexOf("://"); | |
return -1 !== fqdnIndex ? url.substr(0, url.indexOf("/", 3 + fqdnIndex)) : void 0; | |
} | |
})(req.url) || "", removed = "", self = this, slashAdded = !1, paramcalled = {}, stack = this.stack, parentParams = req.params, parentUrl = req.baseUrl || "", done = (function(fn, obj) { | |
for (var props = new Array(arguments.length - 2), vals = new Array(arguments.length - 2), i = 0; i < props.length; i++) props[i] = arguments[i + 2], | |
vals[i] = obj[props[i]]; | |
return function() { | |
for (var i = 0; i < props.length; i++) obj[props[i]] = vals[i]; | |
return fn.apply(this, arguments); | |
}; | |
})(callback, req, "baseUrl", "next", "params"); | |
function next(err) { | |
var layerError = "route" === err ? null : err; | |
if (slashAdded && (req.url = req.url.substr(1), slashAdded = !1), 0 !== removed.length && (req.baseUrl = parentUrl, | |
req.url = protohost + removed + req.url.substr(protohost.length), removed = ""), | |
"router" !== layerError) if (idx >= stack.length) defer(done, layerError); else { | |
var layer, match, route, path = (function(req) { | |
try { | |
return parseUrl(req).pathname; | |
} catch (err) { | |
return; | |
} | |
})(req); | |
if (null == path) return done(layerError); | |
for (;!0 !== match && idx < stack.length; ) if (match = matchLayer(layer = stack[idx++], path), | |
route = layer.route, "boolean" != typeof match && (layerError = layerError || match), | |
!0 === match && route) if (layerError) match = !1; else { | |
var method = req.method, has_method = route._handles_method(method); | |
!has_method && "OPTIONS" === method && methods && methods.push.apply(methods, route._methods()), | |
has_method || "HEAD" === method || (match = !1); | |
} | |
if (!0 !== match) return done(layerError); | |
route && (req.route = route), req.params = self.mergeParams ? (function(params, parent) { | |
if ("object" != typeof parent || !parent) return params; | |
var obj = mixin({}, parent); | |
if (!(0 in params) || !(0 in parent)) return mixin(obj, params); | |
for (var i = 0, o = 0; i in params; ) i++; | |
for (;o in parent; ) o++; | |
for (i--; i >= 0; i--) params[i + o] = params[i], i < o && delete params[i]; | |
return mixin(obj, params); | |
})(layer.params, parentParams) : layer.params; | |
var layerPath = layer.path; | |
self.process_params(layer, paramcalled, req, res, (function(err) { | |
return err ? next(layerError || err) : route ? layer.handle_request(req, res, next) : void (function(layer, layerError, layerPath, path) { | |
if (0 !== layerPath.length) { | |
var c = path[layerPath.length]; | |
if (c && "/" !== c) return void next(layerError); | |
debug("trim prefix (%s) from url %s", layerPath, req.url), removed = layerPath, | |
req.url = protohost + req.url.substr(protohost.length + removed.length), protohost || "/" === req.url[0] || (req.url = "/" + req.url, | |
slashAdded = !0), req.baseUrl = parentUrl + ("/" === removed[removed.length - 1] ? removed.substring(0, removed.length - 1) : removed); | |
} | |
debug("%s %s : %s", layer.name, layerPath, req.originalUrl), layerError ? layer.handle_error(layerError, req, res, next) : layer.handle_request(req, res, next); | |
})(layer, layerError, layerPath, path); | |
})); | |
} else defer(done, null); | |
} | |
req.next = next, "OPTIONS" === req.method && (old = done, fn = (function(res, methods) { | |
return function(fn, err) { | |
if (err || 0 === methods.length) return fn(err); | |
!(function(res, methods, next) { | |
try { | |
!(function(res, methods) { | |
for (var options = Object.create(null), i = 0; i < methods.length; i++) options[methods[i]] = !0; | |
var allow = Object.keys(options).sort().join(", "); | |
res.setHeader("Allow", allow), res.setHeader("Content-Length", Buffer.byteLength(allow)), | |
res.setHeader("Content-Type", "text/plain"), res.setHeader("X-Content-Type-Options", "nosniff"), | |
res.end(allow); | |
})(res, methods); | |
} catch (err) { | |
next(err); | |
} | |
})(res, methods, fn); | |
}; | |
})(res, methods = []), done = function() { | |
var args = new Array(arguments.length + 1); | |
args[0] = old; | |
for (var i = 0, len = arguments.length; i < len; i++) args[i + 1] = arguments[i]; | |
fn.apply(this, args); | |
}), req.baseUrl = parentUrl, req.originalUrl = req.originalUrl || req.url, next(); | |
}, Router.prototype.process_params = function(layer, called, req, res, done) { | |
var params = this.params, keys = layer.keys; | |
if (!keys || 0 === keys.length) return done(); | |
var name, key, paramVal, paramCallbacks, paramCalled, i = 0, paramIndex = 0; | |
function param(err) { | |
return err ? done(err) : i >= keys.length ? done() : (paramIndex = 0, key = keys[i++], | |
name = key.name, paramVal = req.params[name], paramCallbacks = params[name], paramCalled = called[name], | |
void 0 !== paramVal && paramCallbacks ? paramCalled && (paramCalled.match === paramVal || paramCalled.error && "route" !== paramCalled.error) ? (req.params[name] = paramCalled.value, | |
param(paramCalled.error)) : (called[name] = paramCalled = { | |
error: null, | |
match: paramVal, | |
value: paramVal | |
}, void paramCallback()) : param()); | |
} | |
function paramCallback(err) { | |
var fn = paramCallbacks[paramIndex++]; | |
if (paramCalled.value = req.params[key.name], err) return paramCalled.error = err, | |
void param(err); | |
if (!fn) return param(); | |
try { | |
fn(req, res, paramCallback, paramVal, key.name); | |
} catch (e) { | |
paramCallback(e); | |
} | |
} | |
param(); | |
}, Router.prototype.use = function(handler) { | |
var offset = 0, path = "/"; | |
if ("function" != typeof handler) { | |
for (var arg = handler; Array.isArray(arg) && 0 !== arg.length; ) arg = arg[0]; | |
"function" != typeof arg && (offset = 1, path = handler); | |
} | |
var callbacks = flatten(slice.call(arguments, offset)); | |
if (0 === callbacks.length) throw new TypeError("argument handler is required"); | |
for (var i = 0; i < callbacks.length; i++) { | |
var fn = callbacks[i]; | |
if ("function" != typeof fn) throw new TypeError("argument handler must be a function"); | |
debug("use %o %s", path, fn.name || "<anonymous>"); | |
var layer = new Layer(path, { | |
sensitive: this.caseSensitive, | |
strict: !1, | |
end: !1 | |
}, fn); | |
layer.route = void 0, this.stack.push(layer); | |
} | |
return this; | |
}, Router.prototype.route = function(path) { | |
var route = new Route(path), layer = new Layer(path, { | |
sensitive: this.caseSensitive, | |
strict: this.strict, | |
end: !0 | |
}, (function(req, res, next) { | |
route.dispatch(req, res, next); | |
})); | |
return layer.route = route, this.stack.push(layer), route; | |
}, methods.concat("all").forEach((function(method) { | |
Router.prototype[method] = function(path) { | |
var route = this.route(path); | |
return route[method].apply(route, slice.call(arguments, 1)), this; | |
}; | |
})); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = function(a, b) { | |
if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) throw new TypeError("Arguments must be Buffers"); | |
if (a === b) return !0; | |
if ("function" == typeof a.equals) return a.equals(b); | |
if (a.length !== b.length) return !1; | |
for (var i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; | |
return !0; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = __webpack_require__(9).randomBytes; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = function(list, compare, sorted) { | |
return 0 === list.length ? list : compare ? (sorted || list.sort(compare), (function(list, compare) { | |
for (var ptr = 1, len = list.length, a = list[0], b = list[0], i = 1; i < len; ++i) if (b = a, | |
compare(a = list[i], b)) { | |
if (i === ptr) { | |
ptr++; | |
continue; | |
} | |
list[ptr++] = a; | |
} | |
return list.length = ptr, list; | |
})(list, compare)) : (sorted || list.sort(), (function(list) { | |
for (var ptr = 1, len = list.length, a = list[0], b = list[0], i = 1; i < len; ++i, | |
b = a) if (b = a, (a = list[i]) !== b) { | |
if (i === ptr) { | |
ptr++; | |
continue; | |
} | |
list[ptr++] = a; | |
} | |
return list.length = ptr, list; | |
})(list)); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var zlib = __webpack_require__(45), AVAILABLE_WINDOW_BITS = [ 8, 9, 10, 11, 12, 13, 14, 15 ]; | |
function PerMessageDeflate(options, isServer, maxPayload) { | |
if (this instanceof PerMessageDeflate == 0) throw new TypeError("Classes can't be function-called"); | |
this._options = options || {}, this._isServer = !!isServer, this._inflate = null, | |
this._deflate = null, this.params = null, this._maxPayload = maxPayload || 0; | |
} | |
PerMessageDeflate.extensionName = "permessage-deflate", PerMessageDeflate.prototype.offer = function() { | |
var params = {}; | |
return this._options.serverNoContextTakeover && (params.server_no_context_takeover = !0), | |
this._options.clientNoContextTakeover && (params.client_no_context_takeover = !0), | |
this._options.serverMaxWindowBits && (params.server_max_window_bits = this._options.serverMaxWindowBits), | |
this._options.clientMaxWindowBits ? params.client_max_window_bits = this._options.clientMaxWindowBits : null == this._options.clientMaxWindowBits && (params.client_max_window_bits = !0), | |
params; | |
}, PerMessageDeflate.prototype.accept = function(paramsList) { | |
var params; | |
return paramsList = this.normalizeParams(paramsList), params = this._isServer ? this.acceptAsServer(paramsList) : this.acceptAsClient(paramsList), | |
this.params = params, params; | |
}, PerMessageDeflate.prototype.cleanup = function() { | |
this._inflate && (this._inflate.writeInProgress ? this._inflate.pendingClose = !0 : (this._inflate.close && this._inflate.close(), | |
this._inflate = null)), this._deflate && (this._deflate.writeInProgress ? this._deflate.pendingClose = !0 : (this._deflate.close && this._deflate.close(), | |
this._deflate = null)); | |
}, PerMessageDeflate.prototype.acceptAsServer = function(paramsList) { | |
var accepted = {}; | |
if (!paramsList.some((function(params) { | |
if (accepted = {}, (!1 !== this._options.serverNoContextTakeover || !params.server_no_context_takeover) && (!1 !== this._options.serverMaxWindowBits || !params.server_max_window_bits) && !("number" == typeof this._options.serverMaxWindowBits && "number" == typeof params.server_max_window_bits && this._options.serverMaxWindowBits > params.server_max_window_bits) && ("number" != typeof this._options.clientMaxWindowBits || params.client_max_window_bits)) return (this._options.serverNoContextTakeover || params.server_no_context_takeover) && (accepted.server_no_context_takeover = !0), | |
this._options.clientNoContextTakeover && (accepted.client_no_context_takeover = !0), | |
!1 !== this._options.clientNoContextTakeover && params.client_no_context_takeover && (accepted.client_no_context_takeover = !0), | |
"number" == typeof this._options.serverMaxWindowBits ? accepted.server_max_window_bits = this._options.serverMaxWindowBits : "number" == typeof params.server_max_window_bits && (accepted.server_max_window_bits = params.server_max_window_bits), | |
"number" == typeof this._options.clientMaxWindowBits ? accepted.client_max_window_bits = this._options.clientMaxWindowBits : !1 !== this._options.clientMaxWindowBits && "number" == typeof params.client_max_window_bits && (accepted.client_max_window_bits = params.client_max_window_bits), | |
!0; | |
}), this)) throw new Error("Doesn't support the offered configuration"); | |
return accepted; | |
}, PerMessageDeflate.prototype.acceptAsClient = function(paramsList) { | |
var params = paramsList[0]; | |
if (null != this._options.clientNoContextTakeover && !1 === this._options.clientNoContextTakeover && params.client_no_context_takeover) throw new Error('Invalid value for "client_no_context_takeover"'); | |
if (null != this._options.clientMaxWindowBits) { | |
if (!1 === this._options.clientMaxWindowBits && params.client_max_window_bits) throw new Error('Invalid value for "client_max_window_bits"'); | |
if ("number" == typeof this._options.clientMaxWindowBits && (!params.client_max_window_bits || params.client_max_window_bits > this._options.clientMaxWindowBits)) throw new Error('Invalid value for "client_max_window_bits"'); | |
} | |
return params; | |
}, PerMessageDeflate.prototype.normalizeParams = function(paramsList) { | |
return paramsList.map((function(params) { | |
return Object.keys(params).forEach((function(key) { | |
var value = params[key]; | |
if (value.length > 1) throw new Error("Multiple extension parameters for " + key); | |
switch (value = value[0], key) { | |
case "server_no_context_takeover": | |
case "client_no_context_takeover": | |
if (!0 !== value) throw new Error("invalid extension parameter value for " + key + " (" + value + ")"); | |
params[key] = !0; | |
break; | |
case "server_max_window_bits": | |
case "client_max_window_bits": | |
if ("string" == typeof value && (value = parseInt(value, 10), !~AVAILABLE_WINDOW_BITS.indexOf(value))) throw new Error("invalid extension parameter value for " + key + " (" + value + ")"); | |
if (!this._isServer && !0 === value) throw new Error("Missing extension parameter value for " + key); | |
params[key] = value; | |
break; | |
default: | |
throw new Error("Not defined extension parameter (" + key + ")"); | |
} | |
}), this), params; | |
}), this); | |
}, PerMessageDeflate.prototype.decompress = function(data, fin, callback) { | |
var endpoint = this._isServer ? "client" : "server"; | |
if (!this._inflate) { | |
var maxWindowBits = this.params[endpoint + "_max_window_bits"]; | |
this._inflate = zlib.createInflateRaw({ | |
windowBits: "number" == typeof maxWindowBits ? maxWindowBits : 15 | |
}); | |
} | |
this._inflate.writeInProgress = !0; | |
var self = this, buffers = [], cumulativeBufferLength = 0; | |
function onError(err) { | |
cleanup(), callback(err); | |
} | |
function onData(data) { | |
void 0 !== self._maxPayload && null !== self._maxPayload && self._maxPayload > 0 && (cumulativeBufferLength += data.length) > self._maxPayload ? (buffers = [], | |
cleanup(), callback({ | |
type: 1009 | |
})) : buffers.push(data); | |
} | |
function cleanup() { | |
self._inflate && (self._inflate.removeListener("error", onError), self._inflate.removeListener("data", onData), | |
self._inflate.writeInProgress = !1, (fin && self.params[endpoint + "_no_context_takeover"] || self._inflate.pendingClose) && (self._inflate.close && self._inflate.close(), | |
self._inflate = null)); | |
} | |
this._inflate.on("error", onError).on("data", onData), this._inflate.write(data), | |
fin && this._inflate.write(new Buffer([ 0, 0, 255, 255 ])), this._inflate.flush((function() { | |
cleanup(), callback(null, Buffer.concat(buffers)); | |
})); | |
}, PerMessageDeflate.prototype.compress = function(data, fin, callback) { | |
var endpoint = this._isServer ? "server" : "client"; | |
if (!this._deflate) { | |
var maxWindowBits = this.params[endpoint + "_max_window_bits"]; | |
this._deflate = zlib.createDeflateRaw({ | |
flush: zlib.Z_SYNC_FLUSH, | |
windowBits: "number" == typeof maxWindowBits ? maxWindowBits : 15, | |
memLevel: this._options.memLevel || 8 | |
}); | |
} | |
this._deflate.writeInProgress = !0; | |
var self = this, buffers = []; | |
function onError(err) { | |
cleanup(), callback(err); | |
} | |
function onData(data) { | |
buffers.push(data); | |
} | |
function cleanup() { | |
self._deflate && (self._deflate.removeListener("error", onError), self._deflate.removeListener("data", onData), | |
self._deflate.writeInProgress = !1, (fin && self.params[endpoint + "_no_context_takeover"] || self._deflate.pendingClose) && (self._deflate.close && self._deflate.close(), | |
self._deflate = null)); | |
} | |
this._deflate.on("error", onError).on("data", onData), this._deflate.write(data), | |
this._deflate.flush((function() { | |
cleanup(); | |
var data = Buffer.concat(buffers); | |
fin && (data = data.slice(0, data.length - 4)), callback(null, data); | |
})); | |
}, module.exports = PerMessageDeflate; | |
}, function(module, exports, __webpack_require__) { | |
var ip = exports, {Buffer: Buffer} = __webpack_require__(10), os = __webpack_require__(21); | |
ip.toBuffer = function(ip, buff, offset) { | |
var result; | |
if (offset = ~~offset, this.isV4Format(ip)) result = buff || new Buffer(offset + 4), | |
ip.split(/\./g).map((byte => { | |
result[offset++] = 255 & parseInt(byte, 10); | |
})); else if (this.isV6Format(ip)) { | |
var i, sections = ip.split(":", 8); | |
for (i = 0; i < sections.length; i++) { | |
var v4Buffer; | |
this.isV4Format(sections[i]) && (v4Buffer = this.toBuffer(sections[i]), sections[i] = v4Buffer.slice(0, 2).toString("hex")), | |
v4Buffer && ++i < 8 && sections.splice(i, 0, v4Buffer.slice(2, 4).toString("hex")); | |
} | |
if ("" === sections[0]) for (;sections.length < 8; ) sections.unshift("0"); else if ("" === sections[sections.length - 1]) for (;sections.length < 8; ) sections.push("0"); else if (sections.length < 8) { | |
for (i = 0; i < sections.length && "" !== sections[i]; i++) ; | |
var argv = [ i, 1 ]; | |
for (i = 9 - sections.length; i > 0; i--) argv.push("0"); | |
sections.splice.apply(sections, argv); | |
} | |
for (result = buff || new Buffer(offset + 16), i = 0; i < sections.length; i++) { | |
var word = parseInt(sections[i], 16); | |
result[offset++] = word >> 8 & 255, result[offset++] = 255 & word; | |
} | |
} | |
if (!result) throw Error(`Invalid ip address: ${ip}`); | |
return result; | |
}, ip.toString = function(buff, offset, length) { | |
offset = ~~offset; | |
var i, result = []; | |
if (4 === (length = length || buff.length - offset)) { | |
for (i = 0; i < length; i++) result.push(buff[offset + i]); | |
result = result.join("."); | |
} else if (16 === length) { | |
for (i = 0; i < length; i += 2) result.push(buff.readUInt16BE(offset + i).toString(16)); | |
result = (result = (result = result.join(":")).replace(/(^|:)0(:0)*:0(:|$)/, "$1::$3")).replace(/:{3,4}/, "::"); | |
} | |
return result; | |
}; | |
var ipv4Regex = /^(\d{1,3}\.){3,3}\d{1,3}$/, ipv6Regex = /^(::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?$/i; | |
function _normalizeFamily(family) { | |
return 4 === family ? "ipv4" : 6 === family ? "ipv6" : family ? family.toLowerCase() : "ipv4"; | |
} | |
ip.isV4Format = function(ip) { | |
return ipv4Regex.test(ip); | |
}, ip.isV6Format = function(ip) { | |
return ipv6Regex.test(ip); | |
}, ip.fromPrefixLen = function(prefixlen, family) { | |
var len = 4; | |
"ipv6" === (family = prefixlen > 32 ? "ipv6" : _normalizeFamily(family)) && (len = 16); | |
for (var buff = new Buffer(len), i = 0, n = buff.length; i < n; ++i) { | |
var bits = 8; | |
prefixlen < 8 && (bits = prefixlen), prefixlen -= bits, buff[i] = 255 & ~(255 >> bits); | |
} | |
return ip.toString(buff); | |
}, ip.mask = function(addr, mask) { | |
addr = ip.toBuffer(addr), mask = ip.toBuffer(mask); | |
var i, result = new Buffer(Math.max(addr.length, mask.length)); | |
if (addr.length === mask.length) for (i = 0; i < addr.length; i++) result[i] = addr[i] & mask[i]; else if (4 === mask.length) for (i = 0; i < mask.length; i++) result[i] = addr[addr.length - 4 + i] & mask[i]; else { | |
for (i = 0; i < result.length - 6; i++) result[i] = 0; | |
for (result[10] = 255, result[11] = 255, i = 0; i < addr.length; i++) result[i + 12] = addr[i] & mask[i + 12]; | |
i += 12; | |
} | |
for (;i < result.length; i++) result[i] = 0; | |
return ip.toString(result); | |
}, ip.cidr = function(cidrString) { | |
var cidrParts = cidrString.split("/"), addr = cidrParts[0]; | |
if (2 !== cidrParts.length) throw new Error(`invalid CIDR subnet: ${addr}`); | |
var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); | |
return ip.mask(addr, mask); | |
}, ip.subnet = function(addr, mask) { | |
for (var networkAddress = ip.toLong(ip.mask(addr, mask)), maskBuffer = ip.toBuffer(mask), maskLength = 0, i = 0; i < maskBuffer.length; i++) if (255 === maskBuffer[i]) maskLength += 8; else for (var octet = 255 & maskBuffer[i]; octet; ) octet = octet << 1 & 255, | |
maskLength++; | |
var numberOfAddresses = Math.pow(2, 32 - maskLength); | |
return { | |
networkAddress: ip.fromLong(networkAddress), | |
firstAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress) : ip.fromLong(networkAddress + 1), | |
lastAddress: numberOfAddresses <= 2 ? ip.fromLong(networkAddress + numberOfAddresses - 1) : ip.fromLong(networkAddress + numberOfAddresses - 2), | |
broadcastAddress: ip.fromLong(networkAddress + numberOfAddresses - 1), | |
subnetMask: mask, | |
subnetMaskLength: maskLength, | |
numHosts: numberOfAddresses <= 2 ? numberOfAddresses : numberOfAddresses - 2, | |
length: numberOfAddresses, | |
contains: other => networkAddress === ip.toLong(ip.mask(other, mask)) | |
}; | |
}, ip.cidrSubnet = function(cidrString) { | |
var cidrParts = cidrString.split("/"), addr = cidrParts[0]; | |
if (2 !== cidrParts.length) throw new Error(`invalid CIDR subnet: ${addr}`); | |
var mask = ip.fromPrefixLen(parseInt(cidrParts[1], 10)); | |
return ip.subnet(addr, mask); | |
}, ip.not = function(addr) { | |
for (var buff = ip.toBuffer(addr), i = 0; i < buff.length; i++) buff[i] = 255 ^ buff[i]; | |
return ip.toString(buff); | |
}, ip.or = function(a, b) { | |
var i; | |
if (a = ip.toBuffer(a), b = ip.toBuffer(b), a.length === b.length) { | |
for (i = 0; i < a.length; ++i) a[i] |= b[i]; | |
return ip.toString(a); | |
} | |
var buff = a, other = b; | |
b.length > a.length && (buff = b, other = a); | |
var offset = buff.length - other.length; | |
for (i = offset; i < buff.length; ++i) buff[i] |= other[i - offset]; | |
return ip.toString(buff); | |
}, ip.isEqual = function(a, b) { | |
var i; | |
if (a = ip.toBuffer(a), b = ip.toBuffer(b), a.length === b.length) { | |
for (i = 0; i < a.length; i++) if (a[i] !== b[i]) return !1; | |
return !0; | |
} | |
if (4 === b.length) { | |
var t = b; | |
b = a, a = t; | |
} | |
for (i = 0; i < 10; i++) if (0 !== b[i]) return !1; | |
var word = b.readUInt16BE(10); | |
if (0 !== word && 65535 !== word) return !1; | |
for (i = 0; i < 4; i++) if (a[i] !== b[i + 12]) return !1; | |
return !0; | |
}, ip.isPrivate = function(addr) { | |
return /^(::f{4}:)?10\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?192\.168\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?172\.(1[6-9]|2\d|30|31)\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^(::f{4}:)?169\.254\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^f[cd][0-9a-f]{2}:/i.test(addr) || /^fe80:/i.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); | |
}, ip.isPublic = function(addr) { | |
return !ip.isPrivate(addr); | |
}, ip.isLoopback = function(addr) { | |
return /^(::f{4}:)?127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/.test(addr) || /^fe80::1$/.test(addr) || /^::1$/.test(addr) || /^::$/.test(addr); | |
}, ip.loopback = function(family) { | |
if ("ipv4" !== (family = _normalizeFamily(family)) && "ipv6" !== family) throw new Error("family must be ipv4 or ipv6"); | |
return "ipv4" === family ? "127.0.0.1" : "fe80::1"; | |
}, ip.address = function(name, family) { | |
var interfaces = os.networkInterfaces(); | |
if (family = _normalizeFamily(family), name && "private" !== name && "public" !== name) { | |
var res = interfaces[name].filter((details => _normalizeFamily(details.family) === family)); | |
if (0 === res.length) return; | |
return res[0].address; | |
} | |
var all = Object.keys(interfaces).map((nic => { | |
var addresses = interfaces[nic].filter((details => (details.family = _normalizeFamily(details.family), | |
details.family === family && !ip.isLoopback(details.address) && (!name || ("public" === name ? ip.isPrivate(details.address) : ip.isPublic(details.address)))))); | |
return addresses.length ? addresses[0].address : void 0; | |
})).filter(Boolean); | |
return all.length ? all[0] : ip.loopback(family); | |
}, ip.toLong = function(ip) { | |
var ipl = 0; | |
return ip.split(".").forEach((octet => { | |
ipl <<= 8, ipl += parseInt(octet); | |
})), ipl >>> 0; | |
}, ip.fromLong = function(ipl) { | |
return `${ipl >>> 24}.${ipl >> 16 & 255}.${ipl >> 8 & 255}.${255 & ipl}`; | |
}; | |
}, function(module, exports) { | |
module.exports = require("timers"); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLAttribute, XMLNode, isFunction, isObject, ref, hasProp = {}.hasOwnProperty; | |
ref = __webpack_require__(52), isObject = ref.isObject, isFunction = ref.isFunction, | |
XMLNode = __webpack_require__(36), XMLAttribute = __webpack_require__(279), module.exports = (function(superClass) { | |
function XMLElement(parent, name, attributes) { | |
if (XMLElement.__super__.constructor.call(this, parent), null == name) throw new Error("Missing element name"); | |
this.name = this.stringify.eleName(name), this.attributes = {}, null != attributes && this.attribute(attributes), | |
parent.isDocument && (this.isRoot = !0, this.documentObject = parent, parent.rootObject = this); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLElement, superClass), XMLElement.prototype.clone = function() { | |
var att, attName, clonedSelf, ref1; | |
for (attName in (clonedSelf = Object.create(this)).isRoot && (clonedSelf.documentObject = null), | |
clonedSelf.attributes = {}, ref1 = this.attributes) hasProp.call(ref1, attName) && (att = ref1[attName], | |
clonedSelf.attributes[attName] = att.clone()); | |
return clonedSelf.children = [], this.children.forEach((function(child) { | |
var clonedChild; | |
return (clonedChild = child.clone()).parent = clonedSelf, clonedSelf.children.push(clonedChild); | |
})), clonedSelf; | |
}, XMLElement.prototype.attribute = function(name, value) { | |
var attName, attValue; | |
if (null != name && (name = name.valueOf()), isObject(name)) for (attName in name) hasProp.call(name, attName) && (attValue = name[attName], | |
this.attribute(attName, attValue)); else isFunction(value) && (value = value.apply()), | |
this.options.skipNullAttributes && null == value || (this.attributes[name] = new XMLAttribute(this, name, value)); | |
return this; | |
}, XMLElement.prototype.removeAttribute = function(name) { | |
var attName, i, len; | |
if (null == name) throw new Error("Missing attribute name"); | |
if (name = name.valueOf(), Array.isArray(name)) for (i = 0, len = name.length; i < len; i++) attName = name[i], | |
delete this.attributes[attName]; else delete this.attributes[name]; | |
return this; | |
}, XMLElement.prototype.toString = function(options) { | |
return this.options.writer.set(options).element(this); | |
}, XMLElement.prototype.att = function(name, value) { | |
return this.attribute(name, value); | |
}, XMLElement.prototype.a = function(name, value) { | |
return this.attribute(name, value); | |
}, XMLElement; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLCData(parent, text) { | |
if (XMLCData.__super__.constructor.call(this, parent), null == text) throw new Error("Missing CDATA text"); | |
this.text = this.stringify.cdata(text); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLCData, superClass), XMLCData.prototype.clone = function() { | |
return Object.create(this); | |
}, XMLCData.prototype.toString = function(options) { | |
return this.options.writer.set(options).cdata(this); | |
}, XMLCData; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLComment(parent, text) { | |
if (XMLComment.__super__.constructor.call(this, parent), null == text) throw new Error("Missing comment text"); | |
this.text = this.stringify.comment(text); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLComment, superClass), XMLComment.prototype.clone = function() { | |
return Object.create(this); | |
}, XMLComment.prototype.toString = function(options) { | |
return this.options.writer.set(options).comment(this); | |
}, XMLComment; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, isObject, hasProp = {}.hasOwnProperty; | |
isObject = __webpack_require__(52).isObject, XMLNode = __webpack_require__(36), | |
module.exports = (function(superClass) { | |
function XMLDeclaration(parent, version, encoding, standalone) { | |
var ref; | |
XMLDeclaration.__super__.constructor.call(this, parent), isObject(version) && (version = (ref = version).version, | |
encoding = ref.encoding, standalone = ref.standalone), version || (version = "1.0"), | |
this.version = this.stringify.xmlVersion(version), null != encoding && (this.encoding = this.stringify.xmlEncoding(encoding)), | |
null != standalone && (this.standalone = this.stringify.xmlStandalone(standalone)); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLDeclaration, superClass), XMLDeclaration.prototype.toString = function(options) { | |
return this.options.writer.set(options).declaration(this); | |
}, XMLDeclaration; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLNode, isObject, hasProp = {}.hasOwnProperty; | |
isObject = __webpack_require__(52).isObject, XMLNode = __webpack_require__(36), | |
XMLDTDAttList = __webpack_require__(123), XMLDTDEntity = __webpack_require__(124), | |
XMLDTDElement = __webpack_require__(125), XMLDTDNotation = __webpack_require__(126), | |
module.exports = (function(superClass) { | |
function XMLDocType(parent, pubID, sysID) { | |
var ref, ref1; | |
XMLDocType.__super__.constructor.call(this, parent), this.documentObject = parent, | |
isObject(pubID) && (pubID = (ref = pubID).pubID, sysID = ref.sysID), null == sysID && (sysID = (ref1 = [ pubID, sysID ])[0], | |
pubID = ref1[1]), null != pubID && (this.pubID = this.stringify.dtdPubID(pubID)), | |
null != sysID && (this.sysID = this.stringify.dtdSysID(sysID)); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLDocType, superClass), XMLDocType.prototype.element = function(name, value) { | |
var child; | |
return child = new XMLDTDElement(this, name, value), this.children.push(child), | |
this; | |
}, XMLDocType.prototype.attList = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { | |
var child; | |
return child = new XMLDTDAttList(this, elementName, attributeName, attributeType, defaultValueType, defaultValue), | |
this.children.push(child), this; | |
}, XMLDocType.prototype.entity = function(name, value) { | |
var child; | |
return child = new XMLDTDEntity(this, !1, name, value), this.children.push(child), | |
this; | |
}, XMLDocType.prototype.pEntity = function(name, value) { | |
var child; | |
return child = new XMLDTDEntity(this, !0, name, value), this.children.push(child), | |
this; | |
}, XMLDocType.prototype.notation = function(name, value) { | |
var child; | |
return child = new XMLDTDNotation(this, name, value), this.children.push(child), | |
this; | |
}, XMLDocType.prototype.toString = function(options) { | |
return this.options.writer.set(options).docType(this); | |
}, XMLDocType.prototype.ele = function(name, value) { | |
return this.element(name, value); | |
}, XMLDocType.prototype.att = function(elementName, attributeName, attributeType, defaultValueType, defaultValue) { | |
return this.attList(elementName, attributeName, attributeType, defaultValueType, defaultValue); | |
}, XMLDocType.prototype.ent = function(name, value) { | |
return this.entity(name, value); | |
}, XMLDocType.prototype.pent = function(name, value) { | |
return this.pEntity(name, value); | |
}, XMLDocType.prototype.not = function(name, value) { | |
return this.notation(name, value); | |
}, XMLDocType.prototype.up = function() { | |
return this.root() || this.documentObject; | |
}, XMLDocType; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLDTDAttList(parent, elementName, attributeName, attributeType, defaultValueType, defaultValue) { | |
if (XMLDTDAttList.__super__.constructor.call(this, parent), null == elementName) throw new Error("Missing DTD element name"); | |
if (null == attributeName) throw new Error("Missing DTD attribute name"); | |
if (!attributeType) throw new Error("Missing DTD attribute type"); | |
if (!defaultValueType) throw new Error("Missing DTD attribute default"); | |
if (0 !== defaultValueType.indexOf("#") && (defaultValueType = "#" + defaultValueType), | |
!defaultValueType.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT"); | |
if (defaultValue && !defaultValueType.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT"); | |
this.elementName = this.stringify.eleName(elementName), this.attributeName = this.stringify.attName(attributeName), | |
this.attributeType = this.stringify.dtdAttType(attributeType), this.defaultValue = this.stringify.dtdAttDefault(defaultValue), | |
this.defaultValueType = defaultValueType; | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLDTDAttList, superClass), XMLDTDAttList.prototype.toString = function(options) { | |
return this.options.writer.set(options).dtdAttList(this); | |
}, XMLDTDAttList; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, isObject, hasProp = {}.hasOwnProperty; | |
isObject = __webpack_require__(52).isObject, XMLNode = __webpack_require__(36), | |
module.exports = (function(superClass) { | |
function XMLDTDEntity(parent, pe, name, value) { | |
if (XMLDTDEntity.__super__.constructor.call(this, parent), null == name) throw new Error("Missing entity name"); | |
if (null == value) throw new Error("Missing entity value"); | |
if (this.pe = !!pe, this.name = this.stringify.eleName(name), isObject(value)) { | |
if (!value.pubID && !value.sysID) throw new Error("Public and/or system identifiers are required for an external entity"); | |
if (value.pubID && !value.sysID) throw new Error("System identifier is required for a public external entity"); | |
if (null != value.pubID && (this.pubID = this.stringify.dtdPubID(value.pubID)), | |
null != value.sysID && (this.sysID = this.stringify.dtdSysID(value.sysID)), null != value.nData && (this.nData = this.stringify.dtdNData(value.nData)), | |
this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity"); | |
} else this.value = this.stringify.dtdEntityValue(value); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLDTDEntity, superClass), XMLDTDEntity.prototype.toString = function(options) { | |
return this.options.writer.set(options).dtdEntity(this); | |
}, XMLDTDEntity; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLDTDElement(parent, name, value) { | |
if (XMLDTDElement.__super__.constructor.call(this, parent), null == name) throw new Error("Missing DTD element name"); | |
value || (value = "(#PCDATA)"), Array.isArray(value) && (value = "(" + value.join(",") + ")"), | |
this.name = this.stringify.eleName(name), this.value = this.stringify.dtdElementValue(value); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLDTDElement, superClass), XMLDTDElement.prototype.toString = function(options) { | |
return this.options.writer.set(options).dtdElement(this); | |
}, XMLDTDElement; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLDTDNotation(parent, name, value) { | |
if (XMLDTDNotation.__super__.constructor.call(this, parent), null == name) throw new Error("Missing notation name"); | |
if (!value.pubID && !value.sysID) throw new Error("Public or system identifiers are required for an external entity"); | |
this.name = this.stringify.eleName(name), null != value.pubID && (this.pubID = this.stringify.dtdPubID(value.pubID)), | |
null != value.sysID && (this.sysID = this.stringify.dtdSysID(value.sysID)); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLDTDNotation, superClass), XMLDTDNotation.prototype.toString = function(options) { | |
return this.options.writer.set(options).dtdNotation(this); | |
}, XMLDTDNotation; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLRaw(parent, text) { | |
if (XMLRaw.__super__.constructor.call(this, parent), null == text) throw new Error("Missing raw text"); | |
this.value = this.stringify.raw(text); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLRaw, superClass), XMLRaw.prototype.clone = function() { | |
return Object.create(this); | |
}, XMLRaw.prototype.toString = function(options) { | |
return this.options.writer.set(options).raw(this); | |
}, XMLRaw; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLText(parent, text) { | |
if (XMLText.__super__.constructor.call(this, parent), null == text) throw new Error("Missing element text"); | |
this.value = this.stringify.eleText(text); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLText, superClass), XMLText.prototype.clone = function() { | |
return Object.create(this); | |
}, XMLText.prototype.toString = function(options) { | |
return this.options.writer.set(options).text(this); | |
}, XMLText; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports, __webpack_require__) { | |
(function() { | |
var XMLNode, hasProp = {}.hasOwnProperty; | |
XMLNode = __webpack_require__(36), module.exports = (function(superClass) { | |
function XMLProcessingInstruction(parent, target, value) { | |
if (XMLProcessingInstruction.__super__.constructor.call(this, parent), null == target) throw new Error("Missing instruction target"); | |
this.target = this.stringify.insTarget(target), value && (this.value = this.stringify.insValue(value)); | |
} | |
return (function(child, parent) { | |
for (var key in parent) hasProp.call(parent, key) && (child[key] = parent[key]); | |
function ctor() { | |
this.constructor = child; | |
} | |
ctor.prototype = parent.prototype, child.prototype = new ctor, child.__super__ = parent.prototype; | |
})(XMLProcessingInstruction, superClass), XMLProcessingInstruction.prototype.clone = function() { | |
return Object.create(this); | |
}, XMLProcessingInstruction.prototype.toString = function(options) { | |
return this.options.writer.set(options).processingInstruction(this); | |
}, XMLProcessingInstruction; | |
})(XMLNode); | |
}).call(this); | |
}, function(module, exports) { | |
exports.codeUnit16FromBytes = function(hi, lo) { | |
return (255 & hi) << 8 | 255 & lo; | |
}, exports.adjustConfidence = function(codeUnit, confidence) { | |
return 0 == codeUnit ? confidence -= 10 : (codeUnit >= 32 && codeUnit <= 255 || 10 == codeUnit) && (confidence += 10), | |
confidence < 0 ? confidence = 0 : confidence > 100 && (confidence = 100), confidence; | |
}; | |
}, function(module, exports) { | |
function iteratedChar(input) { | |
this.charValue = 0, this.index = 0, this.nextIndex = 0, this.error = !1, this.done = !1, | |
this.input = input, this.inputLength = input.length; | |
} | |
iteratedChar.prototype = { | |
reset: function() { | |
this.charValue = 0, this.index = -1, this.nextIndex = 0, this.error = !1, this.done = !1; | |
}, | |
nextByte: function() { | |
return this.nextIndex >= this.inputLength ? (this.done = !0, -1) : 255 & this.input[this.nextIndex++]; | |
} | |
}, module.exports = function(commonChars, nextChar) { | |
return function(input) { | |
var doubleByteCharCount = 0, commonCharCount = 0, badCharCount = 0, totalCharCount = 0, confidence = 0, iter = new iteratedChar(input); | |
detectBlock: { | |
for (iter.reset(); nextChar(iter); ) { | |
if (totalCharCount++, iter.error) badCharCount++; else { | |
var cv = 4294967295 & iter.charValue; | |
!(cv <= 255) && (doubleByteCharCount++, null != commonChars && commonChars.indexOf(cv) >= 0 && commonCharCount++); | |
} | |
if (badCharCount >= 2 && 5 * badCharCount >= doubleByteCharCount) break detectBlock; | |
} | |
if (doubleByteCharCount <= 10 && 0 == badCharCount) confidence = 0 == doubleByteCharCount && totalCharCount < 10 ? 0 : 10; else if (doubleByteCharCount < 20 * badCharCount) confidence = 0; else if (null == commonChars) (confidence = 30 + doubleByteCharCount - 20 * badCharCount) > 100 && (confidence = 100); else { | |
var scaleFactor = 90 / Math.log(doubleByteCharCount / 4); | |
confidence = Math.log(commonCharCount + 1) * scaleFactor + 10, confidence = Math.min(confidence, 100); | |
} | |
} | |
return confidence; | |
}; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var path = __webpack_require__(4), fs = __webpack_require__(2), _0777 = parseInt("0777", 8); | |
function mkdirP(p, opts, f, made) { | |
"function" == typeof opts ? (f = opts, opts = {}) : opts && "object" == typeof opts || (opts = { | |
mode: opts | |
}); | |
var mode = opts.mode, xfs = opts.fs || fs; | |
void 0 === mode && (mode = _0777), made || (made = null); | |
var cb = f || function() {}; | |
p = path.resolve(p), xfs.mkdir(p, mode, (function(er) { | |
if (!er) return cb(null, made = made || p); | |
if ("ENOENT" === er.code) { | |
if (path.dirname(p) === p) return cb(er); | |
mkdirP(path.dirname(p), opts, (function(er, made) { | |
er ? cb(er, made) : mkdirP(p, opts, cb, made); | |
})); | |
} else xfs.stat(p, (function(er2, stat) { | |
er2 || !stat.isDirectory() ? cb(er, made) : cb(null, made); | |
})); | |
})); | |
} | |
module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP, mkdirP.sync = function sync(p, opts, made) { | |
opts && "object" == typeof opts || (opts = { | |
mode: opts | |
}); | |
var mode = opts.mode, xfs = opts.fs || fs; | |
void 0 === mode && (mode = _0777), made || (made = null), p = path.resolve(p); | |
try { | |
xfs.mkdirSync(p, mode), made = made || p; | |
} catch (err0) { | |
if ("ENOENT" === err0.code) made = sync(path.dirname(p), opts, made), sync(p, opts, made); else { | |
var stat; | |
try { | |
stat = xfs.statSync(p); | |
} catch (err1) { | |
throw err0; | |
} | |
if (!stat.isDirectory()) throw err0; | |
} | |
} | |
return made; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var Buffer = __webpack_require__(23).Buffer, isEncoding = Buffer.isEncoding || function(encoding) { | |
switch ((encoding = "" + encoding) && encoding.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; | |
} | |
}; | |
function StringDecoder(encoding) { | |
var nb; | |
switch (this.encoding = (function(enc) { | |
var nenc = (function(enc) { | |
if (!enc) return "utf8"; | |
for (var retried; ;) switch (enc) { | |
case "utf8": | |
case "utf-8": | |
return "utf8"; | |
case "ucs2": | |
case "ucs-2": | |
case "utf16le": | |
case "utf-16le": | |
return "utf16le"; | |
case "latin1": | |
case "binary": | |
return "latin1"; | |
case "base64": | |
case "ascii": | |
case "hex": | |
return enc; | |
default: | |
if (retried) return; | |
enc = ("" + enc).toLowerCase(), retried = !0; | |
} | |
})(enc); | |
if ("string" != typeof nenc && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc); | |
return nenc || enc; | |
})(encoding), this.encoding) { | |
case "utf16le": | |
this.text = utf16Text, this.end = utf16End, nb = 4; | |
break; | |
case "utf8": | |
this.fillLast = utf8FillLast, nb = 4; | |
break; | |
case "base64": | |
this.text = base64Text, this.end = base64End, nb = 3; | |
break; | |
default: | |
return this.write = simpleWrite, void (this.end = simpleEnd); | |
} | |
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = Buffer.allocUnsafe(nb); | |
} | |
function utf8CheckByte(byte) { | |
return byte <= 127 ? 0 : byte >> 5 == 6 ? 2 : byte >> 4 == 14 ? 3 : byte >> 3 == 30 ? 4 : byte >> 6 == 2 ? -1 : -2; | |
} | |
function utf8FillLast(buf) { | |
var p = this.lastTotal - this.lastNeed, r = (function(self, buf, p) { | |
if (128 != (192 & buf[0])) return self.lastNeed = 0, " "; | |
if (self.lastNeed > 1 && buf.length > 1) { | |
if (128 != (192 & buf[1])) return self.lastNeed = 1, " "; | |
if (self.lastNeed > 2 && buf.length > 2 && 128 != (192 & buf[2])) return self.lastNeed = 2, | |
" "; | |
} | |
})(this, buf); | |
return void 0 !== r ? r : this.lastNeed <= buf.length ? (buf.copy(this.lastChar, p, 0, this.lastNeed), | |
this.lastChar.toString(this.encoding, 0, this.lastTotal)) : (buf.copy(this.lastChar, p, 0, buf.length), | |
void (this.lastNeed -= buf.length)); | |
} | |
function utf16Text(buf, i) { | |
if ((buf.length - i) % 2 == 0) { | |
var r = buf.toString("utf16le", i); | |
if (r) { | |
var c = r.charCodeAt(r.length - 1); | |
if (c >= 55296 && c <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = buf[buf.length - 2], | |
this.lastChar[1] = buf[buf.length - 1], r.slice(0, -1); | |
} | |
return r; | |
} | |
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = buf[buf.length - 1], | |
buf.toString("utf16le", i, buf.length - 1); | |
} | |
function utf16End(buf) { | |
var r = buf && buf.length ? this.write(buf) : ""; | |
if (this.lastNeed) { | |
var end = this.lastTotal - this.lastNeed; | |
return r + this.lastChar.toString("utf16le", 0, end); | |
} | |
return r; | |
} | |
function base64Text(buf, i) { | |
var n = (buf.length - i) % 3; | |
return 0 === n ? buf.toString("base64", i) : (this.lastNeed = 3 - n, this.lastTotal = 3, | |
1 === n ? this.lastChar[0] = buf[buf.length - 1] : (this.lastChar[0] = buf[buf.length - 2], | |
this.lastChar[1] = buf[buf.length - 1]), buf.toString("base64", i, buf.length - n)); | |
} | |
function base64End(buf) { | |
var r = buf && buf.length ? this.write(buf) : ""; | |
return this.lastNeed ? r + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : r; | |
} | |
function simpleWrite(buf) { | |
return buf.toString(this.encoding); | |
} | |
function simpleEnd(buf) { | |
return buf && buf.length ? this.write(buf) : ""; | |
} | |
exports.StringDecoder = StringDecoder, StringDecoder.prototype.write = function(buf) { | |
if (0 === buf.length) return ""; | |
var r, i; | |
if (this.lastNeed) { | |
if (void 0 === (r = this.fillLast(buf))) return ""; | |
i = this.lastNeed, this.lastNeed = 0; | |
} else i = 0; | |
return i < buf.length ? r ? r + this.text(buf, i) : this.text(buf, i) : r || ""; | |
}, StringDecoder.prototype.end = function(buf) { | |
var r = buf && buf.length ? this.write(buf) : ""; | |
return this.lastNeed ? r + " " : r; | |
}, StringDecoder.prototype.text = function(buf, i) { | |
var total = (function(self, buf, i) { | |
var j = buf.length - 1; | |
if (j < i) return 0; | |
var nb = utf8CheckByte(buf[j]); | |
return nb >= 0 ? (nb > 0 && (self.lastNeed = nb - 1), nb) : --j < i || -2 === nb ? 0 : (nb = utf8CheckByte(buf[j])) >= 0 ? (nb > 0 && (self.lastNeed = nb - 2), | |
nb) : --j < i || -2 === nb ? 0 : (nb = utf8CheckByte(buf[j])) >= 0 ? (nb > 0 && (2 === nb ? nb = 0 : self.lastNeed = nb - 3), | |
nb) : 0; | |
})(this, buf, i); | |
if (!this.lastNeed) return buf.toString("utf8", i); | |
this.lastTotal = total; | |
var end = buf.length - (total - this.lastNeed); | |
return buf.copy(this.lastChar, 0, end), buf.toString("utf8", i, end); | |
}, StringDecoder.prototype.fillLast = function(buf) { | |
if (this.lastNeed <= buf.length) return buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), | |
this.lastChar.toString(this.encoding, 0, this.lastTotal); | |
buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length), this.lastNeed -= buf.length; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var __WEBPACK_AMD_DEFINE_RESULT__, __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __createBinding; | |
!(function(factory) { | |
var root = "object" == typeof global ? global : "object" == typeof self ? self : "object" == typeof this ? this : {}; | |
function createExporter(exports, previous) { | |
return exports !== root && ("function" == typeof Object.create ? Object.defineProperty(exports, "__esModule", { | |
value: !0 | |
}) : exports.__esModule = !0), function(id, v) { | |
return exports[id] = previous ? previous(id, v) : v; | |
}; | |
} | |
__WEBPACK_AMD_DEFINE_RESULT__ = function(exports) { | |
!(function(exporter) { | |
var extendStatics = Object.setPrototypeOf || { | |
__proto__: [] | |
} instanceof Array && function(d, b) { | |
d.__proto__ = b; | |
} || function(d, b) { | |
for (var p in b) Object.prototype.hasOwnProperty.call(b, p) && (d[p] = b[p]); | |
}; | |
__extends = function(d, b) { | |
if ("function" != typeof b && null !== b) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | |
function __() { | |
this.constructor = d; | |
} | |
extendStatics(d, b), d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, | |
new __); | |
}, __assign = Object.assign || function(t) { | |
for (var s, i = 1, n = arguments.length; i < n; i++) for (var p in s = arguments[i]) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]); | |
return t; | |
}, __rest = function(s, e) { | |
var t = {}; | |
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0 && (t[p] = s[p]); | |
if (null != s && "function" == typeof Object.getOwnPropertySymbols) { | |
var i = 0; | |
for (p = Object.getOwnPropertySymbols(s); i < p.length; i++) e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]) && (t[p[i]] = s[p[i]]); | |
} | |
return t; | |
}, __decorate = function(decorators, target, key, desc) { | |
var d, c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc; | |
if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r); | |
return c > 3 && r && Object.defineProperty(target, key, r), r; | |
}, __param = function(paramIndex, decorator) { | |
return function(target, key) { | |
decorator(target, key, paramIndex); | |
}; | |
}, __metadata = function(metadataKey, metadataValue) { | |
if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(metadataKey, metadataValue); | |
}, __awaiter = function(thisArg, _arguments, P, generator) { | |
return new (P || (P = Promise))((function(resolve, reject) { | |
function fulfilled(value) { | |
try { | |
step(generator.next(value)); | |
} catch (e) { | |
reject(e); | |
} | |
} | |
function rejected(value) { | |
try { | |
step(generator.throw(value)); | |
} catch (e) { | |
reject(e); | |
} | |
} | |
function step(result) { | |
result.done ? resolve(result.value) : (function(value) { | |
return value instanceof P ? value : new P((function(resolve) { | |
resolve(value); | |
})); | |
})(result.value).then(fulfilled, rejected); | |
} | |
step((generator = generator.apply(thisArg, _arguments || [])).next()); | |
})); | |
}, __generator = function(thisArg, body) { | |
var f, y, t, g, _ = { | |
label: 0, | |
sent: function() { | |
if (1 & t[0]) throw t[1]; | |
return t[1]; | |
}, | |
trys: [], | |
ops: [] | |
}; | |
return g = { | |
next: verb(0), | |
throw: verb(1), | |
return: verb(2) | |
}, "function" == typeof Symbol && (g[Symbol.iterator] = function() { | |
return this; | |
}), g; | |
function verb(n) { | |
return function(v) { | |
return (function(op) { | |
if (f) throw new TypeError("Generator is already executing."); | |
for (;_; ) try { | |
if (f = 1, y && (t = 2 & op[0] ? y.return : op[0] ? y.throw || ((t = y.return) && t.call(y), | |
0) : y.next) && !(t = t.call(y, op[1])).done) return t; | |
switch (y = 0, t && (op = [ 2 & op[0], t.value ]), op[0]) { | |
case 0: | |
case 1: | |
t = op; | |
break; | |
case 4: | |
return _.label++, { | |
value: op[1], | |
done: !1 | |
}; | |
case 5: | |
_.label++, y = op[1], op = [ 0 ]; | |
continue; | |
case 7: | |
op = _.ops.pop(), _.trys.pop(); | |
continue; | |
default: | |
if (!((t = (t = _.trys).length > 0 && t[t.length - 1]) || 6 !== op[0] && 2 !== op[0])) { | |
_ = 0; | |
continue; | |
} | |
if (3 === op[0] && (!t || op[1] > t[0] && op[1] < t[3])) { | |
_.label = op[1]; | |
break; | |
} | |
if (6 === op[0] && _.label < t[1]) { | |
_.label = t[1], t = op; | |
break; | |
} | |
if (t && _.label < t[2]) { | |
_.label = t[2], _.ops.push(op); | |
break; | |
} | |
t[2] && _.ops.pop(), _.trys.pop(); | |
continue; | |
} | |
op = body.call(thisArg, _); | |
} catch (e) { | |
op = [ 6, e ], y = 0; | |
} finally { | |
f = t = 0; | |
} | |
if (5 & op[0]) throw op[1]; | |
return { | |
value: op[0] ? op[1] : void 0, | |
done: !0 | |
}; | |
})([ n, v ]); | |
}; | |
} | |
}, __exportStar = function(m, o) { | |
for (var p in m) "default" === p || Object.prototype.hasOwnProperty.call(o, p) || __createBinding(o, m, p); | |
}, __createBinding = Object.create ? function(o, m, k, k2) { | |
void 0 === k2 && (k2 = k), Object.defineProperty(o, k2, { | |
enumerable: !0, | |
get: function() { | |
return m[k]; | |
} | |
}); | |
} : function(o, m, k, k2) { | |
void 0 === k2 && (k2 = k), o[k2] = m[k]; | |
}, __values = function(o) { | |
var s = "function" == typeof Symbol && Symbol.iterator, m = s && o[s], i = 0; | |
if (m) return m.call(o); | |
if (o && "number" == typeof o.length) return { | |
next: function() { | |
return o && i >= o.length && (o = void 0), { | |
value: o && o[i++], | |
done: !o | |
}; | |
} | |
}; | |
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); | |
}, __read = function(o, n) { | |
var m = "function" == typeof Symbol && o[Symbol.iterator]; | |
if (!m) return o; | |
var r, e, i = m.call(o), ar = []; | |
try { | |
for (;(void 0 === n || n-- > 0) && !(r = i.next()).done; ) ar.push(r.value); | |
} catch (error) { | |
e = { | |
error: error | |
}; | |
} finally { | |
try { | |
r && !r.done && (m = i.return) && m.call(i); | |
} finally { | |
if (e) throw e.error; | |
} | |
} | |
return ar; | |
}, __spread = function() { | |
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); | |
return ar; | |
}, __spreadArrays = function() { | |
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; | |
var r = Array(s), k = 0; | |
for (i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, | |
k++) r[k] = a[j]; | |
return r; | |
}, __spreadArray = function(to, from, pack) { | |
if (pack || 2 === arguments.length) for (var ar, i = 0, l = from.length; i < l; i++) !ar && i in from || (ar || (ar = Array.prototype.slice.call(from, 0, i)), | |
ar[i] = from[i]); | |
return to.concat(ar || Array.prototype.slice.call(from)); | |
}, __await = function(v) { | |
return this instanceof __await ? (this.v = v, this) : new __await(v); | |
}, __asyncGenerator = function(thisArg, _arguments, generator) { | |
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | |
var i, g = generator.apply(thisArg, _arguments || []), q = []; | |
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function() { | |
return this; | |
}, i; | |
function verb(n) { | |
g[n] && (i[n] = function(v) { | |
return new Promise((function(a, b) { | |
q.push([ n, v, a, b ]) > 1 || resume(n, v); | |
})); | |
}); | |
} | |
function resume(n, v) { | |
try { | |
(r = g[n](v)).value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); | |
} catch (e) { | |
settle(q[0][3], e); | |
} | |
var r; | |
} | |
function fulfill(value) { | |
resume("next", value); | |
} | |
function reject(value) { | |
resume("throw", value); | |
} | |
function settle(f, v) { | |
f(v), q.shift(), q.length && resume(q[0][0], q[0][1]); | |
} | |
}, __asyncDelegator = function(o) { | |
var i, p; | |
return i = {}, verb("next"), verb("throw", (function(e) { | |
throw e; | |
})), verb("return"), i[Symbol.iterator] = function() { | |
return this; | |
}, i; | |
function verb(n, f) { | |
i[n] = o[n] ? function(v) { | |
return (p = !p) ? { | |
value: __await(o[n](v)), | |
done: "return" === n | |
} : f ? f(v) : v; | |
} : f; | |
} | |
}, __asyncValues = function(o) { | |
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); | |
var i, m = o[Symbol.asyncIterator]; | |
return m ? m.call(o) : (o = __values(o), i = {}, verb("next"), verb("throw"), verb("return"), | |
i[Symbol.asyncIterator] = function() { | |
return this; | |
}, i); | |
function verb(n) { | |
i[n] = o[n] && function(v) { | |
return new Promise((function(resolve, reject) { | |
!(function(resolve, reject, d, v) { | |
Promise.resolve(v).then((function(v) { | |
resolve({ | |
value: v, | |
done: d | |
}); | |
}), reject); | |
})(resolve, reject, (v = o[n](v)).done, v.value); | |
})); | |
}; | |
} | |
}, __makeTemplateObject = function(cooked, raw) { | |
return Object.defineProperty ? Object.defineProperty(cooked, "raw", { | |
value: raw | |
}) : cooked.raw = raw, cooked; | |
}; | |
var __setModuleDefault = Object.create ? function(o, v) { | |
Object.defineProperty(o, "default", { | |
enumerable: !0, | |
value: v | |
}); | |
} : function(o, v) { | |
o.default = v; | |
}; | |
__importStar = function(mod) { | |
if (mod && mod.__esModule) return mod; | |
var result = {}; | |
if (null != mod) for (var k in mod) "default" !== k && Object.prototype.hasOwnProperty.call(mod, k) && __createBinding(result, mod, k); | |
return __setModuleDefault(result, mod), result; | |
}, __importDefault = function(mod) { | |
return mod && mod.__esModule ? mod : { | |
default: mod | |
}; | |
}, __classPrivateFieldGet = function(receiver, state, kind, f) { | |
if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a getter"); | |
if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); | |
return "m" === kind ? f : "a" === kind ? f.call(receiver) : f ? f.value : state.get(receiver); | |
}, __classPrivateFieldSet = function(receiver, state, value, kind, f) { | |
if ("m" === kind) throw new TypeError("Private method is not writable"); | |
if ("a" === kind && !f) throw new TypeError("Private accessor was defined without a setter"); | |
if ("function" == typeof state ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); | |
return "a" === kind ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), | |
value; | |
}, exporter("__extends", __extends), exporter("__assign", __assign), exporter("__rest", __rest), | |
exporter("__decorate", __decorate), exporter("__param", __param), exporter("__metadata", __metadata), | |
exporter("__awaiter", __awaiter), exporter("__generator", __generator), exporter("__exportStar", __exportStar), | |
exporter("__createBinding", __createBinding), exporter("__values", __values), exporter("__read", __read), | |
exporter("__spread", __spread), exporter("__spreadArrays", __spreadArrays), exporter("__spreadArray", __spreadArray), | |
exporter("__await", __await), exporter("__asyncGenerator", __asyncGenerator), exporter("__asyncDelegator", __asyncDelegator), | |
exporter("__asyncValues", __asyncValues), exporter("__makeTemplateObject", __makeTemplateObject), | |
exporter("__importStar", __importStar), exporter("__importDefault", __importDefault), | |
exporter("__classPrivateFieldGet", __classPrivateFieldGet), exporter("__classPrivateFieldSet", __classPrivateFieldSet); | |
})(createExporter(root, createExporter(exports))); | |
}.apply(exports, [ exports ]), void 0 === __WEBPACK_AMD_DEFINE_RESULT__ || (module.exports = __WEBPACK_AMD_DEFINE_RESULT__); | |
})(); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
Object.defineProperty(exports, "__esModule", { | |
value: !0 | |
}), exports.E_CANCELED = exports.E_ALREADY_LOCKED = exports.E_TIMEOUT = void 0, | |
exports.E_TIMEOUT = new Error("timeout while waiting for mutex to become available"), | |
exports.E_ALREADY_LOCKED = new Error("mutex already locked"), exports.E_CANCELED = new Error("request for lock canceled"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), MasterElement = __webpack_require__(29), schema = __webpack_require__(13), _proto = __webpack_require__(19); | |
function Segment(doc, tagId, start, length) { | |
MasterElement.call(this, doc, tagId, schema.byName.Segment, start, length); | |
} | |
util.inherits(Segment, MasterElement), module.exports = Segment, Segment.prototype.toString = function() { | |
return "[Segment #" + this.tagId + "]"; | |
}, _proto.oneChild(Segment.prototype, "Info"), _proto.oneChild(Segment.prototype, "SeekHead"), | |
_proto.oneChild(Segment.prototype, "Attachments"), _proto.oneChild(Segment.prototype, "Tracks"), | |
_proto.oneChild(Segment.prototype, "Tags"); | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var util = __webpack_require__(0), Segment = __webpack_require__(136), schema = __webpack_require__(13); | |
function Segment1(doc, elementId, start, length) { | |
Segment.call(this, doc, elementId, start, length); | |
} | |
function verifyCRC(element) { | |
if (element.children) { | |
var children = element.children || [], found = !1; | |
children.forEach((function(c) { | |
c.ebmlID === schema.byName.CRC_32 && (children[0] !== c ? c.remove() : found = !0); | |
})), found || (element.$crc_32 = 0); | |
} | |
} | |
function verifySeek(seekHeadElements, targetElement) { | |
seekHeadElements.forEach((function(seekHead) { | |
var found = !1; | |
if (seekHead.seeks.forEach((function(seek) { | |
if (seek.seekID === targetElement.ebmlID) return found = !0, !1; | |
})), !found) { | |
var newSeek = seekHead.newSeek(); | |
newSeek.seekID = targetElement.ebmlID, newSeek.seekPosition = targetElement; | |
} | |
})); | |
} | |
util.inherits(Segment1, Segment), module.exports = Segment1, Segment1.prototype.normalize = function(options, callback) { | |
"function" == typeof options && (callback = options, options = null), options = options || {}; | |
var self = this, cluster = this.getFirstChildByName(schema.byName.Cluster), seekHeadElements = this.listChildrenByName(schema.byName.SeekHead); | |
return seekHeadElements.forEach((function(seekHeadElement) { | |
self.moveChildBefore(seekHeadElement, cluster), verifyCRC(seekHeadElement); | |
})), this.eachChildByName(schema.byName.Info, (function(infoElement) { | |
self.moveChildBefore(infoElement, cluster), verifyCRC(infoElement), verifySeek(seekHeadElements, infoElement); | |
})), this.eachChildByName(schema.byName.Tracks, (function(tracksElement) { | |
self.moveChildBefore(tracksElement, cluster), verifyCRC(tracksElement), verifySeek(seekHeadElements, tracksElement); | |
})), this.eachChildByName(schema.byName.Cues, (function(cuesElement) { | |
self.moveChildBefore(cuesElement, cluster), verifyCRC(cuesElement), verifySeek(seekHeadElements, cuesElement); | |
})), this.eachChildByName(schema.byName.Void, (function(voidElement) { | |
voidElement.remove(); | |
})), this.eachChildByName(schema.byName.Tags, (function(tagsElement) { | |
self.moveChildBefore(tagsElement, null), verifyCRC(tagsElement), verifySeek(seekHeadElements, tagsElement); | |
})), this.eachChildByName(schema.byName.Attachments, (function(attachementsElement) { | |
self.moveChildBefore(attachementsElement, null), verifyCRC(attachementsElement), | |
verifySeek(seekHeadElements, attachementsElement); | |
})), this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { | |
verifyCRC(attachedFile); | |
})), callback(); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var crc32 = __webpack_require__(71).crc32, fs = __webpack_require__(2), Mime = __webpack_require__(63), Path = __webpack_require__(4), util = __webpack_require__(0), Segment1 = __webpack_require__(137), schema = __webpack_require__(13), tools = __webpack_require__(75); | |
function Segment2(doc, tagId, start, length) { | |
Segment1.call(this, doc, tagId, start, length); | |
} | |
function targetIn(id, elements) { | |
if (!elements || !elements.length) return !1; | |
for (var i = 0; i < elements.length; i++) if (elements[i].getValue() === id) return !0; | |
return !1; | |
} | |
util.inherits(Segment2, Segment1), module.exports = Segment2, Segment2.prototype.addFileAttachment = function(path, description, mimeType, fileName, callback) { | |
if ("function" == typeof description && 2 == arguments.length ? (callback = description, | |
description = void 0) : "function" == typeof mimeType && 3 == arguments.length ? (callback = mimeType, | |
mimeType = void 0) : "function" == typeof fileName && 4 == arguments.length && (callback = fileName, | |
fileName = void 0), "function" != typeof callback) return this.addFileAttachmentSync(path, description, mimeType, fileName); | |
if ("string" != typeof path || !path) return callback("Invalid path '" + path + "'"); | |
var self = this; | |
fs.stat(path, (function(error, stats) { | |
if (error) return callback(error); | |
fileName || (fileName = Path.basename(path)), mimeType || (mimeType = Mime.lookup(path)); | |
var attachedFileTag = self._addAttachment({ | |
path: path, | |
description: description, | |
size: stats.size, | |
fileName: fileName, | |
mimeType: mimeType, | |
date: stats.mtime | |
}); | |
callback(null, attachedFileTag); | |
})); | |
}, Segment2.prototype.getAttachmentByFileName = function(filename) { | |
return this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { | |
var fn = attachedFile.getFirstChildByName(schema.byName.FileName); | |
if (fn && fn.getValue() === filename) return attachedFile; | |
})); | |
}, Segment2.prototype.getAttachmentByFileUID = function(fileUID) { | |
return this.eachChildByName(schema.byName.AttachedFile, (function(attachedFile) { | |
var fn = attachedFile.getFirstChildByName(schema.byName.FileUID); | |
if (fn && fn.getValue() === fileUID) return attachedFile; | |
})); | |
}, Segment2.prototype.addFileAttachmentSync = function(path, description, mimeType, fileName) { | |
if ("string" != typeof path || !path) throw new Error("Invalid path '" + path + "'"); | |
var stats = fs.statSync(path); | |
return fileName || (fileName = Path.basename(path)), mimeType || (mimeType = Mime.lookup(path)), | |
this._addAttachment({ | |
path: path, | |
description: description, | |
size: stats.size, | |
fileName: fileName, | |
mimeType: mimeType, | |
date: stats.mtime | |
}); | |
}, Segment2.prototype.addStreamAttachment = function(stream, fileName, mimeType, size, description, callback) { | |
return "number" != typeof size ? callback("Invalid size for attachment '" + size + "'") : "string" == typeof mimeType && mimeType.length ? "string" == typeof fileName && fileName.length ? ("function" == typeof description && (callback = description, | |
description = void 0), void callback(null, this._addAttachment({ | |
stream: stream, | |
description: description, | |
size: size, | |
fileName: fileName, | |
mimeType: mimeType | |
}))) : callback("Invalid fileName for attachment '" + fileName + "'") : callback("Invalid mimeType for attachment '" + mimeType + "'"); | |
}, Segment2.prototype._addAttachment = function(desc) { | |
this.ownerDocument; | |
var attachedFile = this.$attachments.$attachedFile; | |
attachedFile.$crc_32 = 0, attachedFile.fileName = desc.fileName, attachedFile.fileMimeType = desc.mimeType, | |
desc.description && (attachedFile.fileDescription = desc.description); | |
var uid = crc32(desc.fileName + "$" + desc.mimeType + "$" + desc.description + "$" + desc.size); | |
attachedFile.fileUID = uid; | |
var getStream, info, fileData = attachedFile.getFileData(); | |
return fileData.dataSize = desc.size, "function" == typeof desc.stream ? (getStream = desc.stream, | |
info = "*function*") : desc.path && (getStream = function(options, callback) { | |
callback(null, fs.createReadStream(desc.path, options)); | |
}, info = desc.path), fileData._dataSource = { | |
getStream: getStream, | |
info: info | |
}, attachedFile; | |
}, Segment2.prototype.getTagByTargetType = function(targetInfos) { | |
for (var tags = this.listChildrenByName(schema.byName.Tag), i = 0; i < tags.length; i++) { | |
var tag = tags[i], targets = tag.targets; | |
if (targets && !targets.empty) { | |
if (!(void 0 !== targetInfos.targetTypeValue && targetInfos.targetTypeValue !== targets.targetTypeValue || void 0 !== targetInfos.targetType && targetInfos.targetType !== targets.targetType)) { | |
var tus = targets.tagTrackUIDs; | |
if (void 0 !== targetInfos.tagTrackUID) { | |
if (!targetIn(targetInfos.tagTrackUID, tus)) continue; | |
} else if (tus && tus.length) continue; | |
var tes = targets.tagEditionUIDs; | |
if (void 0 !== targetInfos.tagEditionUID) { | |
if (!targetIn(targetInfos.tagEditionUID, tes)) continue; | |
} else if (tes && tes.length) continue; | |
var tcs = targets.tagChapterUIDs; | |
if (void 0 !== targetInfos.tagChapterUID) { | |
if (!targetIn(targetInfos.tagChapterUID, tcs)) continue; | |
} else if (tcs && tcs.length) continue; | |
var tas = targets.tagAttachmentUIDs; | |
if (void 0 !== targetInfos.tagAttachmentUID) { | |
if (!targetIn(targetInfos.tagAttachmentUID, tas)) continue; | |
} else if (tas && tas.length) continue; | |
return tag; | |
} | |
} else if (!targetInfos) return tag; | |
} | |
}, Segment2.prototype.addSimpleTagSync = function(targetInfos, name, language, defaultLanguage, value) { | |
var tag; | |
if (targetInfos.ebmlID === schema.byName.SimpleTag) tag = targetInfos; else if (!(tag = this.getTagByTargetType(targetInfos))) { | |
var targets = (tag = this.$tags.newTag()).$targets; | |
targetInfos && (targetInfos.tagAttachmentUID && targets.addTagAttachmentUID(targetInfos.tagAttachmentUID), | |
targetInfos.targetTypeValue && (targets.targetTypeValue = targetInfos.targetTypeValue), | |
targetInfos.targetType && (targets.targetType = targetInfos.targetType)); | |
} | |
var simpleTag = tag.newSimpleTag(); | |
return simpleTag.tagName = name, simpleTag.tagLanguage = language || "und", simpleTag.tagDefault = defaultLanguage ? 1 : 0, | |
null == value ? simpleTag : Buffer.isBuffer(value) ? (simpleTag.tagBinary = value, | |
simpleTag) : (value instanceof Date && (value = tools.formatDate(value)), value = String(value), | |
simpleTag.tagString = value, simpleTag); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var _AdtsStream, Stream = __webpack_require__(37), ONE_SECOND_IN_TS = __webpack_require__(54).ONE_SECOND_IN_TS, ADTS_SAMPLING_FREQUENCIES = [ 96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350 ]; | |
(_AdtsStream = function(handlePartialSegments) { | |
var buffer, frameNum = 0; | |
_AdtsStream.prototype.init.call(this), this.skipWarn_ = function(start, end) { | |
this.trigger("log", { | |
level: "warn", | |
message: "adts skiping bytes " + start + " to " + end + " in frame " + frameNum + " outside syncword" | |
}); | |
}, this.push = function(packet) { | |
var frameLength, protectionSkipBytes, oldBuffer, sampleCount, adtsFrameDuration, i = 0; | |
if (handlePartialSegments || (frameNum = 0), "audio" === packet.type) { | |
var skip; | |
for (buffer && buffer.length ? (oldBuffer = buffer, (buffer = new Uint8Array(oldBuffer.byteLength + packet.data.byteLength)).set(oldBuffer), | |
buffer.set(packet.data, oldBuffer.byteLength)) : buffer = packet.data; i + 7 < buffer.length; ) if (255 === buffer[i] && 240 == (246 & buffer[i + 1])) { | |
if ("number" == typeof skip && (this.skipWarn_(skip, i), skip = null), protectionSkipBytes = 2 * (1 & ~buffer[i + 1]), | |
frameLength = (3 & buffer[i + 3]) << 11 | buffer[i + 4] << 3 | (224 & buffer[i + 5]) >> 5, | |
adtsFrameDuration = (sampleCount = 1024 * (1 + (3 & buffer[i + 6]))) * ONE_SECOND_IN_TS / ADTS_SAMPLING_FREQUENCIES[(60 & buffer[i + 2]) >>> 2], | |
buffer.byteLength - i < frameLength) break; | |
this.trigger("data", { | |
pts: packet.pts + frameNum * adtsFrameDuration, | |
dts: packet.dts + frameNum * adtsFrameDuration, | |
sampleCount: sampleCount, | |
audioobjecttype: 1 + (buffer[i + 2] >>> 6 & 3), | |
channelcount: (1 & buffer[i + 2]) << 2 | (192 & buffer[i + 3]) >>> 6, | |
samplerate: ADTS_SAMPLING_FREQUENCIES[(60 & buffer[i + 2]) >>> 2], | |
samplingfrequencyindex: (60 & buffer[i + 2]) >>> 2, | |
samplesize: 16, | |
data: buffer.subarray(i + 7 + protectionSkipBytes, i + frameLength) | |
}), frameNum++, i += frameLength; | |
} else "number" != typeof skip && (skip = i), i++; | |
"number" == typeof skip && (this.skipWarn_(skip, i), skip = null), buffer = buffer.subarray(i); | |
} | |
}, this.flush = function() { | |
frameNum = 0, this.trigger("done"); | |
}, this.reset = function() { | |
buffer = void 0, this.trigger("reset"); | |
}, this.endTimeline = function() { | |
buffer = void 0, this.trigger("endedtimeline"); | |
}; | |
}).prototype = new Stream, module.exports = _AdtsStream; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var box, dinf, esds, ftyp, mdat, mfhd, minf, moof, moov, mvex, mvhd, trak, tkhd, mdia, mdhd, hdlr, sdtp, stbl, stsd, traf, trex, trun, types, MAJOR_BRAND, MINOR_VERSION, AVC1_BRAND, VIDEO_HDLR, AUDIO_HDLR, HDLR_TYPES, VMHD, SMHD, DREF, STCO, STSC, STSZ, STTS, videoSample, audioSample, audioTrun, videoTrun, trunHeader, UINT32_MAX = Math.pow(2, 32) - 1; | |
!(function() { | |
var i; | |
if (types = { | |
avc1: [], | |
avcC: [], | |
btrt: [], | |
dinf: [], | |
dref: [], | |
esds: [], | |
ftyp: [], | |
hdlr: [], | |
mdat: [], | |
mdhd: [], | |
mdia: [], | |
mfhd: [], | |
minf: [], | |
moof: [], | |
moov: [], | |
mp4a: [], | |
mvex: [], | |
mvhd: [], | |
pasp: [], | |
sdtp: [], | |
smhd: [], | |
stbl: [], | |
stco: [], | |
stsc: [], | |
stsd: [], | |
stsz: [], | |
stts: [], | |
styp: [], | |
tfdt: [], | |
tfhd: [], | |
traf: [], | |
trak: [], | |
trun: [], | |
trex: [], | |
tkhd: [], | |
vmhd: [] | |
}, "undefined" != typeof Uint8Array) { | |
for (i in types) types.hasOwnProperty(i) && (types[i] = [ i.charCodeAt(0), i.charCodeAt(1), i.charCodeAt(2), i.charCodeAt(3) ]); | |
MAJOR_BRAND = new Uint8Array([ "i".charCodeAt(0), "s".charCodeAt(0), "o".charCodeAt(0), "m".charCodeAt(0) ]), | |
AVC1_BRAND = new Uint8Array([ "a".charCodeAt(0), "v".charCodeAt(0), "c".charCodeAt(0), "1".charCodeAt(0) ]), | |
MINOR_VERSION = new Uint8Array([ 0, 0, 0, 1 ]), VIDEO_HDLR = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0 ]), | |
AUDIO_HDLR = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0 ]), | |
HDLR_TYPES = { | |
video: VIDEO_HDLR, | |
audio: AUDIO_HDLR | |
}, DREF = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1 ]), | |
SMHD = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0 ]), STCO = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0 ]), | |
STSC = STCO, STSZ = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]), STTS = STCO, | |
VMHD = new Uint8Array([ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 ]); | |
} | |
})(), box = function(type) { | |
var i, result, payload = [], size = 0; | |
for (i = 1; i < arguments.length; i++) payload.push(arguments[i]); | |
for (i = payload.length; i--; ) size += payload[i].byteLength; | |
for (result = new Uint8Array(size + 8), new DataView(result.buffer, result.byteOffset, result.byteLength).setUint32(0, result.byteLength), | |
result.set(type, 4), i = 0, size = 8; i < payload.length; i++) result.set(payload[i], size), | |
size += payload[i].byteLength; | |
return result; | |
}, dinf = function() { | |
return box(types.dinf, box(types.dref, DREF)); | |
}, esds = function(track) { | |
return box(types.esds, new Uint8Array([ 0, 0, 0, 0, 3, 25, 0, 0, 0, 4, 17, 64, 21, 0, 6, 0, 0, 0, 218, 192, 0, 0, 218, 192, 5, 2, track.audioobjecttype << 3 | track.samplingfrequencyindex >>> 1, track.samplingfrequencyindex << 7 | track.channelcount << 3, 6, 1, 2 ])); | |
}, ftyp = function() { | |
return box(types.ftyp, MAJOR_BRAND, MINOR_VERSION, MAJOR_BRAND, AVC1_BRAND); | |
}, hdlr = function(type) { | |
return box(types.hdlr, HDLR_TYPES[type]); | |
}, mdat = function(data) { | |
return box(types.mdat, data); | |
}, mdhd = function(track) { | |
var result = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 1, 95, 144, track.duration >>> 24 & 255, track.duration >>> 16 & 255, track.duration >>> 8 & 255, 255 & track.duration, 85, 196, 0, 0 ]); | |
return track.samplerate && (result[12] = track.samplerate >>> 24 & 255, result[13] = track.samplerate >>> 16 & 255, | |
result[14] = track.samplerate >>> 8 & 255, result[15] = 255 & track.samplerate), | |
box(types.mdhd, result); | |
}, mdia = function(track) { | |
return box(types.mdia, mdhd(track), hdlr(track.type), minf(track)); | |
}, mfhd = function(sequenceNumber) { | |
return box(types.mfhd, new Uint8Array([ 0, 0, 0, 0, (4278190080 & sequenceNumber) >> 24, (16711680 & sequenceNumber) >> 16, (65280 & sequenceNumber) >> 8, 255 & sequenceNumber ])); | |
}, minf = function(track) { | |
return box(types.minf, "video" === track.type ? box(types.vmhd, VMHD) : box(types.smhd, SMHD), dinf(), stbl(track)); | |
}, moof = function(sequenceNumber, tracks) { | |
for (var trackFragments = [], i = tracks.length; i--; ) trackFragments[i] = traf(tracks[i]); | |
return box.apply(null, [ types.moof, mfhd(sequenceNumber) ].concat(trackFragments)); | |
}, moov = function(tracks) { | |
for (var i = tracks.length, boxes = []; i--; ) boxes[i] = trak(tracks[i]); | |
return box.apply(null, [ types.moov, mvhd(4294967295) ].concat(boxes).concat(mvex(tracks))); | |
}, mvex = function(tracks) { | |
for (var i = tracks.length, boxes = []; i--; ) boxes[i] = trex(tracks[i]); | |
return box.apply(null, [ types.mvex ].concat(boxes)); | |
}, mvhd = function(duration) { | |
var bytes = new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 1, 95, 144, (4278190080 & duration) >> 24, (16711680 & duration) >> 16, (65280 & duration) >> 8, 255 & duration, 0, 1, 0, 0, 1, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 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 ]); | |
return box(types.mvhd, bytes); | |
}, sdtp = function(track) { | |
var flags, i, samples = track.samples || [], bytes = new Uint8Array(4 + samples.length); | |
for (i = 0; i < samples.length; i++) flags = samples[i].flags, bytes[i + 4] = flags.dependsOn << 4 | flags.isDependedOn << 2 | flags.hasRedundancy; | |
return box(types.sdtp, bytes); | |
}, stbl = function(track) { | |
return box(types.stbl, stsd(track), box(types.stts, STTS), box(types.stsc, STSC), box(types.stsz, STSZ), box(types.stco, STCO)); | |
}, stsd = function(track) { | |
return box(types.stsd, new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1 ]), "video" === track.type ? videoSample(track) : audioSample(track)); | |
}, videoSample = function(track) { | |
var i, avc1Box, sps = track.sps || [], pps = track.pps || [], sequenceParameterSets = [], pictureParameterSets = []; | |
for (i = 0; i < sps.length; i++) sequenceParameterSets.push((65280 & sps[i].byteLength) >>> 8), | |
sequenceParameterSets.push(255 & sps[i].byteLength), sequenceParameterSets = sequenceParameterSets.concat(Array.prototype.slice.call(sps[i])); | |
for (i = 0; i < pps.length; i++) pictureParameterSets.push((65280 & pps[i].byteLength) >>> 8), | |
pictureParameterSets.push(255 & pps[i].byteLength), pictureParameterSets = pictureParameterSets.concat(Array.prototype.slice.call(pps[i])); | |
if (avc1Box = [ types.avc1, new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (65280 & track.width) >> 8, 255 & track.width, (65280 & track.height) >> 8, 255 & track.height, 0, 72, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 0, 1, 19, 118, 105, 100, 101, 111, 106, 115, 45, 99, 111, 110, 116, 114, 105, 98, 45, 104, 108, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 17, 17 ]), box(types.avcC, new Uint8Array([ 1, track.profileIdc, track.profileCompatibility, track.levelIdc, 255 ].concat([ sps.length ], sequenceParameterSets, [ pps.length ], pictureParameterSets))), box(types.btrt, new Uint8Array([ 0, 28, 156, 128, 0, 45, 198, 192, 0, 45, 198, 192 ])) ], | |
track.sarRatio) { | |
var hSpacing = track.sarRatio[0], vSpacing = track.sarRatio[1]; | |
avc1Box.push(box(types.pasp, new Uint8Array([ (4278190080 & hSpacing) >> 24, (16711680 & hSpacing) >> 16, (65280 & hSpacing) >> 8, 255 & hSpacing, (4278190080 & vSpacing) >> 24, (16711680 & vSpacing) >> 16, (65280 & vSpacing) >> 8, 255 & vSpacing ]))); | |
} | |
return box.apply(null, avc1Box); | |
}, audioSample = function(track) { | |
return box(types.mp4a, new Uint8Array([ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, (65280 & track.channelcount) >> 8, 255 & track.channelcount, (65280 & track.samplesize) >> 8, 255 & track.samplesize, 0, 0, 0, 0, (65280 & track.samplerate) >> 8, 255 & track.samplerate, 0, 0 ]), esds(track)); | |
}, tkhd = function(track) { | |
var result = new Uint8Array([ 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, (4278190080 & track.id) >> 24, (16711680 & track.id) >> 16, (65280 & track.id) >> 8, 255 & track.id, 0, 0, 0, 0, (4278190080 & track.duration) >> 24, (16711680 & track.duration) >> 16, (65280 & track.duration) >> 8, 255 & track.duration, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 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, 64, 0, 0, 0, (65280 & track.width) >> 8, 255 & track.width, 0, 0, (65280 & track.height) >> 8, 255 & track.height, 0, 0 ]); | |
return box(types.tkhd, result); | |
}, traf = function(track) { | |
var trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable, upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime; | |
return trackFragmentHeader = box(types.tfhd, new Uint8Array([ 0, 0, 0, 58, (4278190080 & track.id) >> 24, (16711680 & track.id) >> 16, (65280 & track.id) >> 8, 255 & track.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ])), | |
upperWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime / (UINT32_MAX + 1)), | |
lowerWordBaseMediaDecodeTime = Math.floor(track.baseMediaDecodeTime % (UINT32_MAX + 1)), | |
trackFragmentDecodeTime = box(types.tfdt, new Uint8Array([ 1, 0, 0, 0, upperWordBaseMediaDecodeTime >>> 24 & 255, upperWordBaseMediaDecodeTime >>> 16 & 255, upperWordBaseMediaDecodeTime >>> 8 & 255, 255 & upperWordBaseMediaDecodeTime, lowerWordBaseMediaDecodeTime >>> 24 & 255, lowerWordBaseMediaDecodeTime >>> 16 & 255, lowerWordBaseMediaDecodeTime >>> 8 & 255, 255 & lowerWordBaseMediaDecodeTime ])), | |
"audio" === track.type ? (trackFragmentRun = trun(track, 92), box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun)) : (sampleDependencyTable = sdtp(track), | |
trackFragmentRun = trun(track, sampleDependencyTable.length + 92), box(types.traf, trackFragmentHeader, trackFragmentDecodeTime, trackFragmentRun, sampleDependencyTable)); | |
}, trak = function(track) { | |
return track.duration = track.duration || 4294967295, box(types.trak, tkhd(track), mdia(track)); | |
}, trex = function(track) { | |
var result = new Uint8Array([ 0, 0, 0, 0, (4278190080 & track.id) >> 24, (16711680 & track.id) >> 16, (65280 & track.id) >> 8, 255 & track.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1 ]); | |
return "video" !== track.type && (result[result.length - 1] = 0), box(types.trex, result); | |
}, trunHeader = function(samples, offset) { | |
var durationPresent = 0, sizePresent = 0, flagsPresent = 0, compositionTimeOffset = 0; | |
return samples.length && (void 0 !== samples[0].duration && (durationPresent = 1), | |
void 0 !== samples[0].size && (sizePresent = 2), void 0 !== samples[0].flags && (flagsPresent = 4), | |
void 0 !== samples[0].compositionTimeOffset && (compositionTimeOffset = 8)), [ 0, 0, durationPresent | sizePresent | flagsPresent | compositionTimeOffset, 1, (4278190080 & samples.length) >>> 24, (16711680 & samples.length) >>> 16, (65280 & samples.length) >>> 8, 255 & samples.length, (4278190080 & offset) >>> 24, (16711680 & offset) >>> 16, (65280 & offset) >>> 8, 255 & offset ]; | |
}, videoTrun = function(track, offset) { | |
var bytesOffest, bytes, header, samples, sample, i; | |
for (offset += 20 + 16 * (samples = track.samples || []).length, header = trunHeader(samples, offset), | |
(bytes = new Uint8Array(header.length + 16 * samples.length)).set(header), bytesOffest = header.length, | |
i = 0; i < samples.length; i++) sample = samples[i], bytes[bytesOffest++] = (4278190080 & sample.duration) >>> 24, | |
bytes[bytesOffest++] = (16711680 & sample.duration) >>> 16, bytes[bytesOffest++] = (65280 & sample.duration) >>> 8, | |
bytes[bytesOffest++] = 255 & sample.duration, bytes[bytesOffest++] = (4278190080 & sample.size) >>> 24, | |
bytes[bytesOffest++] = (16711680 & sample.size) >>> 16, bytes[bytesOffest++] = (65280 & sample.size) >>> 8, | |
bytes[bytesOffest++] = 255 & sample.size, bytes[bytesOffest++] = sample.flags.isLeading << 2 | sample.flags.dependsOn, | |
bytes[bytesOffest++] = sample.flags.isDependedOn << 6 | sample.flags.hasRedundancy << 4 | sample.flags.paddingValue << 1 | sample.flags.isNonSyncSample, | |
bytes[bytesOffest++] = 61440 & sample.flags.degradationPriority, bytes[bytesOffest++] = 15 & sample.flags.degradationPriority, | |
bytes[bytesOffest++] = (4278190080 & sample.compositionTimeOffset) >>> 24, bytes[bytesOffest++] = (16711680 & sample.compositionTimeOffset) >>> 16, | |
bytes[bytesOffest++] = (65280 & sample.compositionTimeOffset) >>> 8, bytes[bytesOffest++] = 255 & sample.compositionTimeOffset; | |
return box(types.trun, bytes); | |
}, audioTrun = function(track, offset) { | |
var bytes, bytesOffest, header, samples, sample, i; | |
for (offset += 20 + 8 * (samples = track.samples || []).length, header = trunHeader(samples, offset), | |
(bytes = new Uint8Array(header.length + 8 * samples.length)).set(header), bytesOffest = header.length, | |
i = 0; i < samples.length; i++) sample = samples[i], bytes[bytesOffest++] = (4278190080 & sample.duration) >>> 24, | |
bytes[bytesOffest++] = (16711680 & sample.duration) >>> 16, bytes[bytesOffest++] = (65280 & sample.duration) >>> 8, | |
bytes[bytesOffest++] = 255 & sample.duration, bytes[bytesOffest++] = (4278190080 & sample.size) >>> 24, | |
bytes[bytesOffest++] = (16711680 & sample.size) >>> 16, bytes[bytesOffest++] = (65280 & sample.size) >>> 8, | |
bytes[bytesOffest++] = 255 & sample.size; | |
return box(types.trun, bytes); | |
}, trun = function(track, offset) { | |
return "audio" === track.type ? audioTrun(track, offset) : videoTrun(track, offset); | |
}, module.exports = { | |
ftyp: ftyp, | |
mdat: mdat, | |
moof: moof, | |
moov: moov, | |
initSegment: function(tracks) { | |
var result, fileType = ftyp(), movie = moov(tracks); | |
return (result = new Uint8Array(fileType.byteLength + movie.byteLength)).set(fileType), | |
result.set(movie, fileType.byteLength), result; | |
} | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = { | |
toUnsigned: function(value) { | |
return value >>> 0; | |
}, | |
toHexString: function(value) { | |
return ("00" + value.toString(16)).slice(-2); | |
} | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var ONE_SECOND_IN_TS = __webpack_require__(54).ONE_SECOND_IN_TS; | |
module.exports = { | |
clearDtsInfo: function(track) { | |
delete track.minSegmentDts, delete track.maxSegmentDts, delete track.minSegmentPts, | |
delete track.maxSegmentPts; | |
}, | |
calculateTrackBaseMediaDecodeTime: function(track, keepOriginalTimestamps) { | |
var baseMediaDecodeTime, minSegmentDts = track.minSegmentDts; | |
return keepOriginalTimestamps || (minSegmentDts -= track.timelineStartInfo.dts), | |
baseMediaDecodeTime = track.timelineStartInfo.baseMediaDecodeTime, baseMediaDecodeTime += minSegmentDts, | |
baseMediaDecodeTime = Math.max(0, baseMediaDecodeTime), "audio" === track.type && (baseMediaDecodeTime *= track.samplerate / ONE_SECOND_IN_TS, | |
baseMediaDecodeTime = Math.floor(baseMediaDecodeTime)), baseMediaDecodeTime; | |
}, | |
collectDtsInfo: function(track, data) { | |
"number" == typeof data.pts && (void 0 === track.timelineStartInfo.pts && (track.timelineStartInfo.pts = data.pts), | |
void 0 === track.minSegmentPts ? track.minSegmentPts = data.pts : track.minSegmentPts = Math.min(track.minSegmentPts, data.pts), | |
void 0 === track.maxSegmentPts ? track.maxSegmentPts = data.pts : track.maxSegmentPts = Math.max(track.maxSegmentPts, data.pts)), | |
"number" == typeof data.dts && (void 0 === track.timelineStartInfo.dts && (track.timelineStartInfo.dts = data.dts), | |
void 0 === track.minSegmentDts ? track.minSegmentDts = data.dts : track.minSegmentDts = Math.min(track.minSegmentDts, data.dts), | |
void 0 === track.maxSegmentDts ? track.maxSegmentDts = data.dts : track.maxSegmentDts = Math.max(track.maxSegmentDts, data.dts)); | |
} | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var _TransportPacketStream, _TransportParseStream, _ElementaryStream, Stream = __webpack_require__(37), CaptionStream = __webpack_require__(416), StreamTypes = __webpack_require__(144), TimestampRolloverStream = __webpack_require__(418).TimestampRolloverStream; | |
(_TransportPacketStream = function() { | |
var buffer = new Uint8Array(188), bytesInBuffer = 0; | |
_TransportPacketStream.prototype.init.call(this), this.push = function(bytes) { | |
var everything, startIndex = 0, endIndex = 188; | |
for (bytesInBuffer ? ((everything = new Uint8Array(bytes.byteLength + bytesInBuffer)).set(buffer.subarray(0, bytesInBuffer)), | |
everything.set(bytes, bytesInBuffer), bytesInBuffer = 0) : everything = bytes; endIndex < everything.byteLength; ) 71 !== everything[startIndex] || 71 !== everything[endIndex] ? (startIndex++, | |
endIndex++) : (this.trigger("data", everything.subarray(startIndex, endIndex)), | |
startIndex += 188, endIndex += 188); | |
startIndex < everything.byteLength && (buffer.set(everything.subarray(startIndex), 0), | |
bytesInBuffer = everything.byteLength - startIndex); | |
}, this.flush = function() { | |
188 === bytesInBuffer && 71 === buffer[0] && (this.trigger("data", buffer), bytesInBuffer = 0), | |
this.trigger("done"); | |
}, this.endTimeline = function() { | |
this.flush(), this.trigger("endedtimeline"); | |
}, this.reset = function() { | |
bytesInBuffer = 0, this.trigger("reset"); | |
}; | |
}).prototype = new Stream, (_TransportParseStream = function() { | |
var parsePsi, parsePat, parsePmt, self; | |
_TransportParseStream.prototype.init.call(this), self = this, this.packetsWaitingForPmt = [], | |
this.programMapTable = void 0, parsePsi = function(payload, psi) { | |
var offset = 0; | |
psi.payloadUnitStartIndicator && (offset += payload[offset] + 1), "pat" === psi.type ? parsePat(payload.subarray(offset), psi) : parsePmt(payload.subarray(offset), psi); | |
}, parsePat = function(payload, pat) { | |
pat.section_number = payload[7], pat.last_section_number = payload[8], self.pmtPid = (31 & payload[10]) << 8 | payload[11], | |
pat.pmtPid = self.pmtPid; | |
}, parsePmt = function(payload, pmt) { | |
var tableEnd, offset; | |
if (1 & payload[5]) { | |
for (self.programMapTable = { | |
video: null, | |
audio: null, | |
"timed-metadata": {} | |
}, tableEnd = 3 + ((15 & payload[1]) << 8 | payload[2]) - 4, offset = 12 + ((15 & payload[10]) << 8 | payload[11]); offset < tableEnd; ) { | |
var streamType = payload[offset], pid = (31 & payload[offset + 1]) << 8 | payload[offset + 2]; | |
streamType === StreamTypes.H264_STREAM_TYPE && null === self.programMapTable.video ? self.programMapTable.video = pid : streamType === StreamTypes.ADTS_STREAM_TYPE && null === self.programMapTable.audio ? self.programMapTable.audio = pid : streamType === StreamTypes.METADATA_STREAM_TYPE && (self.programMapTable["timed-metadata"][pid] = streamType), | |
offset += 5 + ((15 & payload[offset + 3]) << 8 | payload[offset + 4]); | |
} | |
pmt.programMapTable = self.programMapTable; | |
} | |
}, this.push = function(packet) { | |
var result = {}, offset = 4; | |
if (result.payloadUnitStartIndicator = !!(64 & packet[1]), result.pid = 31 & packet[1], | |
result.pid <<= 8, result.pid |= packet[2], (48 & packet[3]) >>> 4 > 1 && (offset += packet[offset] + 1), | |
0 === result.pid) result.type = "pat", parsePsi(packet.subarray(offset), result), | |
this.trigger("data", result); else if (result.pid === this.pmtPid) for (result.type = "pmt", | |
parsePsi(packet.subarray(offset), result), this.trigger("data", result); this.packetsWaitingForPmt.length; ) this.processPes_.apply(this, this.packetsWaitingForPmt.shift()); else void 0 === this.programMapTable ? this.packetsWaitingForPmt.push([ packet, offset, result ]) : this.processPes_(packet, offset, result); | |
}, this.processPes_ = function(packet, offset, result) { | |
result.pid === this.programMapTable.video ? result.streamType = StreamTypes.H264_STREAM_TYPE : result.pid === this.programMapTable.audio ? result.streamType = StreamTypes.ADTS_STREAM_TYPE : result.streamType = this.programMapTable["timed-metadata"][result.pid], | |
result.type = "pes", result.data = packet.subarray(offset), this.trigger("data", result); | |
}; | |
}).prototype = new Stream, _TransportParseStream.STREAM_TYPES = { | |
h264: 27, | |
adts: 15 | |
}, _ElementaryStream = function() { | |
var programMapTable, self = this, segmentHadPmt = !1, video = { | |
data: [], | |
size: 0 | |
}, audio = { | |
data: [], | |
size: 0 | |
}, timedMetadata = { | |
data: [], | |
size: 0 | |
}, flushStream = function(stream, type, forceFlush) { | |
var packetFlushable, fragment, packetData = new Uint8Array(stream.size), event = { | |
type: type | |
}, i = 0, offset = 0; | |
if (stream.data.length && !(stream.size < 9)) { | |
for (event.trackId = stream.data[0].pid, i = 0; i < stream.data.length; i++) fragment = stream.data[i], | |
packetData.set(fragment.data, offset), offset += fragment.data.byteLength; | |
var payload, pes, ptsDtsFlags, startPrefix; | |
pes = event, startPrefix = (payload = packetData)[0] << 16 | payload[1] << 8 | payload[2], | |
pes.data = new Uint8Array, 1 === startPrefix && (pes.packetLength = 6 + (payload[4] << 8 | payload[5]), | |
pes.dataAlignmentIndicator = 0 != (4 & payload[6]), 192 & (ptsDtsFlags = payload[7]) && (pes.pts = (14 & payload[9]) << 27 | (255 & payload[10]) << 20 | (254 & payload[11]) << 12 | (255 & payload[12]) << 5 | (254 & payload[13]) >>> 3, | |
pes.pts *= 4, pes.pts += (6 & payload[13]) >>> 1, pes.dts = pes.pts, 64 & ptsDtsFlags && (pes.dts = (14 & payload[14]) << 27 | (255 & payload[15]) << 20 | (254 & payload[16]) << 12 | (255 & payload[17]) << 5 | (254 & payload[18]) >>> 3, | |
pes.dts *= 4, pes.dts += (6 & payload[18]) >>> 1)), pes.data = payload.subarray(9 + payload[8])), | |
packetFlushable = "video" === type || event.packetLength <= stream.size, (forceFlush || packetFlushable) && (stream.size = 0, | |
stream.data.length = 0), packetFlushable && self.trigger("data", event); | |
} | |
}; | |
_ElementaryStream.prototype.init.call(this), this.push = function(data) { | |
({ | |
pat: function() {}, | |
pes: function() { | |
var stream, streamType; | |
switch (data.streamType) { | |
case StreamTypes.H264_STREAM_TYPE: | |
stream = video, streamType = "video"; | |
break; | |
case StreamTypes.ADTS_STREAM_TYPE: | |
stream = audio, streamType = "audio"; | |
break; | |
case StreamTypes.METADATA_STREAM_TYPE: | |
stream = timedMetadata, streamType = "timed-metadata"; | |
break; | |
default: | |
return; | |
} | |
data.payloadUnitStartIndicator && flushStream(stream, streamType, !0), stream.data.push(data), | |
stream.size += data.data.byteLength; | |
}, | |
pmt: function() { | |
var event = { | |
type: "metadata", | |
tracks: [] | |
}; | |
null !== (programMapTable = data.programMapTable).video && event.tracks.push({ | |
timelineStartInfo: { | |
baseMediaDecodeTime: 0 | |
}, | |
id: +programMapTable.video, | |
codec: "avc", | |
type: "video" | |
}), null !== programMapTable.audio && event.tracks.push({ | |
timelineStartInfo: { | |
baseMediaDecodeTime: 0 | |
}, | |
id: +programMapTable.audio, | |
codec: "adts", | |
type: "audio" | |
}), segmentHadPmt = !0, self.trigger("data", event); | |
} | |
})[data.type](); | |
}, this.reset = function() { | |
video.size = 0, video.data.length = 0, audio.size = 0, audio.data.length = 0, this.trigger("reset"); | |
}, this.flushStreams_ = function() { | |
flushStream(video, "video"), flushStream(audio, "audio"), flushStream(timedMetadata, "timed-metadata"); | |
}, this.flush = function() { | |
if (!segmentHadPmt && programMapTable) { | |
var pmt = { | |
type: "metadata", | |
tracks: [] | |
}; | |
null !== programMapTable.video && pmt.tracks.push({ | |
timelineStartInfo: { | |
baseMediaDecodeTime: 0 | |
}, | |
id: +programMapTable.video, | |
codec: "avc", | |
type: "video" | |
}), null !== programMapTable.audio && pmt.tracks.push({ | |
timelineStartInfo: { | |
baseMediaDecodeTime: 0 | |
}, | |
id: +programMapTable.audio, | |
codec: "adts", | |
type: "audio" | |
}), self.trigger("data", pmt); | |
} | |
segmentHadPmt = !1, this.flushStreams_(), this.trigger("done"); | |
}; | |
}, _ElementaryStream.prototype = new Stream; | |
var m2ts = { | |
PAT_PID: 0, | |
MP2T_PACKET_LENGTH: 188, | |
TransportPacketStream: _TransportPacketStream, | |
TransportParseStream: _TransportParseStream, | |
ElementaryStream: _ElementaryStream, | |
TimestampRolloverStream: TimestampRolloverStream, | |
CaptionStream: CaptionStream.CaptionStream, | |
Cea608Stream: CaptionStream.Cea608Stream, | |
Cea708Stream: CaptionStream.Cea708Stream, | |
MetadataStream: __webpack_require__(828) | |
}; | |
for (var type in StreamTypes) StreamTypes.hasOwnProperty(type) && (m2ts[type] = StreamTypes[type]); | |
module.exports = m2ts; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = { | |
H264_STREAM_TYPE: 27, | |
ADTS_STREAM_TYPE: 15, | |
METADATA_STREAM_TYPE: 21 | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var ADTS_SAMPLING_FREQUENCIES = [ 96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350 ], parseId3TagSize = function(header, byteIndex) { | |
var returnSize = header[byteIndex + 6] << 21 | header[byteIndex + 7] << 14 | header[byteIndex + 8] << 7 | header[byteIndex + 9]; | |
return returnSize = returnSize >= 0 ? returnSize : 0, (16 & header[byteIndex + 5]) >> 4 ? returnSize + 20 : returnSize + 10; | |
}, getId3Offset = function getId3Offset(data, offset) { | |
return data.length - offset < 10 || data[offset] !== "I".charCodeAt(0) || data[offset + 1] !== "D".charCodeAt(0) || data[offset + 2] !== "3".charCodeAt(0) ? offset : getId3Offset(data, offset += parseId3TagSize(data, offset)); | |
}, parseSyncSafeInteger = function(data) { | |
return data[0] << 21 | data[1] << 14 | data[2] << 7 | data[3]; | |
}; | |
module.exports = { | |
isLikelyAacData: function(data) { | |
var offset = getId3Offset(data, 0); | |
return data.length >= offset + 2 && 255 == (255 & data[offset]) && 240 == (240 & data[offset + 1]) && 16 == (22 & data[offset + 1]); | |
}, | |
parseId3TagSize: parseId3TagSize, | |
parseAdtsSize: function(header, byteIndex) { | |
var lowThree = (224 & header[byteIndex + 5]) >> 5, middle = header[byteIndex + 4] << 3; | |
return 6144 & header[byteIndex + 3] | middle | lowThree; | |
}, | |
parseType: function(header, byteIndex) { | |
return header[byteIndex] === "I".charCodeAt(0) && header[byteIndex + 1] === "D".charCodeAt(0) && header[byteIndex + 2] === "3".charCodeAt(0) ? "timed-metadata" : !0 & header[byteIndex] && 240 == (240 & header[byteIndex + 1]) ? "audio" : null; | |
}, | |
parseSampleRate: function(packet) { | |
for (var i = 0; i + 5 < packet.length; ) { | |
if (255 === packet[i] && 240 == (246 & packet[i + 1])) return ADTS_SAMPLING_FREQUENCIES[(60 & packet[i + 2]) >>> 2]; | |
i++; | |
} | |
return null; | |
}, | |
parseAacTimestamp: function(packet) { | |
var frameStart, frameSize, frame; | |
frameStart = 10, 64 & packet[5] && (frameStart += 4, frameStart += parseSyncSafeInteger(packet.subarray(10, 14))); | |
do { | |
if ((frameSize = parseSyncSafeInteger(packet.subarray(frameStart + 4, frameStart + 8))) < 1) return null; | |
if ("PRIV" === String.fromCharCode(packet[frameStart], packet[frameStart + 1], packet[frameStart + 2], packet[frameStart + 3])) { | |
frame = packet.subarray(frameStart + 10, frameStart + frameSize + 10); | |
for (var i = 0; i < frame.byteLength; i++) if (0 === frame[i]) { | |
var owner = unescape((function(bytes, start, end) { | |
var i, result = ""; | |
for (i = 0; i < end; i++) result += "%" + ("00" + bytes[i].toString(16)).slice(-2); | |
return result; | |
})(frame, 0, i)); | |
if ("com.apple.streaming.transportStreamTimestamp" === owner) { | |
var d = frame.subarray(i + 1), size = (1 & d[3]) << 30 | d[4] << 22 | d[5] << 14 | d[6] << 6 | d[7] >>> 2; | |
return (size *= 4) + (3 & d[7]); | |
} | |
break; | |
} | |
} | |
frameStart += 10, frameStart += frameSize; | |
} while (frameStart < packet.byteLength); | |
return null; | |
} | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var __importDefault = this && this.__importDefault || function(mod) { | |
return mod && mod.__esModule ? mod : { | |
default: mod | |
}; | |
}; | |
const http_1 = __importDefault(__webpack_require__(11)), https_1 = __importDefault(__webpack_require__(22)), url_1 = __webpack_require__(7), stream_1 = __webpack_require__(3), httpLibs = { | |
"http:": http_1.default, | |
"https:": https_1.default | |
}, redirectStatusCodes = new Set([ 301, 302, 303, 307, 308 ]), retryStatusCodes = new Set([ 429, 503 ]), requestEvents = [ "connect", "continue", "information", "socket", "timeout", "upgrade" ], responseEvents = [ "aborted" ]; | |
function Miniget(url, options = {}) { | |
var _a; | |
const opts = Object.assign({}, Miniget.defaultOptions, options), stream = new stream_1.PassThrough({ | |
highWaterMark: opts.highWaterMark | |
}); | |
let activeRequest, activeResponse, activeDecodedStream; | |
stream.destroyed = stream.aborted = !1; | |
let retryTimeout, contentLength, rangeEnd, redirects = 0, retries = 0, reconnects = 0, acceptRanges = !1, rangeStart = 0, downloaded = 0; | |
if (null === (_a = opts.headers) || void 0 === _a ? void 0 : _a.Range) { | |
let r = /bytes=(\d+)-(\d+)?/.exec(`${opts.headers.Range}`); | |
r && (rangeStart = parseInt(r[1], 10), rangeEnd = parseInt(r[2], 10)); | |
} | |
opts.acceptEncoding && (opts.headers = Object.assign({ | |
"Accept-Encoding": Object.keys(opts.acceptEncoding).join(", ") | |
}, opts.headers)); | |
const reconnectIfEndedEarly = err => !!("HEAD" !== options.method && acceptRanges && downloaded !== contentLength && reconnects++ < opts.maxReconnects) && ((err => { | |
activeDecodedStream = null, retries = 0; | |
let inc = opts.backoff.inc, ms = Math.min(inc, opts.backoff.max); | |
retryTimeout = setTimeout(doDownload, ms), stream.emit("reconnect", reconnects, err); | |
})(err), !0), retryRequest = retryOptions => { | |
if (stream.destroyed) return !1; | |
if (activeDecodedStream && downloaded > 0) return reconnectIfEndedEarly(retryOptions.err); | |
if ((!retryOptions.err || "ENOTFOUND" === retryOptions.err.message) && retries++ < opts.maxRetries) { | |
let ms = retryOptions.retryAfter || Math.min(retries * opts.backoff.inc, opts.backoff.max); | |
return retryTimeout = setTimeout(doDownload, ms), stream.emit("retry", retries, retryOptions.err), | |
!0; | |
} | |
return !1; | |
}, forwardEvents = (ee, events) => { | |
for (let event of events) ee.on(event, stream.emit.bind(stream, event)); | |
}, doDownload = () => { | |
let httpLib, parsed = {}; | |
try { | |
let urlObj = "string" == typeof url ? new url_1.URL(url) : url; | |
parsed = Object.assign({}, { | |
host: urlObj.host, | |
hostname: urlObj.hostname, | |
path: urlObj.pathname + urlObj.search + urlObj.hash, | |
port: urlObj.port, | |
protocol: urlObj.protocol | |
}), urlObj.username && (parsed.auth = `${urlObj.username}:${urlObj.password}`), | |
httpLib = httpLibs[String(parsed.protocol)]; | |
} catch (err) {} | |
if (!httpLib) return void stream.emit("error", new Miniget.MinigetError(`Invalid URL: ${url}`)); | |
if (Object.assign(parsed, opts), acceptRanges && downloaded > 0) { | |
let start = downloaded + rangeStart, end = rangeEnd || ""; | |
parsed.headers = Object.assign({}, parsed.headers, { | |
Range: `bytes=${start}-${end}` | |
}); | |
} | |
if (opts.transform) { | |
try { | |
parsed = opts.transform(parsed); | |
} catch (err) { | |
return void stream.emit("error", err); | |
} | |
if ((!parsed || parsed.protocol) && (httpLib = httpLibs[String(null == parsed ? void 0 : parsed.protocol)], | |
!httpLib)) return void stream.emit("error", new Miniget.MinigetError("Invalid URL object from `transform` function")); | |
} | |
const onError = err => { | |
stream.destroyed || stream.readableEnded || stream._readableState.ended || (cleanup(), | |
retryRequest({ | |
err: err | |
}) ? activeRequest.removeListener("close", onRequestClose) : stream.emit("error", err)); | |
}, onRequestClose = () => { | |
cleanup(), retryRequest({}); | |
}, cleanup = () => { | |
activeRequest.removeListener("close", onRequestClose), null == activeResponse || activeResponse.removeListener("data", onData), | |
null == activeDecodedStream || activeDecodedStream.removeListener("end", onEnd); | |
}, onData = chunk => { | |
downloaded += chunk.length; | |
}, onEnd = () => { | |
cleanup(), reconnectIfEndedEarly() || stream.end(); | |
}; | |
activeRequest = httpLib.request(parsed, (res => { | |
if (!stream.destroyed) if (redirectStatusCodes.has(res.statusCode)) { | |
if (redirects++ >= opts.maxRedirects) stream.emit("error", new Miniget.MinigetError("Too many redirects")); else { | |
if (!res.headers.location) { | |
let err = new Miniget.MinigetError("Redirect status code given with no location", res.statusCode); | |
return stream.emit("error", err), void cleanup(); | |
} | |
url = res.headers.location, setTimeout(doDownload, 1e3 * parseInt(res.headers["retry-after"] || "0", 10)), | |
stream.emit("redirect", url); | |
} | |
cleanup(); | |
} else if (retryStatusCodes.has(res.statusCode)) { | |
if (!retryRequest({ | |
retryAfter: parseInt(res.headers["retry-after"] || "0", 10) | |
})) { | |
let err = new Miniget.MinigetError(`Status code: ${res.statusCode}`, res.statusCode); | |
stream.emit("error", err); | |
} | |
cleanup(); | |
} else { | |
if (res.statusCode && (res.statusCode < 200 || res.statusCode >= 400)) { | |
let err = new Miniget.MinigetError(`Status code: ${res.statusCode}`, res.statusCode); | |
return res.statusCode >= 500 ? onError(err) : stream.emit("error", err), void cleanup(); | |
} | |
if (activeDecodedStream = res, opts.acceptEncoding && res.headers["content-encoding"]) for (let enc of res.headers["content-encoding"].split(", ").reverse()) { | |
let fn = opts.acceptEncoding[enc]; | |
fn && (activeDecodedStream = activeDecodedStream.pipe(fn()), activeDecodedStream.on("error", onError)); | |
} | |
contentLength || (contentLength = parseInt(`${res.headers["content-length"]}`, 10), | |
acceptRanges = "bytes" === res.headers["accept-ranges"] && contentLength > 0 && opts.maxReconnects > 0), | |
res.on("data", onData), activeDecodedStream.on("end", onEnd), activeDecodedStream.pipe(stream, { | |
end: !acceptRanges | |
}), activeResponse = res, stream.emit("response", res), res.on("error", onError), | |
forwardEvents(res, responseEvents); | |
} | |
})), activeRequest.on("error", onError), activeRequest.on("close", onRequestClose), | |
forwardEvents(activeRequest, requestEvents), stream.destroyed && streamDestroy(...destroyArgs), | |
stream.emit("request", activeRequest), activeRequest.end(); | |
}; | |
let destroyArgs; | |
stream.abort = err => { | |
console.warn("`MinigetStream#abort()` has been deprecated in favor of `MinigetStream#destroy()`"), | |
stream.aborted = !0, stream.emit("abort"), stream.destroy(err); | |
}; | |
const streamDestroy = err => { | |
activeRequest.destroy(err), null == activeDecodedStream || activeDecodedStream.unpipe(stream), | |
null == activeDecodedStream || activeDecodedStream.destroy(), clearTimeout(retryTimeout); | |
}; | |
return stream._destroy = (...args) => { | |
stream.destroyed = !0, activeRequest ? streamDestroy(...args) : destroyArgs = args; | |
}, stream.text = () => new Promise(((resolve, reject) => { | |
let body = ""; | |
stream.setEncoding("utf8"), stream.on("data", (chunk => body += chunk)), stream.on("end", (() => resolve(body))), | |
stream.on("error", reject); | |
})), process.nextTick(doDownload), stream; | |
} | |
Miniget.MinigetError = class extends Error { | |
constructor(message, statusCode) { | |
super(message), this.statusCode = statusCode; | |
} | |
}, Miniget.defaultOptions = { | |
maxRedirects: 10, | |
maxRetries: 2, | |
maxReconnects: 0, | |
backoff: { | |
inc: 100, | |
max: 1e4 | |
} | |
}, module.exports = Miniget; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var hasOwn = Object.prototype.hasOwnProperty, toStr = Object.prototype.toString, defineProperty = Object.defineProperty, gOPD = Object.getOwnPropertyDescriptor, isArray = function(arr) { | |
return "function" == typeof Array.isArray ? Array.isArray(arr) : "[object Array]" === toStr.call(arr); | |
}, isPlainObject = function(obj) { | |
if (!obj || "[object Object]" !== toStr.call(obj)) return !1; | |
var key, hasOwnConstructor = hasOwn.call(obj, "constructor"), hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, "isPrototypeOf"); | |
if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) return !1; | |
for (key in obj) ; | |
return void 0 === key || hasOwn.call(obj, key); | |
}, setProperty = function(target, options) { | |
defineProperty && "__proto__" === options.name ? defineProperty(target, options.name, { | |
enumerable: !0, | |
configurable: !0, | |
value: options.newValue, | |
writable: !0 | |
}) : target[options.name] = options.newValue; | |
}, getProperty = function(obj, name) { | |
if ("__proto__" === name) { | |
if (!hasOwn.call(obj, name)) return; | |
if (gOPD) return gOPD(obj, name).value; | |
} | |
return obj[name]; | |
}; | |
module.exports = function extend() { | |
var options, name, src, copy, copyIsArray, clone, target = arguments[0], i = 1, length = arguments.length, deep = !1; | |
for ("boolean" == typeof target && (deep = target, target = arguments[1] || {}, | |
i = 2), (null == target || "object" != typeof target && "function" != typeof target) && (target = {}); i < length; ++i) if (null != (options = arguments[i])) for (name in options) src = getProperty(target, name), | |
target !== (copy = getProperty(options, name)) && (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy))) ? (copyIsArray ? (copyIsArray = !1, | |
clone = src && isArray(src) ? src : []) : clone = src && isPlainObject(src) ? src : {}, | |
setProperty(target, { | |
name: name, | |
newValue: extend(deep, clone, copy) | |
})) : void 0 !== copy && setProperty(target, { | |
name: name, | |
newValue: copy | |
})); | |
return target; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var rng = __webpack_require__(938), bytesToUuid = __webpack_require__(939); | |
module.exports = function(options, buf, offset) { | |
var i = buf && offset || 0; | |
"string" == typeof options && (buf = "binary" === options ? new Array(16) : null, | |
options = null); | |
var rnds = (options = options || {}).random || (options.rng || rng)(); | |
if (rnds[6] = 15 & rnds[6] | 64, rnds[8] = 63 & rnds[8] | 128, buf) for (var ii = 0; ii < 16; ++ii) buf[i + ii] = rnds[ii]; | |
return buf || bytesToUuid(rnds); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
function flattenWithDepth(array, result, depth) { | |
for (var i = 0; i < array.length; i++) { | |
var value = array[i]; | |
depth > 0 && Array.isArray(value) ? flattenWithDepth(value, result, depth - 1) : result.push(value); | |
} | |
return result; | |
} | |
function flattenForever(array, result) { | |
for (var i = 0; i < array.length; i++) { | |
var value = array[i]; | |
Array.isArray(value) ? flattenForever(value, result) : result.push(value); | |
} | |
return result; | |
} | |
module.exports = function(array, depth) { | |
return null == depth ? flattenForever(array, []) : flattenWithDepth(array, [], depth); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var assert = __webpack_require__(15), sshpk = __webpack_require__(230), util = __webpack_require__(0), HASH_ALGOS = { | |
sha1: !0, | |
sha256: !0, | |
sha512: !0 | |
}, PK_ALGOS = { | |
rsa: !0, | |
dsa: !0, | |
ecdsa: !0 | |
}; | |
function HttpSignatureError(message, caller) { | |
Error.captureStackTrace && Error.captureStackTrace(this, caller || HttpSignatureError), | |
this.message = message, this.name = caller.name; | |
} | |
function InvalidAlgorithmError(message) { | |
HttpSignatureError.call(this, message, InvalidAlgorithmError); | |
} | |
util.inherits(HttpSignatureError, Error), util.inherits(InvalidAlgorithmError, HttpSignatureError), | |
module.exports = { | |
HASH_ALGOS: HASH_ALGOS, | |
PK_ALGOS: PK_ALGOS, | |
HttpSignatureError: HttpSignatureError, | |
InvalidAlgorithmError: InvalidAlgorithmError, | |
validateAlgorithm: function(algorithm) { | |
var alg = algorithm.toLowerCase().split("-"); | |
if (2 !== alg.length) throw new InvalidAlgorithmError(alg[0].toUpperCase() + " is not a valid algorithm"); | |
if ("hmac" !== alg[0] && !PK_ALGOS[alg[0]]) throw new InvalidAlgorithmError(alg[0].toUpperCase() + " type keys are not supported"); | |
if (!HASH_ALGOS[alg[1]]) throw new InvalidAlgorithmError(alg[1].toUpperCase() + " is not a supported hash algorithm"); | |
return alg; | |
}, | |
sshKeyToPEM: function(key) { | |
return assert.string(key, "ssh_key"), sshpk.parseKey(key, "ssh").toString("pem"); | |
}, | |
fingerprint: function(key) { | |
return assert.string(key, "ssh_key"), sshpk.parseKey(key, "ssh").fingerprint("md5").toString("hex"); | |
}, | |
pemToRsaSSHKey: function(pem, comment) { | |
assert.equal("string", typeof pem, "typeof pem"); | |
var k = sshpk.parseKey(pem, "pem"); | |
return k.comment = comment, k.toString("ssh"); | |
} | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var BigInteger = __webpack_require__(98).BigInteger, Barrett = BigInteger.prototype.Barrett; | |
function ECFieldElementFp(q, x) { | |
this.x = x, this.q = q; | |
} | |
function ECPointFp(curve, x, y, z) { | |
this.curve = curve, this.x = x, this.y = y, this.z = null == z ? BigInteger.ONE : z, | |
this.zinv = null; | |
} | |
function ECCurveFp(q, a, b) { | |
this.q = q, this.a = this.fromBigInteger(a), this.b = this.fromBigInteger(b), this.infinity = new ECPointFp(this, null, null), | |
this.reducer = new Barrett(this.q); | |
} | |
ECFieldElementFp.prototype.equals = function(other) { | |
return other == this || this.q.equals(other.q) && this.x.equals(other.x); | |
}, ECFieldElementFp.prototype.toBigInteger = function() { | |
return this.x; | |
}, ECFieldElementFp.prototype.negate = function() { | |
return new ECFieldElementFp(this.q, this.x.negate().mod(this.q)); | |
}, ECFieldElementFp.prototype.add = function(b) { | |
return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q)); | |
}, ECFieldElementFp.prototype.subtract = function(b) { | |
return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q)); | |
}, ECFieldElementFp.prototype.multiply = function(b) { | |
return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q)); | |
}, ECFieldElementFp.prototype.square = function() { | |
return new ECFieldElementFp(this.q, this.x.square().mod(this.q)); | |
}, ECFieldElementFp.prototype.divide = function(b) { | |
return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q)); | |
}, ECPointFp.prototype.getX = function() { | |
null == this.zinv && (this.zinv = this.z.modInverse(this.curve.q)); | |
var r = this.x.toBigInteger().multiply(this.zinv); | |
return this.curve.reduce(r), this.curve.fromBigInteger(r); | |
}, ECPointFp.prototype.getY = function() { | |
null == this.zinv && (this.zinv = this.z.modInverse(this.curve.q)); | |
var r = this.y.toBigInteger().multiply(this.zinv); | |
return this.curve.reduce(r), this.curve.fromBigInteger(r); | |
}, ECPointFp.prototype.equals = function(other) { | |
return other == this || (this.isInfinity() ? other.isInfinity() : other.isInfinity() ? this.isInfinity() : !!other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q).equals(BigInteger.ZERO) && other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q).equals(BigInteger.ZERO)); | |
}, ECPointFp.prototype.isInfinity = function() { | |
return null == this.x && null == this.y || this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO); | |
}, ECPointFp.prototype.negate = function() { | |
return new ECPointFp(this.curve, this.x, this.y.negate(), this.z); | |
}, ECPointFp.prototype.add = function(b) { | |
if (this.isInfinity()) return b; | |
if (b.isInfinity()) return this; | |
var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q), v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q); | |
if (BigInteger.ZERO.equals(v)) return BigInteger.ZERO.equals(u) ? this.twice() : this.curve.getInfinity(); | |
var THREE = new BigInteger("3"), x1 = this.x.toBigInteger(), y1 = this.y.toBigInteger(), v2 = (b.x.toBigInteger(), | |
b.y.toBigInteger(), v.square()), v3 = v2.multiply(v), x1v2 = x1.multiply(v2), zu2 = u.square().multiply(this.z), x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q), y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q), z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q); | |
return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); | |
}, ECPointFp.prototype.twice = function() { | |
if (this.isInfinity()) return this; | |
if (0 == this.y.toBigInteger().signum()) return this.curve.getInfinity(); | |
var THREE = new BigInteger("3"), x1 = this.x.toBigInteger(), y1 = this.y.toBigInteger(), y1z1 = y1.multiply(this.z), y1sqz1 = y1z1.multiply(y1).mod(this.curve.q), a = this.curve.a.toBigInteger(), w = x1.square().multiply(THREE); | |
BigInteger.ZERO.equals(a) || (w = w.add(this.z.square().multiply(a))); | |
var x3 = (w = w.mod(this.curve.q)).square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q), y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q), z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q); | |
return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3); | |
}, ECPointFp.prototype.multiply = function(k) { | |
if (this.isInfinity()) return this; | |
if (0 == k.signum()) return this.curve.getInfinity(); | |
var i, e = k, h = e.multiply(new BigInteger("3")), neg = this.negate(), R = this; | |
for (i = h.bitLength() - 2; i > 0; --i) { | |
R = R.twice(); | |
var hBit = h.testBit(i); | |
hBit != e.testBit(i) && (R = R.add(hBit ? this : neg)); | |
} | |
return R; | |
}, ECPointFp.prototype.multiplyTwo = function(j, x, k) { | |
var i; | |
i = j.bitLength() > k.bitLength() ? j.bitLength() - 1 : k.bitLength() - 1; | |
for (var R = this.curve.getInfinity(), both = this.add(x); i >= 0; ) R = R.twice(), | |
j.testBit(i) ? R = k.testBit(i) ? R.add(both) : R.add(this) : k.testBit(i) && (R = R.add(x)), | |
--i; | |
return R; | |
}, ECCurveFp.prototype.getQ = function() { | |
return this.q; | |
}, ECCurveFp.prototype.getA = function() { | |
return this.a; | |
}, ECCurveFp.prototype.getB = function() { | |
return this.b; | |
}, ECCurveFp.prototype.equals = function(other) { | |
return other == this || this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b); | |
}, ECCurveFp.prototype.getInfinity = function() { | |
return this.infinity; | |
}, ECCurveFp.prototype.fromBigInteger = function(x) { | |
return new ECFieldElementFp(this.q, x); | |
}, ECCurveFp.prototype.reduce = function(x) { | |
this.reducer.reduce(x); | |
}, ECCurveFp.prototype.encodePointHex = function(p) { | |
if (p.isInfinity()) return "00"; | |
var xHex = p.getX().toBigInteger().toString(16), yHex = p.getY().toBigInteger().toString(16), oLen = this.getQ().toString(16).length; | |
for (oLen % 2 != 0 && oLen++; xHex.length < oLen; ) xHex = "0" + xHex; | |
for (;yHex.length < oLen; ) yHex = "0" + yHex; | |
return "04" + xHex + yHex; | |
}, ECCurveFp.prototype.decodePointHex = function(s) { | |
var yIsEven; | |
switch (parseInt(s.substr(0, 2), 16)) { | |
case 0: | |
return this.infinity; | |
case 2: | |
yIsEven = !1; | |
case 3: | |
null == yIsEven && (yIsEven = !0); | |
var len = s.length - 2, xHex = s.substr(2, len), x = this.fromBigInteger(new BigInteger(xHex, 16)), beta = x.multiply(x.square().add(this.getA())).add(this.getB()).sqrt(); | |
if (null == beta) throw "Invalid point compression"; | |
var betaValue = beta.toBigInteger(); | |
return betaValue.testBit(0) != yIsEven && (beta = this.fromBigInteger(this.getQ().subtract(betaValue))), | |
new ECPointFp(this, x, beta); | |
case 4: | |
case 6: | |
case 7: | |
len = (s.length - 2) / 2, xHex = s.substr(2, len); | |
var yHex = s.substr(len + 2, len); | |
return new ECPointFp(this, this.fromBigInteger(new BigInteger(xHex, 16)), this.fromBigInteger(new BigInteger(yHex, 16))); | |
default: | |
return null; | |
} | |
}, ECCurveFp.prototype.encodeCompressedPointHex = function(p) { | |
if (p.isInfinity()) return "00"; | |
var xHex = p.getX().toBigInteger().toString(16), oLen = this.getQ().toString(16).length; | |
for (oLen % 2 != 0 && oLen++; xHex.length < oLen; ) xHex = "0" + xHex; | |
return (p.getY().toBigInteger().isEven() ? "02" : "03") + xHex; | |
}, ECFieldElementFp.prototype.getR = function() { | |
if (null != this.r) return this.r; | |
this.r = null; | |
var bitLength = this.q.bitLength(); | |
return bitLength > 128 && -1 == this.q.shiftRight(bitLength - 64).intValue() && (this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q)), | |
this.r; | |
}, ECFieldElementFp.prototype.modMult = function(x1, x2) { | |
return this.modReduce(x1.multiply(x2)); | |
}, ECFieldElementFp.prototype.modReduce = function(x) { | |
if (null != this.getR()) { | |
for (var qLen = q.bitLength(); x.bitLength() > qLen + 1; ) { | |
var u = x.shiftRight(qLen), v = x.subtract(u.shiftLeft(qLen)); | |
this.getR().equals(BigInteger.ONE) || (u = u.multiply(this.getR())), x = u.add(v); | |
} | |
for (;x.compareTo(q) >= 0; ) x = x.subtract(q); | |
} else x = x.mod(q); | |
return x; | |
}, ECFieldElementFp.prototype.sqrt = function() { | |
if (!this.q.testBit(0)) throw "unsupported"; | |
if (this.q.testBit(1)) { | |
var z = new ECFieldElementFp(this.q, this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE), this.q)); | |
return z.square().equals(this) ? z : null; | |
} | |
var qMinusOne = this.q.subtract(BigInteger.ONE), legendreExponent = qMinusOne.shiftRight(1); | |
if (!this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)) return null; | |
var U, V, k = qMinusOne.shiftRight(2).shiftLeft(1).add(BigInteger.ONE), Q = this.x, fourQ = modDouble(modDouble(Q)); | |
do { | |
var P; | |
do { | |
P = new BigInteger(this.q.bitLength(), new SecureRandom); | |
} while (P.compareTo(this.q) >= 0 || !P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)); | |
var result = this.lucasSequence(P, Q, k); | |
if (U = result[0], V = result[1], this.modMult(V, V).equals(fourQ)) return V.testBit(0) && (V = V.add(q)), | |
V = V.shiftRight(1), new ECFieldElementFp(q, V); | |
} while (U.equals(BigInteger.ONE) || U.equals(qMinusOne)); | |
return null; | |
}, ECFieldElementFp.prototype.lucasSequence = function(P, Q, k) { | |
for (var n = k.bitLength(), s = k.getLowestSetBit(), Uh = BigInteger.ONE, Vl = BigInteger.TWO, Vh = P, Ql = BigInteger.ONE, Qh = BigInteger.ONE, j = n - 1; j >= s + 1; --j) Ql = this.modMult(Ql, Qh), | |
k.testBit(j) ? (Qh = this.modMult(Ql, Q), Uh = this.modMult(Uh, Vh), Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))), | |
Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)))) : (Qh = Ql, Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)), | |
Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))), Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)))); | |
for (Ql = this.modMult(Ql, Qh), Qh = this.modMult(Ql, Q), Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql)), | |
Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql))), Ql = this.modMult(Ql, Qh), | |
j = 1; j <= s; ++j) Uh = this.modMult(Uh, Vl), Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1))), | |
Ql = this.modMult(Ql, Ql); | |
return [ Uh, Vl ]; | |
}, exports = { | |
ECCurveFp: ECCurveFp, | |
ECPointFp: ECPointFp, | |
ECFieldElementFp: ECFieldElementFp | |
}, module.exports = exports; | |
}, function(module, exports, __webpack_require__) { | |
module.exports = { | |
read: function(buf, options) { | |
return pem.read(buf, options); | |
}, | |
readSSHPrivate: function(type, buf, options) { | |
var magic = (buf = new SSHBuffer({ | |
buffer: buf | |
})).readCString(); | |
assert.strictEqual(magic, "openssh-key-v1", "bad magic string"); | |
var cipher = buf.readString(), kdf = buf.readString(), kdfOpts = buf.readBuffer(); | |
if (1 !== buf.readInt()) throw new Error("OpenSSH-format key file contains multiple keys: this is unsupported."); | |
var pubKey = buf.readBuffer(); | |
if ("public" === type) return assert.ok(buf.atEnd(), "excess bytes left after key"), | |
rfc4253.read(pubKey); | |
var privKeyBlob = buf.readBuffer(); | |
assert.ok(buf.atEnd(), "excess bytes left after key"); | |
var kdfOptsBuf = new SSHBuffer({ | |
buffer: kdfOpts | |
}); | |
switch (kdf) { | |
case "none": | |
if ("none" !== cipher) throw new Error('OpenSSH-format key uses KDF "none" but specifies a cipher other than "none"'); | |
break; | |
case "bcrypt": | |
var salt = kdfOptsBuf.readBuffer(), rounds = kdfOptsBuf.readInt(), cinf = utils.opensshCipherInfo(cipher); | |
if (void 0 === bcrypt && (bcrypt = __webpack_require__(481)), "string" == typeof options.passphrase && (options.passphrase = Buffer.from(options.passphrase, "utf-8")), | |
!Buffer.isBuffer(options.passphrase)) throw new errors.KeyEncryptedError(options.filename, "OpenSSH"); | |
var pass = new Uint8Array(options.passphrase), salti = new Uint8Array(salt), out = new Uint8Array(cinf.keySize + cinf.blockSize); | |
if (0 !== bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, rounds)) throw new Error("bcrypt_pbkdf function returned failure, parameters invalid"); | |
var ckey = (out = Buffer.from(out)).slice(0, cinf.keySize), iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize), cipherStream = crypto.createDecipheriv(cinf.opensslName, ckey, iv); | |
cipherStream.setAutoPadding(!1); | |
var chunk, chunks = []; | |
for (cipherStream.once("error", (function(e) { | |
if (-1 !== e.toString().indexOf("bad decrypt")) throw new Error("Incorrect passphrase supplied, could not decrypt key"); | |
throw e; | |
})), cipherStream.write(privKeyBlob), cipherStream.end(); null !== (chunk = cipherStream.read()); ) chunks.push(chunk); | |
privKeyBlob = Buffer.concat(chunks); | |
break; | |
default: | |
throw new Error('OpenSSH-format key uses unknown KDF "' + kdf + '"'); | |
} | |
if ((buf = new SSHBuffer({ | |
buffer: privKeyBlob | |
})).readInt() !== buf.readInt()) throw new Error("Incorrect passphrase supplied, could not decrypt key"); | |
var ret = {}, key = rfc4253.readInternal(ret, "private", buf.remainder()); | |
buf.skip(ret.consumed); | |
var comment = buf.readString(); | |
return key.comment = comment, key; | |
}, | |
write: function(key, options) { | |
var pubKey; | |
pubKey = PrivateKey.isPrivateKey(key) ? key.toPublic() : key; | |
var passphrase, privBuf, cipher = "none", kdf = "none", kdfopts = Buffer.alloc(0), cinf = { | |
blockSize: 8 | |
}; | |
if (void 0 !== options && ("string" == typeof (passphrase = options.passphrase) && (passphrase = Buffer.from(passphrase, "utf-8")), | |
void 0 !== passphrase && (assert.buffer(passphrase, "options.passphrase"), assert.optionalString(options.cipher, "options.cipher"), | |
void 0 === (cipher = options.cipher) && (cipher = "aes128-ctr"), cinf = utils.opensshCipherInfo(cipher), | |
kdf = "bcrypt")), PrivateKey.isPrivateKey(key)) { | |
privBuf = new SSHBuffer({}); | |
var checkInt = crypto.randomBytes(4).readUInt32BE(0); | |
privBuf.writeInt(checkInt), privBuf.writeInt(checkInt), privBuf.write(key.toBuffer("rfc4253")), | |
privBuf.writeString(key.comment || ""); | |
for (var n = 1; privBuf._offset % cinf.blockSize != 0; ) privBuf.writeChar(n++); | |
privBuf = privBuf.toBuffer(); | |
} | |
switch (kdf) { | |
case "none": | |
break; | |
case "bcrypt": | |
var salt = crypto.randomBytes(16), kdfssh = new SSHBuffer({}); | |
kdfssh.writeBuffer(salt), kdfssh.writeInt(16), kdfopts = kdfssh.toBuffer(), void 0 === bcrypt && (bcrypt = __webpack_require__(481)); | |
var pass = new Uint8Array(passphrase), salti = new Uint8Array(salt), out = new Uint8Array(cinf.keySize + cinf.blockSize); | |
if (0 !== bcrypt.pbkdf(pass, pass.length, salti, salti.length, out, out.length, 16)) throw new Error("bcrypt_pbkdf function returned failure, parameters invalid"); | |
var ckey = (out = Buffer.from(out)).slice(0, cinf.keySize), iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize), cipherStream = crypto.createCipheriv(cinf.opensslName, ckey, iv); | |
cipherStream.setAutoPadding(!1); | |
var chunk, chunks = []; | |
for (cipherStream.once("error", (function(e) { | |
throw e; | |
})), cipherStream.write(privBuf), cipherStream.end(); null !== (chunk = cipherStream.read()); ) chunks.push(chunk); | |
privBuf = Buffer.concat(chunks); | |
break; | |
default: | |
throw new Error("Unsupported kdf " + kdf); | |
} | |
var header, buf = new SSHBuffer({}); | |
buf.writeCString("openssh-key-v1"), buf.writeString(cipher), buf.writeString(kdf), | |
buf.writeBuffer(kdfopts), buf.writeInt(1), buf.writeBuffer(pubKey.toBuffer("rfc4253")), | |
privBuf && buf.writeBuffer(privBuf), buf = buf.toBuffer(), header = PrivateKey.isPrivateKey(key) ? "OPENSSH PRIVATE KEY" : "OPENSSH PUBLIC KEY"; | |
var tmp = buf.toString("base64"), len = tmp.length + tmp.length / 70 + 18 + 16 + 2 * header.length + 10, o = 0; | |
o += (buf = Buffer.alloc(len)).write("-----BEGIN " + header + "-----\n", o); | |
for (var i = 0; i < tmp.length; ) { | |
var limit = i + 70; | |
limit > tmp.length && (limit = tmp.length), o += buf.write(tmp.slice(i, limit), o), | |
buf[o++] = 10, i = limit; | |
} | |
return o += buf.write("-----END " + header + "-----\n", o), buf.slice(0, o); | |
} | |
}; | |
var bcrypt, assert = __webpack_require__(15), Buffer = (__webpack_require__(49), | |
__webpack_require__(14).Buffer), utils = (__webpack_require__(30), __webpack_require__(26)), crypto = __webpack_require__(9), PrivateKey = (__webpack_require__(25), | |
__webpack_require__(27)), pem = __webpack_require__(56), rfc4253 = __webpack_require__(57), SSHBuffer = __webpack_require__(100), errors = __webpack_require__(44); | |
}, function(module, exports, __webpack_require__) { | |
var Buffer = __webpack_require__(10).Buffer; | |
void 0 === Buffer.from && (Buffer.from = function(a, b, c) { | |
return new Buffer(a, b, c); | |
}, Buffer.alloc = Buffer.from), module.exports = Buffer; | |
}, function(module, exports) { | |
module.exports = function(st) { | |
var type, types = [ "Directory", "File", "SymbolicLink", "Link", "BlockDevice", "CharacterDevice", "FIFO", "Socket" ]; | |
if (st.type && -1 !== types.indexOf(st.type)) return st[st.type] = !0, st.type; | |
for (var i = 0, l = types.length; i < l; i++) { | |
var is = st[type = types[i]] || st["is" + type]; | |
if ("function" == typeof is && (is = is.call(st)), is) return st[type] = !0, st.type = type, | |
type; | |
} | |
return null; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
var url = __webpack_require__(7), os = __webpack_require__(21), events = __webpack_require__(5), path = __webpack_require__(4), util = __webpack_require__(0), fs = __webpack_require__(2), fetch = __webpack_require__(33), connect = __webpack_require__(540), rangeParser = __webpack_require__(159), bodyParser = __webpack_require__(106), Router = __webpack_require__(111), mime = __webpack_require__(565), pump = __webpack_require__(162), PeerSearch = __webpack_require__(567), parseTorrentFile = __webpack_require__(269), EngineFS = new events.EventEmitter, Counter = __webpack_require__(621), GuessFileIdx = __webpack_require__(622), spoofedPeerId = __webpack_require__(624), safeStatelessRegex = __webpack_require__(169), IH_REGEX = new RegExp("([0-9A-Fa-f]){40}", "g"); | |
EngineFS.STREAM_TIMEOUT = 3e4, EngineFS.ENGINE_TIMEOUT = 6e4; | |
var engines = {}; | |
function createEngine(infoHash, options, cb) { | |
EngineFS.beforeCreateEngine(infoHash, (function() { | |
if (!EngineFS.engine) throw new Error("EngineFS requires EngineFS.engine to point to engine constructor"); | |
"function" == typeof options && (cb = options, options = null), cb = cb || function() {}, | |
EngineFS.once("engine-ready:" + infoHash, (function() { | |
cb(null, engines[infoHash]); | |
})), (options = util._extend(EngineFS.getDefaults(infoHash), options || {})).path = options.path || EngineFS.getCachePath(infoHash), | |
Emit([ "engine-create", infoHash, options ]); | |
var torrent = options.torrent || "magnet:?xt=urn:btih:" + infoHash; | |
options.id = spoofedPeerId(); | |
var isNew = !engines[infoHash], e = engines[infoHash] = engines[infoHash] || EngineFS.engine(torrent, options); | |
if (e.swarm.resume(), e.options = options, isNew && options.peerSearch) { | |
var peerSources = []; | |
peerSources = ((torrent || {}).announce || []).length ? peerSources.concat(torrent.announce).map((function(src) { | |
return "tracker:" + src; | |
})).concat("dht:" + infoHash) : options.peerSearch.sources, new PeerSearch(peerSources, e.swarm, options.peerSearch); | |
} | |
if (isNew && options.swarmCap) { | |
var updater = updateSwarmCap.bind(null, e, options.swarmCap); | |
e.swarm.on("wire", updater), e.swarm.on("wire-disconnect", updater), e.on("download", updater); | |
} | |
options.growler && e.setFloodedPulse && e.setFloodedPulse(options.growler.flood, options.growler.pulse), | |
isNew && (e.on("error", (function(err) { | |
EngineFS.emit("engine-error:" + infoHash, err), EngineFS.emit("engine-error", infoHash, err); | |
})), e.on("invalid-piece", (function(p) { | |
EngineFS.emit("engine-invalid-piece:" + infoHash, p), EngineFS.emit("engine-invalid-piece", infoHash, p); | |
})), Emit([ "engine-created", infoHash ])), e.ready((function() { | |
EngineFS.emit("engine-ready:" + infoHash, e.torrent), EngineFS.emit("engine-ready", infoHash, e.torrent); | |
})); | |
})); | |
} | |
function updateSwarmCap(e, opts) { | |
var unchoked = e.swarm.wires.filter((function(peer) { | |
return !peer.peerChoking; | |
})).length, primaryCond = !0; | |
opts.maxSpeed && (primaryCond = e.swarm.downloadSpeed() > opts.maxSpeed), opts.maxBuffer && (primaryCond = (function(e) { | |
var buf = 0, n = 0, b = 0; | |
return e.selection.forEach((function(sel) { | |
if (sel.readFrom > 0 && sel.selectTo > 0) { | |
var bufferPieces = sel.selectTo - sel.readFrom, prog = (sel.from + sel.offset - sel.readFrom) / bufferPieces; | |
b += prog, n++; | |
} | |
})), n > 0 && (buf = b / n), buf; | |
})(e) > opts.maxBuffer); | |
var minPeerCond = unchoked > opts.minPeers; | |
primaryCond && minPeerCond ? e.swarm.pause() : e.swarm.resume(); | |
} | |
function getSelections(infoHash) { | |
return (engines[infoHash.toLowerCase()] || {}).selection || []; | |
} | |
function getEngine(infoHash) { | |
return engines[infoHash.toLowerCase()]; | |
} | |
function existsEngine(infoHash) { | |
return !!engines[infoHash.toLowerCase()]; | |
} | |
function removeEngine(infoHash, cb) { | |
existsEngine(infoHash) ? engines[infoHash.toLowerCase()].destroy((function() { | |
Emit([ "engine-destroyed", infoHash ]), delete engines[infoHash.toLowerCase()], | |
cb && cb(); | |
})) : cb && cb(); | |
} | |
function listEngines() { | |
return Object.keys(engines); | |
} | |
EngineFS.getDefaults = function(ih) { | |
return { | |
peerSearch: { | |
min: 40, | |
max: 200, | |
sources: [ "dht:" + ih ] | |
}, | |
dht: !1, | |
tracker: !1 | |
}; | |
}, EngineFS.getCachePath = function(ih) { | |
return path.join(os.tmpdir(), ih); | |
}, EngineFS.beforeCreateEngine = function(hash, cb) { | |
cb(); | |
}; | |
var router = Router(), externalRouter = Router(); | |
function prewarmStream(hash, idx) { | |
engines[hash] && engines[hash].ready((function() { | |
engines[hash].files[idx].select(); | |
})); | |
} | |
var jsonHead = { | |
"Content-Type": "application/json" | |
}; | |
function handleTorrent(req, res, next) { | |
var u = url.parse(req.url, !0), trackers = u.query.tr && [].concat(u.query.tr), fileMustInclude = u.query.f && [].concat(u.query.f), isRegex = /^\/(.*)\/(.*)$/; | |
fileMustInclude = (fileMustInclude || []).map((function(el) { | |
if ((el || "").match(isRegex)) { | |
var parts = isRegex.exec(el); | |
try { | |
return new RegExp(parts[1], parts[2]); | |
} catch (e) {} | |
} | |
return el; | |
})), (function(path, trackers, fileMustInclude, cb) { | |
var parts = path.split("/").filter((function(x) { | |
return x; | |
})); | |
if (parts[0] && parts[0].match(IH_REGEX)) { | |
var infoHash = parts[0].toLowerCase(), i = Number(parts[1] || -1), opts = {}; | |
if (trackers) { | |
const defaults = EngineFS.getDefaults(infoHash); | |
opts.peerSearch = { | |
min: defaults.peerSearch.min, | |
max: defaults.peerSearch.max, | |
sources: trackers | |
}; | |
} | |
createEngine(infoHash, opts, (function(err, engine) { | |
if (err) return cb(err); | |
if ((fileMustInclude || []).length && engine.files.find((function(file, idx) { | |
return !!fileMustInclude.find((function(reg) { | |
return reg = "string" == typeof reg ? new RegExp(reg) : reg, !!safeStatelessRegex(file.name, reg, 500) && (i = idx, | |
!0); | |
})); | |
})), isNaN(i)) { | |
var name = decodeURIComponent(parts[1]); | |
if (engine.files.some((function(file, idx) { | |
if (name === file.name) return i = idx, !0; | |
})), isNaN(i)) return cb(new Error("Cannot parse path: info hash received, but invalid file index or file name")); | |
} else if (-1 === i) { | |
var engineStats = getStatistics(engine); | |
engineStats.files && (i = GuessFileIdx(engineStats.files, {})); | |
} | |
if (!engine.files[i]) return cb(new Error("Torrent does not contain file with index " + i)); | |
cb(null, engine.files[i], engine); | |
})); | |
} else { | |
if (parts[0] && 64 == parts[0].length) return cb(new Error("Not implemented yet")); | |
cb(new Error("Cannot parse path")); | |
} | |
})(u.pathname, trackers, fileMustInclude, (function(err, handle, e) { | |
if (err) return console.error(err), res.statusCode = 500, res.end(); | |
if (u.query.external) return res.statusCode = 307, res.setHeader("Location", "/" + e.infoHash + "/" + encodeURIComponent(handle.name) + (u.query.download ? "?download=1" : "")), | |
res.end(); | |
EngineFS.emit("stream-open", e.infoHash, e.files.indexOf(handle)); | |
var closed = !1, emitClose = function() { | |
closed || (closed = !0, EngineFS.emit("stream-close", e.infoHash, e.files.indexOf(handle))); | |
}; | |
res.on("finish", emitClose), res.on("close", emitClose), req.connection.setTimeout(864e5); | |
var range = req.headers.range; | |
range && range.endsWith("-") && (EngineFS.getDefaults(e.infoHash).circularBuffer || prewarmStream(e.infoHash, e.files.indexOf(handle))), | |
range = range && rangeParser(handle.length, range)[0], res.setHeader("Accept-Ranges", "bytes"), | |
res.setHeader("Content-Type", mime.lookup(handle.name)), res.setHeader("Cache-Control", "max-age=0, no-cache"), | |
u.query.download && res.setHeader("Content-Disposition", 'attachment; filename="' + handle.name + '";'), | |
u.query.subtitles && res.setHeader("CaptionInfo.sec", u.query.subtitles); | |
var opts = {}; | |
return req.headers["enginefs-prio"] && (opts.priority = parseInt(req.headers["enginefs-prio"]) || 1), | |
range ? (res.statusCode = 206, res.setHeader("Content-Length", range.end - range.start + 1), | |
res.setHeader("Content-Range", "bytes " + range.start + "-" + range.end + "/" + handle.length), | |
"HEAD" === req.method ? res.end() : void pump(handle.createReadStream(util._extend(range, opts)), res)) : (res.setHeader("Content-Length", handle.length), | |
"HEAD" === req.method ? res.end() : void pump(handle.createReadStream(opts), res)); | |
})); | |
} | |
function createApp() { | |
var app = connect(); | |
return app.use((function(req, res, next) { | |
util._extend(req, url.parse(req.url, !0)), EngineFS.loggingEnabled && console.log("-> " + req.method + " " + url.parse(req.url).path + " " + (req.headers.range || "")), | |
next(); | |
})), app.use(bodyParser.json({ | |
limit: "3mb" | |
})), app.use(bodyParser.urlencoded({ | |
extended: !0 | |
})), app.use(externalRouter), app.use(router), app; | |
} | |
function sendCORSHeaders(req, res, next) { | |
if ("OPTIONS" === req.method && req.headers.origin) return res.setHeader("Access-Control-Allow-Origin", "*"), | |
res.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS"), res.setHeader("Access-Control-Allow-Headers", req.headers["access-control-request-headers"] || "Range"), | |
res.setHeader("Access-Control-Max-Age", "1728000"), res.end(), !0; | |
req.headers.origin && res.setHeader("Access-Control-Allow-Origin", "*"), next && next(); | |
} | |
function sendDLNAHeaders(req, res, next) { | |
res.setHeader("transferMode.dlna.org", "Streaming"), res.setHeader("contentFeatures.dlna.org", "DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000"), | |
next && next(); | |
} | |
function getStatistics(e, idx) { | |
if (!e) return null; | |
var s = { | |
infoHash: e.infoHash, | |
name: e.torrent && e.torrent.name, | |
peers: e.swarm.wires.length, | |
unchoked: e.swarm.wires.filter((function(peer) { | |
return !peer.peerChoking; | |
})).length, | |
queued: e.swarm.queued, | |
unique: Object.keys(e.swarm._peers).length, | |
connectionTries: e.swarm.tries, | |
swarmPaused: e.swarm.paused, | |
swarmConnections: e.swarm.connections.length, | |
swarmSize: e.swarm.size, | |
selections: e.selection, | |
wires: void 0 !== idx ? null : e.swarm.wires.filter((function(peer) { | |
return !peer.peerChoking; | |
})).map((function(wire) { | |
return { | |
requests: wire.requests.length, | |
address: wire.peerAddress, | |
amInterested: wire.amInterested, | |
isSeeder: wire.isSeeder, | |
downSpeed: wire.downloadSpeed(), | |
upSpeed: wire.uploadSpeed() | |
}; | |
})), | |
files: e.torrent && e.torrent.files, | |
downloaded: e.swarm.downloaded, | |
uploaded: e.swarm.uploaded, | |
downloadSpeed: e.swarm.downloadSpeed(), | |
uploadSpeed: e.swarm.downloadSpeed(), | |
sources: e.swarm.peerSearch && e.swarm.peerSearch.stats(), | |
peerSearchRunning: e.swarm.peerSearch ? e.swarm.peerSearch.isRunning() : void 0, | |
opts: e.options | |
}; | |
return !isNaN(idx) && e.torrent && e.torrent.files[idx] && util._extend(s, (function(e, file) { | |
var stats = {}; | |
stats.streamLen = file.length, stats.streamName = file.name; | |
for (var startPiece = file.offset / e.torrent.pieceLength | 0, endPiece = (file.offset + file.length - 1) / e.torrent.pieceLength | 0, availablePieces = 0, i = startPiece; i <= endPiece; i++) e.bitfield.get(i) && availablePieces++; | |
var filePieces = Math.ceil(file.length / e.torrent.pieceLength); | |
return stats.streamProgress = availablePieces / filePieces, stats; | |
})(e, e.torrent.files[idx])), s; | |
} | |
function Emit(args) { | |
EngineFS.emit.apply(EngineFS, args), EngineFS.emit(args.join(":")); | |
} | |
router.use(sendCORSHeaders), router.get("/favicon.ico", (function(req, res) { | |
res.writeHead(404, jsonHead), res.end(); | |
})), router.get("/:infoHash/stats.json", (function(req, res) { | |
res.writeHead(200, jsonHead), res.end(JSON.stringify(getStatistics(engines[req.params.infoHash]))); | |
})), router.get("/:infoHash/:idx/stats.json", (function(req, res) { | |
res.writeHead(200, jsonHead), res.end(JSON.stringify(getStatistics(engines[req.params.infoHash], req.params.idx))); | |
})), router.get("/stats.json", (function(req, res) { | |
res.writeHead(200, jsonHead); | |
var stats = {}; | |
for (ih in req.url.match("sys=1") && (stats.sys = { | |
loadavg: os.loadavg(), | |
cpus: os.cpus() | |
}), engines) stats[ih] = getStatistics(engines[ih]); | |
res.end(JSON.stringify(stats)); | |
})), router.all("/:infoHash/create", (function(req, res) { | |
var ih = req.params.infoHash.toLowerCase(), body = req.body || {}; | |
createEngine(ih, body, (function() { | |
res.writeHead(200, jsonHead); | |
var engineStats = getStatistics(engines[ih]); | |
if (engineStats.files) { | |
if ((body.fileMustInclude || []).length) { | |
var isRegex = /^\/(.*)\/(.*)$/; | |
fileMustInclude = body.fileMustInclude.map((function(el) { | |
if ((el || "").match(isRegex)) { | |
var parts = isRegex.exec(el); | |
try { | |
return new RegExp(parts[1], parts[2]); | |
} catch (e) {} | |
} | |
return el; | |
})), engineStats.files.find((function(file, idx) { | |
return !!fileMustInclude.find((function(reg) { | |
return reg = "string" == typeof reg ? new RegExp(reg) : reg, !!safeStatelessRegex(file.name, reg, 500) && (engineStats.guessedFileIdx = idx, | |
!0); | |
})); | |
})); | |
} | |
body.guessFileIdx && !engineStats.hasOwnProperty("guessedFileIdx") && (engineStats.guessedFileIdx = GuessFileIdx(engineStats.files, body.guessFileIdx)); | |
} | |
res.end(JSON.stringify(engineStats)); | |
})); | |
})), router.all("/create", (function(req, res) { | |
var from = req.body.from, blob = req.body.blob; | |
if ("string" == typeof blob) onBlob(null, Buffer.from(blob, "hex")); else { | |
if ("string" != typeof from) return onErr(); | |
0 === from.indexOf("http") ? fetch(from).then((function(res) { | |
return res.buffer(); | |
})).then((function(buf) { | |
onBlob(null, buf); | |
})).catch(onErr) : fs.readFile(req.body.from, onBlob); | |
} | |
function onBlob(err, blob) { | |
if (err) return onErr(err); | |
var ih = null, parsed = null; | |
try { | |
ih = (parsed = parseTorrentFile(blob)).infoHash.toLowerCase(); | |
} catch (e) { | |
return onErr(e); | |
} | |
createEngine(ih, { | |
torrent: parsed | |
}, (function(err, res) { | |
err ? onErr(err) : onSuccess(res); | |
})); | |
} | |
function onErr(err) { | |
res.writeHead(500), res.end(), console.error(err); | |
} | |
function onSuccess(result) { | |
res.writeHead(200, jsonHead), res.end(JSON.stringify(getStatistics(result))); | |
} | |
})), router.get("/:infoHash/remove", (function(req, res) { | |
removeEngine(req.params.infoHash, (function() { | |
res.writeHead(200, jsonHead), res.end(JSON.stringify({})); | |
})); | |
})), router.get("/removeAll", (function(req, res) { | |
for (ih in engines) removeEngine(ih); | |
res.writeHead(200, jsonHead), res.end(JSON.stringify({})); | |
})), router.get("/:infoHash/:idx", sendDLNAHeaders, handleTorrent), router.get("/:infoHash/:idx/*", sendDLNAHeaders, handleTorrent), | |
EngineFS.on("stream-open", (function(infoHash, fileIndex) { | |
var e = getEngine(infoHash); | |
e.ready((function() { | |
var file = e.torrent.files[fileIndex]; | |
if (!file.__cacheEvents) { | |
file.__cacheEvents = !0, EngineFS.emit("stream-created", infoHash, fileIndex, file); | |
for (var startPiece = file.offset / e.torrent.pieceLength | 0, endPiece = (file.offset + file.length - 1) / e.torrent.pieceLength | 0, fpieces = [], i = startPiece; i <= endPiece; i++) e.bitfield.get(i) || fpieces.push(i); | |
var filePieces = Math.ceil(file.length / e.torrent.pieceLength), onDownload = function(p) { | |
if (void 0 !== p) { | |
var idx = fpieces.indexOf(p); | |
if (-1 == idx) return; | |
fpieces.splice(idx, 1); | |
} | |
if (EngineFS.emit("stream-progress:" + infoHash + ":" + fileIndex, (filePieces - fpieces.length) / filePieces, fpath), | |
!fpieces.length) { | |
var fpath = e.store.getDest && e.store.getDest(fileIndex); | |
EngineFS.emit("stream-cached:" + infoHash + ":" + fileIndex, fpath, file), EngineFS.emit("stream-cached", infoHash, fileIndex, fpath, file), | |
e.removeListener("download", onDownload), e.removeListener("verify", onDownload); | |
} | |
}; | |
e.on("verify", onDownload), onDownload(); | |
var vLen = e.torrent.realPieceLength || e.torrent.verificationLen || e.torrent.pieceLength, ratio = (startPiece = file.offset / vLen | 0, | |
endPiece = (file.offset + file.length - 1) / vLen | 0, vLen / e.torrent.pieceLength); | |
e.buffer || e.select(startPiece * ratio, (endPiece + 1) * ratio, !1); | |
} | |
})); | |
})), new Counter(EngineFS, "stream-open", "stream-close", (function(hash, idx) { | |
return hash + ":" + idx; | |
}), (function(hash, idx) { | |
Emit([ "stream-active", hash, idx ]); | |
}), (function(hash, idx) { | |
existsEngine(hash) && Emit([ "stream-inactive", hash, idx ]); | |
}), (function() { | |
return EngineFS.STREAM_TIMEOUT; | |
})), new Counter(EngineFS, "stream-open", "stream-close", (function(hash, idx) { | |
return hash; | |
}), (function(hash) { | |
Emit([ "engine-active", hash ]); | |
}), (function(hash) { | |
existsEngine(hash) && Emit([ "engine-inactive", hash ]); | |
}), (function() { | |
return EngineFS.ENGINE_TIMEOUT; | |
})), new Counter(EngineFS, "stream-created", "stream-cached", (function(hash, idx) { | |
return hash; | |
}), (function() {}), (function(hash) { | |
existsEngine(hash) && Emit([ "engine-idle", hash ]); | |
}), (function() { | |
return EngineFS.STREAM_TIMEOUT; | |
})), EngineFS.http = function(port) { | |
var server = __webpack_require__(11).createServer(createApp()); | |
return port && server.listen(port), server; | |
}, EngineFS.app = createApp, EngineFS.sendCORSHeaders = sendCORSHeaders, EngineFS.sendDLNAHeaders = sendDLNAHeaders, | |
EngineFS.create = createEngine, EngineFS.exists = existsEngine, EngineFS.getFilename = function(infoHash, fileIdx) { | |
return !!existsEngine(infoHash) && (getEngine(infoHash).files[fileIdx] || {}).name; | |
}, EngineFS.remove = removeEngine, EngineFS.settings = function(infoHash, settings) { | |
var e = engines[infoHash]; | |
e && (settings.hasOwnProperty("writeQueue") && e.store.writequeue && e.ready((function() { | |
"PAUSE" == settings.writeQueue ? (e.store.writequeue.pause(), setTimeout((function() { | |
e.store.writequeue.resume(); | |
}), 5e4)) : e.store.writequeue.resume(); | |
})), "PAUSE" == settings.swarm && e.swarm.pause(), "RESUME" == settings.swarm && e.swarm.resume()); | |
}, EngineFS.stats = function(infoHash, idx) { | |
return engines[infoHash] ? getStatistics(engines[infoHash], idx) : null; | |
}, EngineFS.list = listEngines, EngineFS.getSelections = getSelections, EngineFS.keepConcurrency = function(hash, concurrency) { | |
const enginesCount = listEngines().length + 1; | |
if (!concurrency || enginesCount <= concurrency) return Promise.resolve(); | |
console.log("keep concurrency", concurrency); | |
const enginesToRemove = listEngines().filter((ih => ih.toLowerCase() !== hash.toLowerCase() && 0 === getSelections(ih).length)).slice(0, enginesCount - concurrency); | |
return enginesToRemove.length ? new Promise((resolve => { | |
enginesToRemove.forEach(((ih, idx) => { | |
console.log(`remove engine ${ih}`), removeEngine(ih, (() => { | |
idx === enginesToRemove.length - 1 && resolve(); | |
})); | |
})); | |
})) : Promise.resolve(); | |
}, EngineFS.prewarmStream = prewarmStream, EngineFS.router = externalRouter, EngineFS.loggingEnabled = !1, | |
EngineFS.getRootRouter = function() { | |
return router; | |
}, module.exports = EngineFS; | |
}, function(module, exports) { | |
module.exports = require("string_decoder"); | |
}, function(module) { | |
module.exports = [ [ "0", "\0", 127, "€" ], [ "8140", "丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪", 5, "乲乴", 9, "乿", 6, "亇亊" ], [ "8180", "亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂", 6, "伋伌伒", 4, "伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾", 4, "佄佅佇", 5, "佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢" ], [ "8240", "侤侫侭侰", 4, "侶", 8, "俀俁係俆俇俈俉俋俌俍俒", 4, "俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿", 11 ], [ "8280", "個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯", 10, "倻倽倿偀偁偂偄偅偆偉偊偋偍偐", 4, "偖偗偘偙偛偝", 7, "偦", 5, "偭", 8, "偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎", 20, "傤傦傪傫傭", 4, "傳", 6, "傼" ], [ "8340", "傽", 17, "僐", 5, "僗僘僙僛", 10, "僨僩僪僫僯僰僱僲僴僶", 4, "僼", 9, "儈" ], [ "8380", "儉儊儌", 5, "儓", 13, "儢", 28, "兂兇兊兌兎兏児兒兓兗兘兙兛兝", 4, "兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦", 4, "冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒", 5 ], [ "8440", "凘凙凚凜凞凟凢凣凥", 5, "凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄", 5, "剋剎剏剒剓剕剗剘" ], [ "8480", "剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳", 9, "剾劀劃", 4, "劉", 6, "劑劒劔", 6, "劜劤劥劦劧劮劯劰労", 9, "勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務", 5, "勠勡勢勣勥", 10, "勱", 7, "勻勼勽匁匂匃匄匇匉匊匋匌匎" ], [ "8540", "匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯", 9, "匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏" ], [ "8580", "厐", 4, "厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯", 6, "厷厸厹厺厼厽厾叀參", 4, "収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝", 4, "呣呥呧呩", 7, "呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡" ], [ "8640", "咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠", 4, "哫哬哯哰哱哴", 5, "哻哾唀唂唃唄唅唈唊", 4, "唒唓唕", 5, "唜唝唞唟唡唥唦" ], [ "8680", "唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋", 4, "啑啒啓啔啗", 4, "啝啞啟啠啢啣啨啩啫啯", 5, "啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠", 6, "喨", 8, "喲喴営喸喺喼喿", 4, "嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗", 4, "嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸", 4, "嗿嘂嘃嘄嘅" ], [ "8740", "嘆嘇嘊嘋嘍嘐", 7, "嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀", 11, "噏", 4, "噕噖噚噛噝", 4 ], [ "8780", "噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽", 7, "嚇", 6, "嚐嚑嚒嚔", 14, "嚤", 10, "嚰", 6, "嚸嚹嚺嚻嚽", 12, "囋", 8, "囕囖囘囙囜団囥", 5, "囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國", 6 ], [ "8840", "園", 9, "圝圞圠圡圢圤圥圦圧圫圱圲圴", 4, "圼圽圿坁坃坄坅坆坈坉坋坒", 4, "坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀" ], [ "8880", "垁垇垈垉垊垍", 4, "垔", 6, "垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹", 8, "埄", 6, "埌埍埐埑埓埖埗埛埜埞埡埢埣埥", 7, "埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥", 4, "堫", 4, "報堲堳場堶", 7 ], [ "8940", "堾", 5, "塅", 6, "塎塏塐塒塓塕塖塗塙", 4, "塟", 5, "塦", 4, "塭", 16, "塿墂墄墆墇墈墊墋墌" ], [ "8980", "墍", 4, "墔", 4, "墛墜墝墠", 7, "墪", 17, "墽墾墿壀壂壃壄壆", 10, "壒壓壔壖", 13, "壥", 5, "壭壯壱売壴壵壷壸壺", 7, "夃夅夆夈", 4, "夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻" ], [ "8a40", "夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛", 4, "奡奣奤奦", 12, "奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦" ], [ "8a80", "妧妬妭妰妱妳", 5, "妺妼妽妿", 6, "姇姈姉姌姍姎姏姕姖姙姛姞", 4, "姤姦姧姩姪姫姭", 11, "姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪", 6, "娳娵娷", 4, "娽娾娿婁", 4, "婇婈婋", 9, "婖婗婘婙婛", 5 ], [ "8b40", "婡婣婤婥婦婨婩婫", 8, "婸婹婻婼婽婾媀", 17, "媓", 6, "媜", 13, "媫媬" ], [ "8b80", "媭", 4, "媴媶媷媹", 4, "媿嫀嫃", 5, "嫊嫋嫍", 4, "嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬", 4, "嫲", 22, "嬊", 11, "嬘", 25, "嬳嬵嬶嬸", 7, "孁", 6 ], [ "8c40", "孈", 7, "孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏" ], [ "8c80", "寑寔", 8, "寠寢寣實寧審", 4, "寯寱", 6, "寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧", 6, "屰屲", 6, "屻屼屽屾岀岃", 4, "岉岊岋岎岏岒岓岕岝", 4, "岤", 4 ], [ "8d40", "岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅", 5, "峌", 5, "峓", 5, "峚", 6, "峢峣峧峩峫峬峮峯峱", 9, "峼", 4 ], [ "8d80", "崁崄崅崈", 5, "崏", 4, "崕崗崘崙崚崜崝崟", 4, "崥崨崪崫崬崯", 4, "崵", 7, "崿", 7, "嵈嵉嵍", 10, "嵙嵚嵜嵞", 10, "嵪嵭嵮嵰嵱嵲嵳嵵", 12, "嶃", 21, "嶚嶛嶜嶞嶟嶠" ], [ "8e40", "嶡", 21, "嶸", 12, "巆", 6, "巎", 12, "巜巟巠巣巤巪巬巭" ], [ "8e80", "巰巵巶巸", 4, "巿帀帄帇帉帊帋帍帎帒帓帗帞", 7, "帨", 4, "帯帰帲", 4, "帹帺帾帿幀幁幃幆", 5, "幍", 6, "幖", 4, "幜幝幟幠幣", 14, "幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨", 4, "庮", 4, "庴庺庻庼庽庿", 6 ], [ "8f40", "廆廇廈廋", 5, "廔廕廗廘廙廚廜", 11, "廩廫", 8, "廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤" ], [ "8f80", "弨弫弬弮弰弲", 6, "弻弽弾弿彁", 14, "彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢", 5, "復徫徬徯", 5, "徶徸徹徺徻徾", 4, "忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇" ], [ "9040", "怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰", 4, "怶", 4, "怽怾恀恄", 6, "恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀" ], [ "9080", "悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽", 7, "惇惈惉惌", 4, "惒惓惔惖惗惙惛惞惡", 4, "惪惱惲惵惷惸惻", 4, "愂愃愄愅愇愊愋愌愐", 4, "愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬", 18, "慀", 6 ], [ "9140", "慇慉態慍慏慐慒慓慔慖", 6, "慞慟慠慡慣慤慥慦慩", 6, "慱慲慳慴慶慸", 18, "憌憍憏", 4, "憕" ], [ "9180", "憖", 6, "憞", 8, "憪憫憭", 9, "憸", 5, "憿懀懁懃", 4, "應懌", 4, "懓懕", 16, "懧", 13, "懶", 8, "戀", 5, "戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸", 4, "扂扄扅扆扊" ], [ "9240", "扏扐払扖扗扙扚扜", 6, "扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋", 5, "抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁" ], [ "9280", "拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳", 5, "挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖", 7, "捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙", 6, "採掤掦掫掯掱掲掵掶掹掻掽掿揀" ], [ "9340", "揁揂揃揅揇揈揊揋揌揑揓揔揕揗", 6, "揟揢揤", 4, "揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆", 4, "損搎搑搒搕", 5, "搝搟搢搣搤" ], [ "9380", "搥搧搨搩搫搮", 5, "搵", 4, "搻搼搾摀摂摃摉摋", 6, "摓摕摖摗摙", 4, "摟", 7, "摨摪摫摬摮", 9, "摻", 6, "撃撆撈", 8, "撓撔撗撘撚撛撜撝撟", 4, "撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆", 6, "擏擑擓擔擕擖擙據" ], [ "9440", "擛擜擝擟擠擡擣擥擧", 24, "攁", 7, "攊", 7, "攓", 4, "攙", 8 ], [ "9480", "攢攣攤攦", 4, "攬攭攰攱攲攳攷攺攼攽敀", 4, "敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數", 14, "斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱", 7, "斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘", 7, "旡旣旤旪旫" ], [ "9540", "旲旳旴旵旸旹旻", 4, "昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷", 4, "昽昿晀時晄", 6, "晍晎晐晑晘" ], [ "9580", "晙晛晜晝晞晠晢晣晥晧晩", 4, "晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘", 4, "暞", 8, "暩", 4, "暯", 4, "暵暶暷暸暺暻暼暽暿", 25, "曚曞", 7, "曧曨曪", 5, "曱曵曶書曺曻曽朁朂會" ], [ "9640", "朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠", 5, "朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗", 4, "杝杢杣杤杦杧杫杬杮東杴杶" ], [ "9680", "杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹", 7, "柂柅", 9, "柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵", 7, "柾栁栂栃栄栆栍栐栒栔栕栘", 4, "栞栟栠栢", 6, "栫", 6, "栴栵栶栺栻栿桇桋桍桏桒桖", 5 ], [ "9740", "桜桝桞桟桪桬", 7, "桵桸", 8, "梂梄梇", 7, "梐梑梒梔梕梖梘", 9, "梣梤梥梩梪梫梬梮梱梲梴梶梷梸" ], [ "9780", "梹", 6, "棁棃", 5, "棊棌棎棏棐棑棓棔棖棗棙棛", 4, "棡棢棤", 9, "棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆", 4, "椌椏椑椓", 11, "椡椢椣椥", 7, "椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃", 16, "楕楖楘楙楛楜楟" ], [ "9840", "楡楢楤楥楧楨楩楪楬業楯楰楲", 4, "楺楻楽楾楿榁榃榅榊榋榌榎", 5, "榖榗榙榚榝", 9, "榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽" ], [ "9880", "榾榿槀槂", 7, "構槍槏槑槒槓槕", 5, "槜槝槞槡", 11, "槮槯槰槱槳", 9, "槾樀", 9, "樋", 11, "標", 5, "樠樢", 5, "権樫樬樭樮樰樲樳樴樶", 6, "樿", 4, "橅橆橈", 7, "橑", 6, "橚" ], [ "9940", "橜", 4, "橢橣橤橦", 10, "橲", 6, "橺橻橽橾橿檁檂檃檅", 8, "檏檒", 4, "檘", 7, "檡", 5 ], [ "9980", "檧檨檪檭", 114, "欥欦欨", 6 ], [ "9a40", "欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍", 11, "歚", 7, "歨歩歫", 13, "歺歽歾歿殀殅殈" ], [ "9a80", "殌殎殏殐殑殔殕殗殘殙殜", 4, "殢", 7, "殫", 7, "殶殸", 6, "毀毃毄毆", 4, "毌毎毐毑毘毚毜", 4, "毢", 7, "毬毭毮毰毱毲毴毶毷毸毺毻毼毾", 6, "氈", 4, "氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋", 4, "汑汒汓汖汘" ], [ "9b40", "汙汚汢汣汥汦汧汫", 4, "汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘" ], [ "9b80", "泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟", 5, "洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽", 4, "涃涄涆涇涊涋涍涏涐涒涖", 4, "涜涢涥涬涭涰涱涳涴涶涷涹", 5, "淁淂淃淈淉淊" ], [ "9c40", "淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽", 7, "渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵" ], [ "9c80", "渶渷渹渻", 7, "湅", 7, "湏湐湑湒湕湗湙湚湜湝湞湠", 10, "湬湭湯", 14, "満溁溂溄溇溈溊", 4, "溑", 6, "溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪", 5 ], [ "9d40", "滰滱滲滳滵滶滷滸滺", 7, "漃漄漅漇漈漊", 4, "漐漑漒漖", 9, "漡漢漣漥漦漧漨漬漮漰漲漴漵漷", 6, "漿潀潁潂" ], [ "9d80", "潃潄潅潈潉潊潌潎", 9, "潙潚潛潝潟潠潡潣潤潥潧", 5, "潯潰潱潳潵潶潷潹潻潽", 6, "澅澆澇澊澋澏", 12, "澝澞澟澠澢", 4, "澨", 10, "澴澵澷澸澺", 5, "濁濃", 5, "濊", 6, "濓", 10, "濟濢濣濤濥" ], [ "9e40", "濦", 7, "濰", 32, "瀒", 7, "瀜", 6, "瀤", 6 ], [ "9e80", "瀫", 9, "瀶瀷瀸瀺", 17, "灍灎灐", 13, "灟", 11, "灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞", 12, "炰炲炴炵炶為炾炿烄烅烆烇烉烋", 12, "烚" ], [ "9f40", "烜烝烞烠烡烢烣烥烪烮烰", 6, "烸烺烻烼烾", 10, "焋", 4, "焑焒焔焗焛", 10, "焧", 7, "焲焳焴" ], [ "9f80", "焵焷", 13, "煆煇煈煉煋煍煏", 12, "煝煟", 4, "煥煩", 4, "煯煰煱煴煵煶煷煹煻煼煾", 5, "熅", 4, "熋熌熍熎熐熑熒熓熕熖熗熚", 4, "熡", 6, "熩熪熫熭", 5, "熴熶熷熸熺", 8, "燄", 9, "燏", 4 ], [ "a040", "燖", 9, "燡燢燣燤燦燨", 5, "燯", 9, "燺", 11, "爇", 19 ], [ "a080", "爛爜爞", 9, "爩爫爭爮爯爲爳爴爺爼爾牀", 6, "牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅", 4, "犌犎犐犑犓", 11, "犠", 11, "犮犱犲犳犵犺", 6, "狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛" ], [ "a1a1", " 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈", 7, "〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓" ], [ "a2a1", "ⅰ", 9 ], [ "a2b1", "⒈", 19, "⑴", 19, "①", 9 ], [ "a2e5", "㈠", 9 ], [ "a2f1", "Ⅰ", 11 ], [ "a3a1", "!"#¥%", 88, " ̄" ], [ "a4a1", "ぁ", 82 ], [ "a5a1", "ァ", 85 ], [ "a6a1", "Α", 16, "Σ", 6 ], [ "a6c1", "α", 16, "σ", 6 ], [ "a6e0", "︵︶︹︺︿﹀︽︾﹁﹂﹃﹄" ], [ "a6ee", "︻︼︷︸︱" ], [ "a6f4", "︳︴" ], [ "a7a1", "А", 5, "ЁЖ", 25 ], [ "a7d1", "а", 5, "ёж", 25 ], [ "a840", "ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═", 35, "▁", 6 ], [ "a880", "█", 7, "▓▔▕▼▽◢◣◤◥☉⊕〒〝〞" ], [ "a8a1", "āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ" ], [ "a8bd", "ńň" ], [ "a8c0", "ɡ" ], [ "a8c5", "ㄅ", 36 ], [ "a940", "〡", 8, "㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦" ], [ "a959", "℡㈱" ], [ "a95c", "‐" ], [ "a960", "ー゛゜ヽヾ〆ゝゞ﹉", 9, "﹔﹕﹖﹗﹙", 8 ], [ "a980", "﹢", 4, "﹨﹩﹪﹫" ], [ "a996", "〇" ], [ "a9a4", "─", 75 ], [ "aa40", "狜狝狟狢", 5, "狪狫狵狶狹狽狾狿猀猂猄", 5, "猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀", 8 ], [ "aa80", "獉獊獋獌獎獏獑獓獔獕獖獘", 7, "獡", 10, "獮獰獱" ], [ "ab40", "獲", 11, "獿", 4, "玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣", 5, "玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃", 4 ], [ "ab80", "珋珌珎珒", 6, "珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳", 4 ], [ "ac40", "珸", 10, "琄琇琈琋琌琍琎琑", 8, "琜", 5, "琣琤琧琩琫琭琯琱琲琷", 4, "琽琾琿瑀瑂", 11 ], [ "ac80", "瑎", 6, "瑖瑘瑝瑠", 12, "瑮瑯瑱", 4, "瑸瑹瑺" ], [ "ad40", "瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑", 10, "璝璟", 7, "璪", 15, "璻", 12 ], [ "ad80", "瓈", 9, "瓓", 8, "瓝瓟瓡瓥瓧", 6, "瓰瓱瓲" ], [ "ae40", "瓳瓵瓸", 6, "甀甁甂甃甅", 7, "甎甐甒甔甕甖甗甛甝甞甠", 4, "甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘" ], [ "ae80", "畝", 7, "畧畨畩畫", 6, "畳畵當畷畺", 4, "疀疁疂疄疅疇" ], [ "af40", "疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦", 4, "疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇" ], [ "af80", "瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄" ], [ "b040", "癅", 6, "癎", 5, "癕癗", 4, "癝癟癠癡癢癤", 6, "癬癭癮癰", 7, "癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛" ], [ "b080", "皜", 7, "皥", 8, "皯皰皳皵", 9, "盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥" ], [ "b140", "盄盇盉盋盌盓盕盙盚盜盝盞盠", 4, "盦", 7, "盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎", 10, "眛眜眝眞眡眣眤眥眧眪眫" ], [ "b180", "眬眮眰", 4, "眹眻眽眾眿睂睄睅睆睈", 7, "睒", 7, "睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳" ], [ "b240", "睝睞睟睠睤睧睩睪睭", 11, "睺睻睼瞁瞂瞃瞆", 5, "瞏瞐瞓", 11, "瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶", 4 ], [ "b280", "瞼瞾矀", 12, "矎", 8, "矘矙矚矝", 4, "矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖" ], [ "b340", "矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃", 5, "砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚" ], [ "b380", "硛硜硞", 11, "硯", 7, "硸硹硺硻硽", 6, "场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚" ], [ "b440", "碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨", 7, "碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚", 9 ], [ "b480", "磤磥磦磧磩磪磫磭", 4, "磳磵磶磸磹磻", 5, "礂礃礄礆", 6, "础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮" ], [ "b540", "礍", 5, "礔", 9, "礟", 4, "礥", 14, "礵", 4, "礽礿祂祃祄祅祇祊", 8, "祔祕祘祙祡祣" ], [ "b580", "祤祦祩祪祫祬祮祰", 6, "祹祻", 4, "禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠" ], [ "b640", "禓", 6, "禛", 11, "禨", 10, "禴", 4, "禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙", 5, "秠秡秢秥秨秪" ], [ "b680", "秬秮秱", 6, "秹秺秼秾秿稁稄稅稇稈稉稊稌稏", 4, "稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二" ], [ "b740", "稝稟稡稢稤", 14, "稴稵稶稸稺稾穀", 5, "穇", 9, "穒", 4, "穘", 16 ], [ "b780", "穩", 6, "穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服" ], [ "b840", "窣窤窧窩窪窫窮", 4, "窴", 10, "竀", 10, "竌", 9, "竗竘竚竛竜竝竡竢竤竧", 5, "竮竰竱竲竳" ], [ "b880", "竴", 4, "竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹" ], [ "b940", "笯笰笲笴笵笶笷笹笻笽笿", 5, "筆筈筊筍筎筓筕筗筙筜筞筟筡筣", 10, "筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆", 6, "箎箏" ], [ "b980", "箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹", 7, "篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈" ], [ "ba40", "篅篈築篊篋篍篎篏篐篒篔", 4, "篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲", 4, "篸篹篺篻篽篿", 7, "簈簉簊簍簎簐", 5, "簗簘簙" ], [ "ba80", "簚", 4, "簠", 5, "簨簩簫", 12, "簹", 5, "籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖" ], [ "bb40", "籃", 9, "籎", 36, "籵", 5, "籾", 9 ], [ "bb80", "粈粊", 6, "粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴", 4, "粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕" ], [ "bc40", "粿糀糂糃糄糆糉糋糎", 6, "糘糚糛糝糞糡", 6, "糩", 5, "糰", 7, "糹糺糼", 13, "紋", 5 ], [ "bc80", "紑", 14, "紡紣紤紥紦紨紩紪紬紭紮細", 6, "肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件" ], [ "bd40", "紷", 54, "絯", 7 ], [ "bd80", "絸", 32, "健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸" ], [ "be40", "継", 12, "綧", 6, "綯", 42 ], [ "be80", "線", 32, "尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻" ], [ "bf40", "緻", 62 ], [ "bf80", "縺縼", 4, "繂", 4, "繈", 21, "俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀" ], [ "c040", "繞", 35, "纃", 23, "纜纝纞" ], [ "c080", "纮纴纻纼绖绤绬绹缊缐缞缷缹缻", 6, "罃罆", 9, "罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐" ], [ "c140", "罖罙罛罜罝罞罠罣", 4, "罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂", 7, "羋羍羏", 4, "羕", 4, "羛羜羠羢羣羥羦羨", 6, "羱" ], [ "c180", "羳", 4, "羺羻羾翀翂翃翄翆翇翈翉翋翍翏", 4, "翖翗翙", 5, "翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿" ], [ "c240", "翤翧翨翪翫翬翭翯翲翴", 6, "翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫", 5, "耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗" ], [ "c280", "聙聛", 13, "聫", 5, "聲", 11, "隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫" ], [ "c340", "聾肁肂肅肈肊肍", 5, "肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇", 4, "胏", 6, "胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋" ], [ "c380", "脌脕脗脙脛脜脝脟", 12, "脭脮脰脳脴脵脷脹", 4, "脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸" ], [ "c440", "腀", 5, "腇腉腍腎腏腒腖腗腘腛", 4, "腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃", 4, "膉膋膌膍膎膐膒", 5, "膙膚膞", 4, "膤膥" ], [ "c480", "膧膩膫", 7, "膴", 5, "膼膽膾膿臄臅臇臈臉臋臍", 6, "摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁" ], [ "c540", "臔", 14, "臤臥臦臨臩臫臮", 4, "臵", 5, "臽臿舃與", 4, "舎舏舑舓舕", 5, "舝舠舤舥舦舧舩舮舲舺舼舽舿" ], [ "c580", "艀艁艂艃艅艆艈艊艌艍艎艐", 7, "艙艛艜艝艞艠", 7, "艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗" ], [ "c640", "艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸" ], [ "c680", "苺苼", 4, "茊茋茍茐茒茓茖茘茙茝", 9, "茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐" ], [ "c740", "茾茿荁荂荄荅荈荊", 4, "荓荕", 4, "荝荢荰", 6, "荹荺荾", 6, "莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡", 6, "莬莭莮" ], [ "c780", "莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠" ], [ "c840", "菮華菳", 4, "菺菻菼菾菿萀萂萅萇萈萉萊萐萒", 5, "萙萚萛萞", 5, "萩", 7, "萲", 5, "萹萺萻萾", 7, "葇葈葉" ], [ "c880", "葊", 6, "葒", 4, "葘葝葞葟葠葢葤", 4, "葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁" ], [ "c940", "葽", 4, "蒃蒄蒅蒆蒊蒍蒏", 7, "蒘蒚蒛蒝蒞蒟蒠蒢", 12, "蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗" ], [ "c980", "蓘", 4, "蓞蓡蓢蓤蓧", 4, "蓭蓮蓯蓱", 10, "蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳" ], [ "ca40", "蔃", 8, "蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢", 8, "蔭", 9, "蔾", 4, "蕄蕅蕆蕇蕋", 10 ], [ "ca80", "蕗蕘蕚蕛蕜蕝蕟", 4, "蕥蕦蕧蕩", 8, "蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱" ], [ "cb40", "薂薃薆薈", 6, "薐", 10, "薝", 6, "薥薦薧薩薫薬薭薱", 5, "薸薺", 6, "藂", 6, "藊", 4, "藑藒" ], [ "cb80", "藔藖", 5, "藝", 6, "藥藦藧藨藪", 14, "恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔" ], [ "cc40", "藹藺藼藽藾蘀", 4, "蘆", 10, "蘒蘓蘔蘕蘗", 15, "蘨蘪", 13, "蘹蘺蘻蘽蘾蘿虀" ], [ "cc80", "虁", 11, "虒虓處", 4, "虛虜虝號虠虡虣", 7, "獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃" ], [ "cd40", "虭虯虰虲", 6, "蚃", 6, "蚎", 4, "蚔蚖", 5, "蚞", 4, "蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻", 4, "蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜" ], [ "cd80", "蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威" ], [ "ce40", "蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀", 6, "蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚", 5, "蝡蝢蝦", 7, "蝯蝱蝲蝳蝵" ], [ "ce80", "蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎", 4, "螔螕螖螘", 6, "螠", 4, "巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺" ], [ "cf40", "螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁", 4, "蟇蟈蟉蟌", 4, "蟔", 6, "蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯", 9 ], [ "cf80", "蟺蟻蟼蟽蟿蠀蠁蠂蠄", 5, "蠋", 7, "蠔蠗蠘蠙蠚蠜", 4, "蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓" ], [ "d040", "蠤", 13, "蠳", 5, "蠺蠻蠽蠾蠿衁衂衃衆", 5, "衎", 5, "衕衖衘衚", 6, "衦衧衪衭衯衱衳衴衵衶衸衹衺" ], [ "d080", "衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗", 4, "袝", 4, "袣袥", 5, "小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄" ], [ "d140", "袬袮袯袰袲", 4, "袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚", 4, "裠裡裦裧裩", 6, "裲裵裶裷裺裻製裿褀褁褃", 5 ], [ "d180", "褉褋", 4, "褑褔", 4, "褜", 4, "褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶" ], [ "d240", "褸", 8, "襂襃襅", 24, "襠", 5, "襧", 19, "襼" ], [ "d280", "襽襾覀覂覄覅覇", 26, "摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐" ], [ "d340", "覢", 30, "觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴", 6 ], [ "d380", "觻", 4, "訁", 5, "計", 21, "印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉" ], [ "d440", "訞", 31, "訿", 8, "詉", 21 ], [ "d480", "詟", 25, "詺", 6, "浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧" ], [ "d540", "誁", 7, "誋", 7, "誔", 46 ], [ "d580", "諃", 32, "铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政" ], [ "d640", "諤", 34, "謈", 27 ], [ "d680", "謤謥謧", 30, "帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑" ], [ "d740", "譆", 31, "譧", 4, "譭", 25 ], [ "d780", "讇", 24, "讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座" ], [ "d840", "谸", 8, "豂豃豄豅豈豊豋豍", 7, "豖豗豘豙豛", 5, "豣", 6, "豬", 6, "豴豵豶豷豻", 6, "貃貄貆貇" ], [ "d880", "貈貋貍", 6, "貕貖貗貙", 20, "亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝" ], [ "d940", "貮", 62 ], [ "d980", "賭", 32, "佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼" ], [ "da40", "贎", 14, "贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸", 8, "趂趃趆趇趈趉趌", 4, "趒趓趕", 9, "趠趡" ], [ "da80", "趢趤", 12, "趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺" ], [ "db40", "跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾", 6, "踆踇踈踋踍踎踐踑踒踓踕", 7, "踠踡踤", 4, "踫踭踰踲踳踴踶踷踸踻踼踾" ], [ "db80", "踿蹃蹅蹆蹌", 4, "蹓", 5, "蹚", 11, "蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝" ], [ "dc40", "蹳蹵蹷", 4, "蹽蹾躀躂躃躄躆躈", 6, "躑躒躓躕", 6, "躝躟", 11, "躭躮躰躱躳", 6, "躻", 7 ], [ "dc80", "軃", 10, "軏", 21, "堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥" ], [ "dd40", "軥", 62 ], [ "dd80", "輤", 32, "荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺" ], [ "de40", "轅", 32, "轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆" ], [ "de80", "迉", 4, "迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖" ], [ "df40", "這逜連逤逥逧", 5, "逰", 4, "逷逹逺逽逿遀遃遅遆遈", 4, "過達違遖遙遚遜", 5, "遤遦遧適遪遫遬遯", 4, "遶", 6, "遾邁" ], [ "df80", "還邅邆邇邉邊邌", 4, "邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼" ], [ "e040", "郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅", 19, "鄚鄛鄜" ], [ "e080", "鄝鄟鄠鄡鄤", 10, "鄰鄲", 6, "鄺", 8, "酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼" ], [ "e140", "酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀", 4, "醆醈醊醎醏醓", 6, "醜", 5, "醤", 5, "醫醬醰醱醲醳醶醷醸醹醻" ], [ "e180", "醼", 10, "釈釋釐釒", 9, "針", 8, "帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺" ], [ "e240", "釦", 62 ], [ "e280", "鈥", 32, "狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧", 5, "饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂" ], [ "e340", "鉆", 45, "鉵", 16 ], [ "e380", "銆", 7, "銏", 24, "恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾" ], [ "e440", "銨", 5, "銯", 24, "鋉", 31 ], [ "e480", "鋩", 32, "洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑" ], [ "e540", "錊", 51, "錿", 10 ], [ "e580", "鍊", 31, "鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣" ], [ "e640", "鍬", 34, "鎐", 27 ], [ "e680", "鎬", 29, "鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩" ], [ "e740", "鏎", 7, "鏗", 54 ], [ "e780", "鐎", 32, "纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡", 6, "缪缫缬缭缯", 4, "缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬" ], [ "e840", "鐯", 14, "鐿", 43, "鑬鑭鑮鑯" ], [ "e880", "鑰", 20, "钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹" ], [ "e940", "锧锳锽镃镈镋镕镚镠镮镴镵長", 7, "門", 42 ], [ "e980", "閫", 32, "椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋" ], [ "ea40", "闌", 27, "闬闿阇阓阘阛阞阠阣", 6, "阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗" ], [ "ea80", "陘陙陚陜陝陞陠陣陥陦陫陭", 4, "陳陸", 12, "隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰" ], [ "eb40", "隌階隑隒隓隕隖隚際隝", 9, "隨", 7, "隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖", 9, "雡", 6, "雫" ], [ "eb80", "雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗", 4, "霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻" ], [ "ec40", "霡", 8, "霫霬霮霯霱霳", 4, "霺霻霼霽霿", 18, "靔靕靗靘靚靜靝靟靣靤靦靧靨靪", 7 ], [ "ec80", "靲靵靷", 4, "靽", 7, "鞆", 4, "鞌鞎鞏鞐鞓鞕鞖鞗鞙", 4, "臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐" ], [ "ed40", "鞞鞟鞡鞢鞤", 6, "鞬鞮鞰鞱鞳鞵", 46 ], [ "ed80", "韤韥韨韮", 4, "韴韷", 23, "怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨" ], [ "ee40", "頏", 62 ], [ "ee80", "顎", 32, "睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶", 4, "钼钽钿铄铈", 6, "铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪" ], [ "ef40", "顯", 5, "颋颎颒颕颙颣風", 37, "飏飐飔飖飗飛飜飝飠", 4 ], [ "ef80", "飥飦飩", 30, "铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒", 4, "锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤", 8, "镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔" ], [ "f040", "餈", 4, "餎餏餑", 28, "餯", 26 ], [ "f080", "饊", 9, "饖", 12, "饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨", 4, "鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦", 6, "鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙" ], [ "f140", "馌馎馚", 10, "馦馧馩", 47 ], [ "f180", "駙", 32, "瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃" ], [ "f240", "駺", 62 ], [ "f280", "騹", 32, "颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒" ], [ "f340", "驚", 17, "驲骃骉骍骎骔骕骙骦骩", 6, "骲骳骴骵骹骻骽骾骿髃髄髆", 4, "髍髎髏髐髒體髕髖髗髙髚髛髜" ], [ "f380", "髝髞髠髢髣髤髥髧髨髩髪髬髮髰", 8, "髺髼", 6, "鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋" ], [ "f440", "鬇鬉", 5, "鬐鬑鬒鬔", 10, "鬠鬡鬢鬤", 10, "鬰鬱鬳", 7, "鬽鬾鬿魀魆魊魋魌魎魐魒魓魕", 5 ], [ "f480", "魛", 32, "簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤" ], [ "f540", "魼", 62 ], [ "f580", "鮻", 32, "酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜" ], [ "f640", "鯜", 62 ], [ "f680", "鰛", 32, "觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅", 5, "龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞", 5, "鲥", 4, "鲫鲭鲮鲰", 7, "鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋" ], [ "f740", "鰼", 62 ], [ "f780", "鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾", 4, "鳈鳉鳑鳒鳚鳛鳠鳡鳌", 4, "鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄" ], [ "f840", "鳣", 62 ], [ "f880", "鴢", 32 ], [ "f940", "鵃", 62 ], [ "f980", "鶂", 32 ], [ "fa40", "鶣", 62 ], [ "fa80", "鷢", 32 ], [ "fb40", "鸃", 27, "鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴", 9, "麀" ], [ "fb80", "麁麃麄麅麆麉麊麌", 5, "麔", 8, "麞麠", 5, "麧麨麩麪" ], [ "fc40", "麫", 8, "麵麶麷麹麺麼麿", 4, "黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰", 8, "黺黽黿", 6 ], [ "fc80", "鼆", 4, "鼌鼏鼑鼒鼔鼕鼖鼘鼚", 5, "鼡鼣", 8, "鼭鼮鼰鼱" ], [ "fd40", "鼲", 4, "鼸鼺鼼鼿", 4, "齅", 10, "齒", 38 ], [ "fd80", "齹", 5, "龁龂龍", 11, "龜龝龞龡", 4, "郎凉秊裏隣" ], [ "fe40", "兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩" ] ]; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
module.exports = function(stream) { | |
if (!stream) throw new TypeError("argument stream is required"); | |
if ("function" != typeof stream.unpipe) { | |
if ((function(stream) { | |
for (var listeners = stream.listeners("data"), i = 0; i < listeners.length; i++) if ("ondata" === listeners[i].name) return !0; | |
return !1; | |
})(stream)) for (var listener, listeners = stream.listeners("close"), i = 0; i < listeners.length; i++) "cleanup" !== (listener = listeners[i]).name && "onclose" !== listener.name || listener.call(stream); | |
} else stream.unpipe(); | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
function mapWithIndex(range, index) { | |
return { | |
start: range.start, | |
end: range.end, | |
index: index | |
}; | |
} | |
function mapWithoutIndex(range) { | |
return { | |
start: range.start, | |
end: range.end | |
}; | |
} | |
function sortByRangeIndex(a, b) { | |
return a.index - b.index; | |
} | |
function sortByRangeStart(a, b) { | |
return a.start - b.start; | |
} | |
module.exports = function(size, str, options) { | |
if ("string" != typeof str) throw new TypeError("argument str must be a string"); | |
var index = str.indexOf("="); | |
if (-1 === index) return -2; | |
var arr = str.slice(index + 1).split(","), ranges = []; | |
ranges.type = str.slice(0, index); | |
for (var i = 0; i < arr.length; i++) { | |
var range = arr[i].split("-"), start = parseInt(range[0], 10), end = parseInt(range[1], 10); | |
isNaN(start) ? (start = size - end, end = size - 1) : isNaN(end) && (end = size - 1), | |
end > size - 1 && (end = size - 1), isNaN(start) || isNaN(end) || start > end || start < 0 || ranges.push({ | |
start: start, | |
end: end | |
}); | |
} | |
return ranges.length < 1 ? -1 : options && options.combine ? (function(ranges) { | |
for (var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart), j = 0, i = 1; i < ordered.length; i++) { | |
var range = ordered[i], current = ordered[j]; | |
range.start > current.end + 1 ? ordered[++j] = range : range.end > current.end && (current.end = range.end, | |
current.index = Math.min(current.index, range.index)); | |
} | |
ordered.length = j + 1; | |
var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex); | |
return combined.type = ranges.type, combined; | |
})(ranges) : ranges; | |
}; | |
}, function(module, exports, __webpack_require__) { | |
"use strict"; | |
var stringify = __webpack_require__(561), parse = __webpack_require__(562), formats = __webpack_require__(249); | |
module.exports = { | |
formats: formats, | |
parse: parse, | |
stringify: stringify | |
}; | |
}, function(module, exports) { | |
module.exports = function pathtoRegexp(path, keys, options) { | |
keys = keys || []; | |
var m, strict = (options = options || {}).strict, end = !1 !== options.end, flags = options.sensitive ? "" : "i", extraOffset = 0, keysOffset = keys.length, i = 0, name = 0; | |
if (path instanceof RegExp) { | |
for (;m = MATCHING_GROUP_REGEXP.exec(path.source); ) keys.push({ | |
name: name++, | |
optional: !1, | |
offset: m.index | |
}); | |
return path; | |
} | |
if (Array.isArray(path)) return path = path.map((function(value) { | |
return pathtoRegexp(value, keys, options).source; | |
})), new RegExp("(?:" + path.join("|") + ")", flags); | |
for (path = ("^" + path + (strict ? "" : "/" === path[path.length - 1] ? "?" : "/?")).replace(/\/\(/g, "/(?:").replace(/([\/\.])/g, "\\$1").replace(/(\\\/)?(\\\.)?:(\w+)(\(.*?\))?(\*)?(\?)?/g, (function(match, slash, format, key, capture, star, optional, offset) { | |
slash = slash || "", format = format || "", capture = capture || "([^\\/" + format + "]+?)", | |
optional = optional || "", keys.push({ | |
name: key, | |
optional: !!optional, | |
offset: offset + extraOffset | |
}); | |
var result = (optional ? "" : slash) + "(?:" + format + (optional ? slash : "") + capture + (star ? "((?:[\\/" + format + "].+?)?)" : "") + ")" + optional; | |
return extraOffset += result.length - match.length, result; | |
})).replace(/\*/g, (function(star, index) { | |
for (var len = keys.length; len-- > keysOffset && keys[len].offset > index; ) keys[len].offset += 3; | |
return "(.*)"; | |
})); m = MATCHING_GROUP_REGEXP.exec(path); ) { | |
for (var escapeCount = 0, index = m.index; "\\" === path.charAt(--index); ) escapeCount++; | |
escapeCount % 2 != 1 && ((keysOffset + i === keys.length || keys[keysOffset + i].offset > m.index) && keys.splice(keysOffset + i, 0, { | |
name: name++, | |
optiona |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment